I recommend starting with a TSOP1100 which is a wideband receiver (33-57kHz carrier, 940nM which is the wavelength used by consumer IR devices) and connect it as shown here...before trying more complex things like a phototransistor.
I recommend starting with a TSOP1100 which is a wideband receiver (33-57kHz carrier, 940nM which is the wavelength used by consumer IR devices) and connect it as shown here...before trying more complex things like a phototransistor.
Last edited by dhouston; - 5th May 2007 at 18:42.
Dave,
Why do you think a phototransistor is "complex"?
I connected it just like you show it up in your webpage and it works. I have connected a BC237 to amplify the phototr's signal but this doesn't make it more reactive.
The only problem is sensibility. Or am I wrong and maybe I should measure the sensibility another way?
I don't know to make it better...
Nevertheless, I'm going to by some IR modules to make some tests.
Roger
I tried (only receiver - not emitter) this way up to now:
- no direct light from outside;
- incadescent lamp about 1 meter away from the IR phototransistor;
- used two different remotes (TV and one for home-lightning);
- did not program any carrier frequency - just looking for any kind of signal.
How should I setup my system to make valid tests?
In fact, what distance should I expect? Is it 30 centimeters, is it 3 meters, is it more?
Since my TV and other equipments can be controlled over 5 meters, my assumings are that the remote I use to make my tests is powerfull enough to make my phototransistor to react at such distances. I may be wrong...
Last edited by flotulopex; - 5th May 2007 at 20:34.
Roger
Since (according to your 1st post) you want to end up with some sort of IR communication, I'd suggest getting rid of that phototransistor and getting an IR receiver module as dhouston suggested earlier.
If you do a search on 'GP1U' at www.digikey.com, you'll get a bunch of hits for various IR detectors.
The GP1UM261RK (which just happens to be the one that I use for a lot of my projects and it works very well) is sensitive to IR modulated at 38Khz.
At the transmitter end, I use a 555 timer tuned to 38Khz @ 50% duty cycle (actually nowadays I'm using a 10F200 for the same function and it's more accurate). I run the output of that to an input of an AND gate, the other input of that same AND gate goes to a serial output pin on the PIC. The output of the AND gate (which is the 38Khz carrier, switched on and off by the PIC), goes to the IR LED unit (which is usually either one IR LED or a few IR LEDs switched by a MOSFET).
At the receiver end, I have the above mentioned IR detector unit hooked up. The output has a 1K pullup on it, and is connected to a PIC pin used for serial input.
According to the datasheets, this detector takes about 8 cycles of 38Khz to lock on (.21ms), so baud rate is limited by the carrier frequency. In the very best of circumstances, the highest baud rate you'll achieve is 1200 baud. I use 300 baud when I need to 'move' data, and usually stick with something around 100 baud if I'm just switching something on or off.
This is the code I use in my MP3 player that I built. I used an old Pioneer sound system remote control to run it:
Code:'IR sensor - Digikey Part # 425-1147-ND, GP1UM281QK, 38KHz, 'side mount, 2 22uF tantalum cap's paralleled across 'power/ground, 47ohm resistor in series between power source and power pin 'PIC18F4620 @ 40Mhz, pulsin will change according to oscillator frequency remotecheck: irdata1 = 0 : pulsin irbit , 0 , temp1w if ( temp1w > 1200 ) then if ( temp1w < 3300 ) then 'header pulse is about 2.2ms, check for 'a pulse a bit longer than a binary 1, but 'shorter than 1 1/2 header pulses getnextpulse1: for temp1 = 0 to 11 pulsin irbit , 0 , temp1w : orbits = 0 if temp1w < 275 then orbits = 1 if temp1w > 1650 then orbits = 1 if orbits = 1 then goto remotecheck else if temp1w < 825 then irdata1.0[temp1] = 0 'Sony IR Remote Signals - Unit, T=550us, 'Header = 4T Pulse followed by 1T space, 'Binary 0 = 1T Pulse followed by 1T space 'Binary 1 = 2T Pulse followed by 1T space if temp1w > 825 then irdata1.0[temp1] = 1 endif next temp1 'irdata1 has any data received and decoded by ir detector, 12 bit sony code endif endif
Thanks a lot skimask,
I'm gonna try an IR module.
I've seen on rentron's web site that he used a NAND.
Going to check this out - didn't read this carefully enough.
May I ask you over which distance you got good & reliable results?
Dave, just saw your post. Yup, going for a module!!
Roger
The receiver filters out ambient IR from sunlight, incandescent lights, fluorescent lights, etc. If it's narrow-band it only reacts to IR that is modulated at the carrier frequency it is designed for. It's also designed for a specific wavelength (your phototransistor is 900nM while most consumer IR uses 940nM). Your test setup is about as bad as one could imagine.
A few years back I designed a CF card that fit an iPAQ and acted as a Consumer IR transmitter. With a single IR emitter and 3.3V it regularly got 30 meters range but that's about 5 times what I expected.
How are you measuring/detecting the output?
With a phototransistor you will receive the carrier frequency, usually in the 36-40kHz range. It's difficult to measure the amplitude of a 25-28µS pulse and the output of the phototransistor circuit will be a series of bursts at the carrier frequency. You'll have to count the number of such pulses to determine the duration of the bursts and decode the transmission. Or, you'll have to use a low pass filter to demodulate the signal to recover the data envelope.
An IR receiver demodulates the transmission and outputs the baseband data envelope with the width of the spaces (it's active low) proportional to the duration of the bursts. It's an order of magnitude or two simpler to deal with.
I suggest the TSOP1100 (available from Mouser) because you don't have to worry about matching the carrier frequency of the IR remotes you might come across. Read the datasheet for the TSOP1100 - it's got a lot stuffed into that small package.
Bookmarks