Shop OBEX P1 Docs P2 Docs Learn Events
interfacing to a microphone — Parallax Forums

interfacing to a microphone

jayjayjayjay Posts: 4
edited 2005-09-08 19:39 in BASIC Stamp
Hello

What is an ideal way to interface to a electret mirophone to a BS2PE, I believe I would need some sort of pre amp circuit, but how do I read in the voltage values, what command to use? RCTIME?

I am only interested in the voltage value from the mic, i.e. convert the ambient sound to a voltage range of 0-3V, I dont intent to do any audio processing/playback.

Thanks for your help
Jay
·

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-09-06 12:44
    Do a web search for single-ended mic preamps. That said, you'll have to run the output of the preamp into an A2D to read the voltage.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • jayjayjayjay Posts: 4
    edited 2005-09-06 12:56
    Thanks, is there a way to get away without the A2D?
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-09-06 12:59
    Someone [noparse][[/noparse]smarter] will probably contradict me, but my answer is no. You may be able to rig RCTIME to give you a reading, but you won't get a specific voltage measurment. See Dr. Tracy Allen's page (www.ememsystems.com) for tricks with RCTIME.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • steve_bsteve_b Posts: 1,563
    edited 2005-09-06 13:35
    What exactly are you trying to measure?

    Do you just want to trigger the stamp when things get above a certain threshold?· or do you want to actively measure ambient sound?
    In either case, know what your mic outputs is needed.·
    Then you might need a small op-amp to bring things up to level and then it really depends what your actually use of the signal represents!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • jayjayjayjay Posts: 4
    edited 2005-09-06 17:48
    Steve

    I am interested in the ambient noise continously, light up a bar led as the noise increases. All I am looking to do is convert the ambient sound to a voltage range of 0-3V.

    Thanks
    Jay
  • steve_bsteve_b Posts: 1,563
    edited 2005-09-06 18:11
    You'll have to have a pretty sensitive mic...which means you may be battling electrical noise too.
    Are you planning to use the stamp to light up these light bars? Or are you building a separate cct to do that....if you're building something, then you could easily 'condition' a voltage that it would work how you want (w/ RCtime?)....or, use some photodetectors mounted near each light bar and just monitor them....it'll show you stages, not a lot of resolution.

    http://www.discovercircuits.com/V/vu-meter.htm has a few ccts for making a light bar cct.

    I don't think you get much voltage out of electret mics....only a little more than line level signals (which is 1Vp-p)....So you'll need an op-amp for sure!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • jayjayjayjay Posts: 4
    edited 2005-09-06 18:29
    I have got the amp part done, I am just trying to see if I can do the voltage read into a stamp withot the use of an additional ADC.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-09-06 18:33
    Jay -

    Nationl Semiconductor makes a number of bar-dot LED driver chips which will probably do exactly what you want, without even using a Stamp. Take a look at the following chips: LM3914, LM3915, LM3916. Here is a link to the LM3914:
    http://www.national.com/pf/LM/LM3914.html

    As I remember they show an example of an audio DB Meter, in one of the applications notes. Couldn't get much simpiler than that.

    Regards,

    Bruce Bates
  • TonyATonyA Posts: 226
    edited 2005-09-06 19:39
    Jay,

    I posted the schematics for doing this in my post called "using piezo with BS2". It comes from a book by Gilliland. In this example you use a mic that is amplified by an opamp. This then goes into a schmitt trigger. The schmitt trigger IC chip converts the voltage into a square wave that can then be read by the stamp using the pulsin command.


    In my experience you have to amplify the hell out of the mic for some reason. I am about to try adding another opamp to the one in the schem. to see if I can get the signal I need.

    It's strange, but Gillilands circuit doesn't really work. It can work with increased amplification though.

    Let me know if you try this.



    Tony

    Post Edited (TonyA) : 9/6/2005 8:01:38 PM GMT
  • AmaralAmaral Posts: 176
    edited 2005-09-08 19:39
    If you trying to convert the voltage value without an AD converter , you could use an 555 to do this job , pin 5 of this can work as PWM converter, Then using Pulsin you can mesure the value .

    But , you are using an AD converter , the 555 is being the AD .

    Amaral.
Sign In or Register to comment.