The IR transmitter and receiver on breadboards for test
I made this circuit for a project that i am currently making (Instant Cold Coffee Machine). I needed of a circuit, that can detect a light beam cut. The first circuit i made was a light/dark detector with photoresistor. Although it could sense the light cut, it had a major disadvantage: extreme interferences from ambient light.
That is why i designed this simple circuit. I tried to keep it as simple as possible. The maximum distance of the IR LED pair that i used is up to about 2.5cm (close to 1 inch). That explains the title "Short Distance". It has a very good sensitivity. With a potentiometer you can adjust it to sense completely opaque objects, or it can sense semi-transparent films as well! It is also suitable for rotary encoders. It is not suitable for making security systems which require a beam that can go up to 3 or 4 meters long.
The transmitter circuit
The transmitter circuit
This is the first part of this IR pair. The transmitter circuit is a pulse generator that drives an infrared LED. I have use the good old 555 chip. The pulses are about 7KHz. You can use of course any kind of pulse generator like an Astable Multivibrator transistor circuit. That is up to you. Here is the schematic for the 555 connected as an astable multivibrator, oscillating at around 7KHz:
Bill Of Materials (Transmitter circuit only)
Resistors
R1
Resistor 330 Ohm 1/4 Watt 5% Carbon Film
R2
Resistor 4.7 KOhm 1/4 Watt 5% Carbon Film
R3
Resistor 47 Ohm 1/4 Watt 5% Carbon Film
Capacitors
C1
0.1 uF Ceramic capacitor
Semiconductors
LED1
TLN 100 3mm Infrared Diode
Integrated Circuits
IC1
555 Timer
The receiver circuit
The receiver circuit
I began designing a complicated interference-proof circuit, with an active filter and other stages of filtering. Then, i realized that i was going the long way. There is no need for such filtering. This is an IR pair that will be most likely inside a housing, with the transmitter close to the receiver, away from parasitic lights. So, i start removing stages until i got down to minimum. The circuit that follows can be powered with a single 5 volts supply (unlike the other circuits that i designed that required double power supply). It has a simple capacitors filter that drops all constant and low frequency IR light sources such as the sun, the household lighting. The IR detector itself will reject any other source of light beyond the IR, such as other LEDs and the sun. So, the only thing that will interfere with the receiver is sources of high frequency modulated IR light, such as the TV remote controls. But i supposed that if you built a rotary encoder, you will not turn the TV remote control directly to the receiver LED do you? I might re-make the complicated filtered version and upload another circuit.
So, here is the schematic diagram of the receiver:
First of all, notice the IR Detector LED that is connected reverse! And that is how it should be! This receiver will reject all light sources except the infrared. Then, the capacitor C1 will only allow the modulated IR light to go through. Constant light sources such as the sun, or low frequency such as the household light will not be allowed to go through. Remember that both the sun and the household lamps, except the visible light, they emit also infrared light.
Next is the adjustable gain amplifier. The R3-R4 voltage divider biases the base of the transistor. The R5 will set the maximum gain, while the potentiometer R2 will adjust the current that flows to the base of the amplifier. The amplified signal will charge the capacitor C2. This capacitor also will smooth the signal into a constant straight line.
The final stage is the comparator. The R7-R8 voltage divider will set the voltage reference. The comparison of the voltage across the C2 and this reference voltage, will result into a HIGH or LOW output of the comparator. As long as the IR beam reaches the receiver LED1, the signal will be amplified (and inverted) from T1. The C2 will then generate a voltage across its leads. This voltage level can be adjusted by R2. It must be less than the voltage of the non-inverting input (R7-R8 voltage divider). The output of the comparator will then be HIGH. When the beam is cut, the output of the amplifier (T1) will be 5 volts, and that will also be the voltage across the C2. The inverting input of the comparator will be higher than the non-inverting, and thus the output (pin 6) will be LOW.
You can change the output state of the comparator easily, by swapping the inverting and non-inverting inputs. If you do so, the comparator output will be LOW when the pulses arrive at the IR diode, and will go to HIGH when the beam is cut - completely the opposite as before.
Bill Of Materials (Receiver circuit only)
Resistors
R1
Resistor 1 KOhm 1/4 Watt 5% Carbon Film
R2
50K potentiometer
R3
Resistor 4.7 KOhm 1/4 Watt 5% Carbon Film
R4
Resistor 1 KOhm 1/4 Watt 5% Carbon Film
R5
Resistor 47 KOhm 1/4 Watt 5% Carbon Film
R6
Resistor 1 KOhm 1/4 Watt 5% Carbon Film
R7
Resistor 22 KOhm 1/4 Watt 5% Carbon Film
R8
Resistor 33 KOhm 1/4 Watt 5% Carbon Film
R9
Resistor 330 Ohm 1/4 Watt 5% Carbon Film
Capacitors
C1
0.1 uF Ceramic capacitor
C2
47 uF 16V Electrolytic capacitor
Semiconductors
LED1
IRD 300 3mm Infrared Detector Diode
LED2
LED 3mm green
Transistors
T1
BC547 Switching and Applications NPN Epitaxial Transistor
@sundar a very basic one, yes it can. I would use a higher power IR LED though with a potentiometer to adjust the sensitivity, because the reflection might not be sufficient.
@Jerry it depends on the beam width. I have tried it with a wire and it worked, but the beam was narrow. You can narrow the beam if you place the emitter led in a small tube.
At 29 November 2011, 10:03:14 user Jerry wrote: [reply @ Jerry]
I was wondering if this would work on detecting a wire. I would like to use it on my project. Thanks.
@aidan you can use this circuit to interface to the PIC directly. I used it for my coffee maker project and works with a 16F888
At 16 September 2011, 11:10:07 user aidan wrote: [reply @ aidan]
Hi,
First of all, thanks for sharing this circuit. I able to construct it and I notice to output of the receiver is around 2V(when the beam is not cut).
If i want to use the output of this circuit as input(4v ~ 5v) to trigger my PIC16F887 how should I modified in order to use it as input?
Kevin, you go for the long range for sure. not only because of the distance, but because of the modulation of the signal. the short range is supposed to be inside a housing without external interferences. the long range has much better filters to drop out ambient light
Could this or your long range detector circuit be used for a distance of between 2 and a6 inches.
I am trying to put together a box that will be in a wall and from one side of the wall there will be a slit that paperwork will be in and a door on the other side of the wall. When a piece of paper is droped into the slot a beam will be broken and a light will light up indicating to someone on the door side of the box that it is full and can come and get the paper out of it. I have been trying to find something pre-made but if I cant I would like to make it. I will need to work with 12 or 24 ac or dc as a supply.
you can hack a mouse and interface its left button to this circuit for example. each time the beam is cut, the mouse will send a mouse button. or hack a cheap keyboard and send an enter key, or whatever.
At 31 January 2011, 21:23:48 user Alex wrote: [reply @ Alex]
I would like to use the beam break signal to trigger a counter. I will be counting in the range of 150 beam breaks in 30 seconds. My first try was connecting a dollar store pedometer and an LCD kitchen timer, but the pedometer wasn't picking up every beam break. My second idea is to output the signal to USB or a mic input and have a software program count the number of beam breaks in a 30 second period. Does a program like this exist? Is there a more simple solution to my project?
At 12 December 2010, 10:06:42 user Fung wrote: [reply @ Fung]
The equation F=1/[0.67(R1+2xR2)xC] that I have used to calculate the frequency of output.
I have calculated the frequency for the resistances of R1 and R2 that you recommended by using the equation above, the value of F was not about to equal to 40k, but 7.77k only. Have I used a wrong equation?
Since the current may be too large for small resistance of R1 and R2, the power also increases that the battery would get flat easily, I hope that I can use larger resistance of R1 and R2 and smaller capacitance for C to save power. If I have capacitor which is smaller than 103, what value will be the most suitable?
Hello fung,
-> yes, there is a frequency present, it is 7KHz coming from pin 3 of the 555.
-> to climb up to 40KHz, you need a selection of parts like R1+R2=10K and C1=0.01uF (check this page: http://pcbheaven.com/wikipages/555_Theory/) but you need to test it out to have exactly 40KHz. Better use a 10K potentiometer (R1) and a 4.7K resistor.(R2)
-> You can use 100K potentiometer and put another 100K resistor parallel with it, it is absolutely the same as a 50K. But 1M is too big.
-> The distance depends on the diodes (IR LED IR receiver) only. To increase distance you need to select other parts.
At 9 December 2010, 10:53:22 user Fung wrote: [reply @ Fung]
Since I do not know too much on this circuit, and the receiver circuit is not made and tested yet due to the absence of the IR receiver (I have seen but did not bought it), so do you mind to tell me is there a frequency present when the receiver circuit is in operation? Or just constant?
In the transmitter circuit, in order to increase the frequency to 40kHz, what resistance of R1 and R2 should change to under the voltage of 6V?* And what modifications should I take in the receiver circuit? And what its vaild distance?
The potentiometer controls the sensitivity, is it okay to use other values such as 100k (104) or even 1M (105)?
When it is operated in 40kHz, what is the maximum distance as it works?
*The capacitor is limited to use as small as 103, I have no capacitors which have a lower capacitance than this temporary.
It is not equal to phototransistor, is looks like a normal LED.
Regarding the resistors, this is something that you have to test. You can use the resistors you said with no problem. i am not sure about the results though.
To increase the distance, you need to change the IR transmitter LED, run at 40KHz and use an integrated IR receiver at 40KHz as well. The parts that i have chosen are for close distances with high sensitivity.
At 8 December 2010, 10:54:55 user Fung wrote: [reply @ Fung]
I would like to know that about the infrared detector diode, is it equal to a phototransistor (its appearance is similar to this diode)?
I use 6V for Vcc, so for R8, I have no 33k resistors, is it okay to use 40k (1%) instead? And should I change the resistance of R7 to balance?
This circuit is okay when the distance is used to be in a few centimeters, this is the limit, can it be solved by increasing the frequency of the transmitter? Or the Vcc? Or using more powerful IR LED and receiver?
I will work on long distance circuits. I have provide myself some IR receivers and ran some test (drafts) , at around than 10 meters distance with success.
Panagioti, to increase the response time, you need to alter the C2 capacitor, or the R7-R8 divider. you may for example try a 100K potentiometer in place of R8.
I changed the 555 and it worked perfectly!!!.Thanks a lot for your patience and your concern.Also i noticed that if an object with small diameter ex 5mm passes the beam very very fast the circuit don\'t respond.For the job i want to use it is perfect but just for knowing if it can be done anything for it.Also as hassan said is it possible to change the distance???
Thanks again!!!!
At 12 November 2010, 5:53:48 user Hassan wrote: [reply @ Hassan]
This ckt is working perfect.. but try to give some alternate for a bit long range... Thanks
the resistor value is ok (56 instead of 47). No problem. Frequency can vary widely because the filter i use is not narrow pass. So There is no problem at all with frequencies.
Let me give you a way to test if 555 oscillates. Replace the R3 with a 0.1uF capacitor and the IR LED with a normal LED. If 555 oscillates, then the LED should light because the capacitor would act as a resistor (at 7KHz around 220 ohms), otherwise the 555 is wrong connected or toasted because the cap acts as cut-off in DC circuits.
Its not the capacitor so i am going to change the 555.I would like to tell me because i don't have an oscilloscope where i shall put a trimmer to play with the frequency to see where the led turns off???.Does the tolerance of the resistors affect frequency?Also i forgot to mention you tha the R3 of the transmitter is 56Ω instead of 47Ω Does it really matters?
Ok, these numbers makes more sense. 0.88 comes form the R3-R4 divider. Which means that either your capacitor is dead, or the transmitter is oscillating at all. Change the capacitor. If this does not work, then check what is wrong with the transmitter. It should generate a frequency around 7KHz. If this frequency is not applied to the transmitter LED, then the capacitor will cut-off any DC signal.
Oh, that is weird! First of all, C1 is 0.1uF ceramic, which should not have polarity. Second, it MUST have some voltage on both ends. Check the net R3-R4-R5-C1. The error must be there somewhere. It cannot have 0 volts! Impossible. You should find something like 0.6, to 1 volt.
You need to make 4 measurements for me. First, turnoff the transmitter circuit completely, only the receiver circuit should have power. Measure the voltage on both pins of the C1. To do this, put the red wire of the voltmeter on the first wire of C1 and the black to circuit ground. Then, move the red wire to the other wire of C1. These are the 2 first measurements.
Then, turn on the transmitter circuit and approach the 2 LEDs as close as possible, 5mm maximum distance. Repeat the 2 measurements on the C1 and send me the results.
hi again...
Could you be more sprsific?
you said 'measure the voltage BEFORE and AFTER C1, with the transmitter turned on and off.'you mean to put a voltemeter to + of the C1 and the Ground and then???I can't understand.And what do you mean by saying and the transmmitter on and off.My distance is no longer than 2-3cm
Frankly i do not remember the voltages. But the R7-R8 divider should provide around 3 volts to the non-inverting input (+). I think that the current of your receiver diode is very different from mine. Having always 5v on the inverting input means that the transistor base never gets enough current. First of all, change r5 with a 2.2K resistor. That will extremely increase the tr base current. If it works, you may need to change R2 to get better scale over range.
If that does not work, then put back the original r5, and start increasing r4, which will increase th tr base voltage. Don't go above 10K, it would have no sense.
Finally, if this also does not work, then you need to change R1. Restore all other components. Replace R1 with a 220 Ohms resistor in series with a 10K potentiometer. Changing the potentiometer should 100% find the correct size somewhere. Measure with a multimeter and put the proper amount of resistor.
Do me another favor. Before you start doing the above, measure the voltage BEFORE and AFTER C1, with the transmitter turned on and off. Also, how long is the transmitter LED form the receiver LED? The pair i use has limited range within about 2.5cm.
Hello its me again.Well i did the experiment you told me and i saw that the pair is working.Yeasterday i also built it in a pcb but i have the same results not functioning properly.I changed the inverting and the non inverting because that would help me to my application and now i always get +5 to the output no matter if i put my finger between the ir beam.Could you please tell me what voltages are appropriate to particular points to measure???
Hello Panagioti,
-This resistor is to convert my 100K pot into 50K, because i did not have a 50K by that time. Notice that it parallel to the potentiometer wires.
-You can mount both circuits on one breadboard and that would cause no problem at all
-According to your description, i suppose that you have connect the IR reciever wrong (it should light on never). Notice that the receiver is reverse-biased, the cathode (short long lead) goes to the positive of the power supply.
Make an experiment. Put a 1K resistor form positive to the cathode of the IR receiver and then the anode of the receiver to the negative power supply (5 volts). Then, put a multimeter across the resistor. When the transmitter circuit is close to the receiver LED, the voltage across the resistor must change. This means that the pair works.
Well hello my friend i have sent you a message in Greek but as i can see the page doesn't support Greek so i am going to write it in English...I have built the circuit above but i can't make it work for the last 2 days. I don't know what the problem would be.I noticed that you have a resistor that it's not included in the schematic (100k)Please have a look to your drawing-photo and if there is any mistake please let me know.Also i would like to tell you that i built both circuits to the same breadboard and i don't know if there is such problem of not working.Also i couldn't find the particular ir but the seller told me that the ir transmitter-receiver is a pair so i used the without knowing the specifications of them only that their brand is kingbright.I saw using a camera that the ir led is lit but the led on the receiver is just lights on and then lights off when i power the circuits....
Thanks Panagiotis
Hassan that would not be correct. I need to make and test a circuit. There are though tons of circuit in the web for IR remote controlling applications. I will make one for sure, but not for the time.
At 7 November 2010, 16:45:27 user Hassan wrote: [reply @ Hassan]
Thanks for your quick reply.
I know its not too long, but can you please give complete details of parts I should buy, and circuit?
Thanks & regards
3 feet are not too long. Nevertheless this IR pair is not too powerful. You will need different IR LED diode and receiver, which should have also hardware IF filter. like the TSOP4840 (series) to avoid interferences
At 7 November 2010, 16:04:36 user Hassan wrote: [reply @ Hassan]
This is something that you need to test with trial and error. You need to measure the voltage on the C2 capacitor when the beam is cut and when it is not cut, and if the difference is not too high (for example is less than 2 volts) then increase the capacitor. You can also play with the R7-R8 voltage divider to adjust the triggering voltage.
At 10 September 2010, 19:51:02 user Daniel wrote: [reply @ Daniel]
What would I need to change the capacitors to to adapt the 5v reciever circuit to use 9v? I want to integrate it into an existing 9v circuit I am working on.