Looking at instructables I saw a project that make me think in a possible device to build:
"How to Deal with Noisy Neighbors"
This device detects the noise from the neighbors through a MIC in the wall, if it takes longer than 10 seconds, an electrical signal is sending to a CD player and it turns on speakers that are pointing to the wall.
After seeing the video, I wanted to apply the same principle to build a Baby Noise Detection.
Step 1: Supplies
1 Breadboard (later I solder all the components in another board)
1 Arduino Uno
1 5v power source to power the Arduino (I powered it through USB from my laptop)
1 Electret microphone
1 Green 10 LED bar graph (individual LEDs will work too)
1 Red 10 LED bar graph (individual LEDs will work too)
1 Orange LED (or any other color)
1 NPN Transistor 2N3904 or similar
2 0.1uF capacitor
1 100k ohm resistor
2 10k ohm resistor
13 220 ohm resistor (Or whatever will run your LEDs at 5v)
1 Music player for babies
Step 2: Setting Up the Circuit
(The system is the same, so I upload the same breadboard circuit)
Step 3: Soldering All the Components
I just tape the wires of the MIC for make it more aesthetic.
Step 4: The Music Player for Babies and the "hardware"
The next step was to create a “hardware” where all the circuit are kept. I just created a box with a hole for the noise meter.
Step 5: The Code
You can download the attached sketch and load it onto your Arduino. The program will automatically run on powerup.
Some important notes about the code:
const int threshold = 320;
This sets the threshold for triggering the playback. It should be low enough so that the baby's crying makes our graph go into the red, but high enough so ambient noise won't set it off (like a loud car outside). Play around with this value to set it just right.
These are all of the outputs that make up the LED bar graph. If you use more than I did, you will need to add the extra ports here.
const long waitTime = 10000.0;
This is the 10 second wait period to avoid false alarms. You can change this as needed (the value is in milliseconds).
const long cancelTime = 4000.0;
This is what defines "continuous" crying during the waiting period. If the cry stays below the threshold for 4 seconds then it cancels the waiting period and goes back to monitoring. You can change this as needed (the value is in milliseconds).
const long playTime = 30000.0;
This is how long the music will be played. It is set for 30 seconds but you can change this as needed (the value is in milliseconds).
This is the music player control output.
ledLevel = map(sensorReading, 200, threshold, 0, ledCount);
The 200 here eliminates ambient noise. When it was 0 the first couple LED bars would stay on constantly.
Step 6: Final Result