One of the main reasons I wanted to learn microcontrollers was that I wanted to make my own energy consumption monitor. I live in the US, and I have an Itron digital electric meter on my house. On the top of the meter is a plastic optical conduit that goes to an IR LED that flashes once for each watt-hour used. I was hoping to use an IR transistor to read the meter flashes with an MSP430, and pass the info to a host computer (probably an old junk laptop I have). Once I had the meter-reading done, I could start considering weather sensors and appliance sensors to see how they affect the electricity usage.
So, I tried wiring up an IR sensor (one side of a dual-IR phototransistor salvaged from an old ball mouse) and hooking it up as I would a switch on an input pin.
I ran a test program, aimed an old VCR remote at it, and voila! It worked! While still jazzed about this, I took the LaunchPad outside with a battery pack, and taped the IR phototransistor over where the IR flash should be… nothing. I turned on the air conditioning to be sure I was using a decent amount of energy… nothing.
I finally broke out my cell phone camera and tried to see the flashes. At first, I thought my meter didn’t flash. Then, I put the camera up close. It wouldn’t focus, but I could see the flashes (please excuse the noise from the A/C unit):
Too dim for my set-up. I need to either find a more sensitive sensor, change the circuit to amplify the signal (an o-scope would be nice!), or can this idea.
Any ideas? I would love your comments.

Wow, that *is* very dim but don’t dismiss the project. Look on the bright side (pun not intended), the flash is clear enough for your mobile phone to pick up.
I’d buy a new IR transistor. I wouldn’t be surprised if the units inside an old ball mouse aren’t a bit crappy, spec-wise.
You could also try using something like a 2N3904 transistor to boost the output.
Is the meter in a cupboard at all? I ask because I know IR from direct sunlight will confuse my Wiimote, by the same token it could cause false triggers for your system, once you get it working.
Doc,
Here’s something you can try. First I would lower the resistance of your pull-up resistor. Make it something between 500 Ohms and 10k Ohms. Then use the MSP430 that has a comparator (this method assumes that you have a potentiometer. Use the comparator to compare the value coming out of the IR receive to the voltage drop provided by the potentiometer, you can test it by toggling an LED when the comparator shows a ’1′. Move the potentiometer till you have it set to a good triggering voltage which gets every pulse.
You could also use the ADC to see when the signal jumps and have a “software comparator”.
Hope that made sense.
Sorry for the double post, but I also saw you have the EZ430. If you do not like the comparator idea, you can use the SD-16 ADC in the F2013, it has built in op-amps which can be used to provide gain to your signal if it is too small.
@Gareth:
Thanks for the comment. I have ordered some high-quality IR phototransistors that claim much higher sensitivity.
@NJC & Gareth:
EDIT: Please ignore this paragraph. NJC explained transistors to me over on the 43oh.com forums (you should check 43oh.com out, if you don’t already!).
I’m not sure the extra transistor or the integrated op-amps will boost the output, though. I thought transistors acted as solid-state switches; when the voltage on the base reached a certain level, the transistor would conduct. I think it’s either all or nothing, so there would be nothing to “boost”. What I’m lacking is that threshold of IR light to trigger the phototransistor, and I have no way to boost that. This pretty much kills the comparator idea as well (unless, of course, I’m wrong about the transistors).Alas, my meter is in full sun for a few hours in the afternoon. I am aware that the sunlight may play hell on my sensor, but I was going to cross that bridge when I came to it (i.e.: at least got the sensor working!). I am planning on using a wide chunk of salvaged inner tube to both weatherproof and shade the sensor. However, there is still a ~0.5″ gap between the meter itself and the plastic “jar” that covers it. since the front will remain uncovered (because I think the power company would complain otherwise), I will have at least some sunlight to deal with.
Thanks for your thoughts.
you might try using a lens of sorts. working in a manufacturing plant i got to bust open the broken proximity sensors on some of the machinery when they threw them away. inside all of them I always found little plastic lenses that looked similar to those found in cd/dvd-rom drives. might want to give that a try to get the sun out of your eyes.
This is pretty cool. 43Oh is great and I am slapping myself for not stumbling upon them and this blog before now. Have you considered using inductive looping (a bit more dangerous then the IR method)? That way you would have a more reliable reading without the issues of sunlight and obscuring the meter, which some electric companies (especially in regulated or recently deregulated states) frown upon. Meter tampering in any way is a serious violation unless you are lucky enough to live in a jurisdiction that allows for exceptions in the case of personal monitoring efforts. Just curious if you plan to integrate this into Google’s power monitoring network?
I did consider inductive pickups, but they are expensive and not as easy to install. My sensor does not obscure the meter; the entire front of the meter is open (see: http://blog.docstech.net/2010/09/13/electricity-consumption-monitor-a-step-forward/ ) and the sensor is entirely non-invasive (slips on and off), so I’m not worried about the utility company complaining.
I don’t know about integrating with the Google network. Maybe rev. 3 or 4. ;-)