So you're a Noob? Post your questions here until you graduate! Don't be shy.
User avatar
By Barnabybear
#70793 Hi, I’m glad that worked for you. No you’re not paranoid it’s a perfectly good question.

In your case two voltages come in to play 3.3V and Ground. 3.3V will always be 3.3V, Ground will always be Ground, however GPIO2 can be 3.3V or Ground.

When you connect the buzzer between GPIO2 and Ground there could be 3.3V across it (GPIO2 high) and it will buzz, or 0V across it (GPIO2 low) and it will not.

With the buzzer between 3.3V and GPIO2 there could be 0V across it (GPIO2 is high) and it will not buzz or 3.3V across it (GPIO2 is low) and it will buzz.

To answer your question: There is no difference between the two connection methods with regard to the current that will flow and that’s the thing that will do damage to the ESP.

The important question for both connection methods is how much current is flowing through the GPIO? The GPIOS are good for 12mA so you should add resistors to limit the current to this.
User avatar
By philbowles
#70972
Voidable wrote:Thanks Barnabybear, I tried what you suggested and it works fine now. My only question is, "Is this safe for the board?" My knowledge on this is pretty poor but I feel like there should be a resistor between the buzzer and board when connecting like this. Am I just being paranoid or is there a risk with this?


Yes. I have just been doing something very similar. The typical buzzer I'm using can draw 20mA - way too much for your chip over a sustained period...also the buzzer is very "tinny" at 3,3v

My solution was to use the GPIO pin to drive a single transistor calculating the current (@ 3.3v - 0.7v) through the base resistor to give about 15mA (@ 5v) through the collector to which the buzzer is wired. This way you get proper drive amplification+GPIO pin protection with level conversion thrown in for free...