It's all about the pattern

Arduino Sound Alarm

I’ve just completed my second Arduino project, a sound level detector which sets off an “alarm” when there’s the sound level is to high for too long. I built it for use in a school that wants to provide visual feedback to students when they are being too loud. The “alarm” is a string of flashing LEDs that’s controlled by an IR-remote, which I reverse engineered using the the arduino itself and the excellent IRremote library to figure out which codes activate the LED string. The IRremote library includes an example that dumps the codes and code types that remotes typically use. So I just ran that example with my arduino hooked up to an IR detector from adafruit. It was really quite easy to do.

It’s been a fun project because it’s quite flexible and configurable. Here’s a short video of the finished product:

For anyone who wants to build one of these here’s a bread-board diagram that I made using the very cool Fritzing package:

Then drilling holes and installing the configuration controls (push-button and pot)

Then assembling and soldering the board with the sound circuit and the trim pot for the LCD as well as the resistor for the IR LED.

Finally, just before enclosing..

The completed project. Note that I left the mic and IR LED lose because I’m not sure exactly where the alarm is going to be installed and the way they face could matter.

Some lessons learned:

When soldering a header for an LCD remember to take into account that if you copy the wiring order as you have plugged it into the bread-board, you will actually be doing it backwards because the connecter will be attached upside-down!

You will need to drill a little extra hole in your case to accept the tab on the pot that keeps it from rotating when you spin the shaft.

Electret microphones have a polarity.

Hot-glue is great for attaching push-buttons.

Ask you children for UI advice! Will had the excellent idea of using the setup-pot to spin between the different settings. In the original code I had it so you had to press the button to toggle between the setup parameters and then do a long-press to actually set one. The way it ended up is much better.

Please let me know if there’s any mistake in the short note I wrote about it and if the link I chose for it is the right one.
Obviously sharing the list on social networks, blogs and forums is also appreciated

The IR receiver is part of the circuit. If you look at the fritzing digaram you see that it’s attached to pin 3 of the Arduino and also to a resistor that goes to ground. The IR works in software in that the Arduino monitors the data on that pin coming from the IR receiver.

I tried to correct the problem by deleting the IR function , it succeeded ,
but it was me another error Compile not find Wprogram.h ,
Arduino it should have been in the installation itself which I do not ,
I have done so reinstalling the program, and I was another mistake by the instruction ” Bounce ”

respectively . –

Sound_Alarm_no_IR_code_-_test.ino:209: error: ‘Bounce’ does not name a type
Sound_Alarm_no_IR_code_-_test.ino: In function ‘void loop()’:
Sound_Alarm_no_IR_code_-_test.ino:240: error: ‘bouncer’ was not declared in this scope
Sound_Alarm_no_IR_code_-_test.ino: In function ‘boolean shortPress()’:
Sound_Alarm_no_IR_code_-_test.ino:534: error: ‘bouncer’ was not declared in this scope
Sound_Alarm_no_IR_code_-_test.ino: In function ‘boolean longPress()’:
Sound_Alarm_no_IR_code_-_test.ino:538: error: ‘bouncer’ was not declared in this scope

all the code that I am trying to compile them :
–

/*
* Alarm: Monitors a voltage source and triggers an alarm if it’s greater that a value
* for more than a configured percent of a configured time.
*
* See the readme for documentation (https://github.com/zippy/sound_alarm/blob/master/README.md)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*/