Shop OBEX P1 Docs P2 Docs Learn Events
QRB1134 IR Sensor — Parallax Forums

QRB1134 IR Sensor

kenwtnkenwtn Posts: 250
edited 2006-04-09 20:00 in BASIC Stamp
·· As a newbie both to electronics and robotics I have many questions. I recently recieved 8 QRB1134 IR sensors from a friend and from what I have read is these can be used to determine the difference between black and white. My thought was I could use them to read a encoder wheel to calculate distance traveled. I have software that will allow me to create a Black/White wheel with any number of divisions. My question is has anyone used this sensor in this manner and can you give me any information that may help? Information like how to connect it to Basic Stamp and how to read it.


Thanks In Advance

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-04-09 16:56
    kenwtn -

    To approach this properly and intelligently, the VERY first thing you want to do is to learn as much as you can about the sensor you are intending on using. Here is a link to the Fairchild data sheet for the QRB1134 I/R sensor:
    http://www.fairchildsemi.com/pf/QR/QRB1134.html

    Read it thoroughly, and if you have any questions, please ask before you start hooking it up. After the fact it may be too late smile.gif

    Theory and Application:

    As you will learn from that data sheet, the sensor doesn't understand black from white per se, but what it DOES understand is whether an I/R light beam which it transmits from the emitter side of the sensor has been detected on the photo-transistor side of this sensor. The I/R light beam is emitted from the I/R LED on the one side of this sensor, and then it either is or is not reflected by the rotating code wheel, back to the photo-transistor. If it IS reflected back, a signal will be produced which you can then sense with the PBASIC Stamp. From the user's point of view, in this application, the signal is either there or not there, it has no important quantitative value.

    Reflectivity:

    Going back to any science or physics classes you may have had, you probably learned that dark surfaces ABSORB light, and light surfaces REFLECT light. Thus, this reflection of the I/R beam will only occur when a white (or light) surface passes in front of this beam of light, and when a black (or dark) surface passes in front of it, the light will be absorbed; thus not reflected. So, INDIRECTLY it can tell black from white, due to the relative reflectivity of the two different colored surfaces, one black segment followed by one white segment, alternating around the code wheel.

    Interference:

    Why use infrared light you may ask? Simply to reduce the effect of ambient visible light. Any visible light is essentially ignored by this system. Just beware that there ARE other sources of infrared which can be found almost anywhere. The sun is one source, and another is certain heat lamps, as well as some other artificial light sources which use mercury vapor within them (fluorescent, H.I.D. etc). More on this light interference issue in a moment when we speak about the mounting.

    Code wheel:

    As you note, you will be responsible for creating the "code wheel" which has the black and white "pie" segments which you will be detecting. You don't mention which PBASIC Stamp you will be using, so I can't suggest any particular number of "pie" segments, but generally speaking, the more the better, up to a point. That "point" is when either the rotational speed of the axle/wheel is too fast, or the processor you're using is too slow, to maintain the necessary counts this sensor will provide.

    Alternatively, you could rig it up with an off-Stamp hardware counter (CD4020 comes to mind, but check), and then just read and reset the counter as required, or you could also use an off-board co-processor to do the same thing. If you need more information on this, just ask.

    Mounting:

    Needless to say, the distance from the transmitting/receiving surface of the sensor to the code wheel will be important as well. My suggestion would be to shoot for about .375" (3/8") (9.5 mm) or slightly closer if possible. Use a sturdy mounting, and once you have it "set", see if you can shield the top of the sensor from ambient light from above. Something as simple as a small piece of black or dark construction paper should work fine.

    Others can set you up with the best electrical set-up, but try to your wires as short as possible.

    I hope that's helpful.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->

    Post Edited (Bruce Bates) : 4/9/2006 5:57:34 PM GMT
  • kenwtnkenwtn Posts: 250
    edited 2006-04-09 17:07
    Bruce,

    You have giving me alot of information and things I need to consider. I have all the BS2 stamps modules. My thinking for getting them all was it would give me a chance to compare each of them. My final project will use one as a master and I will use the others as slaves to take some of the load of the master. I know a cheaper way would be to go with PIC's, but since I have the Basic Stamps I might as well use them.
    What would be really helpful is a diagram of how to connect the QRB1134 and maybe a short example of PBasic on how to read and process the results.

    Ken
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-04-09 20:00
    Ken,

    ·· Assuming the specs are the same (you would have to make that determination) you could· use the Industrial Control text we have for example circuits and code examples.· I didn't look up the specs to your device, but if it is an IR Emitter/Detector in a single plastic unit then it should be very similar.· Check out the PDF file at the following link:

    http://www.parallax.com/dl/docs/books/edu/ic.pdf

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
Sign In or Register to comment.