Shop OBEX P1 Docs P2 Docs Learn Events
A very basic question about resistor, capacitor and wiring... — Parallax Forums

A very basic question about resistor, capacitor and wiring...

Jimmy HJimmy H Posts: 3
edited 2008-06-17 23:15 in BASIC Stamp
I have recently bought a few pairs of Infrared emitter and detectors as seen in the following link:

http://www.radioshack.com/product/index.jsp?summary=summary&techSpecs=techSpecs&currentTab=custRatings&custRatings=custRatings&features=features&accessories=accessories&productId=2049723&support=support&tab=summary

As shown on the link,

infrared emitter - 2V 40mA
phototransistor detector - 20V 25mA

However, I'm very new at this and am having a little difficulty setting it up since my friend claimed that I need to use a resistor or capacity (with a ohm # that he didn't mention), or else these Infrared LED and Infrared detector will burn out.

If anyone here shall enlighten me in this matter in a newbie friendly way, you have my most sincere gratitude. smile.gif

Comments

  • skynuggetskynugget Posts: 172
    edited 2008-06-14 01:51
    on the inferred emmiter you will need a current limiting resistor in series with the anode, something like 470ohm should work. if you look at the basic stamp tutorials regarding led's you will learn a lot. the emmiter is basicly the sam thing except on a wavelength not visible by the human eye. i neat little trick to check your ir emmiters is to use a digital camera/cell phone to look at the emitters. the cameras cid can see ir and it glows bright from the viewfinder.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-14 01:54
    Look in the Robotics with the BoeBot tutorial manual that you can load from the Stamps in Class Downloads area on the Parallax website.

    Note that the phototransistor is not the same thing as the IR detector from Parallax. It's less sensitive and more subject to interference from ambient light.

    You need a 330 Ohm resistor in series with the infrared emitter. You normally connect the cathode of the emitter to ground (Vss) and the anode through the resistor to an I/O pin.

    The infrared detector's emitter should be connected to ground. The collector should be connected to another I/O pin and to one end of a 4.7K Ohm resistor. The other end of the resistor should be connected to +5V (Vdd). Any resistance from around 1K to around 10K could probably be used.
  • Jimmy HJimmy H Posts: 3
    edited 2008-06-14 02:09
    Uhm, I just found some discrepancy from the description on the back of the package than that on the website. On the back of the package, it reads:

    Detector:

    V ceo collector to emitter 70V
    V eco emitter to collector 5V
    Ic Collect current 50mA

    Emitter:

    Reverse voltage 5V
    Continuous forward urrent: 150mA
    Forward voltage 1.3V typ., 1.7V max.

    as opposed to the values I posted few posts above. I wonder if this piece of new information will change anything? Thanks alot.
  • bald Eaglebald Eagle Posts: 4
    edited 2008-06-14 03:29
    Nope, the stuff written on the package is valuable for min and max specs. The 2 guys that replied gave you very good advice.
  • Predat0rPredat0r Posts: 2
    edited 2008-06-15 02:14
    I am using the same thing for a school project, but I am really clueless as to how to write this. I have to write code for this as well. I planned to use this as a detector for my robot car, ie when it gets close to a white wall, the IR picks it up and the robot stops. Can anyone help me with some basic coding as how to get this working? confused.gif
  • ercoerco Posts: 20,259
    edited 2008-06-15 06:30
    Per Mike, you guys will have an uphill battle using these phototransistors as object / wall detectors unless you're completely·in the dark (no pun intended). Phototransistors are very simple light level sensors. You can·use RCTIME to measure an ambient·light level with a phototransistor sensor (circuit attached) with a line of code like:

    HIGH 10:PAUSE 1:RCTIME 10,1,var2'··· read ptx on P10

    Note that the Radio Shack·phototransistor you mention is most sensitive to the wavelength (~850-940 nm) of the IR LED they are paired with, but they will·also detect·and be overwhelmed by room light, sunlight, any ambient light. If you're only operating in a dark room, you could use the IR LED as an emitter, and detect·any reflected IR light with the phototransistor fairly reliably. But if you're in a room with typical lighting, your IR LED's reflected signal will probably be too weak to detect reliably.

    The IR receiver modules that·most people·use for object detection are far more sophisticated sensors. Radio Shack has these, too, see

    http://www.radioshack.com/product/index.jsp?productId=2049727

    In addition to a phototransistor sensor, they have incredible internal circuitry (amplifiers, integrators, & filters) that only respond to pulsating (flashing) IR at a specific frequency, usually 38-40 kHz. So you have to send a 38-40 kHz signal out of an IR LED and look for reflected pulsating IR energy. Ambient light is usually fairly constant intensity or perhaps 60 hz from flourescent lights, and that gets filtered out to some degree. Lots of examples on the Parallax website on how to send out a 38 kHz·pulse from an LED then quickly look at an IR receiver module to see if the signal is reflected. It's kind of a miracle that it works. The Stamp can only do one thing at a time; it can't emit a signal and look for a reflection at the same time. And the speed of light being what it is, the brief signal is long gone before the Stamp could switch over to "detect" mode. Fortunately, the 38 kHz receivers have a bit of a delayed response to an applied signal. So there's just enough time for the Stamp to "see" the the IR receiver's delayed signal (that's·so·3 milliseconds ago...) FYI, the detection range of an optimized·system like this varies widely, based on the size, geometry, and IR reflective characteristics of the objects you're near. Big white flat perpendicular walls are easy to see, much more so than the skinny round black chair leg that everyone crashes into.

    Probably not the great news you were hoping for, but that's what I've learned about IR sensors in my short time here. Good luck.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • ercoerco Posts: 20,259
    edited 2008-06-15 16:04
    Guys:· Jameco has an IR object detector kit using a phototransistor and LED, just like the parts you have. They have online instructions with an excellent description at http://www.mondotronics.com/PDFs/3-337_Mod_IR_v22.pdf. They also have a robot kit called tke Octobot that uses two identical circuits, and they have similarly posted the robot assembly·instructions and schematics online at http://www.robotstore.com/download/OctoBot_Instructions_1.2.pdf·. This·is goldmine of useful info for any robot builder.

    The good news is that they show exactly how to use a phototransistor & LED (just like you want to use) in a pulsing IR circuit using one of my all-time favorite ICs:an LM567 timer.·The·bad news·is, the circuit has a lot of parts to solder together, and I don't think Radio Shack carries the 567 any longer, so you have some legwork to do. They are very common in electronics stores, just not the Shack. Sadly, the Shack carries fewer components every year. At least they·have added some Parallax parts to their inventory lately.

    I am attaching a screenshot of JAMECO's (not mine, repeat JAMECO's not mine)·detector instructions as·they show this very useful circuit.·Years ago at the Trinity Firefighting robot contest, I naively·built wall detectors that·used 555 timers to generate the IR·pulsing signals, and detected it with 567 decoders.·The frequencies would always drift and require constant·adjustment to synchronize.·Jameco's much better·circuit uses the 567 to generate its own signal. Genious!

    The instructions·quote a range of 3 inches, which isn't a lot.·You could definitely get longer range·using the dedicated·38 kHz modules mentioned·previously. Either·way, much depends on what's reflecting the signal. Pay close attention to isolating your LED and PTX (phototransistor)or IR receiver from each other. Put them in dark parallel tubes and aim them right at the wall you're trying to detect.·Use ultra-flat black paint to stop reflections from your own robot parts or mounting hardware. Fully read·both articles·from Jameco,·they have·lots of very useful info.· Good luck!






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

    Post Edited (erco) : 6/16/2008 6:50:28 AM GMT
    800 x 535 - 72K
  • skynuggetskynugget Posts: 172
    edited 2008-06-17 23:15
    erco is right. using a photo diode is prone to alot of noise from the outside world.. to accoutn for that noise you would have to modulate the ir then demodulate it after the photodiode.
    the radio shack 38k unit works great. the only problem with it is that it only goes low for a brief moment when it recives a 38k carrier frequency. so you have fm that carrier pretty fast to keep it locked closed. kinda like pressing the remote control button over and over again.

    the esiest thing to use is one of those sharp rangefinders.. they come with transmitter/reciever and different model numbers work in different ranges. they cost like 12 bucks, its worth the hassle it saves for sure.

    www.acroname.com/robotics/parts/R144-GP2Y0A02YK.html
Sign In or Register to comment.