Arduino Lab 5: Ambient Light Sensor
Background: From our circuit labs, we remember that a photocell is a variable resistor that changes based on the light. We can use this property to read a change in voltage across the photocell and determine the light intensity. This has all sorts of applications, from recording data for sleep analysis to measuring conditions for light therapy to treat seasonal affective disorder and certain skin conditions.
Goal: Read photocell to calculate ambient light.
Circuit Setup
- Materials
- 1x Photocell
- 1x 10 kOhm Resistor
- Setup
- Connect photocell between 5V and A0.
- Connect resistor between A0 and GND.

Lab Instructions
- Configure serial port to be used.
- We will print photocell values to the user every 500 ms.
- Use analogRead() to read analog voltage in circuit.
- Provides a value between 0-1023 corresponding to a voltage.
- Store this value to a variable, so you can print it out.
- Print the values to the user every 500 ms.
- What happens to the values as it gets darker?
- Make a mental note of the values that you see. You will need these for the next lab.