Shop OBEX P1 Docs P2 Docs Learn Events
Need some help understanding Microphones — Parallax Forums

Need some help understanding Microphones

MarkCrCoMarkCrCo Posts: 89
edited 2014-04-17 11:05 in General Discussion
I've gone through all the projects for the Boe-bot that come with it and started out playing around on my own. I thought I would give him an ear to listen with. I bought a radio shack condensor mic element (actually two diffeent ones http://www.radioshack.com/product/index.jsp?productId=2062215 and http://www.radioshack.com/product/index.jsp?productId=2062216). I searched the internet to try and understand these but I'm still confused. I hooked it up the way I think I should but I get nothing I can read. I've used COUNT, RCTIME, and just plain IN7 but get nothing. I can't get the schematic to paste so I'll try to describe it. 5V(vdd) -> 4.7K resistor -> + mic lead. - mic lead -> vss pin 7 -> .1 uf capacitor -> + mic lead I don't understand how this can do anything and it appears that it doesn't from my results. It seams to me the circuit is always going to be completed through the vdd & vss connections and never through the pin7 and so never detecting anything. I'm not try to get any sophisticated voice recognition or anything like that. I just want to detect a noise that is different from the background. Can anyone help explain what I am doing wrong and or what I can do to make this work? Thanks
mic.gif
Got it to paste after all.

Comments

  • tonyp12tonyp12 Posts: 1,951
    edited 2014-04-17 07:20
    >the circuit is always going to be completed through the vdd & vss connections
    The sound waves creates short pulses of Vdd being conected to ground,
    the series-cap filters is a high-pass filter only allow short pulses through, like a flexible membrane between two water tanks kind off.
    If you dc-balance the output trace so it's for example 1/2Vdd when there is no-sound, the Cap will now also change dc-level as it acts as a dc-to-dc buffer.

    Use the schematic from the Propeller demo board, and if you do it exactly (including that Vdd should be 3.3v) It will work.
    Electret_condenser_microphone_schematic.png
  • MarkCrCoMarkCrCo Posts: 89
    edited 2014-04-17 08:20
    I'm not sure I understood all of that. My background is in programming. All the electronics I know has come from Physics classes and the boe-bot manual. I think I kind of understand. The mic has a membrane that when it vibrates the membrane touches a metal plate and completes the circuit. When the membrane is not touching the metal plate then the circuit should complete through the cap and pin7 (the output). That should give me something I can read on Pin7. Is that correct?
  • LeonLeon Posts: 7,620
    edited 2014-04-17 08:28
    No. Here is how an electret mic works:

    http://en.wikipedia.org/wiki/Electret_microphone
  • MarkCrCoMarkCrCo Posts: 89
    edited 2014-04-17 10:03
    OK when I use the count to count cycles I get 0, When I try to use decay time I get 0 and when I try to just test for a high low state I get 1. I don't seem to be detecting any sound at the output. Not sure why but thanks all. Maybe I can figure it out some day.
  • tonyp12tonyp12 Posts: 1,951
    edited 2014-04-17 10:37
    Maybe go with a digital output mic?
    http://www.mouser.com/ProductDetail/Knowles/SPM1437HM4H-B/?qs=sGAEpiMZZMsZoypmI867EfrxjbMuIgyuL9HQkG4aFwriDnePK5eL8Q%3d%3d
    Set one counter for output square wave at 2mhz, set the other counter to counting edges.
    repeat: Use waitcnt (1024), check the second counters accumulated value= loudness.

    Don't forget to add a pulldown resistor (or may it should be pullup) as the data line goes z to allow muxing of left/right
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-04-17 10:49
    I suspect the circuit is incomplete without some sort of amplification or an ADC conversion to have the BS2 able to respond, possibly both are required with the amplification first..

    You really are just throwing a very small analog signal at a digital input. The voltage output may be too low to trigger the i/o, but could be picked up with an ADC measurement and digitized.

    A 2 pin ADC is the way the Propeller Demo Board creates an interface, but that will never work on the BS2. ... too complex for the device. The Propeller will actually digitally record sound and play them back from an electret mic with just two more capacitors and a resistor or two..

    You might be able to create a one-transistor amplifier of some sort. The schematics that you are referring to will work for a microphone input into an audio preamp. I suspect the audio information is there, but just not enough volts or amps to budge the i/o pin...

    For many many years intercoms in apartment houses didn't have a mike, just used the speaker as one and switched back and forth.

    Try Elliot Sound Products for a sensible explaintion of audio devices. You are just going to have to accept that analog and digital are two divisions of electronics. Preamps squeeze tiny microvolts out of a phonograph needle or a coil passed over magnetic tape and make beautiful sound. But it is a whole different topic.


    sound.westhost.com

    I suspect that if you want to trigger the BS2 with audio, an 8 ohm speaker would produce more electricity. Use a diode to protect against reverse voltages. And use a zener to be sure to prevent peaks over +5. Try clapping your hands in front of the speaker. A moving coil in a nice big magnetic field will create a jolt of electricty... but you have to be sure to figure out how to protect the i/o pin from reverse voltage and too high a peak voltage.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-04-17 11:05
    The Electret microphone does not make or break contact, it produces (modulates) an analog voltage proportional to the motion of the diaphragm in the microphone. The diaphragm essentially is a parallel plate capacitor, where sound causes at least one of the plates to vibrate. This vibration is amplified by the internal FET transistor in a way that complements the external pullup resistor.

    Even though the vibrations are amplified into an electrical signal, the voltages are still pretty low... just a few 10's of millivolts. The Capacitor in the circuit acts as a level shifter and a DC block, allowing only AC (<-- The audio) to pass.

    This link may help:
    http://forums.parallax.com/showthread.php/98348-Measuring-Ambient-sound-Levels
Sign In or Register to comment.