Saving Energy Via Webcam-Based Meter Reading? 215
squoozer writes "Like many people, I am trying to cut down on the amount of energy my family and I use in order to save both the environment and my pay packet. Since I want to do this in as scientific a way as possible, I'm taking meter readings every day and recording them in a spreadsheet (OOo Calc naturally). Currently, in the UK at least, neither gas nor electricity meters can be hooked up to any sort of device that can query the meter for its current reading. Rather than climb down into the cellar every day to read the meters, it would be great if I could simply position a webcam in front of each meter and have the value logged automatically each day. The problem is that while I am a software developer (Java mostly) I have no experience in image processing (dials from the electricity meter) and don't really know where to start with this project." Does anyone have any advice for analyzing the visual data this reader would be gathering?
I don't know if it's anything like in Canada (Score:2)
But you must not block the meter dials from view. Someone goes to check the values manually, every once in a while (monthly?).
If you have the same kind of "spinning wheel with a mark" under the small dials, it might be easier to check for the number of revolutions of that wheel.
Re: (Score:2)
A note, I'm in Canada too, and maybe it's just the neighborhood I grew up in, but all the meters were on the outside of the house. I'm not sure how effective hooking a web-cam rig to the side of your house would be.
Also, since the OP says the meter is in the basement, I'm assuming low light. This means you'll need to light the meter every time you want to snap a photo of it-- or leave a light on all the time. I have to wonder what that would do to your hydro bill...?
Re: (Score:2)
It's easy enough to get webcam with efficient infrared LEDs that light up a small area.
Re: (Score:3, Interesting)
FYI, here in holland you just pay a guesstimate every month, and they give you a final bill every year.
They try to get a meter reading every year. They trust you to do it yourself. They send a guy over every once in a while (i.e. every 5 years or so) to keep you honest. All you can do is postpone the stuff for a while. If you move you either have to arrange for an official meter-taking, or you have to sign a common "agreed meter-positions" note with the next inhabitant.
Apparently they HAVE to check the read
Re: (Score:2)
Note that in Holland they -are- rolling out the new 'smart meters' which basically phone home periodically on how much your usage has been.
This is seen as 'good' for everybody all around.. you no longer have to mail/phone in the numbers once a year (gee, a 3 minute job), and you get a nice view online (or by mail - frequency depends on the utilities company) of what your use has been. So you never have to pay more than you should have to (because the utility company's 'assumption' falls too high - say, if
Re:I don't know if it's anything like in Canada (Score:5, Insightful)
But you must not block the meter dials from view. Someone goes to check the values manually, every once in a while (monthly?).
If you have the same kind of "spinning wheel with a mark" under the small dials, it might be easier to check for the number of revolutions of that wheel.
Of course your biggest power drain will be from the computer that is always on reading the meter.
Re: (Score:2)
Of course your biggest power drain will be from the computer that is always on reading the meter.
I can see it now, a 1kw rig with 4 geforce cards, 32 monitor, 800 watt stereo, lit up like the sun with ever light and fan this side of new egg... all just to read the power meter.
Re: (Score:2)
You mean you don't normally leave all your computers on 24/7 anyway?
Re: (Score:2)
A few people have commented that the computer used to take the readings will be a large power drain but I have to run a server 24/7 for my business anyway so the software will simply run on that. It would also be possible to run a tiny little ITX based box that draw hardly any power. From experience anything less than about 90W and my antiquated meter to turn.
Re: (Score:2)
That's why the only sane way to do this is with a microcontroller, like an AVR. Log to an SD card or maybe even ethernet. Add an LCD for realtime display. Power usage can be under 1W.
The way to read the meter is not to try and do image processing, but to try and sense the notch on the spinning dial. Just shine an IR light on the dial and use an IR detector to sense when the black mark passes by.
Re: (Score:2)
Of course your biggest power drain will be from the computer that is always on reading the meter.
Yes, if you choose to use a constant-monitor system to count ticks (like phk does). But, if you can actually read off a dial, like the OP says he can, one can get by with using a periodic snapshot ... and image processing.
Re: (Score:3, Interesting)
They changed all our electricity meters (madison, WI) to wireless now. they just drive the truck by and read them all instantly.
I assume it would be getting popular elsewhere too. it would be fun if you could tap into that.....
Current reading? (Score:4, Funny)
My meter reads in kilowatt hours, not amperes.
Re: (Score:2)
Yes, Current reading. As in the reading currently or at the present time.
Re: (Score:2)
Re: (Score:2)
Currently, in the UK at least, neither gas nor electricity meters can be hooked up to any sort of device that can query the meter for it's current reading.
Yes, this was an attempt at humor on my part. I see that I failed.
Re: (Score:2)
Humor based on pretending to be stupid fails, because no idea is so stupid that you cannot find someone who honestly believes it.
Re: (Score:2)
I thought it was funny. I modded you up. Oh wait...
Re: (Score:2)
Are you sure you aren't one of those animal rights activists that come out with a protest every time someone starts a debate about a public right to bear arms?...
Re: (Score:2, Funny)
Re: (Score:2)
I think he mean Owl Bears. http://en.wikipedia.org/wiki/Owlbear [wikipedia.org]
Layne
what's your goal? (Score:5, Insightful)
Re: (Score:3, Funny)
You are hereby ordered to report to the home office and turn in your geek card.
Re: (Score:2)
Not to mention that if he's trying to SAVE energy, how much energy is the webcam + computer hooked up to watch this thing consuming?
Re: (Score:2)
Re: (Score:3, Insightful)
Re: (Score:2)
Not to mention that if he's trying to SAVE energy, how much energy is the webcam + computer hooked up to watch this thing consuming?
whenever I hear of these power saving hippies I chuckle and try to throw another server in my power guzzling rack. to balance things out.
Re: (Score:2)
"Reasonable people adapt themselves to the world. Unreasonable people attempt to adapt the world to themselves. All progress, therefore, depends on unreasonable people." —George Bernard Shaw
Re: (Score:3, Interesting)
He should just buy a digital watt hour meter that uses 2 piece or clamp type current transducer coils. It might use rs-232 or usb and just read in the values from the device. There are plenty which are commercially available.
You can make your own using a micro controller with a few A-D channels to read the values of the current transducers and voltage using isolating transformers. Then just read in the two values, figure out the power factor and multiply the volt-amps by the power factor for watts. Then jus
Re: (Score:2)
Try the "oops I dropped my Blackberry into the toiler" upgrade. Take a hammer and beat the crap out of your meter. Call the electric company. They'll come by and replace it with one of those new ones with a serial port or one with OCRable rolling number gauges.
Simple solution (Score:5, Funny)
Post the images as CAPTCHAs that protect porn pictures. You'll have the values typed in for you in no time.
Re: (Score:2)
LOL!! I'd mod you insightful if I had mod points. You really deserve some karma for that post :D
Re: (Score:2)
Possible Implementation (Score:2, Insightful)
Re: (Score:2)
The position of everything should be the same each time. Convert to black & white (not greyscale). Then, because the center positions are known and the position of each number, figure out which "wedge" the point falls into. A wedge is defined as starting with a number and proceeding to the next (like the hour hand in a clock).
You can compute the coordinates of the wedge ahead of time. I would probably AND/OR the wedge from the picture with a known wedge to quickly compare them.
0 indicates "filled" (
Rubbish (Score:4, Informative)
Rubbish. Look up smart meters gas & electric meters which update the utility company continously on usage which they can provide to you as well. (currently insanely popular after the recent documentry on smart meters)
If your supplier is reluctant to include you in the trials, for electrical use try "Wattson" [diykyoto.com] or other similar personal wireless power meters (also sold out everywhere, but there a cheaper more functional equivalents around)
Re: (Score:3, Informative)
Re: (Score:2)
The submitter is in britan. Typicaly in britan the meter is conencted to the consumer unit using double insulated single core tails which are usually exposed for at least long enough to get a clamp on them.
Re: (Score:2)
Kill-A-Watt? (Score:4, Informative)
A Kill-A-Watt [thinkgeek.com] might be a better choice for "power trimming", since you can get an instant reading of the power used by anything that plugs in.
On my website [phot.ogra.ph] I have a couple of webcams that I grab the image from at a specific interval and store the result. Basically, if you get a Trendnet TV-IP201 and a Pentax 10mm f/1.2 [bhphotovideo.com] lens with a C-mount to CS-mount [bhphotovideo.com] adapter, you can just wget the image however often you want. Image processing is another issue, but I don't know anything about that.
hall-effect ampmeter? (Score:2)
I got a hall-effect ampmeter for the purpose of measuring power usage. It works pretty well, you just clamp it around the wire you want to measure.
The one caveat, though, which makes it far less convenient to use than it would otherwise be, is that it doesn't work if it surrounds both the positive and negative wires at the same time. I ended up modifying a power strip by cutting open the rubberized outer coating of the power cord so I could clamp the meter around just the postive cord.
In retrospect, t
Re: (Score:2)
Alternating current times voltage only equals power if they are in phase, which is the case with resistive loads such as incandescent light bulbs and heaters.
In equipment with transformers (halogen lighting, fluorescent tubes, electronics), and motors (refrigerator, laundry machine), the current is out of phase with the voltage, which means a correction factor ("cos phi") that can be anywhere between 0.6 and 0.9. Especially transformers
Re: (Score:2)
Re: (Score:2)
Hence my suggestion of the $25 Kill-A-Watt.
It seems like he wants to monitor the whole house, make some change, see how that affects the power usage over a day, and repeat. That seems like a really annoying thing to do, so my idea was to measure everything with the Kill-A-Watt directly, and then he would know what all of the "little things" used each, how much they draw when in standby, etc. It doesn't help with big things l
The standards are coming (some already here) (Score:5, Informative)
Whether or not they'll specifically give you access to the data is somewhat moot, since it's network-over-powerline and there are already consumer devices [google.com] that can access the same network and (eventually if not already) be hacked to reveal the data being sent from your meter.
It's an exploding industry (like 20-30% CAGR in the US alone, higher in other less-developed areas where the first power meters will be homeplug-capable) so I wouldn't suggest putting too much effort into your image-analysis idea at least for a few months to see what happens in homeplug-world.
OCR plugins? (Score:3, Informative)
As long as your web cam doesn't get moved, you can set static cropping on the image so only the numbers are in the jpg file without a huge complicated border than might confuse the OCR engine.
Re: (Score:3, Informative)
Re: (Score:2)
Going the OCR route is actually quite a bit more complicated. You'd basically have to train the OCR to recognize the dial pattern and what a "5"
Re: (Score:2)
Of course only the true nerds look for the programming solution when there are much easier options around... but this is slashdot so I feel proud, not ashamed
Re:OCR plugins? (Score:5, Informative)
This guy [eissq.com] has an algorithm run in matlab to convert dial indicator readings to numbers using MatLab. He claims 99% accuracy over 2000 readings.
Re: (Score:2)
Do you think Octave might be able to handle what you've done in Matlab? I was referencing this because I'd run across your page a while back and wanted to let the PP and GPP know about your work, but there are aspects of it I could use, as well.
If I'd done this, I think I would've just taken several hundred pictures of the needle as it moves from 0 to 100% scale, then compared the webcam picture to the database and seen which was the best match. I'm not a very sophisticated programmer. But I've been impr
Re: (Score:2)
Even simpler:
Split the pic of each dial into the 10 segments.
Compare today's pic segments with the stored segments.
Whichever 1 or 2 segments checksum 'different' than the stored, that's where the pointer is.
Re: (Score:2)
(Although there are algorithms which actually will work, so your idea is good, it's just the 'checksum' part that's not quite right.)
Re: (Score:2)
Re: (Score:2)
The first thing that came to my mind was OCR too; obviously I also didn't click the link :). Of course everything would've been much simpler if we were dealing with an odometer-type device here.
The sample image should work just fine even in gray-scale. The contrast is high and the needles are pretty large, so it should be reasonably easy for anyone to just get the angle of each one and calculate the value based on that, exactly as you suggest here. One could also hardcode in the areas in which each dial is
Re: (Score:2)
I've tried using some opensource OCR programs, most notably Kooka OCR. What I was doing was (I think) the best possible situation: putting a digital multimeter with a very large readout panel face-down on a flatbed scanner and automatically scanning it and dumping the output to Kooka. It does a pretty terrible job, honestly. I'm lucky to get one digit correct half the time, out of the three digits available.
I'm doing cropping to make sure only the digits I want are in the frame.
If you have any suggestion
Re: (Score:2)
Re: (Score:2)
That's possible. I actually haven't tried Kooka or gocr with printed text, just with the multimeter's segmented LCD.
Re: (Score:2)
OK, if you're already doing all this, it will be pretty easy for you from here on in.
Since you have 7 segment displays, all you need to do is mask off each segment in each digit. Check if the segment is on or off, by adding up all the pixels' brightnesses in the mask, and checking it with a threshold.
Run through a loop comparing the state of all seven segments against the digits 0 through 9.
Repeat for each digit.
Touchy, feely. (Score:2)
"Saving Energy via Web-Cam Based Meter Reading? "
I'd put an induction clamp onto the line in my box and get the data from that point.
Re: (Score:2)
I'd put an induction clamp onto the line in my box and get the data from that point.
Hard to do that with Gas, though.
Plus, you'd have to measure the main (not impossible, but it might be harder to find a clamp-on inductive ammeter that's easy to interface with a computer), and you'd have to monitor it *continuously* in order to integrate over time. Whereas the webcam can even sit powered off for most of the day, and just be activated long enough to grab an image of the dials.
Do what the meter supoorts? (Score:5, Interesting)
ding- electric meters already do infrared pulses (Score:2)
My electric meter (and most everyone else's by now) uses pulses of IR light. The transmitter is either pointed upwards, or out the face. The blink pattern is very simple to decode; it's basically 1 blink per energy unit (I forget how much.)
I have a wireless power meter I bought through the power company which uses the blinks to show me how much energy I'm using. The only downside was that it was a royal, complete, and total fucking pain in the ass to get the receiver's sensor positioned correctly. The
Check for WiFi (Score:2)
The labor costs of checking meters is pretty significant to utility companies. One thing many municipality companies are trying is WiFi enabled meters that will report consumption to a meter truck as it drives down the street, saving hours apon hours of labor every day.
I haven't tried to tap into my own meter, but if they can read it, with sufficient time and effort I'm sure most of the readers of /. could read it as well.
-Rick
Re: (Score:2)
saving hours apon hours of labor every day
Unfortunately, the Grammar Nazis shall never be able to share in this victory.
Re: (Score:2)
Heh, nice catch. I think I actually wrote that, went out to a meeting, then came back, saw the post waiting and hit the submit button with out re-reading it.
If you think that is bad, I totally slaughtered the english language in another post today that was interrupted by a bagel break.
-Rick
Re: (Score:2)
Re: (Score:3, Interesting)
they are wireless, but not wifi
Clamp on ammeters? (Score:2)
I don't know if it is possible but can a ammeter that just goes around one of the conductors be adapted for this purpose? I used to work in the plating industry and we had something we called tong testers. It measured the amps at various points in the system. The beauty was that there was no physical connection with the conductors (I think it measured the magnetic flux that was created.). It might only work with DC. I am sure that there are some electrical engineers that know about such devices. What
One small problem (Score:3, Funny)
For the sake of your family sanity.
Roborealm (Score:2)
Orientation analysis in an image (Score:4, Informative)
What you can do is use image processing commands (in your favorite programming language; a shell script, Python, etc.) to crop the image to generate a small image for each dial. Then convert to grayscale (and maybe increase the contrast to highlight the dial). To then calculate the preferred orientation in the image, you calculate gradients along different directions. There will be a much higher value for the gradient along directions perpendicular to the preferred axis. This procedure is described very briefly in this paper:
Harrison, C.; Cheng, Z.; Sethuraman, S.; Huse, D. A.; Chaikin, P. M.; Vega, D. A.; Sebastian, J. M.; Register, R. A.; Adamson, D. H. "Dynamics of pattern coarsening in a two-dimensional smectic system [aps.org]" Physical Review E 2002, 66, (1), 011706. DOI: 10.1103/PhysRevE.66.011706 [doi.org]
This is easiest to do if you use a graphics package that has directional gradients built-in (but coding it yourself probably wouldn't be too hard). Basically you create copies of the image and on one you do a differentiation in the x-direction, and for the other one a differentiation in the y-direction. Let's call these images DIFX and DIFY. Then you compose two new images:
NUMERATOR = 2*DIFX*DIFY
DENOMINATOR = DIFX^2-DIFY^2
Then you calculate a final image:
ANGLES = atan2( NUMERATOR, DENOMINATOR )
(All the above calculations are done in a pixel-by-pixel mode.) The final image will have an angle map (with values between -pi to pi) for the image. It should be easy to then use the avg or max over that image to pull out the preferred direction. You may also improve results by tweaking the initial thresholding, or by adding an initial "Sharpen Edges" step, or by blurring the NUMERATOR and DENOMINATOR images slightly before doing the next step.
In any case, the above procedure has worked for me when coding image analysis for orientation throughout an image (coding was done in Igor Pro [wavemetrics.com] in my case). So maybe it is useful for you.
Re: (Score:2)
Another approach:
Let f(theta) be the function that, given the dial angle, outputs an image of the dial with the dial at that angle. Since it's easy to generate images with code, this isn't particularly hard. Then, simply estimate df/dtheta by finite differences and perform gradient descent (or use Nelder-Meade). It's possible that you'll need a good initial guess for this to converge. However, once you have this guess, then provided that the dial moves slowly relative to the framerate, each previous fra
Power saving tip (Score:2)
Here's a crazy idea: TURN OFF THE CAMERA AND COMPUTERS!!
Seriously, is it really that hard to read the meter every once in a while?
One solution. (Score:2)
Here is my take on this ... for what it's worth.
Rigidly mount the camera in front of it, and use some constant lighting. You want everything to be the same. Note that the light can be off, except when you want a reading.
Take a bunch of baseline readings, as many as possible. Combine these using Gimp or Photoshop to edit out the dial needles (assuming analog needles). If your meter is anything like older US meters, the needles on the left will hardly budge. No problem. Ignore the left-most digits and co
Re: (Score:2)
Hmmm. After thinking about it a bit more, I have an easier idea. I will describe by example.
For a particular needle, you know that its center is at (x,y). Have a "for" loop go around the circle (say 5 degree increments) and look at (x+20sin(d), y-20cos(d)) where "d" is the angle, and 20 is the number of pixels away to look (depends on the size of the needles and the resolution of your camera). Try to determine if the needle is present or not based on intensity (simple threshold should be enough). When
Use a database (Score:2)
Once you have your OCR working, I think you should use a database to store the data, not a OO Spreadsheet.
sqlite might be the easiest.
Stephan
How does this data help you? (Score:2)
I have a problem with the premise of your question - how would this data help you? Obviously, it could tell you how much you're saving, but whether or not you're being efficient is simply a factor of how many things you have plugged in at a time.
This method also won't tell you which devices/appliances are the ones sucking the most juice. This is where a Kill-A-Watt can come in handy.
I recently trimmed my energy usage by:
-dialing up (or down) the thermostats - a/c, water heater, fridge
-switched to CF light b
Mechanical? (Score:2, Informative)
A watt meter could help (Score:2)
Buy a killawatt or any other watt meter.
http://www.amazon.com/gp/search?&index=electronics&keywords=kill%20a%20watt&_encoding=UTF8 [amazon.com]
I found out that all of my speakers (computer speakers / external tv speakers) drain 5 watts when they are off (but pluged in). I through them on a power strip. It is not much, but everything adds up. .14$/kWh * .010kW * 24h/d * 365d/year = 12$ a year
With 2 sets of speakers:
Corner detection (Score:2)
From looking at your image, this doesn't seem like it should be very difficult to implement, unless you want extreme precision on the 10's dial. The dials themselves aren't moving, and you don't need to actually read the numbers. You just need to know where the tip of the needle is, then use that position relative to the center of the dial to get a reading. The first thing I would do is subtract the background. Use a couple different images to patch together a "background" image, where the needles are miss
Very basic image processing exercise. (Score:2)
Of course others pick the solutions like momentum comparisons, directional gradients and so on. They are very nice mathematically and elegant solutions, but... DAMNED UNRELIABLE. They work very well in theory. In practice, you spend 90% time fighting white noise, 9% replacing computationally intensive algorithms with predefined results, and 1% by doing solid (but rather simple) maths to get the final result.
Oh, and second that much to get image from the camera into a format where you can read or set value o
Is it worth it? (Score:2)
Just a thought.
Get some exercise (Score:2)
Modify the meter hands (Score:2)
If you can get access to the meter hands, then you could put a red blob of ink at the end of the hands, and a blue blob in the centre. This would make determining the angle of each of the meters much easier.
To do this you could use simple image processing tools to guillotine the image up into the respective meters. Then find out the pixel location of the blue and red blobs by filtering out just those colours. From these two x/y pixel locations you could use simple trigonometry to calculate the angle.
If you
Easy image processing (Score:2)
You have known lighting conditions and a strictly limited camera orientation and object configurations.
You can take the inverse of the pixel values as they would be if the hands weren't there (you can mock up the pixel values under the hands by hand since you only need an approximate inverse of the background plate). Then you add that inverse to an image and threshold to get black hands on white background.
Now you can use a hough transform to find all potential hands and you know the locations of the centre
Re: (Score:2)
You might want to blur the image (and blur the inverse). This will allow for minor camera pan or rotation but you'll need a fairly high threshold. The thickness of the hands determines the blur kernel size and just how high is the threshold.
ImageJ - open source image analysis tool (Score:2, Interesting)
Wrong approach (Score:2)
You're making this far too hard.
The way to do this is to use a split-core current transformer. [flex-core.com] You need two of these, one for each hot lead coming into your house, usually placed after the main switch. They clamp around one conductor of the power cable, but don't contact it, so they're safe. Out comes a voltage from 0-5V, proportional to the current. You can wire them in series, to get a single signal (phasing matters). Run the output (which is AC) through a full-wave bridge, and put a capacitor of a
Wrong approach (Score:2)
The total power usage of your house gives you no clue of what the biggest contributors are, unless you're prepared to spend a few weeks running only one appliance at a time. This data would only help to see if the energy-saving measures you're taking have worked.
Get a Kill-A-Watt and take some time to learn the characteristics of your appliances. The even simpler approach would be to read the appliance's type plate or manual. Hell, any website on in-house power usage will have a list of the biggest power ho
It's a simple problem (Score:2)
The meter gauges look identical to the ones in the U.S., so if it's read the same way, all you need is a program to analyze a piece of a photograph for presence or absence of an image.
In the U.S., the rule is 'read down', if a needle is between two numbers you count it as being as the lower of the two. If it's on the number line then you count it as that.
The example picture shown is read as 375,064.4; I originally wasn't sure whether the segment I read as 5 (because the needle was very close to but I wasn'
Re: (Score:2)
Re: (Score:3, Insightful)
Dear /.
Like so many others, I have a project I want to do. The project involves doing X, but alas I can not do X myself. Have any other /.ers done this and have some sample code I can look at and learn how to do this myself?
regards,
someGuyWhoWantsToBeABetterGeek
Re:this is lame (Score:4, Insightful)
How is it lame to ask other people questions when learning how to do something yourself?
Re: (Score:2)
Some people learn from their mistakes, but smart people learn from other people's mistakes.
Re: (Score:2)
And really smart people trick other people into making mistakes for them so they can learn from said mistakes.
Re: (Score:2)
Re: (Score:2)
Dear /.
Like so many others, I have a project I want to do. The project involves doing X, but alas I can not do X myself. Have any other /.ers done this and have some sample code I can look at and learn how to do this myself?
regards,
someGuyWhoWantsToBeABetterGeek
As it turns out, yes, and I am that guy. smellsofbikes was kind enough to point this out in an earlier post. So sounds as if this were a perfect strategy to leverage some other /.er's existing project into something cool and potentially useful.
I say this as a "young scientist" (the EU's term for us) who eschews the traditional publication factories-- I mean scientific journals-- in favor of publishing online where the audience is more likely to use my research. This is how science is supposed to work... thi
Re: (Score:2)
Re: (Score:2)
Definitely the best solution. I've seen it in action and it's great.