Moonlighting Lamp

Oct 23, 2022 |  Author: Nic La |  Tags:  project   code   microcontroller  

Moonlighting Lamp is a glorified nightlight that changes brightness based on proximity. Most nightlights use a motion sensor to detect someone's presence and abruptly turn on. The Moonlighting Lamp uses a proximity sensor to detect someone's presence and calmly illuminates as they approach. The light is only as bright as you need it.

Step 1: Materials + Tools




Step 2: Assemble the Circuit

Start by preparing the ultrasonic rangefinder. Solder the 7-pin female header pins to the through-holes. We'll only be using three of the pins: GND, +5, AN. Wire the rangefinder, leaving enough slack for the sensor to sit on top of the lamp shade. Continue populating the breadboard according to the below pictorial and schematic diagrams.

Pictorial Circuit

Schematic Diagram

Actual Circuit

Step 3: Program the Arduino

Copy and paste the Arduino program from GitHub into your Arduino IDE. Run Verify and Upload. If you don't see a lot happening, try covering the LDR sensor. The program is configured to only power the rangefinder in low-light conditions. This value can be tweaked under // enable distance sensor only if day.

Step 4: Assemble the Lamp

Place the lamp shade over your circuit and thread the rangefinder through thee top. If necessary, use the plastic container to house and center your circuit.

Hidden Circuit

Step 5: Enjoy

Plug in your Arduino and night.

Moonlighting Lamp Day

Moonlighting Lamp Night

Leave a comment: