Introduction
Have you ever noticed that street lamps and security lights turn on automatically at night? How do they do that? The answer is surprisingly simple, they have light sensors in them to work out how dark it is. If the sensor doesn’t detect enough light, it will turn the lamp on.
Now you can make your own automatic light with CodeBug and a light dependant resistor (LDR).

![]() |
CodeBug | |||
Micro USB cable | ||||
Computer | ||||
Crocclips | ||||
Light dependant resistor | ||||
10k ohm resistor |