0
\$\begingroup\$

I want to take a microphone and send it to a micro controller. I then want that microcontroller to evaluate if the audio is above a set db reading and then send a yes or no single to turn on a light. I need help setting up my circuit. I have never used a microcontroller or a microphone, any extra info would be great. Thank you.

\$\endgroup\$
  • 1
    \$\begingroup\$ A MCU is probably overkill for this. \$\endgroup\$ – Ignacio Vazquez-Abrams Jul 19 '15 at 19:34
  • \$\begingroup\$ I don't think microcontrollers have postal facilities, so I am not sure how you would send a microphone to one. In all seriousness though a lot more information is needed about what microphone, what microcontroller, etc. LEDs aren't controlled by Yes or No, they can however be controlled by a digital output with a voltage signal. \$\endgroup\$ – Tom Carpenter Jul 19 '15 at 19:55
  • \$\begingroup\$ All i'm insteresting is reproducing this. youtube.com/watch?v=CwU6rvMSN8o The lights don't matter, in the end I want play with the 'on until loud sound' marked line. I am tryign to do this a cheaply as possible as well. So they used a microcontroller I assumed I would do the same. \$\endgroup\$ – Mike Jul 19 '15 at 19:59
  • 2
    \$\begingroup\$ You don't need a microcontroller for this unless you have some unstated complex logic to apply. Research comparator circuits. That should set you on the right path. \$\endgroup\$ – lyndon Jul 19 '15 at 23:32
  • \$\begingroup\$ You would connect the microphone input to an ADC channel of a microcontroller. Sample the input at frequency as required (probably 8khz or more for voice), then process the digitized stream. A microcontroller is probably the lowest part count method and also let you control the triggering profile easily. \$\endgroup\$ – rioraxe Jul 20 '15 at 6:43
2
\$\begingroup\$

What microphone are you using? What microcontroller? What is your sound source? We are going to need that information to help you build an actual circuit that you can use for this application. As some of the comments said, this doesn't have to be done with a microcontroller, but it will probably make things easier to understand starting off.

As a general idea, your microphone on its own might not have enough of a voltage swing for you to read it directly into the ADC of a uC. You'll want to use an op-amp to amplify the signal coming out of the microphone (you might need to bias the mic as well, depending on specifics of what you're working with). Once you read in the output of the amp in your ADC, your program can decide whether or not to turn on the LED.

If you want to do it without a microcontroller, you could send the output of the microphone amplifier into a comparator and use a potentiometer to adjust when the comparator triggers high, driving an LED. This gives you a physical way of adjusting how loud the sound needs to be before the LED turns on, which is a pretty neat experiment to start off doing as well.

\$\endgroup\$
  • \$\begingroup\$ Honestly I haven't been able to pick a microphone. I was going to use the cheapest microphone. I like your idea of using a comparator and a potentiometer. I am still researching both things. I like the idea of being able to adjust how loud the sound needs to be before the LED turns on. My next step is to design the circuit and figure out my power needs and circuit design. If you have any input that would my research that would also great. Thank you! \$\endgroup\$ – Mike Jul 21 '15 at 19:12
  • \$\begingroup\$ Can you give additional details on the type of sound source you're trying to listen to? Is it music, or just a simple tone? Do you want the LED to simply turn on when it's above a threshold, or do you want it to stay on once the threshold had been reached? \$\endgroup\$ – justinrjy Jul 22 '15 at 6:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.