Projet PROTY : Boîte À Musique

by ines_et_maude in Circuits > Arduino

213 Views, 0 Favorites, 0 Comments

Projet PROTY : Boîte À Musique

Capture d’écran 2023-01-25 à 10.17.24.png

This project was realized in the framework of the Rapid Prototyping module at the Ecole des PontsParistech, by Maude Zerhouni and Inès Vanlaeys. The goal was to create an object with no particular use, reacting to its environment. We chose to create a music box, which plays a particular melody according to the parameters of our body.

Supplies

The music box was made with laser cutting. We used 3mm MDF for the box, and 1mm MDF for the finition.

For the electrical structure, we used:

  • an Arduino Uno board
  • a Breadboard
  • a humidity and temperature sensor DTH22 ( example here )
  • a pulse sensor KY-039 ( example here )
  • a buzzer ( example here )

Write the Code

The code works as follow:


  • We introduce all the needed notes with their frequencies, as well as the songs which are lists of notes. We then write a function who allows the buzzer to play the required note. In facts, the buzzer only plays two tones: HIGH and LOW. Each note can be obtained with a special combination of these HIGH and LOW tones, thanks to the given frequency of the note.


  • The main loop is constituted of a "if" condition:
  • If the hand is dry (<30% moisture):

- If the pulse is low, Little Santa Claus

- If the pulse is high, Jingle Bells

  • If the hand is neither dry nor wet (30%-40% humidity):

- If the pulse is low, Mario Bros Main Theme

- If the pulse is high, Mario Bros Underwater Theme

  • If the hand is wet (>40% moisture):

- If the pulse is low, Pirate of the Caribbean

- If the pulse is high, Indiana Jones



If you want to take a look, here is the full code. Feel free to modify and improve it.

Electrical Assembly

boite_pleine 11.41.48.png
ProjetProty_fritzing2_bb.png
Capture d&rsquo;écran 2023-01-25 à 10.07.47.png

If you want to recreate the project, here is the Fritzing of the electrical assembly.

Design and Cute Out the Music Box

Capture d&rsquo;écran 2023-01-25 à 14.22.43.png
Capture d&rsquo;écran 2023-01-25 à 14.40.06.png
Capture d&rsquo;écran 2023-01-25 à 14.41.51.png
Capture d&rsquo;écran 2023-01-25 à 14.46.03.png

We used Catia to design the box. The small details not to be forgotten are the two holes on the upper side for the sensors, and the hole for the cable that connects the Uno card to the computer. Two 1.1mm thick thin rails are dug to hold two 1mm MDF rails, in order to install the breadbord.

Then, we printed the box with laser. You can find here the .dxf of each side of the box:

Assemble Everything

boite_interieur.png

The pieces should fit perfectly together. Insert the breadboard in the box and wedge the part in the thin rails. Let the buzzer inside, and let the sensors out.

Congratulation !

Capture d&rsquo;écran 2023-01-25 à 10.19.39.png
Capture d&rsquo;écran 2023-01-25 à 10.19.56.png

You can now evaluate anyone's heartbeat and hands humidity by listening to some groovy music!