Shop OBEX P1 Docs P2 Docs Learn Events
your help os needed for this IR detection problem — Parallax Forums

your help os needed for this IR detection problem

kicknitinkckicknitinkc Posts: 28
edited 2010-05-04 18:12 in BASIC Stamp
I'm trying to set up a simple IR detection circuit. How can I set up this phototransistor: http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/phototransistor/List/0/SortField/4/ProductID/604/Default.aspx to detect infrarea light? The product description says it can detect some infrared light but I'm not getting it to work. If that phototransistor is not ideal, then can I just simply replace it with the IR transistor with the black tint? Thanks.

Comments

  • Steph LindsaySteph Lindsay Posts: 767
    edited 2010-05-04 16:35
    Hello kicknitnkc,

    You can learn a lot about how to use that phototransistor in What's a Microcontroller? v3.0, Chapter 7. The book is a free download from www.parallax.com/go/WAM.

    This phototransistor detects visible light as well as infrared light in the environment. The dark-shaded infrared phototransistor filters out the visible daylight, so if you are looking for ambient infrared light in the environment, this would work better.

    If you are trying to make an infrared detection circuit like the kind used in infrared remote controls, you are better off using an Infrared LED as your light source, and an infrared receiver, like this one:

    http://www.parallax.com/tabid/768/List/1/ProductID/177/Default.aspx

    This receiver is designed to look for infrared light that is flashing at a rate of 38 kHz per second. You can pulse and infrared LED to do this with the BASIC Stamp FREQOUT command.·Examples·for this type of IR detection circuit in Robotics with the Boe-Bot chapter 7 and 8. It's a free download from

    http://www.parallax.com/tabid/134/List/1/ProductID/138/Default.aspx

    -Steph
  • kicknitinkckicknitinkc Posts: 28
    edited 2010-05-04 17:17
    I've tried using that but it didn't work right for my application. I'm using IR detection for a dispensing machine that detects when an item has been dispensed. The distance between emitter and receiver is about 3 inches. I got the circuit to work outside of the dispenser Just fine, but inside it was not so great. It seems to be too slow to detect quick breaks in the beam. Using different resistors didn't really help either. This is why I'm trying to use something else. I've successfully put together a circuit that uses the phototransistor with a visible led. It detects the break pretty well but the outside light has too much of an effect on the circuit. I can't get the phototransistor to detect the IR led though. Hmmmm maybe I'll start over with the IR receiver. Do you have any ideas to make the reciever work better? Any suggestions are appreciated. Thanks.

    Sam
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2010-05-04 17:54
    What is your programming strategy?

    If you are using RCTIME with the phototransistor, that is going to give you a slower response in darker conditions, and the size of the capacitor used has an influence as well. With an IR receiver you will have a fast response and simple detected/not detected output. Your programming stragegy will matter here too - you could try putting the IR LED FREQOUT and bit-variable state check in a tight loop, maybe with a DO WHILE or DO UNTIL condition so the loop continues until the change in state you are looking for is detected.
  • kicknitinkckicknitinkc Posts: 28
    edited 2010-05-04 18:12
    Thanks for your input. I'm using rctime with the phototransistor. I haven't messed with the capacitor yet and will give that a shot. I'll also try messing with the IR reciever some more because I'd like to have infrared detection which will work more consistently no matter what the ambient lighting conditions are. I'll spend some time on this when I get home from work and post my program if that helps explain anything. Thanks

    Sam
Sign In or Register to comment.