Shop OBEX P1 Docs P2 Docs Learn Events
Sound Detection With SX Chip??? — Parallax Forums

Sound Detection With SX Chip???

ryester1120ryester1120 Posts: 21
edited 2008-02-18 02:00 in General Discussion
Ok.· I have the idea to try to use the PING))) UltraSonic Sensor and a SX chip to detect sound to make my LED cube make patterns.· Is there a way to use the PING))) sensor or does anyone else know a another way to detect sound with the SX chip.· I have tried to use the command RCTIME and instead of using a photoresistor I use a headphone jack that plugs into my psp or mp3 player.· But it doesn't totally work 100% of the time.

So if anyone has any other ideas can u please leave a comment.


Thanks

Comments

  • cprincecprince Posts: 5
    edited 2008-02-15 00:21
    Maybe you can have a microphone and a simple, high gain amplifier circuit(op-amp??) that will amplify most sounds to 5V and feed the output to one of the SX's inputs.
  • JonnyMacJonnyMac Posts: 9,217
    edited 2008-02-15 00:55
    Do you need to do something special with the sound, or just detect presence? If the later, you can use a fairly simply interface to an electret mic that connects to the comparitor,
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-02-15 10:24
    Also, are you trying to detect normal audio or ultrasonic. Normal audio can be detected easily with an inexpensive electret microphone or even from an 8 ohm speaker with preamplification. I'm not exactly sure what is a cheap sensor to reach into the ultrasonic range unless you can get an old Poloroid Ultrasonic speaker/sensor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • ryester1120ryester1120 Posts: 21
    edited 2008-02-15 21:04
    I am trying to have a microphone of something pick up sound in a room but there is now enough voltage through the microphone.·
  • JonnyMacJonnyMac Posts: 9,217
    edited 2008-02-16 01:40
    I designed a little board for a friend that takes the input from a microphone of MP3 player and modulates LEDs. The mic interface was derived from the book "Physical Computing." This circuit will actually measure the [noparse][[/noparse]amplified] input from the mic, but you could eliminate the ADC0831 and use the comparitor input for audio detection.
  • DigitalDjDigitalDj Posts: 207
    edited 2008-02-16 02:11
    Any code to play with on this Jon. This would make a great article for nuts and volts especially with some filters in the code with high, mid and lows seperated for the leds.

    If anyone is ever interested in controlling the SX with sound on the serial port and wants to look at some software that was written for my light grids I would be willing to share the souce code for the editor and player. Everything is written in VB6 and with some changes could be adapted to other led lighting control.

    Kevin




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔



    Post Edited (DigitalDj) : 2/16/2008 2:21:17 AM GMT
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2008-02-17 16:08
    Microphones are microvoltage analog sensors, so they need a preamp to have enough power to be sensed by microprocessor. Electret mics are cheap, but also need to be provided with DC power. Google for info.

    You have several choices: use an OpAmp, use an Audio Amp or PreAmp chip, or use a transistor or two. Much depends on your own preferences and how much hassle you want in terms of design. The big plus with a single supply OpAmp or AudioAmp chip [noparse][[/noparse]I think there is an LM358 Audio Amp that will output .20 watts when run from 5Volts - it prefers 9, but works.] is that you have good audio properties with a simple power supply. Discrete component amplifiers often have stages which require progressively higher supply voltages and maybe dual voltage supplies. There are tons of audio schematics on the internet.

    Once you get the audio powered, then you have to figure out how to use it. The frequency is the easiest to sense. Alternatively, you might want to sense amplitude as well as frequency. The latter might be best tackled with a ladder of resistors feeding 4 or 8 pins. As the amplitude increases, more pins go high. You just read the whole nibble or byte and then you have both tempo and amplitude to manipulate and distribute to whatever. With the resistors, you might want to power that audio chip from 9 volts as you are going to have a voltage drop and you need at least 2.5volt to indicate a digital high pin. What to do is to clip the overvoltage with a 5.1 volt .5 watt zener. In that way you can include a volume control to find a 'sweet spot' where you get the best response with whatever you have built.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PLEASE CONSIDER the following:

    Do you want a quickly operational black box solution or the knowledge included therein?······
    ···················· Tropically,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • DigitalDjDigitalDj Posts: 207
    edited 2008-02-17 17:35
    Kramer,

    To add to your audio solution there is a .dll called Fmod that we used in our software that will allow you to extract the audio properties like you mentioned for amplitude and frequency. We also did all of the programming in VB6 becuase of the couple of gentlemen that I met up with was very verse in that language. All audio is extrracted from Fmod and then taken and converted to serial commands needed for the controller boards were using. For anyone interested in what we have done with l.e.d. lighting here is my links:

    http://www.freewebs.com/artdecojukebox/lightgridbuild.htm

    http://www.freewebs.com/artdecojukebox/lighjtgridsoftware.htm

    http://www.freewebs.com/artdecojukebox/lightgridvideos.htm

    Kevin




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔



    Post Edited (DigitalDj) : 2/17/2008 5:46:20 PM GMT
  • DigitalDjDigitalDj Posts: 207
    edited 2008-02-18 02:00
    Give this a try!

    Parts Needed:
    1 x 9V Battery for testing 5volt supple for SX
    1 x Standard 3.5mm Male Plug for headphone jack
    1 x 100K Resistor 1/4W
    1 x 22K Resistor 1/4W
    1 x 470 Resistor 1/4W
    1 x LED (or 2)
    2 x General Purpose NPN Transistors BC547

    For a case mod on a computer you can pull audio from the P2 connector. You just need to purcahse a connector.


    blinkyscheme.jpg

    This is essentially a simple darlington pair amplifier to drive up the current and voltage coming from a soundcard's headphone jack.
    2 LEDs can be used while still keeping things looking fairly decent. More LEDs can be added in parallel, but be sure to keep an eye on the current draw. Voltage can be adjusted to 5volts and change the curent limiting resistor. You could feed this into the SX with the 5volt supply but not any higher.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔



    Post Edited (DigitalDj) : 2/18/2008 2:10:59 AM GMT
Sign In or Register to comment.