OCR automatically reads a power meter

ocr-used-to-read-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.

Comments

  1. messmaker says:

    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. Matt says:

    I think the real hack here is using mathematica for OCR. I wonder if her uses labview as a spreadsheet as well.

  3. E says:
  4. pff says:

    i thought people monitored power usage to try and reduce bills by turning off unnecessary appliances, not plug in an extra camera and light and leave them on 24/7

  5. fartface says:

    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.

    • Paul says:

      (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.
      :)

  6. Chris C. says:

    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.

  7. Jacek says:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,339 other followers