The light sensor: the street lamp
Section 5: Sensors and numbersLesson 5.3 · ⏱ 8 min
The light sensor (LDR) gives a small number in the dark and a big number in the light. We compare it with a limit number like 300.

🖥️ What happens on the stage?
When it gets dark (a number below 300), the LED turns on by itself.
📌 Another example: a darker limit
The limit is 150 instead of 300: the LED lights only when it is very dark.



✍️ Practise
Watch the light sensor.
✍️ Practise here in the lesson✖ Close the labor open the lab in a new page ↗
✍️ Practise
Build the street lamp.
✍️ Practise here in the lesson✖ Close the labor open the lab in a new page ↗
🎯 Challenge yourself
Easy
A daylight lamp: it lights when the light is above 600.
👀 Show the solution🙈 Hide the solution


Result: it lights in the light.
Medium
In the dark (below 300), the LED blinks instead of staying on.
👀 Show the solution🙈 Hide the solution


Result: blinking in the dark.
Hard
Print the light value on the Serial, and light up in the dark.
👀 Show the solution🙈 Hide the solution


Result: the numbers appear, and the LED lights up.

