Web Site: www.parallax.com Office: (916) 624-8333 Forums: forums.parallax.com Fax: (916) 624-8003 Sales: sales parallax.com Sales: (888) 512-1024 Technical: support parallax.com Tech Support: (888) 997-8267 Sound Impact Sensor ( 29132) The Sound Impact Sensor provides a means to add noise control to your project and responds to loud noises such as a clap of the hands. Through the on-board microphone, this sensor detects changes in decibel level, which triggers a high pulse to be sent through the signal pin of the sensor. This change can be read by an I/O pin of any Parallax microcontroller. Features y Detection range up to 3 meters away y On-board potentiometer provides an adjustable range of detection y Single bit active-high output y 3-pin SIP header ready for breadboard or through-hole projects y Built-in series resistor for compatibility with the Propeller microcontroller and other 3.3 V devices Key Specifications y Power requirements: 5 VDC y Communication: Single bit high/low output y Operating temperature: 32 to 158 F (0 to +70 C) y Dimensions: 0.6 x 1.5 in (1.5 x 3.8 cm) Application Ideas y Noise Activated Alarm Systems y Holiday Animated Props y Robotic Control Pin Definitions Connection Diagrams For use with the included sample programs on page 2. Pin Name Function Ground 1 GND 2 5V 5 VDC 3 SIG Signal Pin Sensitivity The Sound Impact Sensor has a maximum detection range of 3 meters. However, if you plan to use this sensor in an area where environmental factors can trigger false readings, the range can be shortened by adjusting the potentiometer on the front of the board. Copyright Parallax Inc. Sound Impact Sensor ( 29132) v1.0 10/27/2009 Page 1 of 2 Source Code These programs are available from the Sound Impact Sensor product page. Browse to www.parallax.com and Search for 29132. BASIC Stamp 2 Program This program will display the current state of the output pin from the Sound Impact Sensor connected to P0 using the Debug Terminal included in the BASIC Stamp Editor software, available for download from www.parallax.com/basicstampsoftware. STAMP BS2 PBASIC 2.5 DO IF IN0 = 1 THEN When noise detected, display DEBUG HOME,Sound detected, CLREOL a message PAUSE 1000 ELSE If no sound is detected, DEBUG HOMEAll is wel, CLREOL display that all is well. ENDIF PAUSE 10 Short delay LOOP Repeat Propeller P8X32A Application This program will display the current state of the output pin from the Sound Impact Sensor connected to P0 using the Parallax Serial Terminal. Note: This application uses the Parallax Serial Terminal.spin object for displaying the state of the sensor. This object as well as the Parallax Serial Terminal itself is installed with the Propeller Tool v1.2.6 which is available from the Downloads link at www.parallax.com/Propeller. SoundImpactSensor Simple.spin Displays the current state of the output pin from the Sound Impact Sensor connected to P0 using the Parallax Serial Terminal. For P8X32A. CON clkmode = xtal1 + pll16x System clock 80 MHz xinfreq = 5 000 000 OBJ pst : Parallax Serial Termina 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(stringSound detected)) When noise is detected, display a message waitcnt(clkfreq + cnt) Wait 1 second pst.Clear Clear the Parallax Serial Terminal else pst.Str(stringAll is well)) If no sound detected, display all is well waitcnt(clkfreq/10 + cnt) Wait 1/10 of a second pst.Home Move cursor to the top left corner of the PST Copyright Parallax Inc. Sound Impact Sensor ( 29132) v1.0 10/27/2009 Page 2 of 2