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.


26 thoughts on “Musical Greeting Card With Minimal Parts

  1. 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)

  2. 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.

  3. 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?

    1. 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.

    1. 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…

  4. 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…


  5. 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

    1. Hi Ed,

      I just received my order of a half dozen of your light activated sound modules and they work great and it’s 2016 so I guess BigDawgs is going strong, nice work!
      Very easy to set up with some .mp3’s and have been doing some fun experimentation for a product we are working on.

      We are working on an idea and are looking for ways to squeeze as much oomph (volume) out of these modules as possible. Do you offer a higher spec speaker option if we can order a large enough quantity?

      If you have any tricks to get these louder do let me know. Maybe a large wedge of sticky foam with a recess that creates a bit of a speaker cabinet. They seem to be a little louder on a sheet of card and when I peel the speaker off the double sided tape ring and box it from behind it seems a bit louder.

      I am thinking we can get an audio engineer to create an eq filter to adjust our music to get the most out of speaker could also help and clean up sound from any distortions.

      If there is a sound guy at BigDawg that can give me a few tips I’d be very appreciative.


      1. Hi davemodowest,

        First, the best way is to make sure your sound is amplified enough first. If you get an audio engineer they can you “high limiting” and/or “compressing” techniques. The sound modules do not play well frequencies above 16KHz or below 100Hz, so you can reduce these in an EQ.

        Yes experimenting with the position of speaker and creating as much as an acoustic chamber will increase output as well. If you cup your hand behind the speaker you can hear the dramatic difference this makes.

        Larger speakers are also available, but you will have to contact our corporate sales team here:

        — Edgar Davin

        Specializing in SOUND, LED, LCD and NFC devices for gifting, crafts, hobby, scrapbooking, and presentation projects.

      1. I own a company that designs and manufactures musical greeting cards and sound modules. If you want a fully professionally printed invitation with music, we can make a min of 50pcs for $7.10/pc, 100pcs for $6.42/pc. This are the same professional quality (sound and print) as musical greeting cards sold in retail store (like Hallmark, Carlton Cards, etc). You can view more here:

        Or if you like you can just order the modules. We can make professional sounding ones with and MP3 file or WAV file you send us. 50pcs will cost you $3.31 and 100pcs – $3.25, with a 30-50sec sound.

        Or you can buy modules you can record yourself here:

        — Edgar Davin

        Specializing in SOUND, LED, LCD and NFC devices for gifting, crafts, hobby, scrapbooking, and presentation projects.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.