Saturday, February 15, 2014

A Valentine's Day Surprise

Update: Source code and hardware files can be found on this github page.

Last week I had the idea to create a last-minute valentine's day gift for my girlfriend. I had a bunch of WS2812 LEDs from my previous endeavors and decided to make a big LED heart. These are a great choice because of the very minimal amount of components necessary: no I/O expanders, driving transistors or ICs necessary. Plus you just need one I/O line from your microcontroller to drive them.

Since they run off 5V, I planned to create a board that is powered from a wall-wart power supply. That way the board doesn't even need a voltage regulator on it. I chose to use an ATMega48 because I have several from previous projects.

First was deciding on the placement of the LEDs. Being a bit OCD I wanted them spaced out in some organized fashion. Wolfram Math World has a post with some parametric and polar equations that plot out different heart shapes. I plotted three concentric hearts in excel and played around with some scaling factors and how I wanted them spaced out.

Now I had the coordinates for each LED so it was easy enough to load these into Altium Designer.

After a night of PCB layout I had a decent enough layout:

I used a big copper pour on the top layer for 5V, and a ground place on the bottom. In hindsight I really should have increased the spacing between the 5V pour and the other traces (that was a pain in the butt to clean up!)

But I wasn't finished! There's so much empty board space on the back! Surely it would be cool to have a cool design etched into the bottom copper layer.

Now, I'm no artist, but after messing around with a few inkscape tutorials I was able to whip up a pretty cool looking design with her name that I think looks nice.

Getting this into Altium Designer was a bit of a pain, but eventually I succeeded! I wish I could have made the design a bit bigger, but that would cut the ground connection to some of the LEDs.


I sent out the order to Advanced Circuit's bare bones service (no silk-screen nor soldermask, 1-day turn) on Sunday evening. It shipped on Tuesday and by Thursday it was in my hands! Pretty sweet!

After a few hours of soldering all the components were on the board. Then after a significantly longer time, plenty of cursing, and slightly burnt fingers later, all the short-circuits were cleared up and the board was ready to go. Note to self - don't wait until you're done soldering to start checking your connections. Boy was it fun to try to figure out what could be shorting on a board with dozens of components on a copper plane...

After the whole rush for trying to make it for Valentine's day, my girlfriend didn't even have time to see this weekend because she's traveling for vacation. Oh well, I will have more time to polish it up with more animations and a frame of some sort.

More to come!


  1. Nice project! Can you share the PCB and code?

    1. This comment has been removed by the author.

    2. Thank you very much! I was thinking of doing something like this to my wife on brazillian valentines day (June 12), but i was a bit lost about the animations. She will probably receive it only on christmas LOL

  2. Hi Henry.
    I'd like to have a look at your code, but it seems that the link to your google drive above is restricted.
    Would you please share the link again, or allow access in some way?

    Thanks in advance & nice project / LED effects.

    1. Hi David,
      The source code/hardware files are now on this github page:
      Let me know if you have any issues with the files.