A photoresistor or light-dependent resistor (LDR) or photocell is a light-controlled variable resistor. The resistance of a photoresistor decreases with increasing incident light intensity; in other words, it exhibits photoconductivity, though we like to keep our experiments far from math, but it is worthy to know that the LDR is non-linear resistor. A photoresistor can be applied in light- sensitive detector circuits, and light- and dark-activated switching circuits.

lesson 4-photoresistor with Arduino

                         Fig1: the photoresistor

Experimental Conditions

- 1 Uno board
- 1 USB cable
- 1 Photoresistor
- 1 Resistor (10KΩ)
- 8 LEDs
- 8 Resistor (220Ω)
- Jumper wires
-1 Breadboard

Experimental Principle

The resistance of the photoresistor changes with incident light intensity. If the light intensity directed to the LDR is high, the resistance decreases, in the light, the photoresistor can have a resistance as low as a few hundred ohms, and light intensity directed is low, the resistance increases, in the dark, a photoresistor can have a resistance as high as several megohms (MΩ).

So In this experiment, we will use eight LEDs to indicate light intensity and note how will the LDR affects the circuit. The higher the light intensity is, the more the LED is lit. When the light intensity is high enough, all the LEDs will be lit. When there is no light, all the LEDs will dim.

Experimental Procedures

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.

Now, if you shine the photoresistor with a certain light intensity, you will see several LEDs light up. If you increase the light intensity, you will see more LEDs light up. When you place it in dark environment, all the LEDs will dim.

In addition, you can replace the photoresistor with a microphone to use LEDs to indicate sound intensity. The higher the sound intensity is, the more LEDs are lit. You can realize this effect by yourself.

circuit connection

Fig2: the connection of the LEDs and the photoresistor

eagle schematic

Fig3: the schematic

Experiment summary

Understanding this experiment will get you a step closer to control circuits, the previous circuit itself is a kind of control circuits, you can build a wide number of circuits using the LDR, combining this circuit with those in the first 3 lessons you can come out with an exciting and useful control circuits.


1-Arduino progrme (code)
2-Eagle file