LDR — Sunrise Alarm Clock
When the sun rises, the room wakes up with a soft glow
LDR
PWM
analogRead
analogWrite
Sunrise
What you will learn
- How PWM (analogWrite) creates brightness levels, not just on/off
- How to detect "light enough" using a threshold on the LDR
- How a for-loop + delay = smooth animation (the basic pattern of all UI motion)
What you will need
| Component |
|---|
| 1× 9V battery |
| 1× LDR (light sensor) |
| 1× 220Ω resistor |
| 1× warm white LED |
| 1× 10kΩ resistor |
| 1× slide switch |
Step by step
Take it further
- Add a buzzer that chirps softly at the peak brightness (a "ding" to confirm).
- Make the ramp duration depend on how bright it is (bright = fast ramp, dim = slow ramp — like a real dawn).
- Print the LDR value to Serial Monitor only when it crosses the threshold (not every loop).
Practise it before you build it
Wire this circuit in the ThinkEdge Learn simulator first. The simulator runs a real Arduino sketch against a modified-nodal-analysis solver, so the LED on screen actually lights when the current is right — no hardware, no burnt components, and a class can try it in a browser.
Related projects
LDR — Light-Following Robot (Solar Tracker)It always faces the brightest spot
Arduino — RGB LED Color MixerThree pots, one RGB LED — mix any color of the rainbow
Servo — Knob to AngleTwist to point
Sound Sensor — VU Meter (5 LEDs)The louder the sound, the more LEDs light up
Arduino Mega — 4-Servo Robot ArmDrive 4 servos at once for a pan-tilt-gripper-tilt arm
Arduino — Solar Tracker with Two LDRsA servo that follows the light, like a real solar panel
Where this project sits
It is also part of these lists, which is how a class usually finds it.
Arduino LED projects for beginners36 projects in this list
Arduino LDR light sensor projects7 projects in this list
Try the full simulator with your class
103 guided circuit projects, 21 lessons and an in-browser Arduino simulator. The first 15 projects are free, no account needed. One licence covers a whole school.