loading

The 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. If you're like me and can't stand those abrupt nightlights, this lamp is for you.

Step 1: Materials + Tools

Materials:

  • Ikea Vate Lamp from Amazon
  • Arduino Uno
  • 9V, 250mA or more, 2.1mm center pin positive adapter or other Arduino power supply
  • Ultrasonic Rangefinder - LV-EZ0 from Adafruit. Other distance sensors will work but I picked this one for its long range and wide beam width.
  • 7-pin female header
  • light dependent resistor (LDR) salvaged from a lawn light
  • white 5mm dome piranha LED x4 from DigiKey
  • 220Ohm resistor x4
  • 10kOhm resistor
  • breadboard
  • small recycled plastic container to mount contents inside lamp
  • solid core wire
  • solder

Tools:

  • Arduino IDE
  • A-B USB cable
  • wire cutter
  • soldering iron

Step 2: Assemble the Circuit

Begin by preparing the LV-EZ0. Solder a 7-pin female header through the holes. We'll only be using 3 of these pins: GND, +5, AN. Populate the breadboard according to the pictorial diagram and schematic. I used a breadboard and jumper wires as opposed to soldering the components to a through hole board because of the circuit's simplicity. When wiring the LV-EZ0, use long enough wires so that the sensor can poke out the top of the lamp shade.

Step 3: Upload the Code

Connect your Arduino to your computer. Copy and paste the linked code into your Arduino IDE. Run Verify and then Upload. At first glance, not much might happen. Make sure the LDR is covered and then try testing the circuit. The Arduino is progrmamed to only power the distance sensor in low-light conditions. This value can be tweaked under

"enable distance sensor only if day"

Step 4: Hide the Circuit in the Lamp Shade

Carefully stuff your lamp shade with the assembled circuit. Be sure to thread the distance sensor through the opening at the top. Connect your Arduino to its power source. Lastly, insert your recycled plastic container mount to rest the circuit on and center the LEDs.

Step 5: Enjoy

Plug the Arduino in and enjoy...at night.

This was he best idea I could come up with for this ultrasonic rangefinder sensor thingy that I got! Glad to see the same idea laid out here all nice. I'll let you know how it goes once I put it all together? Cheers! ?
This is a good beginner's project into the Arduino. Just a heads up, the lamp uses a proximity sensor not motion sensor. This means the lamp will stay on as long as there is something in front of it.
this is awesome, thanks for sharing!
I love this lamp! My wife and I are about to have our first child and I've been looking for a motion activated light to use for late night visits. I've never done any arduino before. How difficult would you rate this project?

About This Instructable

4,949views

88favorites

License:

Bio: Making for the Sake of Making
More by Sake of Making:Hidden GoPro Security Camera Ikea Hack: Mobile Whiteboard Ikea Hack: Moonlighting Lamp 
Add instructable to: