2010-03-07

Arduino OpenSuse 11.2 (LED as light sensor)

I need to use my Arduino-shield-Breadboard for another project, so my Pachube-feed will be offline... for a while...

Next time around I'll add some more sensor that I have, like the relative humidity sensor.
I took the time to upgrade to the new Arduino-0018, here I encountered some old and some new problems.
First I needed to add my user to the dialout group in order to have access to the serial ports, as reported here (see last post). The other problem was an old problem, with the standard avr-gcc distribution of OpenSuse you can't program an ATMega328. I didn't solved it right now but the how to is here. But for now pachube is off-line (correction: is on-line but data is bogus).

Alex has a problem with his home monitoring system, he wants to monitor the amount of Water he uses by counting the turns of the pointer in the meter. He intends to use photo-reflexive sensor like this one.

Trying to help him, I started with using LEDs as sensors, Photodiodes are expensive and photodiode amplifiers difficult to build due to the very low bias current of the amplifier. My best results were using a IR LED as a sensor, but I'm still not sure if it will work with the set, in particular becase the sensor Alex has is a fototransistor not a photodiode, the principle used could be the same but instead of a reverse bias (anode to ground), the foto transistor must be actively biased (emitter to ground), the parasitic capacitor should still be discharged function of the light.

A good source of information is here, and here, I based my code on the Arduino example but I changed the port programming instructions for direct port access instructions (DDRD, PORTD), it is not "elegant" for several reasons but it is a bit faster and gives better results at high light levels.


The available pre-compiled avr-gcc does not allow you to program the Arduino Diecimillia (ATmega328 is only possible to do assembly, no C or C++). So my update of the Temperature monitor will have to wait...

No comments: