Shop OBEX P1 Docs P2 Docs Learn Events
optical sensor — Parallax Forums

optical sensor

vla7vla7 Posts: 79
edited 2008-09-28 18:57 in Robotics
I just bought the the QRB1134, it consists of an infrared emitting diode and a NPN silicon phototransistor mounted side by side.· Anyone know how to wire this to the·boe-bot·and how to program it to read black and white lines.· I've attached the data sheet.· Any help would be greatly apprecieated.· Thanks.

Comments

  • DJSandbergDJSandberg Posts: 56
    edited 2008-09-25 01:18
    Via7

    K goes to ground
    A goes to + 5 volts through a 330 ohm resistor
    C goes to + 5 volts
    E goes to the input pin on your microcontoller
    E also connects to ground through a 1K ohm resistor

    Daryl
  • vla7vla7 Posts: 79
    edited 2008-09-25 01:44
    Thanks Daryl. Can anyone give me a sample program to try it out?
  • vla7vla7 Posts: 79
    edited 2008-09-28 18:57
    I followed Daryl's·wiring suggestion for the QRB1134 sensor and connected it to my boe-bot.· I used a 220 ohm resistor since I didn't have a 330.· Should I not do that?· Also, can I now just write code that will read the input from the sensor to determine whether it sees a black or white line?· For example something like:

    Do
    Debug IN1
    Loop
Sign In or Register to comment.