Introduction: IR Photogate
This is a simple photogate using a IR-led and a IR-photodiode. It can sense objects crossing the beam.
- The photogate is adaptable by changing resistors, IR-led and IR-photodiode.
- It is a small circuit and has few components.
- IR uses a specific part of the spectrum, so it has limited interference by other light sources.
In this setup we only change the resistors.
Step 1: Schematic
A photodiode can detect light. It can generate a tiny voltage or can act as an resistor. In this setup we use the photodiode as a resistor. When the photodiode is lit by the light-beam from the led, the photodiode allows the current to flow (cathode to anode). When current can flow, the photodiode has a low resistance.
See: https://playground.arduino.cc/Learning/LEDSensor
The IR photodiode resistance is measured by a voltage/resistance divider.
See: https://en.wikipedia.org/wiki/Voltage_divider
To get result we only change the resistors. In this setup I got good results with:
The current to IR led is in series with a 680Ω resistor. Lowering the resistance of the led increases the brightness off the led. A resistor value below 270Ω can destroy the Arduino.
R1 = 1M: Try different values to get better results, see the formula in the schematic.
Step 2: Program
When the test program is uploaded to the Arduino, you need to open the Serial Monitor to see the results of the photogate. Disturbing the light-beam increases the resistance of the photodiode. A stronger light-beam lowers the resistance, thus a higher voltage at A0. Slide a piece of paper between the led and photodiode and see the new results at the bottom of the screen of the Serial Monitor.
The results are:
- Left column the current voltage at A0
- Middle column the average voltage
- Right column the number of voltages below 2V
If the results are too uniform, experiment with different resistor values.