Musical greeting card with minimal parts

We’re all familiar with those musical greeting cards. Give the Hallmark store $10, and you have a card with a microcontroller inside that plays one of several songs available. [Jarv] was playing around with translating MIDI tracks to square wave songs with an Arduino earlier, so he decided to see how cheaply he could reproduce these musical cards. The resulting build allows him to put any song he wants in his card and costs less than the Hallmark offering.

The circuit is extremely minimal – just an ATtiny 85, a battery holder, and two piezo speakers for two-voice harmony. After soldering up the battery and speakers, [Jarv] needed a way to get music on his chip. For this, he used MuseScore, a music notation program that allows [Jarv] to merge multiple voices together.

Once the sheet music was cleaned up, [Jarv] used his XML2H Python script that takes MIDI data and spits out frequencies and delays. In the end, [Jarv] spent less than $5 on his greeting card – almost cheap enough to start thinking about musical throwies to complement the batteries, LEDs and magnets on our window flashing.

Check out the video after the break to hear [Jarv]‘s circuit play the theme from Toy Story.


  1. third says:

    Front page post with minimal text.

    Also: ATTiny hacks ftw

  2. Sprite_tm says:

    Nice, but why the two speakers? Just connecting the 2 PWM-outputs together with a couple of 100 ohm resistors oughtta give the same result, with just one speaker.

  3. t&p says:

    sounds like the music is out of sync or something

  4. john says:

    I also have some examples of converting midi to audio tones here using the three timers of the Arduino, with the outputs mixed on a single speaker –

  5. Hirudinea says:

    This could be used to hack musical cards ala the Barbie Liberation Front

    What could be better than a “Congratulations on your wedding card” that played Highway to Hell!

  6. RicoElectrico says:

    I think you don’t even need resistors to make 2-voice polyphony – just hook up negative piezo terminal to one uC pin and positive to another.
    Excluding DC (which isn’t conducted by piezo) 2- voice polyphony signal has 3 levels (0, +, -) – checked this in Audacity. Plus, you can make two signals in antiphase for louder monophonic sound (not sure, but maybe even louder than 2 independent speakers)

  7. Jim says:

    Funnily I worked the other way round. My local poundshop sells a thingammy which consists of half a dozenb or so small candles, a mini roman candle and one of these (playing happy birthday). You light it in the centre and you get a small table-top fireworks show for about thirty seconds. It’s the cheapest way I know to get piezos inside a nice little plastic housing if you want to make e.g. you own heartbeat sensor.

  8. qwerty says:

    Very nice. When playing the same tone in both speakers I hear a slight beating between the tones, as if they were slightly out of tune. Is it done on purpose to give sound more warmth or it’s due to some speed limitation of the uC used?

    • john says:

      Yeah you aren’t hearing things though my ear may be less sensitive to it. dealing with the limitations of a chip that’s not designed for this sort of thing :/ It has to do with choosing two different pre-scalers (a scaling factor for the timer) for the two parts.

      one part is using “256” the other is using “64”, It’s a tradeoff between precise pitch between note intervals and having a larger dynamic range. If I brought the two parts closer together in range then it wouldn’t matter as much.

  9. j s says:

    You can order chips from Integral in Belarus custom-made with any tune you want. They sound pretty much like this.

    • Austin says:

      how do I find these chips? I really want to make a card for my girlfriend but I’m not really very technologically inclined and I can’t really follow what everyone is saying here. I would pay anywhere from 15-20 dollars for a card tho…

  10. Bill says:

    I sure would love to find a piezo speaker in any source listed over the past 4 years. I recently looked inside the fold of all the Hallmark talkers and found mini-paper speakers and other mini- magneto speakers and NO piezo speakers. I haven’t found the cheap alarms for traveler protection that some DIYers…

    But enough about me ;) Can anyone tell of a reliable source for piezo speakers that won’t cost an arm and a leg? Even alibaba shows about 30% of its pictured stock under the term “piezo” actually magenetic mini speakers and most of any listed item requires 1000 piece orders.

    Hallmark and American Greetings (Innovation) are NOT piezo talkers…


  11. Ed Davin says:

    I actually own a company that sells the sound modules (or music chips / voice chips) used to make your own greeting cards. It’s pretty simple to record or program your own modules. I even made some videos showing how this is done. Here are some links showing how this is done, how to make your own musical greeting cards, and how to purchase. We even put lcd video screens as well as webkeys and NFC tags (near field communication, rfid) in greeting cards, brochures, and invitations and sales folders as well.

    DIY musical sound modules and voice chips, blank recordable greeting cards, usb programmamble sound, music box (light sensor), user programmable motion sensor sound boxes. Mainly for education, crafts, scrapbooking, and hobbies.

    Prerecorded sound modules, and video lcd screens (with a sound or video you provide) and custom printed cards and invitations. Mainly for events (personal or business), and marketing purposes.

    Please share your thoughts as we are trying to expand our business.

    – Edgar Davin

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 96,711 other followers