3 ms·
I was going to do something similar. I've got a cheap AcuRite indoor/outdoor thermometer and wanted to save the outdoor readings periodically in a database. Th
by tzs 4y ago
I was going to do something similar. I've got a cheap AcuRite indoor/outdoor thermometer and wanted to save the outdoor readings periodically in a database.
The first plan was to periodically take a photo of the display with an RPi camera, extract the temperature from the picture, and put it in the DB.
But I wasn't going to bother with trying to use a fancy OCR library. I was just going to write something specifically for this task. It would not have taken a lot of code, because of the limited nature of the display.
The AcuRite display (and the display in the article) are using 7 segment digits at fixed locations.
For a 3 digits temperature reading that must be an integer in [-199, 199] there are 17 segments whose state you want to look at, and for each you just need to determine if it is on or off.
So it is just a matter of looking at 17 predetermined parts of the image, plus looking at some predetermined parts of the image that are always LCD background, and at some predetermined parts that are always LCD on (like the ℉ or ℃). Using the always background and always on parts as a reference you can decide whether the 17 segments are on or off.
My plan was to use color marker to add some red and green crosses to the case just outside the LCD the near the top corners of the LCD and near the bottom of outdoor digits.
It should then be straightforward given an image library that has a get_color_at(x,y) function to find those crosses, and to have a table of the aforementioned 17 parts plus reference parts that gives their locations relative to the crosses.
I then realized I'd be better off buying an RTL-SDR and putting it on the RPi, and running rtl_433. Rtl_433 knows how to decode the transmissions from the AcuRite outdoor sensor, and I could extract the data from the rtl_433 output to put in my database.
That approach has the advantage that rtl_433 also knows how to decode my AcuRite fridge/freezer thermometer sensor transmissions so I could also include those in my database.
Also, I was going to build a tipping rain gauge that summer and was going to use rtl_433 to decode its transmissions, so was already planning on getting an RTL-SDR for the RPi anyway, so it made the most sense to just push that purchase up a few months and not bother with the image processing approach.
[1] https://www.walmart.com/ip/AcuRite-Indoor-Outdoor-White-Digital-Thermometer-with-Clock-3-5-H-x-2-3-W-x-1-2-D/45810751 https://www.walmart.com/ip/AcuRite-Indoor-Outdoor-White-Digi...