This lamp is a byproduct of the 172 pixel clock project that I created. It came about as I was testing the string of LEDs, My partner saw them and liked how they looked. I finished the clock and then began this project. It has been quite a slow project, other stuff has happened in-between which has allowed it to evolve over time.
The original concept was a little over a meter long it used 3 buttons and a potentiometer to control it. This evolved into a smaller but similar design that used a single rotary encoder. The festive season then come along and I borrowed some of the control concepts for the ATTiny 85 controlled festive lights. Eventually we have this; A cute 50mm cube with a single touch sensitive control.
It would have been easy to have simply purchased a cheap LED controller from eBay, stuffed it into a box and called it done. However I wanted somthing that would required no setting up or pairing and would allow me to decide how the LEDs behaved. Sure I can’t change the light from the comfort of my sofa but I don’t mind. That said, I think the next evolution might be swapping out the ATTiny 85 for somthing like the ESP8266 so I can take advantage of wireless controller but keep some manual control too.
It was really important to me that the light be active but not distracting so on white mode a little bit of colour slowly comes into view at a random point on the lamp and then just as slowly fades off again. It was important that it wouldn’t catch your eye doing it but every time you look at the lamp it would be just a little different.
The cube is made from 3mm frosted opal Acrylic sheet. I cheated and ordered it pre cut into squares that are the right size for what I wanted, I added a few extra to the order incase I made a mistake ( I did) The 1st few that I made I used tensol 12 to bond them together. It works very well but is not nice stuff to use, I made the one here using gorilla epoxy. The bond isn’t as strong as the tinsol 12 but should be strong enough without the really nasty fumes.
The LEDs are SK6812 they are the RGBWW (warm white) option.
The micro Controller is a ATTiny 85
The touch controller is a MTCH101
There are a few passive components:
- 13X 0603 0.1uf capacitors
- 2X 4.7k 0603 resistors
- 2X 10k 0603 resistors
- 1X 470 ohm 0603 resistor
- 1X 1000uf capacitor
While it would be possible to make this on ProtoBoard having PCBs made is cheep and somthing I wanted to lean about.
Old usb cable to cut for a power cable
Hot glue is used to hold the PCB down in the final product and some silicone sealant allows you to stick the bottom of the cube on. Both hot glue are silicone are ok at sticking acrylic but neither are very good. This makes a bond that’s strong enough to hold it all in place but so strong its can’t be teased apart later if needed.
200mm of 0.31mm Enamelled copper wire. (you could use just about any wire here as long as its not so too big that it creates a shadow inside the cube)
The Micro Controller
I have said it before and ill say it again. I really like the ATTiny 85 Micro Controller. They are cheep, easy to use, easy to program and seem to be virtually indestructible.
So, Of course I used one for this project. The code its runs is fairly basic. An interrupt is connected to the touch sensor, When the pin is pulled down the ISR adds 1 to a counter. The main loop then runs the sub loop that corresponds to the counter number. This way you can add or remove animations with just a few lines of code.
I have had this code running on an ATTiny85 for about 8 months now without any problems.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Tools and Consumables
It’s possible to solder all the components by hand but the SK2612s are quite sensitive. I killed quite a few of them before I found a mini oven in Lidl that I converted into a reflow oven.
I used a router and a 45 degree chamfer bit to cut all the edges of the acrylic. You could skip this and have square joints to your cube or 3D print somthing.
Other tools used include:
- Hot glue gun
- Soldering Iron
- Small shape knife
- Masking tape
- Some basic hand tool. snips and small pilers.
- Arduino Uno or similar plus breadboard and jumper wires for uploading code to ATTiny85
- Hack Saw
- Solder Paste
Step 2: Cutting the Acrylic
It was tricky to find a reliable method for cutting the 45 degree angle onto the edges of the acrylic. I think that setting up a table saw with the correct angle would be much easier but unfortunately I only have a router so here what I did.
I used a piece of scrap wood with a straight edge clamped down to my work bench to make a jig. The straight edge is very important as the bearing of the chamfer bit will roll along it. Its then a case of sticking some scrap acrylic sheet down around the piece that I wanted to cut the angle into to hold it still and create the correct height of the bottom of the router.
I had my hot glue gun out and hot when I did this one so decided to use hot glue to stick the support pieces in place. Normally I would I have used double sided sticky tape. Both options work well.
It's then a bit of trial and error to get the router set at exactly the correct height, too high and it will leave a square edge on the acrylic, too low and it will take too much off
Using a little masking tape to make sure nothing can move, allow the router to spin up to speed and smoothly run the router along the edge of the acrylic, rotate the piece and repeat until you have all 6 cut with a 45 degree edge on all 4 edges (5 pieces and 3 edges if you want to mount the cube into somthing)
Step 3: Making the Cube
Once all the acrylic is cut, forming the cube is straight forward but dose require a little attention to detail.
1st take a length of masking tape, with 2 pieces on the ends to hold it down, straight and tight. Position it a few millimetres away from and parallel to a straight edge with the sticky side facing up. The tape will holding everything together until the epoxy sets so I over lapped two pieces to ensure a nice even pressure. Used my silicone matt as my straight edge but a ruler would work just as well or maybe better.
Next, remove the protective film from the acrylic and place one of the of the squares toward one end of the tape making sure its sat neatly against the straight edge and the 45 degree angle is sloping down. Then place a second square next to the first making sure the edges just touch and the top is tight to the straight edge. Repeat for the third and forth square.
When your happy that they are all sitting neatly turn it all over and trim the tape on one end so that it doest go past the end of the acrylic. You should now be able to fold it all together and form a neat box. Its important for the final finish that the top of the box is as close to perfect as it can be, a slight deviation on the bottom can be sanded down and hidden later on.
If you are happy that everything is fitting as it should then its time to fix it in place. Open the cube up and lay flat ready for your choice of adhesive. I have used Tinsol 12 in the past. Its designed to bond acrylic and dose a very good job of it, however its unpleasant to work with and requires refrigerating before use. I would also recommend using it outside on a breezy day and leaving the bonded parts outside or in a shed for at least 24 hours.
A crystal clear two part epoxy works just fine, is much nicer and more forgiving to work with. You still need to use a well ventilated area to work in but I didn’t notice any fumes working by an open window. Its bond isn’t as strong as Tinsol12 but unless your planning on trowing your cube it should be strong enough.
I mixed a little gorilla epoxy on an old cd and used the action end of a bamboo squire to apply a fine layer along one of the edges of all the squares where they where going to meet. Avoid using too much as it will splurge out.
Im sorry I didn’t get any photos of this stage as its set quite quickly.
Once the adhesive is in place fold the squares up to form the box again and use the overhanging piece of masking tape to hold it all together.
After about 5 minutes if felt strong enough to remove the tape. I like to remove the tape as soon as possible incase some of the epoxy splurged out. Once its completely bonded its much harder to get the tape of.
Step 4: The Touch Sensor
The Mk1 version of the cube used a vibration sensor. This worked well but wasn’t ideal as it could be tricky to get it activate just once, especially if I picked it up to change the mode and then put it down again just a little too fast. The design doesn’t really allow for a button to be placed anywhere so the only logical thing was to use touch control.
The MTCH101 seemed like the perfect chip for the job.
As Its a capacitive sensor there is no need no make direct contact with anything so I took what will become the lid of the cube, removed the protective layer from the inside, then arranged 0.31mm enamelled copper wire around the inside holing it in place with masking tape before mixing up a little Gorilla Epoxy to hold it permanently. Make sure to leave enough tail to get down to the PCB.
The MTCH101 Detect Output pin is Active-Low so a tactile switch between 5V and the extra pad would also work near pin 7 to change the mode of the cube
Once the epoxy is cured the top of the cube can be attached to the body with a little more epoxy.
Step 5: The PCB & Soldering
I had always imagined PCBs to be somthing reserved for those who possess a deep understanding of electronics that’s been passed down over many years. It turns out that its actually really easy and inexpensive to design your own boards and have them professionally made.
I won’t go too deep into the process here as its requires a fair bit of detail that others have done a much better job of explaining than I could. But the basic steps are:
Build your circuit on a bread board to test it. Lay out all the components on a schematic Convert the schematic into a PCB, Place all the components as you want them and create the connections. Place the order
The hardest part of the process is waiting for your boards to arrive.
I used JLCPCB. The total cost for 10 boards was a little less then £10 and took just over a week to arrive. I have nothing to compare the quality with but they seem really nice.
I wanted to have the option to make a bigger version of the cube so I added some extra rings of LED pads to the PCB. I can solder LEDs on any of the 3 rings or cut the ones off for smaller designs. JLCPCB charge the same price for any size board unto 100mm x 100mm.
It is possible to hand solder all the components. The 0603 capacitors and resistors are small but resilient so with a bit of practice can be done with ease. The same for the MTCH101 chip. The problem I had was the SK2812 LEDs, they are large enough to solder by hand but I found them to be a little too sensitive to the heat. I guess that I killed at least 10 before I decided to invest in something designed for SMD parts.
I wasn’t sure of the best way forward then my decision was made when I found a mini oven for sale at Lidl. Whilst its not the perfect oven for reflowing its good enough for my needs and with a few modification for more accurate temperature control it doesn’t kill the LED’s.
Again the process of turning a toaster oven or mini oven into a reflow oven is a little beyond the scope of this intractable but there is plenty of information out there if you wanted make somthing similar.
The steeps required for reflowing the PCB are:
Give the PCB a quick clean with alcohol to remove any grease that might prevent the solder sticking correctly. Apply solder paste to the pads on the PCB and then apply the components. Place the board into the oven and reflow.
Once the board is cool you can manually solder in the through hole IC holder and large capacitor.
I have not installed the 1000uf capacitor this time as the light is only going to be used by me and won't be turn on and off to often. It also creates a shadow inside the cube as the LEDS do their thing.
The 1000uf capacitor is there to save the LEDs and micro controller from an inrush of current. I recommend installing it but its somewhat optional if your careful about what you plug it into. For more info on this subject I recommend reading the Adafruit NeoPixel Überguide
Step 6: Code
Upload the code to the AtTiny85.
Here is a great guide on how to do it!
Then place in ATTiny into the IC socket on the PCB
Step 7: Putting It All Together
There is a single resistor on the bottom of the PCB plus the legs from the IC and capacitor stick out a little. I used a Dremel to carve some recesses in the bottom piece of acrylic so that the PCB can sit flat.
Whilst the Dremel was out I also drilled a small hole in the side of the cube in the centre about 6mm up for the power cable and pushed it through before stripping the wires and tinning. A lot of USB cables with have data lines, use a multi meter to work out which is which if necessary.
Use a small blob of hot glue to hold the PCB down (I found hot glue to be idea as it creates a strong hold but can removed if needed) and solder the power wires to it. I used a little hot glue for some extra support.
The next step is to solder the sensor wire to the sensor pad.
Before fixing the bottom to the cube its a good idea to do some testing to make sure everything is working as expected.
If everything is working as expected then the final step is to stick the bottom of the cube into place. I normally use silicone sealant for this as again it holds well but can be removed if needed.
Plug in and enjoy
Step 8: Other Options & Final Thoughts
I during the time this has been evolving I have come up with a few variations. One of which is a wooden base with an acrylic cube on the top. The other is a wooden frame with he LEDs at the back and also a long version using LED tape. I’m also currently working on a clock using a similar design.
They say hind sight is always 2020 and there are a few thing that I might do differently if I decide to go for MkIII
The first of which is changing to 0805 passives. 0603s are fine but there is enough space for the slighter bigger components and they are a little easier to rework if needed.
I was also thinking about adding an extra LED for some visual feedback as to the state of the sensor. The MTCH101 is capable of sinking up to 20 mA so a led with a high ish value resistor wouldn’t be a problem connected directly to pin 4 of the chip.
I think I would also add some pads to the other rings of the PCB so they could be used for other projects if cut off. And also some pads for using the PCB with external LED strips or rings.
I hope you have enjoyed this intractable.
Participated in the
Indoor Lighting Contest