Smart Light: Final Circuit and Enclosure

Here is quick update on the progress of my Smart Lamp project I started near the end of the summer. As I mentioned in my previous post, I have already put together a prototype circuit to test controlling the flow of power to a plugged in lamp based on the input of the light sensor. Below is the proposed final circuit for the smart light project. The only change I foresee is the removal of the LED indicator since the Trinket and the AC-DC converter both feature LEDs on them and space is tight in the enclosure.

Smart Lamp Final Circuit

Smart Lamp Final Circuit

I’ve bought a Hammond ABS enclosure to hold all the components. I removed the mounting stand-offs as they did not match well with any of the components and the relay would not fit if mounted to them. The white board you see in the picture is foam board which I was thinking of using as a medium to mount the parts to. My current plan is the use Velcro to secure the components right to the case. I tested this using my EDtracker build and a small Hammond enclosure and it worked well. The tracker is secure when in the case but can be easily removed if need be. I have included a picture that tries to illustrate how the extension cord will be routed through the enclosure. I still need to drill a hole for the end on the left of the picture.

The biggest change since my last post is the addition of a spare USB charger I had. This will serve the purpose of powering the microcontroller right off of the extension cord. I have removed the USB port from the charger and soldered wires where the power pins were in order to keep the USB port on the Trinket free for programming. Unlike the circuit shown above, the trinket is mounted on a (trimmed) proto-board in order to easily allow multiple connections for powering the relay and sensor.

There’s just testing, soldering and calibration left! I’ll post a final build update regarding the testing and calibration with pictures of the final product soon.

Advertisements

DIY Smart Lamp using Arduino

My Dad has been doing some remodeling of his living room recently and, as part of this, bought bookshelves and some lights to go with them. He wanted some way to turn them on without having to deal with the little switch included with the lights so he thought it would be nice if the lights turned on in the evening on their own. So the task fell to me and and I happily accepted.

This project is actually fairly simple as only a few cheap parts are needed and little coding is required. There is a real danger of electrocution with this project however as we are dealing with voltages from 120V to 220V ( depending on where you live). Please be sure to the necessary precautions when working with live wires for this and any project you take on.

I am using the following parts for this project:

  • Arduino Uno R3 (for prototyping) and an Adafruit Trinket 5V – Mini Microcontroller (finished product)
  • light sensor
  • Seed Grove Relay
  • Adafruit Perma-Proto Small Mint Tin Size Breadboard PCB
  • GA1A12S202 Log-scale Analog Light Sensor
  • Dollar store extension cord (for prototyping)
  • IR Motion Sensor

Since I didn’t have access to the lights when I started nor did I have a light sensor handy, I started by creating a prototype to test the relay with an Adruino Uno R3. I wrote a simple loop that closed the the relay, waited a second then opened it again. This was repeated so long as power was supplied to the Arduino.

Relay connected to extension cord.
Relay connected to extension cord.

For the next prototype I simply added a sensor I had lying around to test controlling the relay based on the input form a sensor. I sensor I chose was a IR motion sensor. The end result was an extension cord that would send power to whatever was plugged into it when motion was detected. I’ll post an update once the light sensor arrives and I find time wire up a circuit for testing.