Ok I have the finalized working schematic with all values updated. After experimenting with a lot of different configurations I now have an excellent performing sound sensor that works beyond my expectations. I made some minor changes to the schematic.
This design will detect a whisper approx one foot away. Adjusting the POT will make the circuit less sensitive, however, it will become more responsive. Adjusting the POT to a higher voltage level, increases the sensitivity, but reduces the responsiveness to sound. In other words, once triggered, there is a small delay before it will reset. I find this feature useful as it offers flexibility. Changing the value of C1 to a lower value will change the reset delay and increase responsiveness with out affecting sensitivity.
I will try to get another video of the final design.
Yeah that will work no problem. Trimmers can be caps or resistors, you just have to pay attention to the type of trimmer you are getting.
Here’s another video showing the effect the pot has when adjusted. If you don’t like the delay the LED has, then you will want to use a cap in the .1uF range. I like the delay because it keeps it from over sampling the sounds.
I have a new problem. I would like to write my code so that the head moves but continues to hold position until 3 to 5 seconds has elapsed with the ADpin voltage value @ 400 or less (no sound). My previous attempts cause the center servo commands to execute after each “turn left” sequence. I can provide example code later today.
If you look at the video above, that is what my current code is doing.
Previous experiments cause the center servo command to happen when the ADpin is more than a value of 400. After the SSC-32 is busy sending a command, the sound sensor is ignored during this time and any new commands to move left is omitted. I want to be able to stay in a loop while checking the ADpin and only exit that loop if more then 3 to 5 seconds has passed with the ADpin less than 400. so in other words, have it react to the first sound and move left, hold the position, only center the servo if there is silence for more than 3 seconds. Any new sound in the 3 second time frame, will reset the 3 second counter delay.
If micValue > 400 then
SeqIndex = 8 ; Move head left
gosub seqplayer ; Go play the sequence
Low P12 ; Turn ON LED
Endif
'--------------------------------------------------------
Restart:
For delayTime = 0 to 2
Pause 1000
ADin 0, micValue ; Check for sound
If delayTime < 3 AND micValue > 400 goto Restart ; Loop till 3 sec silence
Next
Some how the AD pins no longer function. My circuit only puts out a maximum of 2.5 volts and the ADpins can handle 5v. The strange thing, all the ADpins no longer function and I’ve only been using P0, but P1,P2, and P3 no longer show any values either. All I did was download another program with all connections intact and it stopped working. I reloaded the older program that was working and still no go. I turned off power to the bot board and back on, this did no good either.
The below program does nothing anymore:
[code]micValue VAR word
Main:
ADin 0, micValue
serout S_OUT, i57600, [dec micValue, 13]
If micValue > 400 then
Low P12 ; Turn on RED Bot Board LED if greater than 500
Else
High P12
Endif
I did not revert back to the Pot test since the sensor circuit is working as it should. I can do the pot test anyway just to verify that indeed, they are blown to a crisp.
As an alternative, I have connected the output of the sound sensor to a regular pin and using the IN6 (pin #6 as an input) I am able to react to sound the sam way as using the ADin command.
One more thing I need to check is the version of the IDE. I think I might have two versions on my PC. I’ll clean all versions off my pc and do a fresh install and then try the pot test.
Here’s the new board I’m working on. I usually spend a week tweaking stuff like silkscreen labels and a few traces. The board has two channel audio sensors and a SpeakJet. The left and right channels have independent adjustment pots and the SpeakJet has adjustable volume control. The board also has a total of five LED indicators; One for each audio channel and 3 for the SpeakJet. I have also included pull down resistors on all eight event pins eliminating the need for shunts. Oh and the board is ABB stackable (3" x 2.3").