NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Basic Electronics » IR Detector
November 19, 2009 by mikedoug |
I bought an IR transmitter/detector pair from sparkfun. Here is the datasheet for the receiver: http://www.sparkfun.com/datasheets/Components/LTR-301.pdf Can someone help me understand the electrical behavior of this device? I put the +5V (or up to +30V) on the collector, and GND to the Emitter. Then it conducts electricity when it detects light from the IR. I need an in-line resistor to keep the power dissipation under 100mW -- but how do I calculate that without an R value for the device? What is the "On State Collector Current" mean? Is that the maximum amount of current this device can pass from Collector to Emitter? So I could put the collector into an MPU pin and w/o IR signal the pin would read 1, w/ IR signal the pin would read 0? |
---|---|
November 19, 2009 by mrobbins (NerdKits Staff) |
Hi MikeDoug, You should really think of this device as a current source from collector to emitter, where the current is proportional to the light intensity. (This is true as long as long as the collector is at least ~0.2 volts positive with respect to the emitter -- avoiding "saturation".) As long as it's not in saturation, its current will pretty much only be a function of the light intensity, and not the voltage across it. Typically, you will use a series resistor because that will convert the current (often called a "photocurrent" because it's related to light intensity) into a voltage signal. You can use the "On State Collector Current" as a guide to typical levels of current that will be passed under various intensities. They're all in the ~1mA range, so with maybe a 1K series resistor, you will get about 1 volt drop max under that level of illumination. (You want to make the resistance large enough that you get a measurable voltage change, but small enough that you avoid running into "saturation".) Hope that helps... expecting more questions, but just give it a try! Mike |
November 19, 2009 by mikedoug |
Okay... Bear with me. So if I take the receiver, connect each end to a series 1K resistor then when the receiver is receiving the IR signal, I will be able to detect a 1V drop across the resistor? Without any other power source? If this is true, then if I tie the emitter to the ground of my power source then the collector will be +1V in relation to my reference GND? If this is true, then if I change the value of the resistor to 5K then the collector should be at a +5V in relation to the reference GND? If this is true then I could connect the collector to an input pin of the MPU and read the on/off value as well as set an interrupt on pin change? Struggling with this one. :) * OR * Connect the collector to +5V, emitter to the 5K resistor and the MPU input pin, and the other end of the resistor to ground. Even though the 5V would allow more mA to flow, the phototransistor permits only the 1mA and thus forces 5V across the resistor. I'm stabbing in the dark here, but I want to understand it a little better before I go messing around. :) MikeDoug |
November 20, 2009 by mrobbins (NerdKits Staff) |
Hi MikeDoug, It's the second one: connect the collector to +5, emitter to resistor and MPU input pin, other end of resistor to ground. When there's no light, the phototransistor will allow zero current flow (there's a tiny "dark current" but don't worry about that for now), and so the voltage at the MPU input will be 0. When there's some light, the phototransistor will allow current to flow in proportion to the light intensity, and the MPU input voltage will rise. When there's a ton of light, the phototransistor will become "saturated" -- and it will never allow so much current to flow that the emitter voltage becomes higher than +5V. (If it did, then the device would be generating power, which is possible at some abstract level since it is receiving incident photons, and this is in fact how a solar cell or photodiode works. But as far as I know a phototransistor can not operate in this mode.) If you shine a super-bright light on it, the voltage at the MPU input pin will rise to just under 5V, and that's it. I can also point you at this short Fairchild App Note titled "Design Fundamentals for Phototransistor Circuits". Making more sense now? Mike |
November 21, 2009 by mikedoug |
So that Fairchild document says that if Vcc < Rl * Icc that it will operate as a switch (on or off). I read that as meaning that the emitter node will be at nearly +5V, correct? The document states the "load resistor" -- do they mean the Re (in the case of common-collector amplifier we're discussing) or the effective resistance on the Vout connection? If the latter then how is that calculated for the input pin of the MPU? Further, the Icc is the current listed on the spec sheet (http://www.sparkfun.com/datasheets/Components/LTR-301.pdf) in the IcON section? That part really confuses me -- how do I know what 'bin' this receiver is from? (If that's what "BIN" means?) Getting closer! Slowly adding understanding of each piece to my toolbelt. :) MikeDoug |
November 21, 2009 by mikedoug |
Okay -- as is usual for me -- I experimented. First for the transmitter side, the spec sheet said it had a typical forward voltage of 1.2 and a maximum of 1.6. I choose to use the lessor typical forward voltage in my calculations (if it was higher than my overall current would only go down not up). Further, it lists a continuous current of 50mA -- which I think is likely a bit excessive so I shot for 20mA. For my test the transmitter and receiver are ~1" apart (opposite sides of the breadboard) -- so it's not like I NEED to have it at the brightest possible value. With a 5V source that gave me (5V-1.2V) / .02A = 190 Ohm resistor -- the closest I had was 180 which would give me .021A which is << .05A maximum rating. Then, for the transmitter side, I went with the fairchild observation for the "switching" mode to use an R > 5000 so I went with the next biggest of 5.6K. I connected +5 to collector, emitter to resistor, resistor to ground. When the transmitter was off, there was very TINY amounts of current leakage and thus very TINY amounts of voltage. When the transmitter was on, it pushed about 0.87mA through the receiver with a 4.89V drop across the resistor (or "at Vout"). Excellent! I'm still interested in the answers to the questions in my last post above -- just so I have a better, more "taught" understanding of what's going on here. One nice thing: on the transmitter side, since my last "fully learn XYZ" was LEDs, I understand what's going on there 100%. It was even fun to go get my camcorder, put it in night mode, and watch the LED shine BRIGHT. |
November 23, 2009 by mrobbins (NerdKits Staff) |
Hi MikeDoug, First, one trick for the transmitter: if it helps you do debugging, you can add a visible LED in series with your IR LED, and just reduce the resistance to account for the extra voltage drop of the new LED. This doesn't cost any more power, but gives you a visible indication of transmission state, and might be useful for troubleshooting / etc. By "load resistance", it is the effective resistance at that node, so you have to think about both Re and the input resistance of the microcontroller pin. That's because you're basically asking the question: if the phototransistor allows a little extra current to flow, then how much does that voltage change? So it's actually the parallel combination of Re and R_pin, which is (Re*R_pin)/(Re+R_pin). But in this case, because it's a digital input to a CMOS circuit (the microcontroller), there's no actual DC current path except for some really tiny leakage, so the R_pin is in the many-megaohm range. This is so much bigger than the Re value that it has no effect. The "BIN" has to do with binning components as the come out of the factory, which means that they'll test the phototransistors and sell the more sensitive ones for more $$. (Just like Intel / AMD do with testing CPU speeds -- the 2.2GHz and 2.4GHz chip are the same physical silicon, except that after manufacturing, one was tested to work reliably at the faster speed.) Your supplier "should" tell you which bin they're selling you, but a quick search of Mouser and Digi-Key shows that they don't have that info for that part... but if you were buying 10,000 of them directly from Lite-On, you would probably have different prices for different bins. Mike |
Please log in to post a reply.
Did you know that signed numbers need to be sign-extended when chaging variable sizes? Learn more...
|