T ThinkEdge Learn

LDR — Automatic Night Light

The room gets dark, the LED turns on

LDR analogRead Sensor
Arduino LDR light sensor project for students · Tier 2 · Logic & Sensors · Easy · 25 min · Arduino Uno

What you will learn

What you will need

Component
1× 9V battery
1× slide switch
1× LDR (light sensor)
1× 10kΩ resistor
1× 220Ω resistor
1× yellow LED
Breadboard
8× jumper wires

Step by step

  1. Step 1

    Place the battery on the left, switch next, then the LDR + 10kΩ voltage divider, then the LED channel.

  2. Step 2

    Connect battery + → switch.

  3. Step 3

    Switch output → LED anode via the 220Ω resistor (LED cathode → battery −).

  4. Step 4

    Build the voltage divider separately: one leg of LDR → 5V, the other leg → both the 10kΩ resistor (→ GND) AND analog pin A0. (In the lesson code lab.)

  5. Step 5

    In the playground, right-click the LDR to cycle its light level (0–100%) — this is how you "cover it with your hand" in the virtual lab.

  6. Step 6

    Drop the LDR light level below 50% to simulate darkness — the LED should turn on.

Take it further

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.

Open the interactive lab See plans for your class

Related projects

DHT11 — Digital ThermometerRead the room temperature on your laptop Ultrasonic — Distance SensorMeasure how far away an object is PIR — Motion-Activated LEDWalk past, the light turns on. Stand still, it goes off. Sound Sensor — Loud Sound LightLED brightness follows the sound · quiet keeps it off Arduino — Potentiometer Tone ControlTurn the knob, hear the pitch change in real time LDR — Light-Following Robot (Solar Tracker)It always faces the brightest spot

Guides that use this project

4 guides on the site build this project as part of a longer explanation. The guide says why the circuit works; this page says how to wire it.

Solar and Renewable Energy ProjectsSolar and renewable energy projects for students: a light tracker, a solar water heater, a wind generator and a home energy monitor, with the physics behind each. Solar-Powered DevicesHow to build a solar-powered device: charge controllers, energy budgets, why a panel alone is not enough, and how to size everything for a sensor that runs all year. Self-Improving AI: Three Different ClaimsSelf-improving AI means three different things. Separate them, then build the version you can measure: a controller that tunes itself and shows you the numbers. Artificial Intelligence for StudentsArtificial intelligence for students: what a model really is, the three ways to learn it that are not hype, and the projects that prove each one landed.

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.