Introduction: Mary Had a Little Arduino

This project will assemble a collection of LEDs that will flash to represent the notes C, D, E, and G for the song Mary Had a Little Lamb.

Things you will need

  1. An Arduino Uno board
  2. A bread board
  3. 15 jumper wires
  4. 6 resistors
  5. 4 LEDs of a color of your choice
  6. 2 small buttons

Step 1: Attach an LED

  1. Attach one LED using a jumper wire and a resistor. Remember that the resistor goes on the longer end of the LED. View the image for a reference.
  2. Next, attach the jumper wire to the ground on the bread board
  3. Lastly, attach the resistor to slot number 11 on your Arduino

Step 2: Add the Other Three

  1. Using the first step as a reference, attach the other three LEDs in a similar fashion. The placement does not matter too much as long as they are not on the same number of the same side. Mine are staggered the way they would be on sheet music.
  2. Make sure that all the jumper wires are attached to the ground on the bread board
  3. Now attach the LEDs of 2, 3, and 4 to slots 10, 9, and 7 respectively. I left slot 8 out in case you want to add another pin to represent the F key

Step 3: The Buttons

  1. Attach a button to the bread board along the bridge to split the signal.
  2. Next, attach a jumper wire to one lead on one side of the button, and then to the hot rail of the bread board
  3. After that, we need to attach a resistor to the other lead on the same side of the button, and then to the cold rail
  4. Finally, we need to attach the same lead but on the other side of the bread board to slot 6 on the Arduino

Step 4: Add the Other Button

Repeat the previous step to attach another button to slot 5 on the Arduino

Step 5: The Ground Wire

  1. Attach one wire from the ground rail in the bread board to the ground slot on the Arduino
    1. In the image, it is the bottom most wire.

Step 6: Connect the Two Ground Rails

  1. If you followed what I did and had the resistors on the buttons lead to the ground rail on the other side of the bread board, you will need to connect the two rails or connect both rails to individual ground slots on the Arduino. I went ahead and connected the two.

Step 7: The Final Wire

  1. And finally, we attach a jumper wire from the hot rail to the 5v slot on the Arduino. Since there is a cluster of blue wires in the diagram, I went ahead and made this wire red so you can see it better.

Step 8: The Code

All that's left to do is run the code I have provided

Attachments

Step 9: Important Information

The way the code is set up, slot number 5 corresponds to a test button to test if your LEDs are working and slot number 6 on the Arduino does an auto play of Mary Had a Little Lamb