Introduction: Valentine's Day Electronic Card

Picture of Valentine's Day Electronic Card
I don't have anyone special to give a card to this valentine's day, but that doesn't mean I can't enjoy the merriment. I like themed creating, and holidays always allow you to get creative in the way you enjoy them. 

This year for Valentine's Day, I made a PCB card in the shape of a heart (in case you couldn't tell). It flashes 12 SMD red LEDs using charlieplexing with a ATtiny13a, running off a single CR2032 coin cell battery.

I made this card entirely in 4 hours. That includes coming up with the schematic, drawing, cutting, and etching the board, soldering all the components on, developing the program, programming the microcontroller, and debugging. Fun quick day project!

The original plan was to use the slightly larger attiny85 (it has more memory so you can write a larger function). But for some reason my programmer really didn't like that attiny85, so I reluctantly switched to the 13. With that, I had to truncate some code. ALthough the code wasn't fully developed at that point, so it just meant that I didn't finish writing it. The only thing that I am sad that I left out was the cosine wave function thingy that i started writing. So instead, there are just a few patterns it shows. Also, for some reason that I just can't figure out today, I couldn't get the button to work correctly. So ignore the button.

Here's a video of the card in action

Step 1: Materials

Picture of Materials
Materials needed:
  • 6"x6" PCB (FR4 board, 1-sided)
  • dremmel or bandsaw to cut the pcb
  • soldering iron + solder
  • 4 SMD 100 ohm resistors (make it easy by using 1206!)
  • 1 SMD 10 kohm resistor
  • 12 red SMD LEDs (order extra in case they burn out or something)
  • ATtiny13a or similar microcontroller
  • 8 socket IC holder
  • Coin cell
  • Coin cell holder
  • Black Sharpie to draw PCB (unless you have access to fancier equipment, mine is broken for now)
  • switch (SMD) (any size, aim for maybe 4~6 mm)
  • 1 cm wire (I hope thats not too much!) for a single jumper
  • etching chemicals
    • hydrogen peroxide (drug-store quality is perfect)
    • muriatic acid (HCl) (you can buy this at most hardware stores)
    • a pyrex or glass mixing bowl that you are ok never using again

Step 2: Schematic

Picture of Schematic

The schematic follows a 4 pin charlieplexing scheme. The simple form of the charlieplexing circuit is shown in the upper right of the second picture. 

The last picture is an uglier version (the first draft) of the circuit I used on the board. It is sorta in the shape it is supposed to be in. It is assumed the LEDs all have their cathode going to the left (counterclockwise).

The first picture is the overall full schematic of the circuit exactly as I made  the card. It can be a bit confusing at first to understand where the wires are going since they are tucked into the edge of the board. It may be easier to first understand the last picture before looking at this cleaned version.

If you need help understanding the circuit, feel free to contact me.

D1-12 are the LEDs with cathode (-) pointing left (counterclockwise).
R1 are the 100 ohm resistors
R2 is the 10,000 ohm resistor
the coin cell holder is that chunk on the right
s1 is the switch which hops over the ground line.
the ATtiny is in the upper left

the 1's, 2's, 3's, and 4's in red around the picture correspond to the portb pin number of the microcontroller (note B0 is for the switch)

Step 3: Cut the PCB

Picture of Cut the PCB

For this step, first draw out the form of the heart to cut along. You will need a Dremel or vertical bandsaw.

I think you can figure out how to go from a cutting pattern to a cut out object....

If you want help with the pattern, I have attached the drawing I used as the template.

Step 4: PCB Etching

Picture of PCB Etching

There are plenty of other fantastic instructables about the actual process for etching a PCB. I will give a quick recap:

First you will need to apply the masking layer, in this case that is sharpie. Simply draw with a sharpie wherever you don't want the FR4 PCB blank to lose its copper plating. After etching you can simply wipe off the sharpie with acetone.

In your pyrex bowl mix 1 part HCl to 2 parts H2O2.

Put the PCB in the solution. You can stir to help the reaction proceed. I suggest either using a stir plate or just slowly rocking the dish. The etching process takes about 15-20 minutes.

Pull your PCB out, wash off with water, dry with a paper towel. Then wipe off the sharpie with an acetone-soaked paper towel. 

Congrats! you have a shiny new circuit board.


Step 5: Solder

Picture of Solder

The soldering is pretty straightforward  If you are unfamiliar with SMD electronics, this is a pretty good place to start since the parts are well spaced out and fairly large. 

Compare the schematic with the picture if you need help figuring out where things go.

I will make one last note about the pcb:  I like to make a solder trace along all the copper wires so that there is no chance of them chipping away with wear or anything. It isn't necessary, but I like it. It also looks nicer in my opinion.

Step 6: Programming

Picture of Programming

The code is included in the file attached to this step.

A lot of parts are commented out, feel free to put them back in. They may need some tweaking to get working.

I also included the entire Atmel Studios project folder. If you scroll through into the Debug folder, you can find the hex file to program the card.

I used avrdude to program the cube with a usbtinyisp avr programmer that I got from adafruit. The command prompt to execute this is shown in the picture.

Step 7: Finished Card

Picture of Finished Card
Shiny! we got ourselves a new valentines day gift. Color it up if you want, do whatever with it.

Again, here is a quick video of the card.

Comments

sm14570 made it! (author)2017-01-20

My dad helped me make it for my teacher!

saraj53 (author)2017-01-19

love that

http://14thfebvalentineday2017.blogspot.com/

mohammeda237 (author)2016-02-15

Love <3

JackANDJude (author)2014-06-30

This looks like a fun introduction to SMD soldering.

zwebber1 (author)2014-01-27

Trying to make it but cannot find the code for the programming step?

Onyx Ibex (author)zwebber12014-01-27

The code is attached to step 6. See it?

cgrrty (author)2013-12-06


Very beautiful

cgrrty (author)2013-12-06


Very beautiful

shelley echtle (author)2013-08-24

This is amazing but for a bubble head, I couldn't do it. Thanks for sharing on here, tho.

HavocRC (author)2013-02-15

How much solder did that take?

Onyx Ibex (author)HavocRC2013-02-16

not much, you apply as little as possible to cover the traces. Its just to prevent them from wearing off. And it assures good connections in all the traces. It is optional btw. I don't really pay attention to linear inches of solder used though.

techtheaterballoon (author)2013-01-30

Where did you get your pcb?

I make them. I buy square FR4 (copper clad fliberglass boards) blanks and etch and cut them myself. I buy the blanks from Tayda electronics.

frenzy (author)2013-01-30

very cool!

techtheaterballoon (author)2013-01-30

This is very cool!

atepinkrose (author)2013-01-30

This is too cute!

out-of-the-box (author)2013-01-30

did you enter this in the valentines day coontest? if not you totally should!!

scoochmaroo (author)2013-01-30

I love it!

hemalchevli (author)2013-01-30

Great Work!!

About This Instructable

22,454views

188favorites

License:

More by Onyx Ibex:3D Printed Heng LampLucina / Chrom Sword (3D Printed)Illuminated Rocker Switch Voltage Conversion
Add instructable to: