Christmas Tunes and Light Show with Arduino

I programmed 5 Christmas tunes in Arduino, and also made a synchronized light show with some special effects! It plays the following tunes in sequence after each key press:

  • Jingle Bells
  • The First Noel
  • O Holy Night
  • We Three Kings
  • What Child is This

Merry Christmas!

Here is the source code if you are interested:  https://github.com/rmadhuram/ArduinoChristmasTunes

Schematic:

Parts List

I used these components from the OSEPP ARD-101 “Arduino Basics” kit I picked up at Frys.

  • Arduino Uno R3
  • R1: 10 K ohms
  • R2 – R6: 330 ohms
  • LED1, LED5: white, LED2, LED4: green, LED3: red
  • J1: Piezzo Buzzer
  • S1: Switch

How it Works

Hardware

The hardware setup is very simple. Lines D3-D7 drives LEDs. D8 drives the Piezzo Buzzer. A switch is connected to D2. We connect resistors before LEDs to limit the current and prevent them from frying.

Software

Source: https://github.com/rmadhuram/ArduinoChristmasTunes/blob/master/christmas_tunes/christmas_tunes.ino

function loop()

There are two modes of operation, continuous and button press mode. If we set it to continuous mode, it keeps cycling through all the tunes automatically. The global variable continuousMode should be set to 1 for it to operate on the continuous mode.  If it is in button press mode, and we detect a key press, we play the current tune.

function playTune()

We have a global variable toneNum that keeps track of the tune being played. It cycles through 0 to 4. There are also 4 light effects available. We select a random light effect and play it before and after the tune.

– UNDER CONSTRUCTION –

4 Responses

  1. Simple Christmas tune and light show with Arduino « freetronicsblog

    [...] the circuit schematic, notes and Arduino sketch visit Rajkumar’s website. And for more, we’re on twitter and Google+, so follow [...]

  2. Martin
    Martin December 23, 2012 at 11:58 am |

    Cool project you made! I have ported it to an Attiny85 as a tiny standalone project. I needed to rewrite the program a bit due to the limitations of the attiny85.

    One question: Which tool did you use to encode the sheet music into note values and durations? And do you have more tunes already encoded?

  3. gordo
    gordo September 25, 2014 at 6:50 am |

    Hi, I built a pcb with atmega328p-pu to run as a standalone for this sketch you made and I followed the schematic you provided, thank you!!
    I am having crashing after the second or third song and pressing the reset does not help. I think it is the size because when I upload it I get a warning about the size may cause instability. It never crashes at the same spot and I have exceeded the limit of my abilities to troubleshoot the problem and was hoping you might give me some ideas as to what the problem might be. The board I made is a simple arduino with 16mhz crystal and the 2 22pf caps to gnd. The only difference in my schematic is the color of the leds and the size of the resistors which I used a resistor calculator to determine. It is a brilliant piece of work and I had hoped to make a few of the boards to give away for Christmas tree decorations but now I’m stuck on this. I also tried to upload the sketch without the bootloader using a usbasp but I couldn’t get it to work. Thanks for any help

Leave a Reply