Introduction: Color Changing Mood Light

Picture of Color Changing Mood Light

Get in the mood with some fairly simple ATTiny85 based homemade color shifting lamps! The code is Arduino IDE compatible for easy customization.

Step 1: Step 1: Materials

Picture of Step 1: Materials
  1. Saw
  2. Drill
  3. Sheet of wood
  4. Wood screws
  5. Various hole cutter bits
  6. 6" Acrylic Cupcake / CAKE / Centerpiece Tube Extension (for diffusing the light)
  7. Sandpaper
  8. 2 Watt 10 Ohm Metal Film Resistor (qty 3)
  9. Protoboard
  10. Your preference for on off switch (I used the rocker switches in the attached picture)
  11. ULN2003AN (High-Voltage High-Current Darlington Transistor Array)
  12. 3W RGB Color High Power LED Light Common Anode with 20mm Star Heatsink
  13. ATTiny85 (and some means of transferring a sketch to it)
  14. 5v 2W power supply
  15. Wire
  16. Basic soldering equipment (solder, solder iron, wire cutters\strippers, etc)
  17. Hot glue gun
  18. 4 rubber feet

Step 2: Step 2: Build Your Box

Picture of Step 2: Build Your Box

You can build or buy your box as you desire. If you build your box I recommend the following dimensions.

Top and Bottom of the box should be 8x5 inches

Front and Back of the box should be 8x3 inches (Box will be 3 + 2*X inches tall where X is the width of your wood)

The two end pieces should be (5 - 2*X)x3 inches where X is the width of your wood. (the end pieces will be as wide as your bottom piece minus the width of the front and back pieces)

Sand all edges

Assemble bottom, front, back and both edge pieces and hold them together with wood screws.

Align and drill your pilot holes for the top piece to be secured later.

Pro tip (err.... amateur tip)

If your woodworking skills are as abysmal as mine you may end up with some gaps where your sides don't line up quite right. You can diguise those gaps by mixing together some of your sawdust with a little wood glue to make a paste. Fill your gaps with this paste and allow it to dry. After it is dry you can sand it smooth.

Step 3: Step 3: Prepare Your Box

Picture of Step 3: Prepare Your Box

Using a regular drill bit put a hole low in the back of your box where the wire from your 5v power supply to be feed into the box. Only account for the diameter of the wire and not the plug as we'll be cutting the plug off.

Use a spade bit the same size as your rocker switch to make a hole for mounting (or do whatever you need to do to mount the switch you've chosen)

Use a hole drilling bit (see picture) the same diameter as the acrylic tube to make a groove for the tube to rest in. Your LED will rest in the center of this circle. Inside this circle you'll drill four holes for you to feed wire from the electronics inside to the LED outside.

Once everything is drilled and sanded to your liking you can stain the wood if you wish.

Step 4: Step 4: Software

Load the attached code.

Loading software on an ATTiny is a project in itself. I'll leave these two links here to get you started.

(Credit: The attached code is a modified form of the crossfader turorial)

Step 5: Step 5: Electronics

Picture of Step 5: Electronics

Install your power switch into the lid of your box.

Cut the plug off of your power supply and feed the wires through the back of the box to the inside.

Cut your protoboard so that it will fit on the inside of the box when completed.

Solder a wire to each of the four pads on the RGB LED. Place the LED in the center of the circular groove on the lid of the box and feed the four wires through the four holes toward the inside of the box. I found that the wires held the LED in place just fine but you can add some hot glue if you wish.

Wire power through your power switch to the common anode wire of your LED (marked C) and pin 8 of your ATTiny85.

Wire ground to pin 8 of the ULN2003AN and pin 4 of the ATTiny85.

Add your smoothing capacitor between power and ground. It should be rated over 5 volts and have a value around 10 μF

Wire ATTiny85 pin 3 (output for color RED) to ULN2003AN pin 1. Attach the wire on the LED's red pad (marked R) to the associated ULN2003AN pin 16 with one of the 10 Ohm resistors.

Wire ATTiny85 pin 5 (output for color GREEN) to ULN2003AN pin 3. Attach the wire on the LED's green pad (marked G) to the associated ULN2003AN pin 14 with one of the 10 Ohm resistors.

Wire ATTiny85 pin 6 (output for color BLUE) to ULN2003AN pin 5. Attach the wire on the LED's blue pad (marked B) to the associated ULN2003AN pin 12 with one of the 10 Ohm resistors.

The ATTiny85 code will cause the ULN2003AN to sink power from the LED through the resistor independently for each color.

Power everything on and make sure everything is working before finishing off the build.

Step 6: Step 6: Finish Up

Picture of Step 6: Finish Up

Once everything seems to be working properly you stick the protoboard to the inside of the box with some hot glue.

Add some hot glue on the inside of the box where the power cable comes in to prevent it from getting tugged on and pulling away from the board.

Use very fine sandpaper on the clear acrylic tube to make it cloudy so it diffuses light. The LED will be very bright so I recommend making the tube very cloudy so the light is not blinding.

Put the tube into its groove on the lid and fix it in place with hot glue.

Screw the lid into place.

Glue the four rubber feet to the bottom of the box.



Olsi1 (author)2015-01-03

Hi there, can you please clarify (1) how to implement step 4 Software and (2) what type of capacitor did you used?

Olsi1 (author)Olsi12015-01-03

Hi Batkin, thanks a lot for prompt answer. What is please default setup without software upload?

batkin (author)Olsi12015-01-03

The project will not work without uploading the software. The ATTiny85 chip is like a small computer. The software tells the chip to output different values through some of the pins which turn on the lights with different colors. If you do not upload the software then the chip will not no what to do and the light will do nothing.

Olsi1 (author)batkin2015-01-03

Got it :) Thanks

batkin (author)Olsi12015-01-03

The capacitor needs to be rated above 5 volts and have a value around 10 μF.

Loading the software is a project on its own. I'll leave a couple of links here to get you started on the right track.

yours31f (author)2015-01-01

I used to sell something similar. i used enclosures from radio shack and a wireless strip controller from ebay. made them for about 8 bucks

batkin (author)yours31f2015-01-02

I thought about using an enclosure from radio shack but I wanted something that felt a bit more solid so I used this as an excuse to start some amateur wood working.

blanham1 (author)2015-01-01

cool i did it

batkin (author)blanham12015-01-02

You made one? Awesome! How did it turn out?

seamster (author)2015-01-01

Very cool!

batkin (author)seamster2015-01-02

Glad you like it. :)

ririfan.usuk (author)2015-01-02

Happy New Year

About This Instructable




Bio: I am a 34 year old computer programmer who is just getting started in amateur electronics and woodworking.
More by batkin:Color Changing Mood Light
Add instructable to: