9

Tried googling first but could not find any interesting hits relevant to what i am looking for.

The wild idea is to put a camera in front of an energy meter or watt meter display and read the accumulated total in the display, and process it down to digital information like an integer or a float that i can save. It might be enough to capture a still, crop the image and do some ocr-like operation.

Energy meter example

The advantage over monitoring pulses is that You would keep track of the actual meter total, not a forever running incremental.

I'm looking for suggestions and ideas and if anyone have experience of solving similar problems. Pointers to software or libraries appreciated. I know there are posts about bar code reading, but that is not matching my needs.

chgus
  • 91
  • 1
  • 1
  • 2
  • Hello and welcome. Have a look at these: http://raspberrypi.stackexchange.com/questions/23157/scanning-ocr-and-adding-the-scanned-numbers-using-a-raspberry-pi and http://raspberrypi.stackexchange.com/questions/15407/image-recognition-raspberry-pi/15428#15428 and (since your Stromzähler ist deutsch): https://www.kompf.de/cplus/emeocv.html (highly recommended!) – Ghanima Feb 14 '16 at 19:55
  • I am doing exactly this! Putting a camera in front of electricity meter to capture consumption/billing info! – iceman Jun 08 '19 at 03:43

4 Answers4

9

I recently used Tesseract which is an OCR software that's open source and it gives highly accurate results.

To install it on pi, type in the command line:

sudo apt-get install tesseract-ocr

Then set a camera to periodically take pictures preferably using Cron (which schedules tasks) and fswebcam (takes pictures using USB cams) Save the pictures in a special directory and set (also using Cron) Tesseract to extract the text from the pic and output the text in a separate .txt file. Deal with the extracted text according to your preferences.

I know I didn't offer much but I hope I've given some general pointers

Ghanima
  • 15,855
  • 15
  • 61
  • 119
Mero55
  • 191
  • 5
5

Assuming you are able to store the image somewhere, that you can setup Python's PIL dependencies, and have pytesseract you'll need : https://github.com/madmaze/pytesseract

open and crop the image so that only interesting data remains : http://matthiaseisen.com/pp/patterns/p0202/

then try something like :

import pytesseract
import Image
img = Image.open(path_to_your_file)
cropped = img.crop( ... )
pytesseract.image_to_string(cropped, config='outputbase digits')
Ghanima
  • 15,855
  • 15
  • 61
  • 119
cgte
  • 151
  • 1
  • 1
3

I understand that link-only answers are really not the way of StackExchange, but this page is too good a fit to this question to not point to it. This tutorial completely covers all aspects of relevance to capture the image and use OpenCV on a Pi process the image to read the value of the electricity meter.


Side note: if you do not want to use a Pi on this, try an ESP32.

Ghanima
  • 15,855
  • 15
  • 61
  • 119
  • All great pointers. The mathematica tip is partially interesting, the emeocv is a complete solution. I might have failed to explain that i already have an application with a web interface saving statistics in a database and display real time data from my meter. I will get the emeocv and see if i can get the parts of it working that i need. If the tag 'OCR' would have been allowed i could have found this myself. – chgus Feb 15 '16 at 06:38
1

I used a photoresistor to monitor the led blinking and count the blinkd using interrupt when it goes low. It works very well. I of course had to manually tell the beaglebone the starting number of the meter and then it just continues to count. BOM beaglebone/raspberry/arduino photoresistor resistor and three wires.

My kamstrup meter blinks a led for every watt consumed. I can then calculate Wh by measuring the seconds and milliseconds between the blinks. It works better than I thought. I feed that data into openhab and elasticsearch so I have perfect overview of my energy consumption at any time amongs other things.

Ghanima
  • 15,855
  • 15
  • 61
  • 119