My work recently hosted an internal 24 hour hackathon, and since my wife and I had been wanting to make our own art to put in our 8 and a half month old's room, we decided this would be a great opportunity to actually complete the project rather than having the painted canvas continue to taunt us for a few more months.
Step 1: Getting the Painting Done - Materials
We already had the painting done before we knew the hackathon was going to take place so we (well, my wife who actually knows what she's doing) gave me a list of instructions for what you would need to do to make a painting.
Before you ever begin painting though, you need to think long and hard about what you want to paint. We personally decided on a night sky.
Here are the the list of materials that you will need:
- Acrylic paints
- Wash cloth
- And time for lots of trial and error
Step 2: Getting the Painting Done - Painting Portion
To actually paint the night sky, this is what my wife ended up doing:
- Dark blue and shades of black were sponged onto a wet canvas with a washcloth
- Once you are happy with how dark it is, let it dry and add color,
- Colors were diluted with water and then sponged onto the dark background with a washcloth
- Once the color is dry, mix several near white shades and add stars with a toothpick
Step 3: But Doesn't the Night Sky Twinkle?
Step 4: Adding LED Lights to Your Painting
It certainly does twinkle some (or at least ours will). To do this we did the following.
- Pick out small LEDs in the colors you want (we chose white)
- Carefully poke holes on the backside of the painted canvas just large enough for the LEDs
Step 5: Making the LEDs Actually Twinkle
LEDs tend to not blink on their own, so I used a Fubarino Mini as my microcontroller, because it was a nice, small form factor with 5 PWM outputs that I could easily take advantage of to achieve a glowing effect.
Step 6: The Software Code
I took advantage of the 5 PWM pins (0, 4, 7, 8, 9) on the Fubarino Mini and used MPIDE to have them all slowly transition from on to off and then off to on, but with each pin offset from one another so that they were not all twinkling in unison. The code I used is available at the bottom of this step.
Step 7: Too Bright?
If the LEDs are too bright for your taste, use resistors to make them dimmer! I used 10 kOhm resistors and 4.7 kOhm resistors (for the PWM lines that were supporting two LEDs simultaneously).
Step 8: Getting the Circuit Together
I soldered the LEDs on to the appropriate pins on the Fubarino Mini, and then made my ground network to connect all of the cathodes of the LEDs together and connected a 9V battery with a swithch to control when the power was flowing to the circuit.
Step 9: Mounting Everything to the Canvas
The wooden frame on the edge of the canvas let us nail mounts to the backside of the frame so that we can hang it on a wall as well as be able to easily secure the battery in place (as shown in the previous step).
Step 10: And You're Done!
We finally got it completed in the allotted time for the hackathon, so we were pretty pleased with ourselves. Kiernan is pretty happy too.