36 KHz modulated infrared light detector
March 8, 2008
I have started working on a new robot that is mainly based on LEGO MINDSTORMS NXT. This robot is aimed at participating in DTU robocup 2008 but time will tell if it will be finished in time. Anyway in robocup the robot must at least be good at following a black line and preferably it should be able to accomplish other of the tasks at hand as well, and this is just not feasible using the standard LEGO sensors and the very limited number of these it can use at one time. So I thought I'd take advantage of the fact that LEGO sensor ports can access I2C hardware (up to 127 devices on each port!) and make my own I2C slave line follower.
First off I had read somewhere that the picaxe can only do I2C master, so I figured I'd go for using the PCF8574 I/O expander from NXP since I had five of these lying around. After designing a circuit on paper I realised that the picaxe 40x1 which is the only picaxe chip I have can in fact be set to act as an I2C slave (though I have not tested this yet - just read it in the manual), so I dropped the PCF8574 since it would now be possible to do the whole processing of the line detection in the picaxe and just returning the result of the processing to the NXT when it asked for it.
The line sensor will contain 8 SFH5110-36 infrared detectors that can detect an infrared signal modulated at around 36 KHz - when a signal is detected it draws its DETECT-pin low. Also it will contain 7 infrared LEDs that will be modulated at 36 KHz by the picaxe via PWM. The light from the LEDs are supposed to be bounced back from the floor only where there is no black line.
Yesterday I made a test setup for the detector circuit on my breadboard and it seems to work kind of like I want it to. First I thought that the SFHs could only be used for ON/OFF detection but after testing it, I think maybe I can put in a capacitor on the DETECT-pin and maybe a resistor somewhere to make a potential divider and measure the voltage somewhere. I got the idea since the detection LED I put in did not just switch on and off - rather it seemed to go from off to on smoothly which I guess happened because the infrared light just barely reached the SFH so the DETECT-pin was modulated like PWM or something.
You can see a short movie showing detection of my hand here:
As you can see this setup can easily be used for obstacle detection as well (maybe my robot will use that as well).
Picture of the test setup: