OCR Automatically Reads A Power Meter


[Chris] tried his hand at using Optical Character Recognition in his server power monitoring rig. The image above is what the IP camera used in the setup sees. He’s included a bright light to ensure that the contrast is as great as possible. After applying a threshold filter to the captured still, he is able to process the image to test all seven segments of every digit.

He uses Mathematica for the processing. We’re not familiar with the particulars of the language, but it’s easy enough to see the main parts of the program. Line six of his source code applies the image filters and then the program loops through the assigned location of each digit, testing segment combinations to ascertain what number is shown. Things get hairy when it comes to the decimal point. We gather that the meter can show varying degrees of precision based on the total number of digits needed (like a Digital Multimeter). But [Chris’] setup has a difficult time reliably detecting that decimal point because of its size. He uses a shortcut to get around this, knowing that his server never pulls less than 300W so he corrects the output (by multiplying it by ten) if the reading is below that benchmark.

Of course it would be easier to crack open the monitor and glean data electronically (that’s how the Tweet-A-Watt does it) but then [Chris] wouldn’t have had the fun of playing with OCR.

10 thoughts on “OCR Automatically Reads A Power Meter

  1. If you look at the second image on his page ( the one that is used to read ) you can clearly see that he has artifacts in the way of what he is using as the collected data. The sweet spot for the light on the meter is too high, in my opinion. I think if he used some diffusion to even out the light and played with the focus he could get a much better source image.

    If it works to his liking then that is what matters, however, if he is having accuracy issues he could probably play with the above.

  2. For the $295.00 that mathmatica costs, I can buy and have shipped to my home a TED5000 and get a whole house monitoring system with a zigbee interface, ethernet interface and a Wireless zigbee display device and have $98.00 left over.

    Tomorrow on Hack A day, how to use AutoCad2013 to replace your calculator.

    1. (defun c:multiply ()
      (setq getvalue1 (ssget “pick value 1”))
      (setq getvalue2 (ssget “pick value 2”))
      (setq result (* getvalue1 getvalue2))
      repeat for adding subtracting and division.

  3. Good stuff. I used the same technique once to control the temperature of a crockpot to experiment with sous vide cooking. The transmitter of a common thermometer with RF remote display was placed in the crockpot. The receiver was OCR’ed by a computer in another room, and it switched the crockpot on and off as necessary via X10. A quick job with stuff I already had on hand.

    I’m sure there are many other uses for this technique.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.