Slashdot Mirror


Saving Energy Via Webcam-Based Meter Reading?

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?

215 comments

  1. Java Media Framework by Eowaennor · · Score: 1

    Take a look at the Java Media Framework. http://java.sun.com/javase/technologies/desktop/media/jmf/

  2. I don't know if it's anything like in Canada by Yvan256 · · Score: 1

    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.

    1. Re:I don't know if it's anything like in Canada by halcyon1234 · · Score: 1

      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...?

    2. Re:I don't know if it's anything like in Canada by adonoman · · Score: 1

      It's easy enough to get webcam with efficient infrared LEDs that light up a small area.

    3. Re:I don't know if it's anything like in Canada by the_other_one · · Score: 4, 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.

      --
      134340: I am not a number. I am a free planet!
    4. Re:I don't know if it's anything like in Canada by negRo_slim · · Score: 1

      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.

      --
      On the Oregon Cost born and raised, On the beach is where I spent most of my days
    5. Re:I don't know if it's anything like in Canada by jkerman · · Score: 2, 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.....

    6. Re:I don't know if it's anything like in Canada by Anonymous Coward · · Score: 0

      National Instruments makes a software package called LabView that has an image processing package. The software itself is fairly expensive, but if you know someone who has it and knows how to use it, they can compile an executable for you.

      You can find developers and other resources at the National Instruments website. (www.ni.com)

      They may also have crippled demo packages but they aren't known for giving away the farm.

      The software really is good though and is designed from the outset for instrument/machine control/query/process stuff. I know the image processing stuff would do what you want and probably very easily.

    7. Re:I don't know if it's anything like in Canada by rew · · Score: 2, 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 readings every three years. In practise they don't.

      So, here in the Netherlands, most meters are on the insides of houses, and accessible for home owners to put a camera in front.

    8. Re:I don't know if it's anything like in Canada by cayenne8 · · Score: 1
      "Of course your biggest power drain will be from the computer that is always on reading the meter."

      You mean you don't normally leave all your computers on 24/7 anyway?

      --
      Light travels faster than sound. This is why some people appear bright until you hear them speak.........
    9. Re:I don't know if it's anything like in Canada by Animaether · · Score: 1

      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 you recently divorced, and you now only have to draw energy for 1 person - they'll still base it off of the usage for 2 from the year/6 months before) - nor do you end up paying too little and end up with a surprise at year end when the utility company demands more money because actual usage was higher.

      On the other hand... somewhere there is now a database of everybody's usage patterns. What's that, you say, the Willemsens which used to have higher-than-average energy demands have been having near-zero for a week now? You don't say.. gosh, I wonder what that might mean.. I suppose these guys who know some guys should pay their home a visit - you know, just to make sure they're alright.

      I, for one, would much rather log at home to check my usage patterns / make sure I pay the right amount at year end.. if that takes me 3 minutes for phoning in the numbers once a year, and 1 minute once a week / month / however often I want to, to note down the numbers in my own database, then that's quite alright by me. Not paranoid - just not a fan of these automated systems that are touted as being so much more convenient for you but always seem to have negative (side) effects down the road.

    10. Re:I don't know if it's anything like in Canada by Anonymous Coward · · Score: 0

      Why? You can set it to sleep mode and have it wake up on a schedule and read the values and store them, then go right back to sleep mode. Not difficult at all.

    11. Re:I don't know if it's anything like in Canada by Anonymous Coward · · Score: 0

      The utility there does a lot of that sort of thing. Nice to know since I've got a few shares invested.

      It's getting to be more common. I think here in Seattle, it's pretty much just the gas meters at present. I'm not sure when they'll be doing that for the electrical meters. Although I get a feeling they may have already, since ours in in an out of the way spot and I haven't seen anybody go to read it.

    12. Re:I don't know if it's anything like in Canada by squoozer · · Score: 1

      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.

      --
      I used to have a better sig but it broke.
    13. Re:I don't know if it's anything like in Canada by AmiMoJo · · Score: 1

      Of course your biggest power drain will be from the computer that is always on reading the meter.

      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.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    14. Re:I don't know if it's anything like in Canada by KlaymenDK · · Score: 1

      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.

    15. Re:I don't know if it's anything like in Canada by AvitarX · · Score: 1

      In Philadelphia they checked automagically, and the meters were inside/in-accessible.

      Now I moved, and I get a note saying shrubbery blocks the meter once a month. They bill me an estimate.

      --
      Wow, sent an e-mail as suggested when clicking on "use classic" banner, and got a fast response that addressed my msg
    16. Re:I don't know if it's anything like in Canada by sumdumass · · Score: 1

      Here in Ohio, it all depended on when the service was connected. At one point in time, the meters needed to be kept dry and if the service was installed during that time, the meter was probably in the house.

      If you changed something to the house, the meters were generally relocated to the outside and now they are putting smart meters in where they either automatically send the reading or a sensor is ran from the meter to a specific location on the side of the building and the meter readers will hook a device up that checks the meter itself.

      I remember as a kid, once a month, usually in the last week, someone would come to the door, knock twice, yell meter reader and then walk in. He would go directly to the basement which was off of the kitchen, do his thing, and then said good bye on the way out. We wouldn't even bat an eye at him unless he asked us something. (We were told to leave him alone because he had a lot of houses to read)

      Things sure have changed since then. We used to never lock our doors unless we were going to be gone more then the day, and if they were locked when he came, he left a pre-printed note saying sorry I missed you, either call the numbers in to the main office or they will estimate the reading for us. Of course the meter readers were one of three people in our neighborhood and the main meter reader introduced the other two when they got hired on. Our dog who would attempt to go through the door at anyone who knocked at it wouldn't even mind the meter reader coming in. That was the 70's for me.

    17. Re:I don't know if it's anything like in Canada by sumdumass · · Score: 1

      Not all meters have the spinning dial. I have one on the main house that is pure digital and nothing spins at all. On the rental I live in, I have the dial.

      Perhaps something like this http://www.energymonitor.com/ or this http://www.theenergydetective.com/index.html would represent usage accurately enough to accomplish the same things as the poster wants without the hassle of building something of from scratch.

    18. Re:I don't know if it's anything like in Canada by AmiMoJo · · Score: 1

      Even the ones that are digital usually have a flashing light when replaces the notch on the dial.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    19. Re:I don't know if it's anything like in Canada by LordSnooty · · Score: 1

      Someone goes to check the values manually, every once in a while (monthly?).

      Just give the utility company a URL to your meter web page, problem solved! If everyone did this, they'd save thousands.

    20. Re:I don't know if it's anything like in Canada by sumdumass · · Score: 1

      That could be, I have never paid that much attention to it. It seem though that one of those other devices might be more readily used seeing how they already have computer feeds and connect behind the Meter which then you don't have to worry about explaining any modifications or devices hanging from it.

      It would be nice I think, If you could do the run down to each individual Circuit coming from the fuse panel and then narrow it down more to the room or even outlet and see exactly where the resource hogs are, when they are used and who is using them. It might be possible to see that usage patterns (Peak verses off Peak rates) or maybe how something is being used can be more efficient and cost effective.

    21. Re:I don't know if it's anything like in Canada by zmollusc · · Score: 1

      The easy method would seem to be:
      1) timestamped images of the meters as often as you decided
      2) image processing using good old retina/brain
      3) type readings into custom software for the crunching of the numbers
      4) ???
      5) profit!

      As to which devices are costing the most; you can get power measuring doohickeys like http://www.maplin.co.uk/Module.aspx?ModuleNo=38343

      Good luck with the money saving.

      --
      They whose government reduces their essential liberties for temporary security, receive neither liberty nor security.
    22. Re:I don't know if it's anything like in Canada by Gordonjcp · · Score: 1

      A lot of modern digital meters (at least, the ones we use in the UK) have a blinky red LED that pulses at about the rate the disc would turn at - usually something like 800 pulses per kw/h. You could time the blinks and get an approximate reading, and count the blinks to get an absolute reading. The timed blinks would be okay for "minute to minute" power consumption, which you could average, and you'd start counting pulses at midnight to get total consumption per day.

  3. Current reading? by Hatta · · Score: 3, Funny

    My meter reads in kilowatt hours, not amperes.

    --
    Give me Classic Slashdot or give me death!
    1. Re:Current reading? by frooddude · · Score: 1

      Yes, Current reading. As in the reading currently or at the present time.

    2. Re:Current reading? by randyest · · Score: 1

      Where did he say "current" reading? "Currently,..." is not a unit in this usage, and even his image shows kWh. Or were you being "funny?"

      --
      everything in moderation
    3. Re:Current reading? by MiniMike · · Score: 1

      Your forgot to call him an insensitive clod.

    4. Re:Current reading? by Hatta · · Score: 1

      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.

      --
      Give me Classic Slashdot or give me death!
    5. Re:Current reading? by Enleth · · Score: 1

      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?...

      --
      This is Slashdot. Common sense is futile. You will be modded down.
    6. Re:Current reading? by Billhead · · Score: 2, Funny

      Don't you mean to arm bears?

    7. Re:Current reading? by Free+the+Cowards · · Score: 1

      Humor based on pretending to be stupid fails, because no idea is so stupid that you cannot find someone who honestly believes it.

      --
      If you mod me Overrated, you are admitting that you have no penis.
    8. Re:Current reading? by Paradise+Pete · · Score: 1

      Yes, this was an attempt at humor on my part. I see that I failed.

      I liked it.

    9. Re:Current reading? by Anonymous Coward · · Score: 0

      I *would* beat it....but I'm afraid I'd be accused of hate crimes if I tried.

    10. Re:Current reading? by SQLGuru · · Score: 1

      I think he mean Owl Bears. http://en.wikipedia.org/wiki/Owlbear

      Layne

    11. Re:Current reading? by cleatsupkeep · · Score: 1

      I thought it was funny. I modded you up. Oh wait...

  4. Hi! I'm facing a similar problem. by Anonymous Coward · · Score: 0

    I need to capture alphanumeric digits in a captcha for my spam business. Please give me all the tips you have on this subject.

    Thank you!
    vc: bombed

  5. what's your goal? by gEvil+(beta) · · Score: 4, Insightful

    I'd say your approach completely depends on your goal. If your goal is as stated, then I'd use the webcams to get shots of the meters, then I'd take the 2-3 minutes or whatever it takes a week to pull up those images and transcribe their values into the spreadsheet. If the goal is a programming exercise, then go to town with figuring out some way to automate that few-minutes-a-week task. Of course, in order to do that, you'll expend a whole lot more energy than you'd take to read the meters (via the webcam shots) yourself.

    --
    This guy's the limit!
    1. Re:what's your goal? by greg_barton · · Score: 2, Funny

      Of course, in order to do that, you'll expend a whole lot more energy than you'd take to read the meters (via the webcam shots) yourself.

      You are hereby ordered to report to the home office and turn in your geek card.

    2. Re:what's your goal? by Erioll · · Score: 1

      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?

    3. Re:what's your goal? by gEvil+(beta) · · Score: 1

      Well, once he gets his contraption set up, he can find out!

      --
      This guy's the limit!
    4. Re:what's your goal? by Anonymous Coward · · Score: 0

      You sound like my wife. Right after I have a well designed system to automate some task, she has the audacity to tell me what the time/benefit ratio to engineering it would be and dash my dreams.

    5. Re:what's your goal? by jibjibjib · · Score: 2, Insightful

      He probably has a computer running all the time anyway. And a webcam presumably doesn't consume much power, especially if it's turned off most of the time and just wakes up occasionally to grab a single frame.

    6. Re:what's your goal? by crevistontj · · Score: 1

      Agreed. What a stupid waste of effort, unless you're just looking for a practicum. Brains are still a lot more efficient for a lot of tasks than a computer is or will be in the next n years. Just go downstairs and look at the damn meter once a day. Or put a webcam there and save a screenshot each day and spend the 1 minute per month logging the value from the pics. How long does it take to look at a picture of a number and write the number down? 3 seconds? Even if you managed to code the entire thing, start to finish, in one week, it would take you 131 years to break even on man-hours for this project.

    7. Re:what's your goal? by kv9 · · Score: 1

      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.

    8. Re:what's your goal? by raddan · · Score: 1

      "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

    9. Re:what's your goal? by maxume · · Score: 1

      Don't forget to top off the lamps with some whale oil.

      --
      Nerd rage is the funniest rage.
    10. Re:what's your goal? by LoRdTAW · · Score: 2, 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 just tell the PMC to stream out the readings at intervals. Then use your PC to read the values from the PMC and your set.

      Image processing is over complicating the entire system. Most of your time and code is going to be spent on "looking" at a meter.

    11. Re:what's your goal? by gad_zuki! · · Score: 1

      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.

    12. Re:what's your goal? by Anonymous Coward · · Score: 0

      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 just tell the PMC to stream out the readings at intervals. Then use your PC to read the values from the PMC and your set.

      Image processing is over complicating the entire system.

      Uhhh... right. Let's just do what you said.

  6. Simple solution by halcyon1234 · · Score: 5, Funny

    Post the images as CAPTCHAs that protect porn pictures. You'll have the values typed in for you in no time.

    1. Re:Simple solution by Anonymous Coward · · Score: 1, Funny

      I'll volunteer to transcribe them for you. .. exactly what kind of images were they? Resolution?

    2. Re:Simple solution by Anonymous Coward · · Score: 0

      What value would the CAPTCHA authenticate against??

      Hmmm, what he needs is something that would read the number off the video feed, turn it into text data that could be used with the CAPTCHA.
      Then when people type in the CAPTCHA and it verifies off the character-recognized data, he'll have his work done for him! BRILLIANT!

    3. Re:Simple solution by Anonymous Coward · · Score: 0

      True genius:) Thanks for providing a good laugh. Btw to post as Anonymous Coward, i have to type captcha words.

    4. Re:Simple solution by argiedot · · Score: 1

      Perhaps use a method similar to recaptcha. Show two different readings. The first being your previous reading (which you've already got) and the other being your current reading. If they get the first one right, they'll likely get the second one. Show the second one to many people with a different first one, and take the mode.

    5. Re:Simple solution by redscare2k4 · · Score: 1

      LOL!! I'd mod you insightful if I had mod points. You really deserve some karma for that post :D

  7. Possible Implementation by orclevegam · · Score: 2, Insightful

    Depending on the color of the faceplate and the hand, you might be able to mask off everything you don't care about (say everything but a small area around the center of the dial), run it through a hi/low filter to map the faceplate to white and the hand to black, and then just calculate the angle of the hand by searching the edge of the image for black pixels. So long as the cam is fixed and you know the coordinates of the pivot point it should be trivially easy to determine the angle of the hand based on the point at which it crosses the edge of the detection area. Once you've got the angle it should be trivially easy to map that back to a set of values.

    --
    Curiosity was framed, Ignorance killed the cat.
    1. Re:Possible Implementation by Anonymous Coward · · Score: 0

      Holy crap, someone actually answered his question.

    2. Re:Possible Implementation by SQLGuru · · Score: 1

      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" (color = black, or 0x0), . indicates "empty" (color = white, or 0x1)

      Check wedge
      0000 .00. ....

      Test wedge A (arrow not in wedge) .... .... ....

      Test wedge B (arrow partially in wedge)

      000.
      00.. ....

      Check wedge & Test wedge A .... .... ....

      (all white)

      Check wedge & Test wedge B
      000. .0.. ....

      (not all white)

      That should give you two possible wedges at most. You can either fudge it (quick) or you can do detailed checking to see which wedge to indicate. Repeat the process for each dial. Record the number. I don't know the graphics libraries for Java, but as long as they are similar in capability to those of .Net (I assume they are), then it should be a couple of hours to implement and work out the major kinks (it isn't that I can't code in Java, but that I haven't had to do any graphics processing in Java).

      There's probably even some DirectX or OpenGL functions that you can use to do the masking even faster.....but again, I don't know them off the top of my head.

      Layne

  8. well by amnezick · · Score: 0

    If it's digital I don't see any problems (except maybe proper lighting unless using an IR camera) but if it has dials I see a problem if it's somewhere between two digits.

    There are a few tutorials on the net about image-processing (some very interesting using ANNs[artificial neural networks])

    --
    mov ax,4c00h
    int 21h
    1. Re:well by randyest · · Score: 1

      It's not digital in his case. Check the jpg in the summary -- it's one of those 5 clock-face things with 0-10 clocks for 10, 100, 1e4, 1e5, etc. decimal positions.

      --
      everything in moderation
  9. Rubbish by megalomaniacs4u · · Score: 3, Informative

    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.

    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" or other similar personal wireless power meters (also sold out everywhere, but there a cheaper more functional equivalents around)

    1. Re:Rubbish by camperdave · · Score: 2, Informative

      You have to clip a Wattson transmitter around a single line of the power feed from the pole into the fuse box. Most places I've seen have these wires in a conduit leading from the meter to the fuse panel. In order to clamp it appropriately, you'd need to install the transmitter inside the fuse panel itself. This is not recommended, and may be illegal in certain regions unless you're a licenced electrician.

      --
      When our name is on the back of your car, we're behind you all the way!
    2. Re:Rubbish by Anonymous Coward · · Score: 0

      I believe the GP was a play on words, or pun. Current (present) vs. current (electrical)...

    3. Re:Rubbish by petermgreen · · Score: 1

      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.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    4. Re:Rubbish by igb · · Score: 1

      I installed such a device a couple of weeks ago, and I had several metres of cable to choose from on the link from the meter (front of the house) to the consumer unit (rear).

  10. Kill-A-Watt? by corsec67 · · Score: 3, Informative

    A Kill-A-Watt 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 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 lens with a C-mount to CS-mount adapter, you can just wget the image however often you want. Image processing is another issue, but I don't know anything about that.

    --
    If I have nothing to hide, don't search me
    1. Re:Kill-A-Watt? by Anonymous Coward · · Score: 0

      Yes, spend 200+ bucks in equipment so that you can save 20 bucks! That's the answer!

    2. Re:Kill-A-Watt? by Anonymous Coward · · Score: 0

      That would have a net gain in under a year...

    3. Re:Kill-A-Watt? by corsec67 · · Score: 1

      Yes, spend 200+ bucks in equipment so that you can save 20 bucks! That's the answer!

      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 like a furnace or whole house air conditioner, but that isn't going to be easy to fix unless he can tolerate a colder or warmer house, anyways.

      --
      If I have nothing to hide, don't search me
    4. Re:Kill-A-Watt? by Anonymous Coward · · Score: 0

      A Kill-A-Watt might be a better choice for "power trimming", since you can get an instant reading of the power used by anything that plugs in.

      I agree that measuring each device is far more informative than whole house monitoring. My UPS displays current draw via its management software, so that might be a free alternative for some people. I have no idea how well it deals with things like power factors and you should never run inductive loads off a UPS (dish washer, fridge, washing machine, A/C, etc).

  11. The standards are coming (some already here) by randyest · · Score: 4, Informative

    Your power company is probably already looking into standards like Homeplug (main org site) (wiki link) that provide meter data much more accurately than a webcam and image analysis software. This allows them to save money on paying sneaker-net meter readers, and real-time usage data for load balancing and prediction.

    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 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.

    --
    everything in moderation
    1. Re:The standards are coming (some already here) by Anonymous Coward · · Score: 0

      Ameren finished switching everyone in the St. Louis, MO, USA metro area to remote-read electric meters about 10 years ago. I think it's probably safe to assume that their entire service area is handled this way by now.

      Their service area is approximately 30% of Missouri and 60% of Illinois. (See here: http://www.ameren.com/AboutUs/ADC_ServiceMap.asp)

  12. OCR plugins? by phatvw · · Score: 2, Informative

    There are many open source OCR tools available. Write a script to capture a JPG or PNG image every day from your camera and run it through one of the command-line OCR tools..

    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.

    1. Re:OCR plugins? by randyest · · Score: 2, Informative

      Cool. Which one of those can decode the five 10-position analog dials (like clock faces) that he shows in the jog in the summary?

      --
      everything in moderation
    2. Re:OCR plugins? by phatvw · · Score: 1

      You know what, I hope somebody mods my parent comment down. I didn't specifically say how to solve the problem. I really don't know the best way to do this, it would certainly help if the needles were a different colour than the rest of the image. Then you could just compute the angles and relative postition of the needles. Given that data, its a piece of cake.

      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" might look like. a "5" might have the needle just before the 5, on top of the 5, or just past the 5.

      You could also figure out which pie slice of the circle has the most black space. So split the circle into 10 36-degree segments and add up all the black pixels. The one with the most black is likely the one with the needle. Or course you have to take into account corner cases, so some testing is necessary. And of course comparing to the preceding place value and past data points to make sure it all makes sense.

    3. Re:OCR plugins? by smellsofbikes · · Score: 1

      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 suggestions for better OCR programs, I'd love to hear them. I'm really annoyed by this, because my girlfriend's HP flatbed scanner has OCR software from 1998 that came (apparently free) with the scanner, that has better than 95% accuracy on an entire printed page, at an angle to the scanner. Windows-only, of course.

      --
      Nostalgia's not what it used to be.
    4. Re:OCR plugins? by phatvw · · Score: 1

      Bah forget all that. Smart meters are the way to go. Problem solved.

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

    5. Re:OCR plugins? by smellsofbikes · · Score: 4, Informative

      This guy has an algorithm run in matlab to convert dial indicator readings to numbers using MatLab. He claims 99% accuracy over 2000 readings.

      --
      Nostalgia's not what it used to be.
    6. Re:OCR plugins? by YrWrstNtmr · · Score: 1

      You could also figure out which pie slice of the circle has the most black space. So split the circle into 10 36-degree segments and add up all the black pixels.

      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.

    7. Re:OCR plugins? by mobby_6kl · · Score: 1

      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 located to further simplify things. Someone with experience in computer vision could probably write everything from scratch, and there are several computer vision libraries available for everyone else.

    8. Re:OCR plugins? by jibjibjib · · Score: 1
      Checksums don't work for comparing photos, because two photos of the same object won't be identical, due to random fluctuations in the CCD sensor and slight changes in lighting.

      (Although there are algorithms which actually will work, so your idea is good, it's just the 'checksum' part that's not quite right.)

    9. Re:OCR plugins? by jibjibjib · · Score: 1

      I assume your digital multimeter has 7-segment displays. Perhaps the OCR software wasn't designed with that sort of thing in mind at all, but works much better with printed text.

    10. Re:OCR plugins? by smellsofbikes · · Score: 1

      That's possible. I actually haven't tried Kooka or gocr with printed text, just with the multimeter's segmented LCD.

      --
      Nostalgia's not what it used to be.
    11. Re:OCR plugins? by YrWrstNtmr · · Score: 1

      Right. Not checksum, because they won't be "identical", but similar (histogram, black level, white level, whatever) within a few percent.

    12. Re:OCR plugins? by Anonymous Coward · · Score: 0

      But his meter doesn't display actual numbers. It's a series of 6 dials pointing at numbers 0-9 that need to be converted into numerical values. To make this more interesting, some of the dials spin clockwise and some counterclockwise.

    13. Re:OCR plugins? by yo303 · · Score: 1

      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.

    14. Re:OCR plugins? by Anonymous Coward · · Score: 0

      For this particular task, a simpler algorithm will likely suffice: assuming the webcam is stationary, manually determine a set of pixels on the image that will tell you the locations of the needles.

      For example, in the given image, if pixel (424,172) is "dark", the 1000s needle is between 5 and 6.

      From a collection of such points, you can easily figure out the meter reading with enough accuracy to meet the OP's needs.

    15. Re:OCR plugins? by otter42 · · Score: 1

      Hi. As luck would have it, I am "that guy". I think I've got an improved version of that code somewhere, and I really, really do get 99% accuracy (but not necessarily 99% precision). For your needs, this would probably be just peachy. Since I was calibrating servo motors for my Ball and Plate project, I needed to eliminate those outliers, so even 99% wasn't enough and I had to finish the rest by hand.

      Looking at the dials you want to read on your electric meter, my algorithms would work perfectly. (Not the case if you wanted to read the spinning wheel.) You'd just have to make a mask you you're analyzing each dial separately. You also might have to play around with lighting conditions. In fact, judging by the tiny size you'll almost certainly have to make sure it's illuminated with a strong light. Make sure there's no glare or reflection from the light source, though.

      You might also place a white piece of paper behind the dials, if you can. I'm guessing you don't have the right to open this up, but if you can, the more contrast the better.

      Lastly, since the code is written in Matlab, using the image analysis toolbox, you might not have the ability to run this right away. However, rest assured that it would be relatively simple to port this dial-reader to C using the OpenCV toolkit. Since most of the Matlab code is very readable (even if I didn't comment it too, too extensively), you shouldn't have too hard a time. The biggest hassle would be the Hough (pronounced "hoff") Transform. OpenCV does this, but I've no experience with it myself, so I can't say if my method for tuning the parameters would work well for you.

      Give it a shot and let us know. After the /. article is closed to new comments, you can find my email address on my webpages if you want more advice.

      --
      www.eissq.com/BandP.html Ball and Plate System. Amuse your friends. Crush your enemies.
    16. Re:OCR plugins? by smellsofbikes · · Score: 1

      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 impressed by your accomplishment ever since I saw it on hackaday.

      --
      Nostalgia's not what it used to be.
    17. Re:OCR plugins? by otter42 · · Score: 1

      Octave? Sure. The biggest problem would just be the Hough Transformation. The rest is just some logic, and perhaps not even good logic at that. I'm willing to bet there are far more efficient ways to do this, computationally speaking, but my way worked pretty well and has only gotten faster as computers have gotten more powerful.

      I suppose taking lots of pictures and relating them to a database could be pretty efficient. If you binairized everything using Otsu's method as a threshold, you ought to get pretty consistent results. Just take the convolution and see which one it matches up to best. It'd be expensive as heck in computational time terms (convolutions tend to be slow), but as long as the camera didn't budge it should work out well.

      The advantage of my method is that the camera and target can move/shake without requiring recalibration. The advantage of yours is I think you could cut the number of lines of code in half, and maybe do everything in Octave without any special image analysis packages. Of course, I prefer Scilab, but that's another story...

      Thanks for the compliment! I was really shocked to see how many people still remember that hackaday. That was what, 2005?

      --
      www.eissq.com/BandP.html Ball and Plate System. Amuse your friends. Crush your enemies.
  13. Touchy, feely. by Ostracus · · Score: 1

    "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.

    --
    Shai Schticks:"You don't make peace with friends, you make peace with enemies"
    1. Re:Touchy, feely. by dschuetz · · Score: 1

      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.

    2. Re:Touchy, feely. by mpsheppa · · Score: 1

      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.

      Even worse that that, you won't even get the correct result because of power factor effects.

    3. Re:Touchy, feely. by bencoder · · Score: 1

      I don't mean to advertise, but I got a free wireless induction clamp when I signed up with one of the plans from southern electric (a UK power company, and since the submitter is in the UK, this might be what they are looking for).

      It clamps on to the line and transmits the current reading wirelessly every second or so. The reciever box keeps a log of the power used over the last day-week-month and shows you how much you use at different times of the day(morning, afternoon, night).

      Interestingly the reciever box has an RJ-45 port on the bottom, but I havn't tried plugging it in yet.

  14. Do what the meter supoorts? by bugg · · Score: 4, Interesting

    Often the meter supports some sort of data export mechanism, and you just need to tie into it. Hacker extraordinaire Poul-Henning Kamp did this with his gas meter.

    --
    -bugg
    1. Re:Do what the meter supoorts? by phkhd · · Score: 1

      I've heard that many residential electric meters have ERT enabled meters, which use a custom wireless protocol, so that the guys don't have to get out of the truck to read your meter. So, you'll need some sort of radio, and then hack the protocol (maybe sombody already has?).

    2. Re:Do what the meter supoorts? by pianoben · · Score: 0

      Perhaps there is an OPC driver available for your meters? Then you can use your skills as a dev to read the meter's binary output directly!

    3. Re:Do what the meter supoorts? by Anonymous Coward · · Score: 0

      something like that (http://phk.freebsd.dk/Gasdims/) is probably your best chance on getting accurate readings. you should use an IR/laser/optical counter (its simpler than webcam+image processing) just to count the turns on the kWh clock (the one in the botton that reads "kWh per Div.") of your meter. Than you can have a useful reading for every 10 kWh of consumption.

  15. Google is your friend. by Anonymous Coward · · Score: 0

    I found this lower down, since it's IR, you can probably achieve the same thing with a web cam.

    http://hackaday.com/2007/05/30/uk-power-meter-monitor/

  16. Check for WiFi by RingDev · · Score: 1

    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

    --
    "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    1. Re:Check for WiFi by andrewd18 · · Score: 1

      saving hours apon hours of labor every day

      Unfortunately, the Grammar Nazis shall never be able to share in this victory.

    2. Re:Check for WiFi by jkerman · · Score: 2, Interesting

      they are wireless, but not wifi

    3. Re:Check for WiFi by RingDev · · Score: 1

      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

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    4. Re:Check for WiFi by andrewd18 · · Score: 1

      I am totally in favor of slaughtering English over bagels. :P

  17. Re:this is lame by networkBoy · · Score: 2, 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

    --
    whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
  18. Current Transformers by Anonymous Coward · · Score: 0

    Use a networked microcontroller connected to current transformers. That way, you could keep a nice log without even having to bother with image processing. A tiny uC could take care of all the ADC, and a Lantronix module could serve it to your network.

  19. Python. by Markimedes · · Score: 1

    The "pygame" library in Python has a surfarray class that allows you to parse images as arrays.

    Convert the image to black and white, with a tolerance level above the black of the circle and below the black of the dials.

    Then you'll just have dials, so do a vertical scan then a horizontal scan.. whichever point has the least black pixels in common between both scans is the tip of the dial. Whichever has the most black points in common is the center of the dial.

    Draw a line between those two points, measure the angle. Gotcha.

    Prolly to complicated but i'd do it.. it would be a fun project.

  20. ImageJ by Don't+Hate · · Score: 1

    Use ImageJ! It's free, JAVA based and easy.

    1. Re:ImageJ by Don't+Hate · · Score: 1

      http://rsbweb.nih.gov/ij/ I suggest that you threshold the image. Then you can detect where the pointers are within the image. From that information you could then find the values of each dial.

  21. Clamp on ammeters? by wfstanle · · Score: 1

    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 say you, could this work?

    1. Re:Clamp on ammeters? by Anonymous Coward · · Score: 0

      Those devices are called "current transducers", and they come in a variety of shapes and sizes.

      When I worked for an HVAC controls contractor, we used CT's from Veris Industries.

      The common types were anywhere from $20 to $100 each, depending on features, and that was back before the price of copper went through the roof. Also, they're designed to work with building automation systems, so they return either a 4-20mA signal (at 5V) or a 0-20V signal (at 20mA). You'll need some kind of PLC to read that input.

  22. ImageJ by Anonymous Coward · · Score: 0

    Lots of tools for Java image analysis in ImageJ - http://rsbweb.nih.gov/ij/

    Source & docs are there too

    I am a bioengineer not a programmer, but have had a to do a fair bit of automated image analysis, and it's a great resource for useful software parts.

  23. Start Easy by Anonymous Coward · · Score: 0

    take the pictures, and do human-OCR yourself when you want to look at the data.

  24. Blue Line Innovations PowerCost Monitor by sdpinpdx · · Score: 1

    I saw this on This Old House a while ago. I don't see a way to snarf it out into a spreadsheet automatically, but it brings the data to you wirelessly and logs/aggregates some of it for a while.

  25. drarenij@iro.umontreal.ca by Anonymous Coward · · Score: 0

    if the meter is digital it's easy:

    -put the camera in a fronto-parallel position w.r.t the meter.

    -identify, by hand, the bounding box of each digit.
    -proceed to a learning stage, by acquiring images of the 10 digits (0..9).
    -After removing image's noise, your problem reduces to: read each digit and compare it to your databse you have learned earlier.

  26. Need a different approach by Tilzs · · Score: 1

    Forget the OCR, you need to just monitor the lowest ticks of the meter. Monitor when the dial makes a complete revolution and you can base all your calculations off of that. I believe this meter is different than yours but it may give you some ideas. http://www.btinternet.com/~jon00/electmon.shtml

  27. One small problem by YrWrstNtmr · · Score: 2, Funny
    Since you are talking about a webcam, that currently means USB. Your spouse will likely throw a fit about yet another set of wires trailing around the house. So unless you intend to splash out for a fully wireless (and expensive, in cost and 24x7 power) camera setup, my suggestion is to abandon this idea completely.

    For the sake of your family sanity.

  28. One approach... by Anonymous Coward · · Score: 0

    What you would do is first segment out all the dials, so that you have a separate image for each of them - this would be easy to do, given that you are using a webcam - just define the rectangles (bounding boxes) that surround the dials, and clip each from the image. Next, convert each of the dial images to gray scale, and threshold - convert to just two values, black and white - using a dividing value that will eliminate just about all but the dial pointer. Then, find the angle the pointer makes with horizontal (or vertical). That will give you one half of the answer, then determine (via the center of pixels representing the pointer) whether you are on one side of your horizon or the other. From this, you can assign a value. Rinse and repeat.

    Did that solve the homework? It's really a simple problem...

  29. Roborealm by HFShadow · · Score: 1

    Yes, it's windows only but it works wonders: http://www.roborealm.com/tutorial/Digital_Reader/slide010.php Point a webcam at it and use this for the vision processing.

  30. Ironic by Anonymous Coward · · Score: 0

    Does anyone else find it ironic that he's concerned about his energy usage and that his solution involves using more energy?

  31. There are better ways by Anonymous Coward · · Score: 0

    There are power transducers like these:
    http://www.crmagnetics.com/newprod/power_transducers.htm

    The smaller ones have RS485 digital outputs so you can directly read out voltages, currents, active power and reactive power, frequency etc etc, but are limited to 25A for each of the three phases, so you need multiple transducers and sum up afterwards. Up to 16 transducers can use the same RS485 bus.

    The larger ones have analog outputs 4-20mA or 0-10V proportial to the active power. You'd need an ADC in order to get your readings.

    Without proper education you really should call an Electrician for installation.

  32. Image processing problem by Anonymous Coward · · Score: 0

    As others have suggested, ImageJ is a good place to start. You could easily place multiple Regions of Interest (ROI's) around each dial, and output the pixel intensity of each. When the needle passes through a ROI, the pixel intensity will drop, since the needle is black. The readout will be a bit coarse, but should be sufficient for your needs. You can then take the results from each image, and translate those values using simple logic checks into digital numbers.

  33. split core CT or ammeter the way to go by Anonymous Coward · · Score: 0

    You'd probably be better off putting a split-core current transformer around one of the mains coming into your breaker panel, then using some kind of data logging multimeter to log the output. A quick search turned up this for $90, it's almost exactly what you'd need, PC interface too! If you could find a version of that with the ammeter clamp detachable from the body, you'd be set.

    http://www.wescotools.com/p-6812-1000a-data-logging-clamp-on-multimeter-trms.aspx

  34. Orientation analysis in an image by kebes · · Score: 3, Informative

    The image analysis question is interesting. You are trying to read dial positions, so conventional OCR is probably useless (unless there is a package to do exactly that?).

    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" Physical Review E 2002, 66, (1), 011706. DOI: 10.1103/PhysRevE.66.011706

    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 in my case). So maybe it is useful for you.

    1. Re:Orientation analysis in an image by Anonymous Coward · · Score: 0

      Here's an implementation of the above idea in Octave. There are lots of cool built-in functions in the image package.

    2. Re:Orientation analysis in an image by TerranFury · · Score: 1

      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 frame should make exactly such a "good guess" for the next frame, and you'll track the needle successfully.

  35. Re:this is lame by joshuac · · Score: 3, Insightful

    How is it lame to ask other people questions when learning how to do something yourself?

  36. Re:Hi! I'm facing a similar problem. by Ethanol-fueled · · Score: 1

    ...as if webcams are more efficient than software screen captures...

  37. Power saving tip by myxiplx · · Score: 1

    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?

  38. One solution. by harrkev · · Score: 1

    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 concentrate on the right-most digits.

    At this point, you have an image without needles, and you can take an image with the current reading. Make sure both images have the same brightness, and subtract the images. At this point, you can convert this gray-scale difference into a one-bit image easily enough. You might even want to eliminate any "on" pixel not connected to another "on" pixel to eliminate noise. The needles should pop out like crazy. This data should be easy to process. You have a couple of options.

    First, would be to find the centroid of the blobs, and then computer the direction to the centroid from the base of the needle (since you mounted the camera rigidly, you should know the pixel coordinates of the needle bases). Some simple trig, and you have the angle. Some simple algebra to get the number.

    The second option would be to somehow compute the actual line. I can imagine taking each point of the blob as a data point, and using basic statistics (least squares) to find the angle. Of course, this may blow up when the needle is vertical, so you also do a least squares on the transpose of your data, and take the better number. This will only give you an angle. Since rotating the needle 180 degrees will still result in the same angle, you will have to fall back on centroids. to possibly add/subtract 180 degrees as needed.

    To summarize, not too conceptually difficult, but a time-consuming pain in the butt. I hope this helps.

    --
    "-1 Troll" is the apparently the same as "-1 I disagree with you."
    1. Re:One solution. by harrkev · · Score: 1

      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 you have a string on "on" pixels, it is easy to determine the middle "on" pixel and its angle.

      Once again, though, this assumes that the camera is rigidly mounted and fairly constant lighting.

      --
      "-1 Troll" is the apparently the same as "-1 I disagree with you."
  39. Use a database by sugarmotor · · Score: 1

    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

    --
    http://stephan.sugarmotor.org
    1. Re:Use a database by maxume · · Score: 1

      Explain why.

      He doesn't have any performance concerns. He doesn't have any memory concerns. He has very few data integrity concerns (well, he might type a letter in one of his important numbers). In fact, Open Office provides a friendly interface with a whole bunch of convenient tools to analyze the data with.

      If he is going to automate everything, a database probably does provide a more convenient interface for doing the updates, but you made a pretty blanket statement there.

      --
      Nerd rage is the funniest rage.
    2. Re:Use a database by Ant+P. · · Score: 1

      If he's going to automate everything, logging everything to a database and then accessing the database using OOo's built in sqlite functionality should be exactly what's needed. Trying to automate direct edits to a spreadsheet is just retarded.
      And if he's not going to automate everything, he wouldn't be asking this question.

    3. Re:Use a database by sugarmotor · · Score: 1

      I was thinking that other measurements might come in later on.

      For example, water usage or temperature. Or the numbers from the monthly bill, including the current price of electricity.

      Temparature can be measured frequently, resulting in a lot of data over the years: reports will become slow if there is no supporting structure.
      A database will give you indices.

      Using several files I think will become confusing.

      Don't forget the value of ACID.

      I wouldn't go through Open Office's "friendly interface", I would like to see the graphs in a web browser. One click: open bookmark.
      Then the page with the graphs will have links to yearly, monthly reports etc. I don't think OO will make that easy.

      Stephan

      --
      http://stephan.sugarmotor.org
  40. TED The Energy Detective by mea_culpa · · Score: 1

    This along with the Computer Interface will be much more reliable. It is sophisticated enough to learn what appliances turn on and for how long and breaks down the usage detail for each.

    This does require opening your breaker box and installing a loop around the incoming hot lines. This can kill you if you do not know what you are doing. If you are not familiar with working in hot boxes I recommend having an electrician install it.

    My utility provides a box with a smart card that shows real time power usage, balance left on the card and approximate minutes until disconnect. Check with your utility for something similar. I like it much more than the monthly bill.

    1. Re:TED The Energy Detective by Destoo · · Score: 1

      Definitely the best solution. I've seen it in action and it's great.

      --
      Nouvelles de jeux et technologies en français. TC
  41. Apple ? by detnyre · · Score: 1

    If you have a Mac with OS X you could have a webcam take a picture and save it to a particular folder. Then have a worklow in place that automatically takes the image of the meter, adds it to an email and sends it to you. You could then receive the email, see the picture and replay back with the meter reading typed in. You could then have another workflow that monitors for the reply email, copies the meter reading from it and then opens the excel and copies the value to the spreadsheet. This would take some "fooling around" to get right, but would not be that bad to do...

  42. captcha by Anonymous Coward · · Score: 0

    Build a little porn website and use the images as captchas. Someone will read the meter for you :-)
     

  43. How does this data help you? by Lord+Byron+II · · Score: 1

    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 bulbs
    -used Kill-A-Watt on my computer equipment*
    -started regularly changing my air filter in my furnace
    -started using cold water for the clothes washer, and a low-temp setting for the dryer

    *The Kill-A-Watt showed me that turning off my laser printer when I wasn't using it was worth $20/yr. Turning off my subwoofer when I wasn't watching a movie was another $20/yr. Turning off my cable modem and router at night is a few bucks/yr.

  44. Mechanical? by SuicidalLabRat · · Score: 2, Informative

    Mechanical or Spinning disk type meters can be read optically or magnetically, or if you have a dig meter with LED interface you can monitor the LED frequency; Both allow for real time monitoring of your homes load. Monitoring the aggregate by collecting at all load points would be better, but that's a bit more complicated. try: http://web.archive.org/web/20060509092108/http://www.seanadams.com/pge/ ...for a head start. SLR-

    1. Re:Mechanical? by khanyisa · · Score: 1

      A friend of mine does this with an optical sensor over the flashing LED on the power meter (it flashes faster when more power is used) - to prevent the whole system wasting further power he uses embedded systems to run it.

  45. use RoboRealm free machine vision software by Anonymous Coward · · Score: 0

    take a look at the RoboRealm free machine vision program. It's very simple to use. Also do a google search for "OpenCV" for a more robust vision platform.

  46. Mechanical Turk by Anonymous Coward · · Score: 0

    Mechanical Turk. Post the pictures and let people transcribe them for you.

  47. A watt meter could help by coolsnowmen · · Score: 1

    Buy a killawatt or any other watt meter.

    http://www.amazon.com/gp/search?&index=electronics&keywords=kill%20a%20watt&_encoding=UTF8

    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.
    With 2 sets of speakers: .14$/kWh * .010kW * 24h/d * 365d/year = 12$ a year

  48. ding- electric meters already do infrared pulses by SuperBanana · · Score: 1

    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 sensor's sensitivity is so bad, it has to be positioned very, very precisely.

  49. Find the pins by Anonymous Coward · · Score: 0

    Looking at the picture I would think the simplest place to start would be to process each pixel in the image looking for the pins at the centre of each dial (they all appear to be a different colour to the rest of the image so this should be easy).

    After this it should be simple to read a circle around each of these points just far enough to be outside the central black hub but not as far out as the text (you don't care about the text just the position of the dials). By finding the middle of the black area returned by this circle you will have the position of the dial.

  50. One way to do it by Anonymous Coward · · Score: 0

    This can be pretty easy if the camera location is fixed and you can count on the dials being in the same part of the picture every time.

    - Take a picture and note the pixels that define rectangles containing each dial.

    - Set a threshold and turn the image into a binary black/white image so that the background is white and the dial (and numbers and circle) are black.

    - Create a 'test dial arm', the same size and shape as an actual dial.

    - Put the 'test dial' in the center of each rectangle and rotate it around in whatever increment you like (36 degrees would give a resolution of 0.1 on each dial).

    - At each position, calculate the amount of overlap. Just do a pixel-wise AND of the test dial and actual image together and take the sum of the result.

    - The position with the maximum overlap is your current reading.

  51. measure the current with a current clamp by Anonymous Coward · · Score: 0

    It may be far easier to measure the current in the two mains power conductors with a current clamp and use that to estimate the power. You don't need to mess with the live wires as it works inductively.If you want it to be more accurate, measure the line voltage with a digital volt meter as well.
    Both of these things should be available online and have convenient DC outputs that can be digitized, if not already digitized and available on RS-232 serial or USB.

  52. Corner detection by skeeto · · Score: 1

    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 missing. Inconsistent lighting may pose an issue here, however, so controlling the lighting makes the software side much easier.

    After subtracting the background and hopefully leaving you with a bunch of plain needles, apply a low-pass filter (smoothing) to remove and noise and cruft, then convert the image into a binary image. Dilate followed by an erosion to fill in holes left behind by numbers overlapping the needle (this may not be necessary). Then find the most extreme black blob (the one furthest from the center) on a dial (easy, as this is now a binary image). You now know where the point of the needle is. Convert the angle between point and center into a reading.

    I'm just throwing out an idea based on the computer vision classes I took in college. It may not work at all. Other approaches may use a Harris corner detector and/or an edge detector.

  53. Webcam + Matlab = solution by alph4num3r1c · · Score: 1

    I found this http://www.eissq.com/DialADC.html while reading hack-a-day. This may be exactly what you are looking for. Enjoy. http://hackaday.com/2006/02/18/digitally-reading-analog-gauges/

  54. Very basic image processing exercise. by SharpFang · · Score: 1

    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 of a single pixel in the image, but that's up to you.

    First, mount the camera in a consistent way and give it consistent light so that the image doesn't change. Will save a LOT of work with aligning the picture you take and finding the arrows.

    You work on b&w. If it's RGB, just average (r+g+b)/3.

    - Take a few pics of the meter, combine them removing the arrows from the shots (using shop). That is your "neutral" picture. You keep one, forever.
    - Take "current" picture. The one to be read.
    - Run both through median (replace pixel value at (x,y) with the middle out of sorted pixel values from square (x-1,y-1):(x+1,y+1) - removing extreme noise pixels.
    - Run both through gaussian blur (average value over square square (x-1,y-1):(x+1,y+1), softens edges getting rid of off-by-one errors on various edge areas.
    - extract the arrows by substracting one from the other: dif(x,y)=abs(org(x,y)-cur(x,y)).
    - binarize: change grayscale to 1-bit palette (p(x,y)=(p(x,y)thr)?0:1) pick threshold that gives clearest images of the arrows.
    - median again to clean up the edges.
    - denote detection zones - count each arrow as a separate image.

    Now you have a set of images ready for proper recognition. You might calculate center of mass if you wish, by averaging the position of all the set pixels, or just preset the center in the axis.

    Calculate distance from center to edge (nearest transition from 1 to 0) for all angles (transform radial-euclidean where applicable). The angle with maximum distance is the direction of the arrow. Alternatively you may examine a circle at fixed distance from center, detecting pixels set on the circumference.

    Transform the result (in radians) to decimal. Round down (preferably basing on result from lower value). Add up results from the wheels.

    --
    45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
  55. Re:this is lame by hjf · · Score: 1

    Some people learn from their mistakes, but smart people learn from other people's mistakes.

  56. Re:this is lame by kiddygrinder · · Score: 1

    Because he wants to learn IN HIS FREE TIME. What a tool.

    --
    This is a joke. I am joking. Joke joke joke.
  57. Just watch for the stripe - on old power meters by Anonymous Coward · · Score: 0

    Just build an led and photo resistor to watch for the black mark on the wheel that spins around - every revolution is so much power used - hook this to a counter and you have a really simple power meter.

    Building this hardware is simple - faster than programming - and cheaper than your solution.

    look at
    http://www.telusplanet.net/public/jacobs2/jake/projel/pwrmtr/

  58. Infrared Sensor taped on meter? by maxx_entropy · · Score: 1

    I once purchased a device for a mac (macos) that I believe was called ADControl. It was a box that had several analog and digital inputs and outputs. They sold an IR based sensor that you glued/taped to the outside of the meter which sensed the black mark on the "wheel" spinning in the older style electric meters. You then calibrated the pulses into watt-hours based on the number of pulses in a set time vs the increment on the dials. I would imagine such a sensor would not be hard to recreate.

  59. Move to a different country by Anonymous Coward · · Score: 0

    Move to New Zealand where most electricity meters are readable electronically.

  60. Itron/Schlumberger Centron infrared output by Anonymous Coward · · Score: 0

    Itron/Schlumberger Centron meters have an infrared usage indicator facing upwards out of the top of the meter. It blinks briefly for each watt-hour used.

    The LCD display also has a watt-hour indicator, either three blocks that "rotate" to simulate an old wheel meter or a single triangle. An indicator turns on or turns off for each watt-hour used (i.e. if you see the single triangle turn on and then turn off, that's two watt-hours used).

    This web page has more info.

  61. Is it worth it? by roesti · · Score: 1
    How much energy does it cost to keep this exercise running? Was it worth getting a webcam and keeping a computer running for something that you can check yourself in seconds?

    Just a thought.

  62. hall-effect ampmeter? by j1m+5n0w · · Score: 1

    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, the kill-a-watt would have been about equally useful, and I wouldn't have to convert amps to watts.

    If I were having a new house wired, I would perhaps ask to have the main power cables into the circuit breaker box routed through some kind of enclosure that would allow me to use a hall-effect sensor directly.

    Another interesting device if you just want to know how much power your computer is using: the power supply I'm currently using has an analog watt meter that fits in one of 3.5" drive bays in the front of my computer. It pretty much sits at 100-120 watts day or night. If I'm stressing the graphics card, it sometimes goes up to 180 or so.

    I got it at a garage sale. I don't think the company sells them anymore, but here's a link. (Click on "gallery" to see the power meter.) I wish more power supplies were made this way.

    1. Re:hall-effect ampmeter? by hankwang · · Score: 1

      I got a hall-effect ampmeter for the purpose of measuring power usage.

      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 that are not loaded can have a considerable idle current, but large transformers are not so common in a household setting. Old-fashioned fluorescent tubes with an inductive ballast and engines are bad (cos(phi)=0.7 or so); switched-mode power supplies (in compact fluorescent lamps, computers) are closer to 1.0.

    2. Re:hall-effect ampmeter? by j1m+5n0w · · Score: 1

      Thanks, I didn't know that.

  63. Get some exercise by amyhughes · · Score: 1

    How long will it take you to complete this project? How many times could you walk to the basement in that amount of time?

  64. easy way by hamoe · · Score: 1

    put the camera in a fixed position with consistent lighting. figure out the pixel coord of the center of each dial. pick a fixed radius from that center point where there is minimal interference (there is either dial, or its that off white color). now just look at all the pixels in the circle around that point at that radius, and it should be easy to figure out if you're pixel is part of the dial or not. it is going to be sort of close to white #ffffff or sort of close to black #000000, either way, there will be an easy to detect dramatic difference. figure out the angular range that the dial covers (eg it covers from 61 deg to 66 deg) average that, and you have a fairly precise direction its pointing, then convert that to whatever scale the dial is using.

    to make it easier you could run the image through some imagemagick filters (command line image processing) to reduce noise or simplify the colors.

  65. Alternatively, watch the LED by Spooky+Possum · · Score: 1

    The meter should have an LED that pulses at a rate equal to the rate of consumption (the pulses/kWh will be written on the meter near the LED). It's an easier programming exercise to measure this, but you have to continuously monitor it and can't just take snapshots.

    If the meter is really old it might have a rotating disk with a mark on it. You still get a pulse, but the image-processing exercise isn't much simpler than reading the numbers.

  66. Mechanical Turk by Bradley+Batt · · Score: 1

    This is a perfect project for Amazon's Mechanical Turk -- http://mturk.com/

  67. Modify the meter hands by agm · · Score: 1

    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 cannot put a blob of ink on the hands, then you could process the image at the pixel level to find out the top most, left most, right most and bottom most pixel position that has black (i.e. the colour of the meter hand) on it. This would give you the approximate hand position, and hence the angle. It wouldn't be very accurate if the hand were either perfectly horizontal or perfectly vertical.

  68. Easy image processing by Bloater · · Score: 1

    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 centres of the dials so you can sieve the potential hands down to actual hands. You can then do some simple trigonometry as you know which angles relate to which numbers.

    Done.

    1. Re:Easy image processing by Bloater · · Score: 1

      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.

  69. ImageJ - open source image analysis tool by dustingrzesik · · Score: 2, Interesting

    Lots of folks have suggested methods for developing an algorithm so I'll point you to some software that is free and very powerful. ImageJ is funded by the National Institutes of health, it is freely available and more than capable of the degree of image analysis you'll require. As others have mentioned image quality and consistency can be a huge hurdle so make life easier by setting everything up with care.

    1. Re:ImageJ - open source image analysis tool by jdh3.1415 · · Score: 1
      Dustingrzesik,

      I noticed your post and looked into ImageJ. It appears that ImageJ does most image analysis via plug-in. There are hundreds of plug-ins listed on their site. Converting a picture of several dials into a single number is no trivial task. Are there particular plug-ins that would be useful for this task?

  70. does yours have a flashing LED? by Anonymous Coward · · Score: 0

    mine (UK) does. flashes at 1/100th kwh usage IIRC (cant be bothered to look). always thought it would be a neat project, hook up a photodiode to a microcontroller to read/store uses, hook to a pc once a day or so to see how things pan out and for graphing.

  71. An image processing sugestion by Anonymous Coward · · Score: 0

    If you want to go the image processing way, here is a suggestion for getting it done:

    1. Use the MSER feature detector to segment out the needles.
    (a binary implementation is available here: http://www.robots.ox.ac.uk/~vgg/research/affine/detectors.html#binaries
    A Matlab version here: http://vision.ucla.edu/~vedaldi/code/mser/mser.html
    Otherwise, google it and read the papers on it.)
    MSER will return a set of features it found in the image. By simply filtering for a limited size range, you can select the needles. Here is what I get: http://lh3.ggpht.com/_z9CT12wxXK8/SRt0UtEF2eI/AAAAAAAAAJg/XhN_si8uqp4/s800/needles.png
    The image shows ellipses fit to the needles, but MSER can give you the raw pixel segmentation as well.

    2. Since you will only be working with this one meter, the rest of the job should simply consist of assigning the dials to their respective power of ten based on relative position and reading the dials by means of their orientation.

    MSER is also fairly robust, so if you take care of step 2 properly, then moving the camera or changing lighting conditions slightly wont break it.

  72. I did it by watching the LED by jalla2000 · · Score: 1

    I used a microcontroller to watch the flashing LED on my wattmeter. Had it running for a year before I moved. I froze the webpage so you can still watch the log. Check it out: http://indigo.ed.ntnu.no/jalla/power Open source and everything! Woohoo!

  73. Clamp meter on main hot-mains? by cffrost · · Score: 1

    I'm not familiar with UK AC wiring, but my circuit breaker box (CU) contains two incoming hot leads around which a clamp meter could be affixed. This could provide real-time data.

    You could do anything from using a relatively high-end meter with built-in data output, to breaking down a cheap-ass analog meter and tapping the meter's needle/armature contacts for your data.

    If you go this route, note that you'll need a pricier RMS meter to accurately measure AC watts with power factor accounted for, else you'll measure volt-amps, preferable only if you're billed for kVA/hrs instead of kW/hrs.

    --
    Thank you, Edward Snowden.

    "Arguments from authority are worthless." —Carl Sagan
  74. Hough Transform by jdh3.1415 · · Score: 1
    You should look into Hough transforms. It could be very useful for determining the orientation of the dials on the meter. A word of warning, writing image recognition code is not for the faint of heart. It's as much art as it is science. All image processing code I've ever seen is completely illegible. If you think there's a remote change you will change it later, comment it well.

    http://en.wikipedia.org/wiki/Hough_transform

  75. ImageJ by Anonymous Coward · · Score: 0

    ImageJ will handle capture, processing, and output. It has a very well-developed set of plugins and other tools as well: I wouldn't be surprised if someone already has a tool that does almost what you're looking for.

  76. Re:this is lame by hedwards · · Score: 1

    And really smart people trick other people into making mistakes for them so they can learn from said mistakes.

  77. Re:this is lame by Anonymous Coward · · Score: 0

    I love how two opposite comments have both been equally modded +4 Insightful. I guess that's Newton's Third Law of Message Boards or something......

  78. Alternative approach by Anonymous Coward · · Score: 0

    This sounds almost exactly like the project I've just started on, but here I have the benefit of an electronic meter, which flashes a LED for each watt-hour of electricity consumed.
    What I've done is use a fibre optic experiment kit (basically, a photodiode and a length of plastic FO cable) to convert the light pulses into pulses feeding into a this card [http://www.velleman.be/ot/en/product/view/?id=351346] . Then I'll read the counted pulses from the card every 5 minutes (or whatever period you want)
    The trick is that you can't modify or hack into the meter at all - the supply companies are very serious about meter tampering, and I wonder how they'll react to seeing this optical-only coupling device.
    If you've only got a mechanical electricity meter, there is more than likely a spinning disc that's driving the cogs behind the dials. Typically the disc is silver with a black section, and is visible via a window on the meter. If you were to shine a LED onto the disc, and measure the reflection back off the disc (both via fibre-optic cables) then you might be able to generate one pulse per disc rotation. Meters are generally marked with how many rotations are made per kWh.
    To those suggesting kill-a-watt meters - that's fine for appliances, but if you want to measure whole-of-house usage ( including things like 3-phase air-conditioning units, lighting, wall ovens ) then the meter box is THE place to do it.

  79. Count revolutions instead of OCR by Anonymous Coward · · Score: 0

    I found the Power Cost Monitor that reads the meter in a simpler way: count the revolutions of the spinning disc. Unfortunately, the UI seems a bit clunky though. Ideally you could hook it up to a computer and plot usage against time, and have alerts when your consumption is exceptional.

  80. Just do it by ecloud · · Score: 1

    The first approach I can think of would be to imagine a vector (a ray) going from the center of each dial to its circumference. Step the angle of the vector, from 0 to 360 degrees, and for each step, iterate along the vector from the center out, find pixel coordinates along the vector, and count how many dark pixels (darker than some threshold) you find along that vector. When you find several vector angles which all have high dark-pixel counts, take the middle one as being the angle of that dial.

    The critical thing in that case will be positioning the camera solidly so that the centers are always aligned the same way in the webcam pics, unless you find a way to recognize the centers of the dials too.

  81. Wrong approach by Animats · · Score: 1

    You're making this far too hard.

    The way to do this is to use a split-core current transformer. 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 about 100ufd across the output for filtering. Feed the output into some low-end microcontroller with an A/D. Transmit the data somewhere else for further processing.

  82. The cool way :-D by clooner · · Score: 1

    You could do it like this. Just try to crop the image so it will only show the numbers. Next generate images with numbers and start comparing them to the images from the webcam :-D http://it.slashdot.org/article.pl?sid=08/10/08/2132212

  83. Here's one way by tristanreid · · Score: 1

    Don't go nuts with trying to resolve the arrow then figuring out where it's pointing. That can be fairly hard because you're dealing with a bitmap that you have to convert to vectors. I think the best approach is more simple:
    1. Use the webcam to film the meters. What you want is to record at least one full revolution of one of the dials. You want a set of images that show the dial in just about every position. Ideally you'll have enough images that the dial could never be completely between two images, i.e. the dial overlaps itself in subsequent images. Write your java code to read each one of these into an array of Image objects, and store the corresponding value of each Image in a Hashmap (this is the most tedious part of the project, I think)
    2. Does the webcam have an api to snap an image? If not, you'll need to have the webcam take an image and save it to a dir every x minutes, then use java to read the image.
    3. The image that you grab in (2) will have several dials that you want to read. Play around until you isolate the regions that contain each dial. Photoshop is actually the best way to do this, you can just move the cursor to the area you want and read the coordinates. The idea here is that you want to read each dial in such a way that it looks exactly like the others. You create a new Image from the first for each dial, the images should look almost exactly the same except for the position of the dials.
    4. The images you got in (1) should be stored in an array. When you need to read each dial Image that you got in (3), just loop through the stored dials and XOR each one as a Bitmap with the one you're trying to read. Then sum the resulting 1's. The lowest total is the closest image, use it's value. After you try this a few times you can tweak it by dumping the results of all the comparisons to a csv and using a spreadsheet to look at what's happening. If it's fairly consistent you might be able to get away with some performance optimization such as getting rid of some Images or stopping when you get a recognized hit.

    -t.

  84. Some potential solutions... by Anonymous Coward · · Score: 0

    You actually have a pretty nice setup -- assuming your webcam sits still, the dials will always be in the same location in the image. Grab some software like Octave to try out a few algorithms. I'd try running a Canny edge detection on the circularly masked regions corresponding to the dials. You'll have strong edge response from the two edges of the pointer for the dial. At that point, you'll have to write some sort of clever algorithm to find out which direction the dials are pointed in.

    The more I think about it, there's an even simpler solution: mask out everything except the very inner circle of the dials. Then run a threshold on that image and you should get all white (where the pointer is not) and a black segment. Sample around that circular region and the mid-way point of the black section is where your dial is pointing. I'm not sure if that made very much sense...

    There are a few ways to go about it, but luckily you have incredibly controlled conditions -- you know exactly where the dials are and the lighting will most likely stay very constant over time (this is an assumption I'm making). With all of that knowledge about the problem, a bit of time reading about image processing (and honestly, it's quite a solvable problem!) and you'll have yourself a solid solution in no time.

    Good luck! Hope this gave you some keywords to look up.

  85. Take advice from the Daily Show with Jon Stewart.. by wiryd · · Score: 0

    Use your vision balls that you keep in your skull case! [Hint: if you can't find them look above your food taster]

  86. Google is your friend by Anonymous Coward · · Score: 0

    Quick check of "automated webcam" pulls this:

    Dim imageURL
    imageURL = "http://www.mtbachelor.com/@@/cams/wvskycam.jpg"
    Function SaveBinaryData(FileName, ByteArray)
    Const adTypeBinary = 1
    Const adSaveCreateOverWrite = 2
    Dim BinaryStream
    Set BinaryStream = CreateObject("ADODB.Stream")
    BinaryStream.Type = adTypeBinary
    BinaryStream.Open
    BinaryStream.Write ByteArray
    BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
    End Function
    Function BinaryGetURL(URL)
    Dim Http
    Set Http = CreateObject("WinHttp.WinHttpRequest.5.1")
    Http.Open "GET", URL, False
    Http.Send
    BinaryGetURL = Http.ResponseBody
    End Function
    Function doSave()
    Dim image, fName, p_month, p_day, p_hour, p_minute, p_second
    image = BinaryGetURL(imageURL)
    p_month = padZero(Month(Now))
    p_day = padZero(Day(Now))
    p_hour = padZero(Hour(Now))
    p_minute = padZero(Minute(Now))
    p_second = padZero(Second(Now))
    fName = p_month & "_" & p_day & "_" & Year(Now) & "-" & p_hour & "_" & p_minute & "_" & p_second & ".jpg"
    SaveBinaryData fName,image
    End Function
    Function padZero(val)
    If(Len(val) 2) Then
    val = "0" & val
    End If
    padZero = val
    End Function
    doSave()

  87. Cool, but... by Castorvelu · · Score: 1

    What's the point of trying to save energy if you spend so much energy trying to know how much you spend? Having a webcam 24/7 online, probably a small computer behind, some router, PLUS the energy that was needed to produce all this stuff -- that's insane! Cool geeky idea, but think about it: why don't you make some real effort for the planet and give yourself a 2-minutes exercise a day?!?

  88. Energy Monitor by mretallack · · Score: 1

    I use an EON Energy Monitor. EON have being given them away "free" when you sign up to getting energy from them. It is infact a re-branded Current Cost Energy Monitor. http://www.currentcost.co.uk/ The one problem is that it does not easily allow me to check the meter reading against the energy that has been used, but it does mean that I can see the energy usage. I noticed that on the bottom was an RJ45 connector, after a bit of Googling, I found that its a TTL level serial port: http://www.retallack.org.uk/dokuwiki/doku.php?id=energymonitor

  89. Wrong approach by hcdejong · · Score: 1

    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 hogs in an average household. Start with those.

    And there's another approach: spend some time observing your family. Do they leave the lights etc. on in empty rooms? Do computers run 24/7 instead of when they're needed? Are the laundry/dishwasher programs they use appropriate, or can a shorter/more economical program be used with satisfactory results?

  90. Been there, done that. by Anonymous Coward · · Score: 0

    I have made code that does just what you want, but with digital display. Code is here if you want to take a peek. http://www.rouvali.com/fileadmin/Download/CNCMittari.zip
    (code heavily relies on apearance of measure dial I am using, so you can't use this code?)

    Basically what you want to do is:
    Figure out where your dials are in web cam picture. Maybe try finding edges or draw some blue dots so you can scan for. After you know position for two dows, you can calculate dial center position in picture. With every dial, draw imaginary circle around centers. Diameter so small that it goes 'inside' numbers. Within this circle, find darkest dots. There you got direction where pointers are pointing. And that can be converted to numbers. Be careful with light, if possible avoid reflections. (light thru paper is good trick, make sure it does not burn anything) As you can see in your picture, pointers in your picture are black, but whitest dots in your picture are in those black pointers.

  91. Try this Voltcraft thing by Anonymous Coward · · Score: 0

    http://rubenlaguna.com/wp/2008/07/18/voltcraft-energy-control-3000/

  92. opencv library by cekander · · Score: 1

    The opencv (cv=computer vision) library has many functions that will aid you in your quest.

    There's an active group to discuss algorithms and implementing opencv: opencv at yahoogroups

  93. Electronic measuring device by Anonymous Coward · · Score: 0

    Something like this might be useful (it is in German):
    http://www.elv.de/Stromz%C3%A4hler/x.aspx/cid_74/detail_1/detail2_437

  94. modbus over tcp by liamr · · Score: 1
    Hi...

    we constantly do this kind of stuff in http://www.resourcekraft.com/

    The easiest thing to do here is to forget about your existing meter. Just use one of the new modbus over TCP meters and install it in series after your existing utility meter. Some of these have embedded webservers so you don't even need to do programming. see here for a rather advanced example: http://www.electroind.com/shark100s.html/

    Liam

  95. Re:this is lame by otter42 · · Score: 1

    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... this is how science originally worked. Galileo didn't publish in a "journal of science", he published in the open and then people said, "Cool, I wonder if I can do that?" So what better medium for this effect in the modern world than /. ?

    --
    www.eissq.com/BandP.html Ball and Plate System. Amuse your friends. Crush your enemies.
  96. Blinkenlights by Anonymous Coward · · Score: 0

    Some electricity meters have a LED that blinks at a different rate depending on how much power is being used. If yours has one it would be easier to hook up a light detector rather than an entire image processing setup.

  97. It's a simple problem by rfc1394 · · Score: 1

    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't sure if it was on the line) was on or just before the 5, except the number 'below' it was between the 9 and the 0; since it was past 9 and back to zero, that means it was no longer 4 so it had to be 5; at that close if it was still 4 the number below it should have been at least an 8 or more likely a 9.

    In fact, (at least in this area) the tariff schedules for most utilities require meters be replaced (at no cost to the customer), about every 30 years or so, because as they get older they tend to favor the customer more by reading 'slow'. Especially gas meters, they're more mechanical than electric ones, but the use of a photograph works the same for both types of meters too.

    You need something to take a 'snapshot' of the meter. By positioning the camera, you can fix it so that it takes the same image. Since you know where the dials are, you fix it so that you isolate the portion of the dial which is normally blank except for the needle indicating the reading for that segment (100,000 hours, 1,000 hours, etc.) Where the area is other than blank, that's the number, so that the area between 3 and 4 is the '3' value for that digit. Each segment only has one of the 10 possible values as something other than blank because it only has one needle. If you get something else you've got a contamination problem, e.g. something got in the way or the camera moved.

    So once you have the particular segments, and the slices of each segment representing each digit, then you can check each slice to see which is other than a blank image. Set that value, then you can go on to the next digit. It ain't hard to have something analyze an image to determine if it's empty or not, you just have to select what part of each image is a digit segment and which is a slice of that segment representing the number from 0 to 9. It's basically one or more bounding boxes representing a curve-shaped rectangle for each slice. Then once you know what each segment is, you multiply the segment's value by its multiplier, e.g. 100,000 for the 100,000 hour segment, etc.

    Then you just check what the value is, and take a snapshot, say, 4 times every day or however often you want to check usage. More often than probably every 6 hours won't tell you much as you're unlikely to use more than about 8 KW in a 6-hour period based on the average home, at least in the U.S. at an average of 960KWH per month, and U.K. usage probably isn't much different or might be less.

    If you're interested in average hourly usage, you take a snapshot each hour; if you want peaks, try every 15 minutes. Otherwise once every six hours or once a day or however often you want an idea of how much you use and how fast. Processing time for the image shouldn't be more than 10 seconds at most.

    ---- Paul Robinson <paul@paul-robinson.us> My Blog

    --
    The lessons of history teach us - if they teach us anything - that nobody learns the lessons that history teaches us.
  98. My Electricity Supplier Sent Me One! by Anonymous Coward · · Score: 0

    My electricity supplpier (Southern Electric) in the UK sent me one of these meters in the post when I joined.

  99. java.awt.Image by Anonymous Coward · · Score: 0

    I've did some rough image analysis this way: if you have a jpeg, png, bmp, etc of the image dials, use ImageLoader to create a java.awt.Image object. Loop through each pixel, converting from RGB to HSB (methods in Image). Then, check the value for brighness (B): if it's > 0.5, then consider the pixel to be 'black' (or is it 0.5, I can't remember). You'll have to do some vector calculations and some thinking, but you should be able to determine where the arrows are pointing.

  100. There is a better way then image processing by GruntboyX · · Score: 1

    Look at the front of your meter and read the name plate. It will have a bunch of gibberish like meter class, meter form, service voltages and something called Kh with a number beside it. It will most commonly have a 1.0, 7.2, 14.4, 21.6, or 10.0. This number is representative that each time the disk turns that number of watt hours has been registered. If you meter is solid state there is a test led either on the top of the meter or in the hog nose (but not limited too) that flashes infared when it registers that number of watt hours. All you need to do is count the pulses or turns of the disk. This tells you in a Wh resolution how much energy you are consuming. This is way better because with that resolution you can record things such as load profile and demand and analyze your energy usage throughout the day. All you need is a pin diode to detect these pulses. This is a much much easier solution than messing with image processing and trying to control the lighting on your meter that most likely resides outside in the sunlight. And it allows you to read your meter at night.

  101. Why bother with image processing? by DavidYaw · · Score: 1

    ...have the value logged automatically each day.

    Really? You really need OCR or image processing to automatically convert a once daily number?

    Set up the webcam to take a daily picture, and type in the number yourself. It'll take what, 15 seconds per day? 2 minutes for an entire week, less than 10 minutes for an entire month's worth of data? You'll end up spending more time configuring the automatic reader than you would typing in an entire year's worth of data.

  102. already done by Anonymous Coward · · Score: 0

    Poul Henning-Kamp has already done that, check his page:
    http://phk.freebsd.dk/Gasdims/

  103. Get one of these... by Papyrus · · Score: 1

    Black & Decker EM100B Energy Saver Series Power Monitor.

    This has a meter reader gizmo powered by a couple of AA batteries that attaches to your electrical meter and then sends data wirelessly to a small portable lcd display.

    The meter reading gizmo does not interfere with the ability of your power company to read the meter when they stop by periodically.

    Amazon sells them for $99.

    I have had one for about 2 weeks now and it is really interesting to see what my hourly usage is when various household appliances kick on/off.

  104. You could.. by stewsters · · Score: 1

    You could use a k nearest neighbor algorithm to compare dial positions. The problem is that you would need pictures of all the possible dial positions to use as a training set, and the camera couldn't be moved much, or it would error.

  105. TED by Anonymous Coward · · Score: 0

    I've been investigating ways to measure electricity consumption as well. There's the Kill-A-Watt and the T.E.D. (The Energy Dectective).
    http://www.theenergydetective.com/what/overview.html

  106. Alternatively, by argyleblanket · · Score: 1

    get one of these: https://www.ecogadgetshop.co.uk/ShowProducts.aspx?Category=ecoProducts It's not documented, but you can also get a cable to hook the receiver up to a serial port. You can pick a cable up from ebay (google for currentcost meter). A quick google for currentcost meter will bring up some hacking sites showing how to get the data from the meter.

  107. CurrenCost by simonmsh · · Score: 1
    For electricity consumption monitoring, I also vote for the CurrentCost.

    It is quite cheap (30 UKP), and is a very geek-friendly product. It has the all important serial interface which sends out the data every 6 seconds, but it is a TTL-level interface, which gives purchasers the oportunity to exercise or develop their hardware skills, by constructing their own interface with the widely available MAX232 chip and a few capacitors. It also provides an oportunity to exercise software skills when parsing and displaying the XML data the port sends out.

    It's almost as if the designers decided to provide an interface, but also wanted to provide a few challenges for users to solve.
    Here are some more links from CurrentCost fans:
    http://currentcost.wetpaint.com/?t=anon
    http://www.sgurr.co.uk/lundycam/energy_monitor_interface.html

  108. iPhone app, MeterRead (Go Green, Save Green!) PGE by zerogate · · Score: 1

    Out her in California, PG&E is replacing 5 million electric meters with Smart Meters, but they are only about 10% done. It should take another 5 years. They transmit the data back through radio waves. I was thinking the same thing regarding using a camera that would read the meter, take a picture of it and send the data to a website. It could be a new cover for the existing meter and your done. This would be a great invention. I know that there are many patents out there for automatic reading. Check out freepatentsonline.com to search. Anyhow, our iPhone app, MeterRead allows you to simply match the dials to your meter, then you record the data and get feedback such as elapsed time since last read, total kW-h's used, average watt load and and a 30 day estimated usage based on the current read. You will like it if you try it! We have a YouTube video if you want to see it in "action" (the video is pretty boring, but informative).

  109. (laser pointer)look at the problem another way by Anonymous Coward · · Score: 0

    http://www.telusplanet.net/public/jacobs2/jake/projel/pwrmtr/

    http://web.archive.org/web/20040603190403/http://www.seanadams.com/pge/

    uses a laser pointer to count the holes in a disk that spins on many power meters. much easier than OCR the analog dials

  110. My own solution by Anonymous Coward · · Score: 0

    It happens that, some time ago, I completed a similar project to read my natural gas meter using a usb webcam. I've finally gotten around to posting a quick writeup, and implementation in Python: http://www.jjoseph.org/misc_projects/meter_reading_with_a_webcam.html. I'd be pleased to hear any feedback regarding my own or better methods. ~Jacob