Item code: 29132
What It Can Do
- Detects sound up to 10 feet away
- Adjustable sound sensitivity control
- Simple digital output indicates if sound has been detected
The Sound Impact Sensor uses a small microphone and amplifier to detect sound. When the loudness — decibel level — of the sound exceeds a preset level, the output of the sensor goes from LOW (0 volts) to HIGH (5 volts).
A small trimmer control lets you adjust the sensitivity of the sensor. Setting this control has the effect of decreasing or increasing the effective range of the sensor, and its overall sensitivity to quieter sound levels. Initially set the control to its mid point, then dial clockwise or counterclockwise to adjust sensitivity:
- Dial clockwise to decrease sensitivity — quieter sounds not detected. Use this setting in environments where there is a higher amount of ambient (natural) noise.
- Dial counterclockwise to increase sensitivity — quieter sounds detected.
The Sound Impact Sensor is particularly sensitive to loud and abrupt low frequency (under 500 Hz) sound, such as a hand clap. The sensor can also detect the sound caused when something strikes against it (or whatever object the sensor is fastened to). You can use this feature, for example, as an obstacle detector on a small robot.
Parts List
- Sound Impact Sensor
- BASIC Stamp HomeWork Board, Propeller BOE, Propeller QuickStart, or Arduino Uno microcontroller (solderless breadboard as needed)
- 22 gauge solid conductor hookup wire
Basic Wiring
- Power requirements: 5 VDC*
- Communication: Single bit high/low output
- Dimensions: 0.6 x 1.5 in (15 x 38 mm)
* The signal output of the Sound Impact Sensor incorporates a series resistor, allowing it to be directly interfaced to the Propeller, which operates at 3.3 volts. For best results be sure to power the sensor at its rated 5 volts, even when connecting it to the Propeller.
Program KickStarts
Each of the example programs display the current state of the Sound Impact Sensor in a terminal/debug window. Sound that exceeds the adjusted sensitivity of the sensor produces a momentary HIGH output on the SIG(nal) pin. In each program the output of the sensor is checked every 100 milliseconds (1/10th second).
A red LED on the sensor blinks on whenever it has detected a loud sound. Once the sound level falls below the adjusted sensitivity, the sensor resets itself and the LED goes out.
BASIC Stamp HomeWork Board
Download BASIC Stamp 2 code for the Sound Impact Sensor
’ {$STAMP BS2} ’ {$PBASIC 2.5} DO IF IN0 = 1 THEN ’ If loud sound DEBUG "Sound detected!", CR PAUSE 100 ’ Wait 1/10 second ENDIF LOOP
When this program is run, the BASIC Stamp Debug Terminal will automatically open.
Propeller BOE and Propeller QuickStart
Propeller BOE Wiring Diagram
Propeller QuickStart Wiring Diagram
Download Propeller Spin code for the Sound Impact Sensor
OBJ pst : "Parallax Serial Terminal" CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 PUB Main dira[0]~ ’ Set pin 0 to input pst.Start(115_200) ’ Set Parallax Serial Terminal to 115,200 baud repeat if ina[0] == 1 pst.Str(string("Sound detected!")) ’ If loud sound detected pst.NewLine waitcnt(clkfreq / 10 + cnt) ’ Wait 1/10 second ’ Repeat
This program uses the Parallax Serial Terminal object library, which is included with the Propeller Tool software download.
To view the results of the demonstration, after uploading is complete run the Parallax Serial Terminal from the Run menu, or press F12. Momentarily depress the Reset button on the Propeller QuickStart board to restart the program.
Arduino Uno
Download Arduino Code for the Sound Impact Sensor
int sound = 0; void setup() { Serial.begin(9600); } void loop() { sound = digitalRead(2); if (sound == 1) { // If loud sound Serial.println("Sound detected!"); delay(100); // Wait 1/10 second } // Repeat
To view the results of the demonstration, after uploading is complete click the Serial Monitor icon in the Arduino IDE. This displays the Serial Monitor window. Momentarily depress the Reset button on the Arduino board to restart the sketch.
For More Information
- Read the full documentation for the Sound Impact Sensor (#29132).