Introduction: Music Lamp W/ Arduino

This is a project me and my partner (Adrián Calvo) made for one of our university courses. The project consists of an Arduino based music box. The music is played through a piezo buzzer, the tones are similar to what we know as 8bit music. The box has three songs, Take on me, Stairway to Heaven and Song of Storms. For each one of the songs the light of the lamp on top of the box will change color. The box also consists of a next and previous buttons and a lcd display, that shows the name and author of the song. But the cherry on the cake is that you can turn on and off the music by clapping your hands, via a microphone in the front of the box. In this Instructable you will be able to find all the steps to replicate this project. We hope you find this useful.

Step 1: Gathering the Materials

For this project you will need:

  1. KY038 sound sensor
  2. LCD screen (we recommend to get one with an I2C module)
  3. Piezo Buzzer
  4. Push Buttons x2
  5. 4x4 Neopixel Matrix (or similar)
  6. 9v Powersource (better if you install a switch on it to turn on and off the main current)
  7. MDF
  8. Superglue
  9. Arduino UNO x2
  10. A LOT of jumper cables (the ammount depends on the user)

Optional: This project can be made with jumper cables, but if you want to solder cables for extra security go right ahead.

Step 2: Coding the Power Arduino (Clap Switch)

The first bit of coding will be concerning the sound sensor, for it to work as a switch when it registers sounds. We will be using it as a digital input on the arduino. You can download the zip file to get the code, or you can guide yourself through the image.

Step 3: Coding the Main Arduino (the Heart of the Box)

This code is long and complicated, thats why we didn´t include an image, so you are encouraged to download. The code uses 3 libraries, so be ready to install them. We include the names of each one on the code comments. The code explanations of the code can be seen as comments inside of if (//).

Step 4: Puting the Circuit Together (Hardware)

The schematic of the whole box can be seen on the image. Be careful when you follow the image and your music box should be running fine. Remember to pay atenttion where nodes exist for each connection. The hardest part of understanding this circuit is the connection between the two arduinos. This is made through an output pin (13 of the Power_Arduino), and the 5v pin of the other Arduino. You also hace to connect a GND pin of the Main_Arduino to a GND pin of the Power_Arduino. Other than that the connections are pretty self explanatory, and you can use both code setups as guides also.

REMEMBER, that the 9v power source should ONLY be connected to the Power_Arduino.

Step 5: Building the Structure

We will give you step by step to create the box that we created, you can decide to create a box like this one or you can make it bigger, it's your choice.

step 1 create the box in inventor with the following: or you can download the document we upload in this page were you will have all the box and just have to cut on the laser.

step 2 when you already have the document, you will need the lines in the box with this specifications (red and 0.01in). step 3 Now you will place the MDF 3mm on the laser. you will need a wood of 30x40 cm. step 4 Cut the document of inventor on the MDF. step 5 Place altogether and built the box with all the components of arduino. (with the document all the faces you should placed all together).

Step 6: Rock on to Your New MUSIC LAMP!

Once you finish gluing the box with all the circuits inside you are ready to enjoy yourself with your new device!

We hope you find this tutorial helpful!