Inspired by the glowing hearts that you may see in the windowsill as you stroll through the city, I decided to take my own shot at designing a fully customizable window heart.
- Arduino Micro
- Flexible Silicone Neon-like Skinny NeoPixel LED Strip
- 9V 36W Barrel Jack Power Supply
- 5V 3A Step Down Buck Converter
- 1000µF Capacitor
- 470Ω Resistors
- Barrel Jack 2-terminal adaptor
- Jumper wires
- Push buttons
- PLA Filament
- 3D Printer
- Superglue
First, I had to create a heart in which to mount the LED strip. Using Fusion 360, I designed a heart with a suitably designed channel cut through it such that you can mount the strip so snugly that glue is not required. I had to be careful to make sure the dip in the heart would not bend the strip so hard that it would break, and I had to make sure that the perimeter of the heart was sized perfectly so that both ends of the LED strip would be invisible in the base of the heart.
Next, I had to design the base and its cover. I had hoped that the little clips I designed for the plate to cover up the bottom would hold, but they immediately snapped off after printing -- it's okay though, they double as ventilation for the Arduino! I made it with two holes at the front for buttons, a hole at the back for the barrel jack, and three rectangluar holes at the top -- two for fitting the ends of the LED strip through, and the other for an insert I made to help support the heart and keep it from snapping off the base. The base, the cover for the base, and the insert are all shown below.
Finally, the heart section was too large to fit onto the printbed of my Ender V2 printer, so I sliced it up into four suitable chunks, and then superglued all the pieces together. If I were to do this again, I would slice it so that the glue joints are not on peak areas of stress -- for example, the LED strip wants to rip the pointy bit in the middle of the heart apart, since its flexed there. I would rotate all of the cut points about 45 degrees in a circle on a second attempt. In the photo below, there are two gaps at the side joints -- I fixed that later, by re-printing those pieces. I messed up when I put them in my STL slicer, and cut off a little bit -- the CAD models themselves were fine.
Then, I superglued the base on, put the LED strip in, and got this!
Next, I had to figure out the circuit. I knew I wanted two buttons -- one for changing light modes, another for changing the color within said modes. This is also a gift for my girlfriend, and I want to Rick-Roll her every time she plugs it in. So, I added a piezo electric speaker and I have it play Never Gonna Give You Up every time it boots. A rudimentary diagram of the circuit came out as such:
I wired this up without the buttons and uploaded some example code from Adafruit. Look, mom, it lights up!
I then mounted it into the heart.
I knew that I wanted to program this as an FSM. I have 6 main states/modes:
- Startup (this rickrolls the user)
- Solid (solid LED colour)
- Pulse (sends a pulse of light around the heart on either side, starting from the middle at the top)
- Breathe (fades the light on and off, as if it were breathing)
- Rainbow Wave (fades a rainbow seamlessly around the led strip)
- Theater Chase (old style lights chasing around in a circle, but rainbow)
Within states 1-4, the user can press the colour button in order to change the colour used by the effect. Within all the states, the user can press the mode button to change the current mode.
My full code is provided in this repository, and I designed the modes myself, with the exception of the rainbow and theater chase -- Adafruit helped with that -- they were too beautiful to leave out. I did however, have to tweak both effects to work for this project and respond to user input.
Everything works, however I broke some buttons trying to assemble it, so I don't have any videos of me switching modes and colours. New ones are in the mail, and I will try to remember to update this when I get them!