Home voltage monitoring (using OCR)


The goal of this small project is to monitor my home voltage using a voltmeter and a webcam. There are better ways to interface a voltmeter with your computer and here's two techniques that I wish to cover in future projects:

  1. Interface in serie with the multimeter micro controller using an opto-isolator
  2. Build a custom voltage detection device


  • A computer that is always on (I will use a raspberry pi)
  • A digital multimeter (ideally with a backlight, otherwise plan external lightning)
  • A webcam
  • A SPDT relay if you want to monitor two circuits (Eg X and Y on split-phase supply)

How it works


1. Voltmeter
117I originally did this project using my multimeter but the auto-off feature was triggered even if there was power on the test leads... I eventually got this project working using a kill-a-watt. Unlike the multimeter, the KAW doesn't need an external power supply for continuous usage and we can monitor anything the kill-a-watt can report (Amperage or Power for example).
2. Display lightning
maxxima-mln-10-led-night-lightThe kill-a-watt lacks a backlight but its power plug was ideal to connect a LED night light with the light "dissipator" removed.


3. Image capture
sku_25948_1_smallI attached a cheap webcam to the kill-a-watt using card board and white paper to reflect light(It increased the contrast dramatically).


4. Data collecting
muninI hooked the webcam to a raspberry pi running linux. The raspberry pi also controls the relay(JZC-11F) for monitoring two circuits. The capture is done with a tool called fswebcam and the "dumb" OCR is implemented in PHP. Lighttpd allows remote voltage querying. I use my remote munin machine to create graphs (using ocr.php?silent=1).


Fswebcam is actually called by the OCR php script in this way:
fswebcam -r 160x120 -S 10 --jpeg 95 --set sharpness=15 --set contrast=60% --set brightness=50% --set "White Balance Temperature"=0 --no-banner --save /tmp/power.jpg

5. The OCR
ocrI tried several tools for that (like SSOCR) but for some reason they all failed to detect the digits on my snapshots. I ended up writing a small php script that compares several points to a reference. In other words it will detect if a segment is on or off on a 7-segment display type.

Ryan Stoner
Would you go into more detail on how you got the script to run? I suck at PHP and it seems like that's my only stumbling block.
javas?z sohbet
good projects, but needs to be dealt
Connectez-vous ou postez en tant qu'invité:
Your Name Your Email

Vérification: 0585
Go to Top