Table of contents

Abstract
Battery-powered Christmas tune box for decorations and Christmas Trees!
Project
Introduction
Last year I bought a Solar-Powered Christmas light set. It works great with my small Christmas tree as I normally place it near my apartment window and its solar cell gets enough juice to stay blinking all night.
But there's a problem with it. Hear if for yourselves:
That's right. There's no music. These lights have no Christmas jingle in them. So I decided to fix it!
The Basics
So I decided to use an Arduino to produce tones for the music. The tone() tutorial covers how this work, even when their example code is rather lacking.
The plan would be to program some Christmas Jingles in an Arduino and connect it to a speaker. Very simple.
The Amplifier
As I wanted this to have some decent "volume" I also decided to put together a basic transistor-based amplifier, following this schematic:
The Music
If you check the example code for the tone() function, it's just a list of notes and durations, so part of my work was going to be converting some Christmas Jingles to a list of notes and durations. In the process I made some improvements to the code, notably around the pauses, array sizing, and placement of the tune-playing code, but nothing too revolutionary.
I only had time to port "Jingle Bells", but I'll try to do more for next Christmas. This was already enough to make my tree feel more alive. But for all intents and purposes the code with the notes and everything is here:
Putting it all together
So I put the Arduino, a 18650 battery, a 3V-to-5V DC booster, a switch, my small amplifier board and a speaker inside a project box:
The Result
And when put together under the tree, it looks like this:
I'm really happy with the result. I didn't have time to add more music (was trying to find the time to do that before posting the project but in the end I decided to post it as I had it; with just one song). This was a very fun project to build and I really love the result. It can be used to bring musical joy to other decorations like Christmas villages or desk trees, but in my case, it definitely helped my small and humble tree feel more alive!
References
Arduino Tone Tutorial: https://docs.arduino.cc/built-in-examples/digital/toneMelody