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.

Pulse to Drive Speaker and LED's

Status
Not open for further replies.

LiquidOrb24

New Member
Hello

Would it be possible to have the output of a microcontroller which are pulses at either 1.5V, 3V, or 5V to create a sound on a small speaker to simulate a metronome and also have either 1-4 LED's light up as well during each pulse?

I'm basically affraid that there wont be enough power to drive all of these devices from that low output pulse so if this wont work is there an amplifier circuit that I can build that would be able to accomplish this by amplifying each pulse?

If this is possible would it also be possible to have a circuit turn on a different LED in a long LED array?

Sorry to throw all these questions at you but I'm just very lost right now in this design.

Thank you.
 
What kind of speaker rating would be optimal to produce the clicking sound just from the voltages of the I/O pins?

I keep hearing a loud speaker would be great but would I have to amplify the pulse to do that or can it produce audible sound just from the straight voltage coming out of the micorprocessor.

Thanks for the reply by the way.
 
The tiny amount of output current from a microcontroller will create a peak power of only 5mW in an 8 ohm speaker. Earphones and telephones are much louder. A single transistor can amplify it to a peak power of 2W which is loud. An additional transistor can turn on an LED.
 
I'm planning on producing just a simple click sound just like you hear on an old fasion metronome. In fact I would be happy to produce any kind of sound that you would be able to hear very clearly.

I'm not sure if the old speaker I have now that is about 2.5 inches rated at 4 ohms would do the trick. It does move up and down with a low voltage applied but not sure what amplitude I would need or pulse to produce a clicking noise.

I'm interested in the buzzer you mentioned and what the rating is on it, and if it would be able to do what I'm trying to do.

Thanks for the response.
 
The piezo buzzers or 'sounders' as refrenced above only generate sound at a single tone, their oscillator is built in. If you want a metronome tick, you basically just need to use a transistor on the output pin and generate the pulse to represent the tick. Start a timer that will create an interupt say roughly twice per second using the timer prescaller and the known system clock. Every time that timer overflows/triggers run a routine that turns the I/O line the transistor that drives the speaker is hooked up to on, and then immediatly turn it off, see what that gives you for output. Gradually increase the delay between on and off times untill you get the maximum perceived volume. Basically what you're trying to do is turn the I/O line off hard as soon as the speakers cone gets to it's maximum height. That will give you the highest possible impulse spike out of the speaker. You should end up with a nice satisfying tick.
 
Last edited:
A piezo transducer is not a good speaker. It can't produce a pulse like a speaker because its diaphragm moves a very small amount. If it is fed a pulse, it produces a high frequency "snap" twice, once on the leading edge and again on the falling edge.
A bigger speaker produces the pulse and sounds more like a mechanical metronome.
 
Would it be possible to use a regular speaker 8 ohm .5W just something small and amplify the signal from the PWM to create a large enough gain to make an audible sound from the speaker.

Perhapse with a common collector amplifier or a common emitter amplifier to either increase the current or voltage respectively.

I just want a pop sound nothing thats too loud or annoying but rather soothing :)
 
A common emitter transistor with a series base resistor from the microcontroller can supply a peak current of 500mA to an 8 ohm speaker from a 5V supply.
 
Also use a low duty cycle, there's no point in having pulses any longer than about 5mS with a small speaker.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top