# Driving a tiny speaker via pwm, amplified with a BJT - in reverse?

I'm playing around with a micro and a small buzzer (passive). I built up an simple emitter-follower buffer to reduce the load on my uC, but I accidentally installed the transistor backwards on the board. It worked great, although when I noticed my mistake and flipped it around (with the emitter side tied to gnd, and the load coming off the collector), the sound was greatly reduced, about the same as driving the buzzer directly from the gpio.

I'm trying to understand what's happening. The volume is much MUCH louder with the transistor 'flipped' (as in the diagram). Current from collector -> GND is 50mA, and I get the same reading from the speaker - > the emitter. I(b) is too small for me to read with my meter.

What did I just build?

simulate this circuit – Schematic created using CircuitLab

Update:

After looking at the datasheet from the buzzer, and wiring it up as below, the volume output from the speaker is equally loud in either transistor orientation. Oddly enough, if I remove the flyback diode, then I lose a lot of volume in 'normal' orientation, but not in reverse.

I'll also note that I tried a few other tiny speakers, and didn't observe this behaviour. So, something about the particulars of the buzzers I was using.

simulate this circuit

• are you absolutely certain of the transistor orientation? Jul 2, 2020 at 22:44
• Yes, absolutely. And that its NPN. Jul 2, 2020 at 23:13
• The reverse transistor yields an NPN with lower beta (current gain). In both cases you get an input to load diode with cathode to load. I'm guessing that the change in diode properties increases the reverse current when the drive is low. || Test: Does shorting base to emitter increase volume? || If the piezo is a pure capacitor there should be no Vcc to ground current due to switching alone. you MAY be charging the piezo cap on the high level drive and discharging it when drive is off. Jul 3, 2020 at 0:01
• Are you sure it's actually a piezo buzzer and not an electromagnetic type? If you measure the resistance pin-to-pin, what do you see? Jul 3, 2020 at 1:07
• Oooooh! Good catch. It's not Piezo at all. I can see some fine copper coils, and measure 20ohms across it. It has no active components though - it measures 20 ohms in either polarity, and does nothing when connected to DC. Jul 3, 2020 at 1:48

Okay, we've established it's an electromagnetic type transducer.

The resistor appears to be 270 ohms, not 2.7K.

You may be excessively overdriving it with the transistor working properly. An electromagnet transducer in that resistance range is probably expecting about 1.5V. It also should have a diode across it because of the inductance (one I happen to have measures 40.8$$\\Omega\$$ and 0.7mH), so try about 50 ohms in series and a 1N4148 across the pair.

For reference, here is a similar part.

• Yeah, after learning that it's not piezo, I looked up a few datasets. I'll try it with a flyback diode, and maybe a series resistor. I think I pulled it from an old printer, so I really have no idea what voltage it expects, though these little 12mm type buzzers all seem to specify a 50% 1.5v to 12v square wave, and tolerate anywhere from 20mA to about 60mA. Jul 3, 2020 at 2:54

The reversed CE gives full bandwidth at unity current gain.

• I don't understand. It's certainly not drawing 20mA through the base, but I am seeing 20mA through the emitter and collector. The base current can't be any higher than (5V-0.7v)/2.7k, or 1.6mA. Which means I'm getting a current gain of 12.5, not unity Jul 3, 2020 at 2:10
• I suspect you were getting measurement errors with magnetic crosstalk from a magnetic buzzer and back EMF pulses. You have to measure with an RC filter thru DMM. MUCH Louder implies it was being driven at 1.6mA in reverse, not 20mA for the quiet level. Jul 3, 2020 at 2:31
• I believe you are correct about the back EMF messing with my meter readings. With a flyback diode across the speaker, readings are all much more in line with what you'd expect. Jul 3, 2020 at 14:47
• Thanks for verifying my correct answer Jul 3, 2020 at 14:48