Let's Make Robots!

SENSOR problems

Hello all,
I am building a maze solving robot and am trying to use some QRD1113 ( http://www.fairchildsemi.com/ds/QR/QRD1114.pdf) sensors.  I am using a BS2 on a super carrier board.  I tried following the testing instructions in some of the manuals but have not been successful.  I believe i wired it correct....pin 1 VCC pin 2 BS2 input pin, pin 3 BS2 output pin and pin 4 GRD (and many more configs confused ).  I included the 1k and 220 resistors in the circuit but am not sure if these are correct since they are not the same IR sensors as manual.   Any input will be greatly appreciated, thanks for your time. 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I'm not entirely sure how you have the components connected in your set-up.  But I'd normally have the 220 ohm connected to the LED side of the sensor, which I guess you have being driven by the BS2 output on one side, and wired to ground on the other, essentially BS2 output to 220 resistor to pin3 thru LED to pin4 to ground. Transistor side sounds like Vcc to pin1 to 1k resistor and BS2 input pin, with other side of resistor to ground. Now normally, the arrow side of the transistor should go to ground which is pin1, and then pin2 should connect both to the BS2 input, and to the resistor, with the other resistor wire connected to Vcc, +5 volts.

I'd say the resistor on the phototransistor is probably a bit small. Looking at the datasheet you linked shows a collector current of about 1 mA on a good reflection from the 20 mA you have going into the LED side (with the 220 resistor). Using Ohms law, 1 mA x 1k equals about 1 volt of change, probably not enough to register as a logic change on the BS2 input. Try a 4k7 or 5k6 resistor to get a larger voltage swing. Even a 10k might be usable.

Or, you could try wiring it up like Parallax has for their QTI sensor on page 2, with code for this configuration.Note that I think 220 ohm is a better choice for the LED side of the sensor then the 470 ohm they have there.