Intro to IR Circuits
IR is a complex piece of technology yet very simple to work with. Unlike LEDs or LASERs, Infrared cannot be seen with the human eye. So in this Instructable, I will demonstrate the basic use of Infrared through 4 different circuits.
The circuits will not use IR receivers or microcontrollers, instead, they will use a photodiode to detect the IR signal because it is more simple.
IR LED & Photodiode Basics
The three projects all depend on the IR LED and Photodiode. The IR LED emits infrared radiation in all directions, the photodiode is placed next to it so if an object gets close to it, it will reflect the infrared radiation into the photodiode, the photodiode turns the infrared it absorbed into a signal, the signal then can activate other things. Note the diagram above has a black IR LED and a transparent photodiode, this is not very common as it is usually the other way around, but the following 3 projects use the normal types of IR pairs (IR LED: transparent, Photodiode: Black/dark purple). The colours of the diodes do not matter but just make sure you remember which one is which.
Important things to note (Please read the following):
IR LED: The infrared LED emits IR radiation, we cannot see the radiation because it is a lower frequency than visible light, however, humans can detect infrared as heat (so the IR LED can get a bit hot, that's normal), the radiation is also not harmful.
Photodiode: The photodiode is like an LED but it does not give out light, instead, it is an infrared light sensor (like an LDR but not quite). The photodiode can come in many forms: it usually looks like a black LED but it can also be transparent (in which case don't get it mixed up with other LEDs). The photodiode is connected differently from normal LEDs, instead, Vcc is connected to the cathode rather than the anode of the photodiode.
When purchasing IR LEDs and photodiodes, try to buy them in pairs because sometimes the IR LED does not work with the photodiode.
IR Circuit 1
The first IR circuit will just show how the pair (IR LED & Photodiode) works. By using a transistor, we can arbitrarily amplify the analogue signal from the photodiode to power the LED. The circuit is very simple, all it needs is:
Resistor: 2x 220ohm (or similar), 1x 10k
Diode: 1x IR LED, 1x Generic LED, 1x Photodiode
Transistor: 1x BC547 (or any equivalent NPN transistor e.g. 2n2222)
A 5~6v power source (USB is fine), jumper wires and a breadboard.
IR Circuit 1 Test
Before you finish the circuit, make sure the IR LED and Photodiode are placed next to each other.
Once the circuit is complete, test the sensor by hovering an object or your finger about 5cm above the two diodes, then slowly move the object/finger towards the diodes till you touch them both. The generic LED should light up more the closer you get, this is because the object is reflecting more infrared into the photodiode.
If this does not happen, check you have put the photodiode in correctly, check your wire connections, and check your power source, if none of this help, the problem might have occurred between the IR LED and the photodiode. If you have an oscilloscope, try probing the output of the photodiode. If you don't, perhaps try a different IR LED and photodiode pair.
Ensure you do not run the circuit under the sun or very bright light as the EM waves contain a significant amount of IR which can interfere with the circuit.
IR Circuit 2
Now you understand how the IR LED and Photodiode works together as a sensor, we are going to transform the previous circuit into an alarm circuit. This circuit will use an OP Amp to Amplify the photodiodes signal, a buzzer is connected to the output of the OP Amp but that can be modified and replaced with another component/circuit.
This circuit will need:
Resistor: 1x 220 (or similar), 1x 10k
Potentiometer: 1x 10k
Diode: 1x IR LED, 1x Photodiode
IC: 1x LM358
Others: 1x Buzzer or replace it with your own circuit.
5v power supply (USB is fine), Breadboard, jumper wires.
IR Circuit 2 Test
Remember the two diodes have to be next to each other as the last circuit. To test the circuit, move an object or your hand above the two diodes, this should trigger the alarm. You can also adjust the sensitivity of the photodiode by turning the potentiometer, there will be a point when the alarm will always be on, this is because the photodiode is so sensitive to IR it detects it from the atmosphere around it. It is not possible for me to show the circuit functioning in the picture above but just imagine you can hear the sound of the buzzer.
Do not operate the circuit under the sun or very bright light because that can confuse the photodiode.
To troubleshoot, repeat step 3.
IR Circuit 3
In this circuit, we will activate an LED (or any output) without pressing a button. This time two pairs of IR LEDs and Photodiodes will be used. Instead of using an OP Amplifier, we will use a 555 timer for simplicity. We will also bring back the transistors for smoothing the analogue signal.
This circuit will require:
Resistor: 3x 220ohm, 2x 10k, 2x 1M, 2x 3M
Capacitor: 1x 10nf
Diode: 2x IR LED, 2x Photodiode, 1x generic LED
Transistor: BC547 (or equivalent)
IC Chip: 1x 555 timer
5v power supply (USB is fine), Breadboard, jumper wires
Make sure the two pairs of diodes have distance between them so they won't interfere with each other. Also, make sure you pair the right diodes up.
IR Circuit 3 Test
The circuit consists of two pairs of diodes, one turns the output on, the other turns it off. You must first figure out which pair of diodes controls what. Once you do, you can turn the output on by hovering an object over one pair of diodes. The output will stay on even after you have taken your object away from the sensor, the output will only shut off if you hover an object over the other sensor, it will then stay off until you repeat this process.
Again, do not operate under sunlight.
IR Circuit 4
For more flexibility in the circuit, a transistor can be used to drive a relay, which in turn can be used to switch much higher power appliances. This circuit works similar to the first circuit, however, uses a light gate instead.
The photodiode will be conducting when the light gate is completed, which means the transistor will be powered off. When the gate is disrupted, the photodiode will no longer be conducting, thus the transistor switches on and so does the relay.
This circuit can operate from 3.3v to 12v depending on what voltage your relay is rated for. However, from my testing, any voltage below 6v is unreliable as some transistors are unable to provide enough current to power the coil of the relay. R1 should be changed to 220 ohms for 5v to 3.3v. Q1 can be any standard NPN transistor such as 2n2222, 2n3904 or BC547. Variations of this circuit might use a diode in parallel with the coil for reverse current protection, but in my opinion, that is excessive as the circuit is not connected to sensitive microcontrollers.
More IR Stuff
There is a much bigger world to IR circuits, it's not very complicated but is quite fascinating. Instead of IR LEDs and Photodiodes, better circuits would consist of IR remotes and IR receivers, these devices can cover much more range and can transfer more information as well.
Should there be any questions, please feel free to ask.