Opb706a
I've recently bought two OPB706A reflective sensors to make a wheel encoder for a robot. I'm using a BS2 as microcontroller, but i'm not sure how to connect the sensor to the stamp.
The sensor consists in an IR diode (1,7 V) and an NPN transistor bundled together. My question is about the resistors to connect the diode (and how to determine it's value).
Also I need to know if I need to connect the diodes to the BS2 I/O pins or just to the power source (with the apropiate resistors, of course). I think that I can leave the diodes always on, and connect only the transistors to the BS2 pins to get the input from the wheels. Is that correct?
Here is a datasheet of the sensor:
http://www.alldatasheet.co.kr/datasheet-pdf/pdf_kor/QT/OPB706A.html
The sensor consists in an IR diode (1,7 V) and an NPN transistor bundled together. My question is about the resistors to connect the diode (and how to determine it's value).
Also I need to know if I need to connect the diodes to the BS2 I/O pins or just to the power source (with the apropiate resistors, of course). I think that I can leave the diodes always on, and connect only the transistors to the BS2 pins to get the input from the wheels. Is that correct?
Here is a datasheet of the sensor:
http://www.alldatasheet.co.kr/datasheet-pdf/pdf_kor/QT/OPB706A.html
Comments
(5 - 1.7) / 0.01 = 330 ohms
Connect the resistor to a pin and turn it on only when you actually need to look at the device; this will save current consumption on your robot.
For the output you'll want to connect the emitter to ground and pull the collector high through a 10K resistor. Connect the collector to another pin and monitor the output in a test setting. Here's the rub: You're probably going to get a variable voltage out of the collector based on the reflectivity of your targe. You can deal with this through a comparitor (which will let you set the sensitivity of the detector).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
thank you!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office