2013/01/30

IR encoder from a ball mouse


I was a bit curious to see how an old mouse worked to be able to use the phototransistors in there for other DIY purposes. This video is shot with an old sony DV camcorder and shows how the IR shadows penetrate the receiver phototransistors.



Here is the video:

The quaderature signal output from the two phototransistors is then something like this:

A: __|--|__|--|__|- 
B: _|--|__|--|__|--



The direction of rotation is determined by the phase difference of the pulses. This would then be the other direction:

A: _|--|__|--|__|--
B: __|--|__|--|__|- 

 Hope this is useful for someone, i have used the phototransistors for this energymeter interface. 

2013/01/07

Arduino Energy Meter Interface

I like to measure stuff. I also like to trend my energy use in the hoouse. I have been thinkin about an interface to my house's energy meter for some time, and how to read it. I also have an Arduino Uno in my drawer that i never have powered up. So this is actually my first Arduino project :-)

Here is my energy meter:
On the left side it says 1000imp/kWh. So i looked at the Infra Red LED in the metal ring using the camera of my phone:



It turns out that in the magnet cicle ther is an IR LED that emit one pulse for each Wh or 1000 pulses per kWh. Of course i must try to read these pulses and calculate the Power :-)

Inside and old ball type computer mouse i found an IR phototransistor:

The photo transistor is the black one reading the rotary encoder pulses. It is a dual device to read quaderature signals so i only need to use the middel one wich is the collector and one of the sides that is an emitter. I noticed that the middle pin of the IR transistors was connected to + on the Electrolytic capacitor and assumed it was Vcc. The other two pins went to the IC in the mouse.

I connected it up with a 5V from the Arduino on the collector and 100k pulldown on the emitter to ground. Used an old USB wire and placed the transistor on the meter:
Here is the schematic:
  
And the real world :)
  Then measured the emitter to ground using my prehistoric oscilloscope:
Scope is set at 1ms/div so the pulse is about 1.5ms long.

Actually it seems pretty imune to the other light sources around.. except remote controls :-o


Calculation:
The energy consumed between each blink is 1[Wh] = 3600 [J] = 3600[Ws]
The power is then P[W]= 3600[J] / t[s]


So i only need to measure the time and then calulate power.

Here is the quick and dirty Arduino sketch to measure time using timer:

I really like the Arduino platform. It really can not be easier.

Result from the in the IDEs built in serial console:
Playing with some halogen lamps and it looks good :)


Next i might try to collect the data some how.