AtTiny85 Addressable LED Strip
My goal was to make a desk lamp from LEDs.
I wanted it to be adjustable, so it could be used both at day and night.
In my first attempt, I used a simple LED strip, and big MOS-FETs to drive them at 12v.
This time I chose addressable LEDs which are powered by 5v.
This reduced the component count significantly and allows for much more customization, like transition effects.
Supplies
Parts:
- Addressable LED strip based on WS2812b
- AtTiny85 digispark clone.
- TTP223 Capacitive touch button.
- 5v 6A power supply.
- 2.5mm power plug.
- Development PCB.
- 2.54mm headers and pins.
- Some wires.
- Small plastic box.
- IKEA MOSSLANDA shelf.
- Optionally, Photoresistor and a 1k ohm resistor.
Tools For construction:
- Soldering iron and solder wire.
- Drill and wood/plastic bits.
- Hot glue gun.
- A PC to program the microcontroller.
Drill a Hole for the Button.
I wanted the control to be almost seamless.
So I chose to use a capacitive touch button and installed it at the surface level.
To do so, I drilled a shallow hole at the shelf center with a 20mm drill and at its center used a 4mm drill to make a hole for the wires.
Solder Wires to the Button.
Solder 3 wires to the component side of the button, to keep the other side as smooth as possible.
Use colored wires and remember which color is soldered to each pin, It will not be possible to have a look later on.
This device is very sensitive to inverse polarity, so be very careful not to to switch the GND and VCC.
Assemble the Button
Thread the button wires through the hole.
Use the hot glue gun to fasten the button to its place by putting glue on the wood beneath the button.
Then cover the outer side with glue to make a smooth surface.
On the other side of the shelf use the hot glue to attach the wires to the corner of the shelf.
Cover the button with an adhesive label.
Solder and Assemble the Photoresistor
Drill a hole for the photo-resistor.
Solder both pins to wires and cover with heat shrinking isolation.
Thread the wires through the hole and secure with hot glue.
I even glued a small transparent plastic circle on it, to give it a smooth finish.
Attach the Box and Glue the LED Strip
Attach the box to the edge of the shelf.
I choose to attach the cover instead of the box itself, to simplify installation.
I glued the LED strip near the shelf edge.
It is supposed to be self adhesive, but in my case the adhesive preferred to remain on the tab and the LED strip remained glue free.
So I had to use fast glue instead.
Assemble the Power Connector
Solder 2 wires to the power connector, and cover the exposed parts with heat shrinking isolation.
Drill a hole near the box edge and attach the connector.
Solder Pins to the AtTiny85
I soldered pins to the development board instead of soldering all the wires directly to it, in case I would like to reprogram it later.
I did not solder pin 3,4 since they are not used in this application, and are used to program the AtTiny85 with the USB boot loader.
I did solder pin 5 (reset) and Vin for mechanical stability despite not using them.
Assemble the PCB
I’ve cut a 12x13 square of prototype PCB.
Drilled two holes for screws but eventually did not use them.
Marked the position of the headers.
Then soldered all the wires, headers and a single resistor.
Attach the AtTiny85
Program the AtTiny85 and attach it to the PCB.
Then place everything in the box and attach it to the cover which was already screwed to the shelf.
Done
Connect the power supply.
A short touch turns the LEDs on and off.
A continuous touch changes the LED light intensity.
The photo-resistor is used to distinguish day mode from night mode.
At night turning the light on starts at a low intensity warm light, during day turning it on will start at high intensity.