Wood Music Box
Why?
SeaTizen is an ocean protection non-profit organization dedicated to clean the pollution on the ocean. The organization is going to hold a pop-up store in New York City to encourage people to join them and also to make donations. This music box will be a gift from the pop-up store once you made a donation to protect the ocean.
What?
This is a music box once it opened you can hear ocean wave sounds, so the box brings the ocean close to you no matter where you are at. It's ideal to put in your room, and then open it when you feel stressed or before taking a nap.
How?
By opening the box, you can press the bottom inside, and it will play the ocean sound from the mp3 module. If you close the box, the sound will stop.
Laser Cut the Box
1. sketch each part of the box in adobe illustrator
2. purchase plywood
3. Send the AI file to the laser cut machine (takes about 1 hour to cut all pieces)
4. Use wood glue to glue them together
Build the Circuit
Use elements in the Arduino kit to build the circuit by following this instructional chart.
1. button
2. controller board
3. jumper wire
4. breadboard
5. speaker for Arduino + sd micro card (with ocean sound mp3 file in it)
# include "SoftwareSerial.h"
SoftwareSerial mySerial(10, 11); # define Start_Byte 0x7E # define Version_Byte 0xFF # define Command_Length 0x06 # define End_Byte 0xEF # define Acknowledge 0x00 //Returns info with command 0x41 [0x01: info, 0x00: no info]
# define ACTIVATED LOW
int buttonNext = 2; int buttonPause = 3; int buttonPrevious = 4; boolean isPlaying = false;
void setup () {
pinMode(buttonPause, INPUT); digitalWrite(buttonPause,HIGH); pinMode(buttonNext, INPUT); digitalWrite(buttonNext,HIGH); pinMode(buttonPrevious, INPUT); digitalWrite(buttonPrevious,HIGH);
mySerial.begin (9600); delay(1000); playFirst(); isPlaying = true;
}
void loop () {
if (digitalRead(buttonPause) == ACTIVATED) { if(isPlaying) { pause(); isPlaying = false; }else { isPlaying = true; play(); } }
if (digitalRead(buttonNext) == ACTIVATED) { if(isPlaying) { playNext(); } }
if (digitalRead(buttonPrevious) == ACTIVATED) { if(isPlaying) { playPrevious(); } } }
void playFirst() { execute_CMD(0x3F, 0, 0); delay(500); setVolume(20); delay(500); execute_CMD(0x11,0,1); delay(500); }
void pause() { execute_CMD(0x0E,0,0); delay(500); }
void play() { execute_CMD(0x0D,0,1); delay(500); }
void playNext() { execute_CMD(0x01,0,1); delay(500); }
void playPrevious() { execute_CMD(0x02,0,1); delay(500); }
void setVolume(int volume) { execute_CMD(0x06, 0, volume); // Set the volume (0x00~0x30) delay(2000); }
void execute_CMD(byte CMD, byte Par1, byte Par2) // Excecute the command and parameters { // Calculate the checksum (2 bytes) word checksum = -(Version_Byte + Command_Length + CMD + Acknowledge + Par1 + Par2); // Build the command line byte Command_line[10] = { Start_Byte, Version_Byte, Command_Length, CMD, Acknowledge, Par1, Par2, highByte(checksum), lowByte(checksum), End_Byte}; //Send the command line to the module for (byte k=0; k<10; k++) { mySerial.write( Command_line[k]); } }
Put the Coded Arduino Everything Into the Box
Close the box and the music box is ready!