Jump to content
Sign in to follow this  
villekille

Using microphone and controlling program flow with sound

Recommended Posts

Hello, I want to have my software to be controlled with sound. I planned that I would place a electret microphone capsule and connect this to the msp430 and this microphone is connected to a tube where air is flowing and thus making some turbulence noice and I would like my program to react to this noise and do something while the air is flowing and then return back to normal action when flow stops.  In theory  it sounds like a simple thing. But i reality, I have to be honest, I have no idea! I mean, this microphone can be connected to a normal IO, to and ADC..or COMPARATOR..where it would be best? And how it could decide whether there is the flow going and thus noice from the microphone coming or not? I am pretty good with electronics and can design almost anything hardware wise if I just would understand what I need, how the MSP430 would understand what is going on, what features on the msp430 to use and so on. This is a really important project and I am grateful for all the input I can get to get started with this!

Share this post


Link to post
Share on other sites

Well I think you are going to need to try it and see what sort of signal you get out of it.  My guess is that you will need some sort of filtering and amplification to get your SNR high enough but it's hard to say how much and what kind without actually seeing the signal.  You might also consider using an actual pressure transducer instead of a microphone.  If you install a small T in the line and put the transducer in the the T, you should see a pressure drop that is proportional to flow rate.

 

As for the input....again it all depends on how much work you need to do to the signal to make it usable.  

 

One approach would be to hook it up to the ADC, continuously read the output voltage and use software to trigger logic based on levels.  This requires almost zero extra hardware, but you do pay a speed penalty as most of the processing is handled in software.  The benefit is that you can dynamically tune the trigger levels and do all sorts of fancy software DSP if you are so inclined.  If your signal is low enough, you still may need an amplification front end.

 

Option 2 would be to hand off some of the logic to hardware by using a comparator.  Here you can apply a simple internal low pass filter and use an interrupt to handle code execution when your input passes some threshold (the reference), but you have less flexibility in terms of threshold level (if you are using an internally generated reference) or you have to add external hardware to provide an external reference.  You would also need to add additional hardware filtering if the integrated filter isn't enough.

 

Option 3 is to move the entire analog front end off the MCU into dedicated hardware and feed a GPIO pin with a preconditioned digital signal.  The MCU would just see a high/low state and would be able to use a simple interrupt to trigger code execution.  The advantage here is that you have virtually infinite possibilities in terms of signal conditioning, and you are not wasting cycles on DSP....however your circuit becomes more complex and harder (but not impossible) to tune/modify through the MCU.

 

As you move from more to less integrated, you gain and lose functionality in different places.  For your particular application, there will be a balance point.

Share this post


Link to post
Share on other sites

depending on the hardware within the microphone, it can be thought of as a variable voltage source.

 

with most mics you run a low voltage through the device and when it detects "no" sound you get that steady voltage back, but if it is disturbed by sound waves, then the voltage spit back will rise and fall with those waves

 

the problem is that the feedback voltage is exponential i think.  meaning that if full volume was 3v then 50% is only 100mV, 75% is about 500mV

 

so unless you are saturating the mic full on or off, then you have to boost the small voltage changes to what you want so that you can set a level of "flow" or "not flow"  then just have the opamp feeding a comparator feeding a digital input pin.

 

I hope that makes sense.

 

This was the best i could measure with a quick setup using a cheap mic/earpiece I had.   Played a simple sine wave tone, and measured the amplitude of the sine wave feedback on the mic voltage

post-7036-0-20034700-1363485938_thumb.jpg

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...