I know that the maximum output current of a GPIO of the ESP8266 is 12 ma

I have seen the next circuit and I have done it, it works perfectly, I have measured the base current and it gives 10 ma

My question is..., as it is possible that without a base resistor the transistor and the output of the 8266 will not be damaged?

Is it possible that the gpio has some type of protection or current limitation?


enter image description here


I never had the case in 10+ years that an micro-controller had been damaged by having a pin short-circuited, so even if it's not specified on the datasheet there are some sort of current limiting protection.

However, if you do so, you will operate outside the specification of the chip, and as a result you might en up with some unexpected behavior, strange bug/issue or the chip not working at all.

It will also cause the chip to heat up and might reduce the lifetime.

It is just better to keep the resistor, use the chip within its specified range and have a "proper" design and not play with the devil.

If you want to remove the resistor, you can use a N-MOSFET, which is basically a voltage controlled BJT, so you don't need any resistor on the gate. You need to find a mosfet with a gate threshold voltage low enough so that it can fully switch at 3.3V (or whatever voltage is your chip at).

  • \$\begingroup\$ Finally I set a resistance of 1k and the current has dropped to 3.24m, much better. The transistor is a PN2222A and an Infrared Emitting Diode, I do not understand how applying 3.3 volts between base and emitter does not damage the transistor and it is also strange that only a current of 10 ma circulates, will it be due to the input impedance of the PN2222A? Thank you very much for your answer \$\endgroup\$ – Mario Jan 3 at 22:06
  • \$\begingroup\$ @Mario It's due to the output impedance of the ESP. \$\endgroup\$ – JimmyB Jan 4 at 0:24
  • \$\begingroup\$ Thanks JimmyB, I see everyone worrying about not damaging the GPIO output and it turns out that it is short-circuited \$\endgroup\$ – Mario Jan 5 at 10:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.