Final Write Up

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Chapter #15: Understanding The Sound Impact Board

Sound impact boards, like the one shown below, are commonly used to detect sound for
applications such as sound activated alarm systems, and various other props, such as DJ
equipment. The sound impact sensor from Parallax includes an on-board potentiometer
which adjusts the range from just a few inches up to 3 feet. On the bottom of the board
are three pins. The left side is the ground pin, the middle the input voltage, and the right
side the signal output pin. When a sound is detected, the board sends out a high voltage
signal, which can be taken as an input on a BS2. The simple design of the board makes it
exceptionally easy to use.

Activity #1: Using the Sound Impact Board to Flash an LED

In this activity, you will use an LED to test the functionality of a single sound impact
board.

Sound Impact Board Test Circuit Parts

(1) Sound Impact Board


(1) LED
(2) Resistors – 470 Ω, 220 Ω
(3) Jumper Wires

Sound Impact Board Test Circuit

• With the power disconnected from your Board of Education, build the circuit
from the diagram shown on the next page.
• Reconnect the power.
• Clap near the sound impact board. LED should flash.
• If LED does not flash, verify polarity of LED is correct, and then check for proper
placement of hardware into pins.
Wiring Diagram

Sound
Pin 15 Impact
Sensor
470

Vss

Pin 0
Vdd

Programming the Sound Impact Board Test Circuit

‘ {$STAMP BS2}
‘ {$PBASIC 2.5}

DO
IF (INO = 1) THEN
DEBUG “Sound Detected!”, Cr
HIGH 15
PAUSE 50
LOW 15
ENDIF
LOOP

The sound impact sensor waits for a sound to trigger, at which time the board
sends a signal to Pin 0. When Pin 0 receives the signal, the BS2 tells the Pin15 to
send a high signal, via an IF...THEN loop, and the debug window displays
“Sound Detected!”.
Activity #2: Using Multiple Sound Impact Boards

In this activity, you will use two separate sound impact boards to flash two separate
LEDs independently from one another.

Multiple Sound Impact Board Circuit Parts

(2) Sound Impact Board


(2) LEDs
(4) Resistors – 2 x 470 Ω, 2 x 220 Ω
(10) Jumper Wires

Multiple Sound Impact Board Circuit

• With the power disconnected from your Board of Education, build the circuit
from the diagram shown below.
• Reconnect the power.
• Clap near the sound impact board. LEDs should flash.
• Test one side out, then the other. LEDs should blink independently of one
another.

Wiring Diagram
Programming the Multiple Sound Impact Board Circuit

‘ {$STAMP BS2}
‘ {$PBASIC 2.5}

DO
IF IN0 = 1 & IN2 = 1 THEN
HIGH 15
HIGH 13
PAUSE 5
LOW 15
LOW 13
ELSEIF IN0 = 1 THEN
HIGH 15
PAUSE 5
LOW 15
ELSEIF IN2 = 1 THEN
HIGH 13
PAUSE 5
LOW 13
ENDIF
LOOP

Activity #3: Using the Sound Impact Board to Flash an LED Array

In this activity, you will use the sound impact board to flash multiple LEDs
simultaneously.

Array Circuit Parts

(1) Sound Impact Board


(8) LEDs
(10) Resistors – 8 x 470 Ω, 2 x 220 Ω
(30) Jumper Wires

Array Circuit

• With the power disconnected from your Board of Education, build the circuit
from the diagram shown on the next page.
• Reconnect the power.
• Clap near the sound impact board. LEDs should flash.
• If LEDs do not flash, verify that polarity of LEDs are correct, and then check for
proper placement of hardware into pins.
• Color of wires is very important in this step. Proper utilization of wire color
coordination makes the lab much easier, and also safer in terms of hardware.
Without doing so, the next step of the lab will be extremely difficult from a wiring
standpoint.

Wiring Diagram

470 Sound
Pin 1 Impact
470 Sensor
Pin 2
470
Pin 3
470 Vss
Pin 4 470

470
Pin 5 Pin 0
470
Pin 6
470
Vdd
Pin 7
470
Pin 8

Programming the Array Circuit

‘ {$STAMP BS2}
‘ {$PBASIC 2.5}

Do
If (INO = 0) Then
High 7
High 2
Pause 50
Low 7
Low 2
Pause 100
High 5
High 8
Pause 50
Low 5
Low 8
Pause 100
High 3
High 6
Pause 50
Low 3
Low 6
Pause 100
High 1
High 4
Pause 50
Low 1
Low 4
Pause 100
EndIF
Loop

This circuit is basically the same as that found in Activity #1, but with more LEDs. If the
board detects a sound, then all LEDs will flash at the same time. This Activity is also
useful for checking the functionality of both the Board of Education, and the LEDs. Both
are important pieces of the next activity.

Activity #4: The Sound Beast

In this activity, you will use multiple LED arrays along with two sound impact boards to
create a visual compliment for music.

Sound Beast Circuit Parts

(2) Sound Impact Board


(32) LEDs
(2) Resistors – 2 x 220 Ω
(Bazillion) Jumper Wires

Sound Beast Circuit

• With the power disconnected from your Board of Education, build the circuit
from the diagram shown on the next page.
• Reconnect the power.
• Clap near the sound impact boards. LEDs should flash.
• If LEDs does not flash, verify polarity of LEDs is correct, and then check for
proper placement of hardware into pins.
• Since there are four LEDs connected in series on each pin, the voltage is broken
down to safe levels, as per Ohm's Law, and therefore no resistors are required to
protect the LEDs.

Wiring Diagram
Programming the Sound Beast

' {$STAMP BS2} ELSEIF IN0 = 1 THEN


' {$PBASIC 2.5} DEBUG "Sound2", CR
HIGH 1
'--------------- HIGH 3
'Main Routine: HIGH 5
HIGH 7
DO PAUSE 10
DEBUG "Main Routine", CR LOW 1
IF IN0 = 1 THEN LOW 3
GOSUB Sound LOW 5
ELSEIF IN15 = 1 THEN LOW 7
GOSUB Sound PAUSE 50
ELSEIF IN0 = 0 AND IN15
= 0 THEN ELSEIF IN15 = 1 THEN
GOSUB Nosound DEBUG "Sound3", CR
ENDIF HIGH 2
LOOP HIGH 4
HIGH 6
'---------------- HIGH 8
'Sub Routines PAUSE 52
'---------------- LOW 2
LOW 4
'--------------- LOW 6
Sound: LOW 8
PAUSE 50
DO ENDIF
LOOP UNTIL IN0 = 0 AND
IF IN0 = 1 AND IN15 = 1 IN15 = 0
THEN RETURN
DEBUG "Sound1", CR
HIGH 1 '---------------
HIGH 2 Nosound:
HIGH 3
HIGH 4 DO
HIGH 5 IF IN0 = 0 AND IN15 = 0
HIGH 6 THEN
HIGH 7 DEBUG "NoSound", CR
HIGH 8 GOSUB Nosound1
PAUSE 10 GOSUB Nosound2
LOW 1 GOSUB Nosound3
LOW 2 GOSUB Nosound4
LOW 3 RETURN
LOW 4 ELSEIF IN0 = 1 AND IN15
LOW 5 = 1 THEN
LOW 6 GOSUB SOUND
LOW 7 RETURN
LOW 8 ENDIF
PAUSE LOOP
Nosound3:
Nosound1:
IF IN0 = 0 THEN
IF IN0 = 0 THEN HIGH 3
HIGH 7 HIGH 6
HIGH 2 PAUSE 100
PAUSE 100 LOW 3
LOW 7 LOW 6
LOW 2 RETURN
RETURN ELSEIF IN0 = 1 THEN
ELSEIF IN0 = 1 THEN GOSUB Sound
GOSUB Sound RETURN
RETURN ENDIF
ENDIF
Nosound4:
Nosound2:
IF IN0 = 0 THEN
IF IN0 = 0 THEN HIGH 1
HIGH 5 HIGH 4
HIGH 8 PAUSE 100
PAUSE 100 LOW 1
LOW 5 LOW 4
LOW 8 RETURN
RETURN ELSEIF IN0 = 1 THEN
ELSEIF IN0 = 1 THEN GOSUB Sound
GOSUB Sound RETURN
RETURN ENDIF
ENDIF

With this program running, the LEDs will flash when a sound is detected, and fall
back to a default pattern when no sound is present.

Summary

This concludes the Sound Beast lab. With the knowledge and hardware from Activity #4,
a great many projects become possible. The LED iPod dock is just one of them. Other
projects could include a beefed up version of the Sound Beast dock, giving it more LEDs
and better speakers. The possibilities are nearly endless.
Appendix

™ Troubleshooting Tips
¾ MAKE SURE LEDS ARE PROTECTED!!
ƒ LEDs are very easy to burn up. Try not to do that.
¾ KEEP WIRES COLOR CODED!
ƒ Wiring is difficult enough already. Just make things simpler by color
coordinating the wires. Ground black, Hot red, etc..
™ Hardware Information
¾ Sound Impact Board
ƒ http://www.parallax.com/StoreSearchResults/tabid/768/List/0/SortField/4/Pro
ductID/614/Default.aspx?txtSearch=sound+impact+board

You might also like