I had a plan!
I would prove to my wife that buying all this 3D printing stuff and kit boards had something for her in it! And in the process, hopefully get my family interested in electronics.
Oh yeah, romantic brownie points are good too.
The first draft of this had me using an Arduino instead of a generic LED controller because I had big plans. I figured I would 3D print a square vase, buy a nice box from somewhere slightly bigger than the vase, and then have the whole show happen when she lifted up the box. I planned on printing a housing for the Arduino on the side of the vase, along with either a light sensor, or better yet, a switch. I figured the light sensor wouldn't work too well in a romantic, dimly lit room. She opens the box, the lights turn a nice hue, music starts playing, and the beautiful rose light show begins!
I had a devil of a time getting my Arduino to connect to my wifi, nevermind the rest of my IOT kit. Like many other software projects, I started to cut features to ensure I had a nice product. It's always better to deliver less, but higher quality features, than deliver a mess that supposedly satisfies all the checkboxes.
I was comfortable with the Ender 3 and Cura software at this point. I highly, highly recommend them and Chep's Profiles make high quality printing easy. I also added an SKR E3 Mini board to my kit and Teaching Tech's videos are great. The truth is that you could really use any 3D printer and slicer you're comfortable with.
The decision you have to make is what sort of material to use. I first used "natural" (undyed) PLA because I wanted the LEDs to provide the brightness and color. White will also work but you'll have to push the LEDs harder to get the light through them. When you print the flowers, counterintuitively, you want taller layers. Each layer is going to be an occlusion for the light and block a little bit of it. I found that using the "standard" print quality settings, the light went further than using the fine setting. I later decided I didn't like how natural looked milky when it was printed and reprinted everything in white. When in doubt, print one test flower and try it.
Google up some flowers, and remember to pick ones with a flat bottom. I linked the two models I used in the manifest. Vertical flowers work better than short, horizontal flowers. The light isn't going to be able to easily spread out with wide, short flowers. The one file I used is a rose with a stem. We can fix this by setting a negative Z offset in cura, which will give us a thin floor also to help the light shine though!
I know we all like to 3D print everything because of how cool it is but consider that a vase, printed in vase mode, is very thin and not rigid at all. It's probably going to leak, or at least print with holes. You could skip the vase entirely, and just get flowers that come with a vase. This will ensure there's no leaking surprises later, and your electronics won't be at risk. You could also 3D print a vase but do not enable vase-mode so it has walls. Most slicers default to 3 walls, so it'll have three layers of protection. Just give it a thought before choosing to print one.
I found this guide was great because it included video of what each bit of code did. It was an excellent starting point for figuring out how I wanted to control the light show and it used either NeoPixel or FastLED. You want FastLED, it's faster and smaller and it's just better code as it supports all the Arduinos. Mock it up before cutting anything, it's a lot easier to get all the code stuff correct when not fighting the soldering stuff at the same time. In my case, I had a female connector on the LED strip with nice soldering, so I used male-to-male jumper wires. The only part which was a bit of trial and error was that different effects took different time to run, so "10 seconds" was a relative amount of executions to the code. The LED strip will only update once per invocation of the method controlling the strip, so if there's a bunch of instructions to create an effect, the loop gets longer and longer the more complex the effect. What it boils down to is the iterator is simply going to be trial and error to get the "intro loop" the right amount of time.
This also means switching the effect with a button or whatever will add delay to the effects loop as it polls the pin. It's not much, but I decided against having a switch somewhere to change the effect because I didn't want the added complexity in the code and potentially mess up the timing of the effects. All in all from a usability standpoint, I settled on three effects I thought would look cool and picked one. I left the other two commented out.
The code executed:
- 10 seconds of really bright sparkling - this is to give her plenty of time to lift the box
- A infinite loop of whatever effect I choose. I chose to make all the flowers yellow and randomly have one sparkle bright white every now and again.
Other effects in there are a yellow firefly effect for more flowers. With more flowers, it looks like a firefly is inside the flower, lights up, and then fades out. The flowers will light sequentially. This code is based on the meteor code.
The other effect is to pick two flowers, light them up yellow, and then fade them out. This would be really cool to combine with a touch sensor, but given that the flowers are organic, I was worried a touch sensor would always register as "touched". Its still a nice effect even without the touch sensor for each flower and it's based on the Halloween Eyes example.
If you really don't want to hack much on the code, there's also a NeoPixel code generator with some basic effects I played with. I wanted more flexibility than these utilities provided. The WS2812FX library is also a great place to look for effects.
There's a pin map in the comments since I always forget what goes where.
I pretty much hate LED strips. I bought the one with the clear glue on top, and the 3M tape on the bottom. The 3M tape resists hot glue, and the glue on the top will peel the surface mount resistor off the LED strip.
Additionally one LED was DOA after soldering it, but I figure I dragged the iron across the LED. Oops. One LED would turn purple if I cycled it quickly (but it looked cool, so that went in the center). I only figured out the purple LED after I glued it to the PLA rose and I had burned my fingers enough tonight I said to hell with it. I wish I had powered up the strip first to identify the bad LEDs.
The LED strip was cut into single LED segments and I bought tons of extra pin wire to build wiring harnesses. One side was male, one side was female, and it let me add or remove roses. I had to recompile the code of course when I did but it was far easier than building it and cutting it. This also meant if I wanted all the small flowers on the outside, I could re-arrange the strand how I wanted.
Then to create the "wiring harness", I simply ran some hot glue down the sides of the connectors.
At this point I wanted to test how it looked!
So a few things to call out - plug the project in and just show a generic light demo. This will let you know if all your connections are good and if you have any fragile solder joints.
When you glue on the flowers, run the glue over the solder joints as it will help them stay attached.
Press the LED firmly into the bottom of the flower to make sure it's got good contact.
If you're going to mix the flowers with real flowers, you must ensure that none of them get wet. This project isn't waterproof, unless you make it waterproof!
Finally, use flexible straws to hold the flowers. They won't really bear the weight of the flowers but rather let you position your flowers (and wires) in the bouquet. You could also easily use pipe cleaners, or sticks.