Shop OBEX P1 Docs P2 Docs Learn Events
Reflective surface dector circuit — Parallax Forums

Reflective surface dector circuit

KyeKye Posts: 2,200
edited 2008-09-12 03:50 in BASIC Stamp
Hello,

I'm trying to build a reflective object sensor to be used in an array to make a line following robot.

I plan to use this circuit attached.

1.·Its operation works by pulling the BASIC stamp pin to low.

2. Then waiting for the capacitors to discharge.

(When the capacitors are charging the LED will blink once quickly and cause the transistor to ground the other capacitor, the idea is that a reflective object will reflect the light from the LED back to the transistor. The RC time command is there to measure the change is time created by the transistor controlled capacitor and not the LED one.)

3. Afterward executing the RC time command and waiting for the voltage on the capacitors to rise from 0v to 1.4v.

I'm not interested particularly in other ways to make a line following robot -· I already know them, if you have any suggestions to make this circuit better or what values I should use please give feedback. Thank you.

OH! I built this circuit using reference ideas from the parallax qti sensor and from the reference material on the rc time command. I would actually prefer to reverse logic operation and ground and power nodes on the circuit so I could watch the capacitor discharge from 5v to 1.4 but·I only have npn photo transistors so I can't reverse the circuit.





▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye
1374 x 742 - 29K

Comments

  • KyeKye Posts: 2,200
    edited 2008-09-11 04:20
    OH! Please reverse the direction of the LED, it should be turned around. (was submitting this at midnight)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye
  • ercoerco Posts: 20,256
    edited 2008-09-11 18:07
    Try this.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
    350 x 225 - 8K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2008-09-11 18:13
    Also, try not to repeat the same error that so many make when designing optical line detectors. The angle of incidence from the LED should not be the same as the angle of reflection to the sensor. Doing so will only enhance specular reflection from shiny objects, such as black electrical tape, making them hard to distinguish from a light-colored background. For the best results, I would suggest aiming the LED at 45° and looking straight down with the sensor.

    -Phil

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    'Still some PropSTICK Kit bare PCBs left!
  • KyeKye Posts: 2,200
    edited 2008-09-11 19:48
    I like that circuit however, it leaves the LED on all the time. If I have 8 sensors in the array and they are all very close to each other there is a very great chance of a false reading.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye
  • ercoerco Posts: 20,256
    edited 2008-09-11 21:02
    Per Phil, arranging the LEDs and PTXs requires some experimentation, but there's nothing wrong with leaving all the LEDs on, you just need to calibrate the PTXs with them all on for consistency. That 82-ohm resistor I showed lets ~40 mA flow through a 1.8V IR LED, which is a reasonable maximum. You can probably get by with a lot less current than that, because you need less than an inch of range for line following. Again, experiment: 5 mA may be all you need (~600 ohms). If you need to drive several LEDs, it's worth putting them in series pairs to save power. Further, you could use an extra I/O pin to turn all the LEDs on & off to save power when you don't need them.· Beyond aiming your PTXs, you need to optically shutter them so they only "see" directionally through a tube. I like to start with a white plastic tube and paint only the outside ultra-flat black. Black electrical tape is also fairly opaque to IR energy in this (~940 nm) region. Not all materials that are opaque to the human eye block IR energy. You also need to make sure that no IR signal leaks out the rear of your LED and into the rear of your PTX.

    Note that all this applies to homegrown sensors where you·"roll your own" from·discrete LEDs & PTXs.·One excellent integrated sensor·is the Hamamatsu P5587, a bargain at $2.25·from http://www.junun.org/MarkIII/Store.jsp. It is·well-thought out and·the LED & PTX are optically isolated from each other already.·It also contains·internal signal conditioning circuitry. This·sensor is quite useful both for line-following and reading optical encoders.

    Have a look at the new Pololo 3pi robot and its line-following sensors. It has amazing speed and accuracy, yet its sensors are·tiny, relatively high (~1/2 inch) above the floor and have no external optical shutters. It's a very nice piece of engineering.

    http://www.pololu.com/catalog/product/975·Watch all the videos. Slow to load, but fascinating to see.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."

    Post Edited (erco) : 9/13/2008 3:04:02 AM GMT
  • KyeKye Posts: 2,200
    edited 2008-09-12 03:50
    Wow, I keep forgetting stuff.

    Yeah my circuit will never work since I can't discharge the capacitors. I forgot that the diode won't conduct unless it has some voltage across it and that the transistor won't conduct either without some light. (I'm an amateur)

    Stupid... Thanks for the help Erco, I can use your circuit.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Nyamekye
Sign In or Register to comment.