Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

beginners. some help with sound sensor (lm386+microcontollers)

Status
Not open for further replies.

berumin

New Member
Hi, All!

I want to made sound sensor for my robot
I use circuits
**broken link removed**
but I need some help with it. circuits don't work very well.


Audioguru wrote to me
Why is R4 in series with the speaker? It should not be there. Replace R4 with a piece of wire.

Why is a 10 ohm resistor in series with a 0.047uf capacitor missing from the output to ground as shown on the datasheet for the LM386? These are very important parts.

Why is C3 such a low value? then it passes only high audio frequencies. Use 220uF to 1000uF.

The DC voltage at the output pin 5 should be at half the supply voltage.

The supply voltage is only 5V so the LM386 barely works and has a very low output power. Use 9V.

The output of the circuit is AC that normally swings positive and negative.
Audioguru
 
An LM386 is a power amp, not a very suitable choice for a preamp - it's not likely to work very well, use a simple opamp instead.

sorry, i newbie in radio engineering, plz assist me in choice circuits ?
I want make two sound sensor for follower's bot to sound source

thks in reply
 
A simple google finds plenty of examples, here's one:

before ask - I google and find circuits from my first post.

also I find
**broken link removed**
with similar details.

in Circuits from Your post - I can use with +5v supply ? and can I wire from "out" to ADC input in atmega microcontrollers ?
 
The article he posted to me is in Russian so I didn't have a clue about what is the function of the circuit.
 
before ask - I google and find circuits from my first post.

also I find
**broken link removed**
with similar details.

in Circuits from Your post - I can use with +5v supply ? and can I wire from "out" to ADC input in atmega microcontrollers ?

You would need to ensure you used an opamp that will work off a single 5V rail, and neither that circuit, nor the previous poor one you posted are really very suitable for a direct connection to an ADC as they are centred around 0V. I would suggest you rectify and smooth the audio, to provide a positive going DC voltage that represents the volume of the audio.
 
The article he posted to me is in Russian so I didn't have a clue about what is the function of the circuit.
simple sound sensor
from OUT to ADC in microcontrolles
and measure sound level to choice action

thks in advice
 
Last edited:
a lm386 is nothing but an opamp capable of reasonably large current. so yes, it can be used here.

a typical electret mic outputs about 100mv. so to output to full 3.3v mcu or 5v mcu, you need about 40x gain, fairly easy with a lm386.

the original design got a lot of things right: 20x gain (jumper-able), input impedance matching to the mic, input dc blocking (I would upsize the .1u a little bit, to maybe 4.7u but since you aren't looking for sound quality, it is OK to use .1u cap here), supply decoupling, and that 1k resistor on the output.

in short, it should work.

what you want to do next depends on what it is not working for you - "circuits don't work very well." isn't exactly helpful to people who are trying to help you. exactly what are the problems you are having with the circuit?
 
--offtopic---
thks all for advice and reply.
and sorry , if my quiestion is stupid.

i simple want to locate with two sensors sound in room, and move my robot to it's source.

ps I want to make toy, with some AI, for my son
 
your question isn't stupid. but it lacks information for others to help you. when you say that the circuit doesn't work well, what doesn't it do well? what problems are you having with it?
 
what you want to do next depends on what it is not working for you - "circuits don't work very well." isn't exactly helpful to people who are trying to help you. exactly what are the problems you are having with the circuit?
I try see on OUT signal - but I see discharging C3 capacitor from 2.6V
to 0V . and i doubt in correctly circuits

ps sorry for poor english
 
Last edited:
You would need to ensure you used an opamp that will work off a single 5V rail, and neither that circuit, nor the previous poor one you posted are really very suitable for a direct connection to an ADC as they are centred around 0V.

that's incorrect. lm386 can be used for single rail, and is configured for single rail here.

the schematic posted by the oringinal poster is conceptually identical to the one later linked by the original poster: they all use a lm386 as an opamp, powered by single rail, to amplify the signal from an electret mic and then feed that to the adc.

it should work.
 
when powered up, the left of C3 should see 1/2 Vcc (roughly 2.5v if Vcc=5v), and the right of C3 should see 0dc + your ac signal.

actually if you put a headphone / speaker to the right of C3, you should hear sound out of the speaker.
 
when powered up, the left of C3 should see 1/2 Vcc (roughly 2.5v if Vcc=5v), and the right of C3 should see 0dc + your ac signal.

actually if you put a headphone / speaker to the right of C3, you should hear sound out of the speaker.

on pin5 lm 386- 2,6V
on OUT - from 2.6 to 0, and next when hear sound from -0.5 to 0.5
but I don't have oscillograph and see simple voltmeter

all powered 5V
 
Last edited:
The output of the circuit is an AC signal. Its negative swings are limited by the input protection diode of the ADC input. But the max positive swing is only about +1.5V since the supply voltage of the LM386 is only 5V.
The input of the LM386 could be biased so that its output pin5 swings from +1V with no signal to a max of +4V at a loud signal.

The jumper must be in place for the LM386 to have enough gain.
 
on pin5 lm 386- 2,6V
on OUT - from 2.6 to 0, and next when hear sound from -0.5 to 0.5
but I don't have oscillograph and see simple voltmeter

all powered 5V

sounds like the circuit is working. the output is ac, after being filter by the 1k resistor and the .1u capacitor.

if you want to see DC, you can eliminate C3, and the output will be from 0v to 5v, assuming the lm386 is powered by a 5v source.

you just need to make sure that in your program, any (material) deviation from 1/2 Vcc means here is sound.
 
and if you look at the led flasher, it is working off a dc input - I guess to avoid a pin being pulled below 0 too much.

either should work for you, but requires different approach to the programing side of the project.

personally, I would go DC.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top