All work

Motion-sensing light

A light that answers movement, but only when it's dark.

When
2023
Kind
PIR, light sensor, servo, LCD
Role
Solo build
Stack
Arduino, C++, PIR sensor, LDR, MG90S, 16x2 I2C LCD

A light that comes on for movement, but only when it's dark. A PIR sensor watches for motion, a light-dependent resistor decides how sensitive to be, a potentiometer sets the threshold, and a servo and an LCD show what the system is doing.

How it decides

In darkness the threshold drops so the faintest movement counts; in daylight it rises so the light stays off. Motion, scaled by the potentiometer, is compared with the threshold: above it, the LED lights and the servo swings its latch to 125°; below it, the LED goes out and the latch returns to 35°. When the potentiometer is set below the threshold, the LCD reads SYSTEM IS OFF.

  1. PIRIs anything moving?
  2. LDRHow dark is it?
  3. ThresholdSet by the potentiometer
  4. RespondLED, latch at 125°, LCD
One pass of the loop
Weather stationNext project: Temperature and humidity on LCD