Learning Objective
Measure ambient light using a photoresistor.
Light Sensing (LDR)


Hardware: On-board LDR Light Sensor (same position on your MakerBuddy)


Dashboard: Light Level Card
See How the LDR Light Sensor Works
Read the picture from left to right: the change in the world → the sensor signal → a useful action.

1 · What it notices
How much light falls on it.
2 · How it works
Light changes its resistance (how hard it is for current to pass), and MakerBuddy reads a relative light level.
3 · Why it matters
Knowing bright from dark helps save electricity and protect plants.
Where might we use it?
- Automatic streetlights
- Greenhouse shade control
- Energy-saving room lights
Student sentence: An LDR turns a change in light into a change in its reading.
Teacher/parent prompt: Ask, “What changes on the left, what does the sensor turn it into, and what could happen next?”
Theory: Photoresistors (LDR)
From Manual to Automatic
You have used digital inputs (the button) and digital outputs (the LED and RGB LED). Now meet a sensor that notices changes by itself: the Light Dependent Resistor (LDR), or photoresistor.
How Photoresistors Work
An LDR is a resistor made from a material such as cadmium sulfide (CdS). Resistance is how hard it is for electricity to flow, and light makes the flow easier. So more light = lower resistance = higher voltage reading. Resistance can be over 1 megaohm in the dark and as low as a few hundred ohms in bright light. You'll use the same idea with the potentiometer in Week 9!
Reading Light Levels
The LDR is wired in a voltage divider circuit: it sits in a row with a fixed resistor, and the voltage between them changes with the light. The ESP32's 12-bit ADC (the part that turns a voltage into a number) reads it as 0-4095, and the dashboard shows 0-100. Low means dark; high means bright. The LDR reacts in about 20-30 milliseconds, but MakerBuddy measures it once every second and refreshes the card about every 2 seconds. A threshold is the point where we decide "it's dark enough to turn on a light".
Real-World Applications
Light sensors help automatic street lights turn on at dusk and off at dawn. Smartphone screens use them to set their brightness, and solar panels use them to follow the sun.
For Teachers
Ask: "How dark should it be before lights turn on?" Street lights, nightlights and security lights need different thresholds. A poor one can make lights flicker on and off.
For Parents
Your child learns how a device can sense the world and act on its own, the idea behind "smart" technology. They see light turn into a voltage, then into a number.
Try It: Measure Light
Interactive demo · no kit needed
Play with a pretend MakerBuddy board and its web page, right here.
Follow the steps one at a time. Got the kit? You can switch to the real board inside.
Hands-On Activity: Light Detection
Activity Duration: 20-25 minutes
Make the LDR dark and bright, write down the numbers, then pick a threshold.
Step-by-Step Instructions:
- Locate the LDR: Find it near the label 35-LDR (the sensor can hide part of the label). It is already connected and looks like a small resistor with a light-sensitive top.
- Open the Dashboard: Go to the Light Level card and read the light level.
- Baseline Reading: Write down the level in normal classroom light. This is your baseline (starting point).
- Create Darkness: Cover the LDR fully with your hand or paper. Wait at least 3 seconds, then write down the lowest value.
- Create Brightness: Shine a phone flashlight or desk lamp on it from about 2-3 inches away and write down the highest value. 100 is the top of the scale, so two very bright lights can both read 100.
- Test Shadow Conditions: Hold your hand at different heights above the sensor. The value changes gradually.
- Observe Response Time: Cover and uncover the sensor quickly. The card only updates about every 2 seconds, so a very quick cover may not show at all!
- Create a Data Table: Record values for complete darkness, a hand shadow, normal classroom light, a desk lamp and a flashlight.
What Students Should Observe:
- Low values in the dark, high values in bright light
- Smooth changes as the light changes
- The card updates about every 2 seconds; the LDR is much faster
- A clear gap between "dark enough for automatic lights" and normal light
Challenge
Your Mission: Smart Lighting Engineer
You're designing automatic lights. Pick each threshold with care: too high and lights stay on all day wasting energy, too low and people are left in the dark!
Challenge 1: Threshold Determination
Use your data table to choose a threshold for each:
- Classroom lights: on when it gets dim (cloudy day, late afternoon)
- Security lights: on only when it's dark outside (after sunset)
- Nightlight: on only when it's very dark (bedtime)
Write down each threshold and explain why.
Challenge 2: Environmental Testing
Measure the light level in different places at school:
- Next to a window
- Under a desk or table
- In a closet or dark room (if you can)
- Right under the ceiling lights
Which place has the widest range of values during the day?
Discussion Questions:
- Why do street lights need different thresholds in summer and winter?
- What could go wrong if your threshold is close to normal room light?
- How could you stop lights flicking on and off near the threshold?
Bonus Challenge: Your classroom reads 45 by day and 15 at night, and you want lights on at dusk. Would you set the threshold to 30? Why or why not? (Hint: try a buffer zone. Turn on at 25 and off at 35 to stop flickering!)
Key Takeaways
✓ Photoresistors
An LDR changes its resistance with light: more light means lower resistance and a higher voltage. It needs a fixed resistor in a row with it to give a reading.
✓ Light Measurement
The ESP32 turns the LDR's voltage into a number on a 0-100 scale, so we can use light to make decisions.
✓ Threshold Detection
A threshold is the value where we decide to act, like turning lights on below 30. Too high and it triggers when not needed; too low and it misses. A buffer zone (hysteresis) stops flickering on and off when values hover near the threshold.
✓ Automatic Control
Sensors like the LDR let a system watch its surroundings and act without a person. That is what makes technology "smart".
Coming Up Next Week:
Week 8: Term 1 Assessment — The Traffic Light
Learning Support
Use this quick guide to help every learner understand, practice and explain Light Sensing (LDR).
For students
Try it in three steps
- Say it: explain the main idea in one simple sentence.
- Show it: Read the Light Level card. Contrast fully covered vs. direct flashlight glare.
- Stretch it: Identify the threshold value defining 'Darkness' in the classroom.
Checkpoint: What was your input, what decision or process happened, and what was the output?
For teachers & parents
Coach without taking over
- Before: ask the learner to predict what will happen and why.
- During: use prompts such as “What changed?” and “What could you test next?” instead of giving the answer.
- After: ask for a 30-second explanation, one piece of evidence and one improvement.
Look for: safe handling, correct vocabulary, a result the learner can demonstrate, and an explanation in their own words.
Did you get it?
Three quick questions. Pick an answer to see whether it is right, and why.
1How does an LDR (light sensor) react when more light hits it?
2What is a threshold in an automatic light?
3Why use a buffer zone (hysteresis), like on at 25 and off at 35?
