Sensor Analog

Photoresistor

A photoresistor, or photocell, is a light-sensitive resistor. Its resistance drops when brighter light hits the sensitive surface.

Part images

Photoresistor. A light-sensitive variable resistor for brightness projects. Image source: SunFounder Pico 2 W Starter Kit documentation, Components section, © 2026 SunFounder.
Photoresistor symbol. The arrows indicate incoming light changing resistance. Image source: SunFounder Pico 2 W Starter Kit documentation, Components section, © 2026 SunFounder.
KY-018 Module Photo. Module Photo for the KY-018 Photoresistor Module. Image source: Joy-IT SensorKit KY-018 module documentation
KY-018 Pinout / Module Diagram. Pinout / Module Diagram for the KY-018 Photoresistor Module. Image source: Joy-IT SensorKit KY-018 module documentation
KY-018 Arduino Wiring Diagram. Arduino Wiring Diagram for the KY-018 Photoresistor Module. Image source: Joy-IT SensorKit KY-018 module documentation
KY-018 Raspberry Pi Wiring Diagram. Raspberry Pi Wiring Diagram for the KY-018 Photoresistor Module. Image source: Joy-IT SensorKit KY-018 module documentation

What it is

A photoresistor, or photocell, is a light-sensitive resistor. Its resistance drops when brighter light hits the sensitive surface.

How students use it

Students use it for night lights, light meters, theremin-style sound controls, line-of-sight experiments, and projects that react to room brightness.

Pins and power

Two non-polarized leads. Either lead can face either direction in a divider circuit.

Passive sensor. Use it in a 3.3V voltage divider with a fixed resistor so the Pico ADC reads a safe changing voltage.

The ADC should read the divider midpoint, not the bare photoresistor by itself. Swap divider order if you want readings to increase instead of decrease with light.

Voltage and safety

Keep the divider tied to 3.3V and GND. Do not put 5V on the ADC pin.

Normal room-light experiments are safe. Do not point lasers or unusually bright lights at eyes while testing light sensors.

Module internals

Cadmium-sulfide-style light-sensitive resistor body with two leads and a serpentine sensitive surface.

Datasheet notes

SunFounder does not identify an exact photoresistor part number. It notes resistance can reach megaohms in darkness and drop to a few hundred ohms in bright light.

Common libraries

Use machine.ADC for analog readings. Average readings if a project needs a stable threshold.

Common mistakes

Reading it without a divider, using a digital-only pin, using 5V as the divider high side, and expecting exact lux readings from an uncalibrated photocell.