3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Blinking, Singing, Marioman

Blinking, Singing, Marioman
Use an attiny13a, two LEDs and a greeting card speaker to create a blinking Marioman that plays the Super Mario Brothers theme song.

This can be an easy low-cost project for anyone who is looking for a fun way to break into AVR programming!


The notes of the songs are generated by a square wave outputted on a single pin of the AVR microcontroller. The LEDs that alternate on each note are connected to 2 pins each of the same chip.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Materials and Contruction

Materials and Contruction
  • 1 attiny13a
http://www.mouser.com/Search/ProductDetail.aspx?qs=sGAEpiMZZMvu0Nwh4cA1wRKJzS2Lmyk%252bEP0e%2f7dEeq0%3d
Cost: $1.40

  • 2 LEDs - any LEDs will do
  • 1 lithium coin cell battery
http://www.sparkfun.com/commerce/product_info.php?products_id=338
Cost: $2.00

  • 1 coin cell holder
http://www.sparkfun.com/commerce/product_info.php?products_id=8822
Cost: $1.25

  • 1 small speaker from a musical greeting card

Total cost of materials ~ $5

The two LEDs were attached directly to two pins each of the attiny13A.
Two pins are used for each LED, the second pin is set low to use as a ground connection.

The current limit of the I/O pins on the AVR will prevent the LEDs from drawing too much so a resistor is not necessary to connect in series.

The speaker used is typical of one found in a musical greeting card, any small speaker will do, given that this is outputting a square wave tone, it's not too important to worry about driving the speaker or sound quality.
« Previous StepDownload PDFView All StepsNext Step »
5 comments
Sep 7, 2009. 7:32 PMgeeklord says:
Made one a little earlier today, and its pretty sweet. Just wondering, how on earth did you get all those numbers for the frequency, length, and delay arrays?? That would have taken me forever, even with sheet music or something.
Jul 30, 2009. 7:52 AMgeeklord says:
Any links for where I can get one of the little mushrooms?
Aug 10, 2009. 7:34 AMgeeklord says:
O, sweet i could get that. thx
May 19, 2009. 4:16 AMthekanester says:
Really liking this minimal circuit. It makes working with the arduino look positively bloaty! Great work!

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
2
Followers
3
Author:jarv34