This experiment is a very interesting one, it use the principle of glow effect and the photoelectric effect of LEDs. That is, LEDs will generate weak currents when being shined on by light. We use a transistor to amplify the currents and trigger the Uno board to detect them.


- 1 Uno board
- 1 Breadboard
- 1 USB cable
- Jumper wires
- 1 Passive buzzer
- 1 Resistor (10KΩ)
- 1 LED
- 1 NPN Transistor S8050


LEDs not only have a glow effect, but also a photoelectric effect. They will generate weak currents when exposed to light waves.

NPN transistor

Fig1: NPN transistor

NPN Transistors are easy to use. The left pin is Emitter electrode, attached to the power source, the middle pin is Base, and the right pin is Collector. If only the middle pin has weak trigger currents, they will flow from left to right of the LED like a switch being opened.

A 10kΩ pull-down resistor is attached to the transistor output stage in order to avoid analog port suspending to interfere with signals and cause misjudgment.

Experiment procedure

Step 1: Connect circuit as shown in Fig2. The corresponding schematic diagram is shown in Fig3. (Schematic is generated by EAGLE)
Step 2: Program the Arduino (download program from documents).
Step 3: Compile the program.
Step 4: Burn the program into the UNO board.

circuit connection

Fig2: the connection of the circuit

eagle schematic

Fig3: the schematic

Now, you can hear that the buzzer make sounds when the LED is shined.

Experiment summary

This lesson is extraordinary one, a rare concept was introduced, that concept is the photoelectric effect of the LEDs, using a simple electronic components, we have build a light sensing circuit, this reversed effect for LEDs can save you a hardware in simple projects, but be aware that the LEDs can’t always replace the LDRs or other light sensors, when the accuracy is a concern, it is better to use LDRs or other light sensing elements.


1-Arduino progrme (code)
2-Eagle file