buzzer working backwards

Hi, I am trying to connect a simple buzzer to arduino with an 2n3904 npn transistor. so i did connect it in the breadboard like in the picture attached

theres a pulldown resistor, the transistor base resistor, then it goes to a potentiometer to somehow adjust the volume of the buzzer.

I did this a couple of weeks ago and (as far as I remember) it worked. So when I pulled the arduino output pin high, the buzzer sounded, and stopped when the pin is low.

Now im trying to do the same but in a perfboard instead of a breadboard. I have soldered everything but… it works backwards! i.e I have to make the pin LOW in order for the buzzer to sound.
(this perfboard contains also other components, but it all is working ok except for the buzzer)

so… what am i doing wrong?

as a side note… when i was testing it still in the breadboard, i though i was using a 10k base resistor and a 1K pulldown resistor. when i went to solder the perfboard, i measured the resistors of the breadboard and they were both 1k… so i soldered in the perfboard 1k resistors too. Could this be the problem? (even tho, as I said, i think it worked ok…)

I don't understand what you are doing with the trimpot. I would expect one end of the buzzer would go to 5v and the other to the collector. Why is the trimpot connected one end to 5v?

Weedpharma

The idea was to control the buzzer's volume with the potentiometer. Look http://www.learningaboutelectronics.com/Articles/How-to-vary-the-volume-of-a-buzzer

(even tho there's a couple of errors I can see in that article, for example the pic shows 1k potentiometer and then he talks about 10k, plus in the drawing there's a pin of the potentiometer that is not connected to anything, and should be connected to ground, as i see it...)

by the way, my potentiometer is 10k.

There’s no mistake using the pot like that article shows: it’s used as a variable resistor not as a voltage divider. From what I understand, dividers are not good for providing current to drive loads.

Have a look at the attachment: the top part is the way you have it as far as I can see. The bottom part uses the pot as a variable resistor, with (as weedpharma suggests) the load on the collector. When the base is high, the transistor is closed, the collector is pulled low, and the current is through the buzzer and the variable resistor.

ok, now im thinking my knowledge about potentiometers is pretty much wrong... :-[

my idea about potentiometers was something like: you connect one pin to Vcc, another one to GND, and as you turn the knob you will be getting at the third pin (the one that is alone in a side of the pot) a voltage that varies between 0-Vcc... so thats why i was directing that pin to the + of the buzzer.

now looking at your answers and that schematic, it seems i can just forget about the third pin... is this right?

Your thinking about potentiometers is spot-on, it’s just that in this case you don’t want a pot you want a variable resistor. I’ll leave it to others to explain why: I think it’s that when there’s significant current involved, it’s no longer a simple matter of dividing the voltage in proportion to where the wiper is.

As JimboZA says, the pot is used purely as a variable resistor. Leave one end open and you have a resistance between the central pin and the remaining end and it can be varied. This gives you a resistance range of 0 to 10k to put in series with your buzzer.

You are correct in saying that the pot can be used between 5v and ground and get variable voltage out, but in this case it is not what we want.

Weedpharma

oh ok, I understand now. just two different uses for the same thing. thanks guys.

just to be sure I got it before I go desoldering/soldering: one of the lateral pins should be left unconnected (wich one doesnt matter), then of the 2 remaining pins, one should go to +5v and the other to the + of the buzzer. these two are interchangeable, so doesnt matter wich one goes to +5 and wich one to the buzzer.

is this right?

patsy:
so doesnt matter wich one goes to +5 and wich one to the buzzer.

is this right?

Yep, since at that stage it’s just a resistor, albeit adjustable.

ok perfect. thank you very much guys!

If you have an ohm-meter, you can verify for yourself that either end to the middle varies in resistance while you turn it.

Normal convention is that clockwise rotation increases the resistance.

Weedpharma

Does a buzzer working backwards, go "zzub"?

weedpharma: Normal convention is that clockwise rotation increases the resistance.

Wanna bet?

weedpharma: Normal convention is that clockwise rotation increases the resistance.

Weedpharma

Normal convention is that clockwise rotation increases the Volume. So that means the resistance is decreasing.

Henry_Best: Normal convention is that clockwise rotation increases the Volume. So that means the resistance is decreasing.

So on a volume control pot the wiper moves towards ground when turning clockwise?

In a potentiometer situation where there is a signal applied to one end and gnd on the other, clockwise rotation increases the resistance that is "read" to the next stage. The input volume is fed to the top of the pot and the wiper is wound to increase the resistance and hence feed a larger voltage to the next stage.

In the OP situation we have a series resistor. If the device was anything else we would wind clockwise to increase the series R.

Weedpharma

weedpharma: In the OP situation we have a series resistor. If the device was anything else we would wind clockwise to increase the series R.

Err, No! We wouldn't. Dimmers, fan speed controllers, speaker volume selectors - just about everything you turn clockwise to decrease the resistance and feed more power.

Addendum: Hey! Cite an actual example.

weedpharma: So on a volume control pot the wiper moves towards ground when turning clockwise?

No, ground is not where the signal is coming from. On a volume control pot the wiper moves towards the input signal when turning clockwise. Turning clockwise decreases the resistance between the wiper and the signal source. Obviously.

Ok, I may have generalised and there are many situations that use reduction in R, (dimmers) to increase the output. These are situations where the time to trigger something needs to be shortened to increase the output.

There are also situations where an increase in timing is required to increase the output time (RC delay, although these are now much less used as becoming digital).

As far as the volume control goes, it can be considered as reducing the R. But as it is a voltage divider not a simple series R, the R between the gnd and wiper is being increased to tap off more of the input voltage. I will go out on a limb and say that this is the usual way to look at a volume control, ie, tapping off the input of a potential divider.

Weedpharma