Exercise 7 - Automatic Night Lamp

An automatic night lamp is basically a lamp that will automatically turn on when it sense darkness in the environment. In this example, we will be using a photoresistor to demonstrate how to convert the ambient level into a lamp’s brightness.

A photoresistor or photocell or a light dependent resistor (LDR) is a component that has a variable resistance with the light intensity that falls upon it. The brighter the light is, the lower the resistance will be. The photoresistor is commonly used to turn on a light and also used to control the shutter speed on a camera.

In the circuit below, a voltage divider is formed by a 10K resistor and the photoresistor. When light shines on the photoresistor, the resistance of the photoresistor become lower, thus the voltage drop across the photoresistor will be lower. When the photoresistor is being covered and away from light, the resistance of the photresistor will become higher and caused the voltage drop across it to be higher. By knowing the voltage drop across the photoresistor, we can obtain the relative light level value converted from the voltage read across the photoresistor.

Schematic Title
STEMTera™ Breadboard - Exercise 7 - Automatic Night Lamp Schematic Diagram
Part Title
JUMPER_WIREx3
LDRx1
RES_330Rx1
RES_10KRx1
LED_REDx1
  1. Connect the 10K resistor to 5V and 30A.
  2. Connect the photoresistor to 30E and 30F.
  3. Connect the 330Ω resistor to PIN9 and 32J.
  4. Connect the anode (longer pin) of the LED to 32I and the other pin to 33I.
  5. Connect a jumper to GND and 30J.
  6. Connect a jumper to GND and 33J.
  7. Connect a jumper to A0 and 30C.
Breadboard Title
STEMTera™ Breadboard - Exercise 7 - Automatic Night Lamp Inkscape Breadboard Diagram