-->
Page 1 of 2

Powering Esp1 giving strange behaviour

PostPosted: Sat Nov 21, 2020 2:38 pm
by J.Silva
Hello,

I am trying to power 3 leds to blink with esp1 using an universal charger that can be adjusted to 3V.
I'm posting an image of the circuit as a file, and will aswel describe the pin connections below:

RX - LED
GPIO0 - LED
GPIO2 - LED
RESET - VCC
CH_PD - VCC
TX - open

here is what I tried and I'll start by the only case that worked:

Lipo battery: the 3 leds blink as expected, the battery is measuring about 2.8V

Arduino Uno 3.3V;
usb adapter for esp1 vcc and gnd pins,
universal charger (3.6V on voltimiter, drops to 3.1 when loaded)

All of these three will only light the leds pluged on the GPIOs and not the one connected to RX. And I should mention that they don't blink.


I preferebly would like this to work with a charger since I'm learning and testing.

anyone have a clue or can point me to a solution?

I was thinking if it's correct to connect leds directly to gpios and rx, tho I've seen people doing that in tutorials. And I am still confused that it works with the lipo battery, but not the other sources.

thanks.

Re: Powering Esp1 giving strange behaviour

PostPosted: Sun Nov 22, 2020 12:18 pm
by btidey
It is not a great idea to connect a LED to a GPIO without a series resistor to define the current. For example the red LED starts conducting around 1.2V across it and will rapidly increase as that voltage increases. With 3.3V from a GPIO the current would theoretically be enormous but in practice gets limited by the drive capability of the GPIO. This is not well defined and so you don't really know how much current is going through the LED, and it is putting unnecessary strain on the GPIO. Instead you should use a series resistor to set the current. So for example if you want 5mA through the LED then assume the LED will drop 1.5V then the resistor should be (3.3 - 1.5) / .005 or 360 Ohm. The voltage dropped by the LED will vary depending on its color.

Second the power supply. Your charger is dropping to 3.1V when loaded but this is measured with a voltmeter which is giving you an average reading. If there is pulses in the current drawn then the voltage may be dipping well below the voltage you measure and this could be causing mal-operation of the ESP. A power supply that is dropping by 0.5V when under what should be a modest load does not sound like a supply that is fit for this use. You need one that can supply 0.5A without a significant drop.

The LIPO measuring 2.8V sounds bad as well. A charged LIPO should start at about 4.2V and go down gradually to 3.3V when it discharged. Measuring 2.8V would indicate either that the battery is suspect or fully discharged or that you have high resistance power leads connecting the power to the ESP so that voltage is being dropped across them.

Re: Powering Esp1 giving strange behaviour

PostPosted: Sat Apr 10, 2021 5:07 am
by J.Silva
btidey wrote:It is not a great idea to connect a LED to a GPIO without a series resistor to define the current. For example the red LED starts conducting around 1.2V across it and will rapidly increase as that voltage increases. With 3.3V from a GPIO the current would theoretically be enormous but in practice gets limited by the drive capability of the GPIO. This is not well defined and so you don't really know how much current is going through the LED, and it is putting unnecessary strain on the GPIO. Instead you should use a series resistor to set the current. So for example if you want 5mA through the LED then assume the LED will drop 1.5V then the resistor should be (3.3 - 1.5) / .005 or 360 Ohm. The voltage dropped by the LED will vary depending on its color.

Second the power supply. Your charger is dropping to 3.1V when loaded but this is measured with a voltmeter which is giving you an average reading. If there is pulses in the current drawn then the voltage may be dipping well below the voltage you measure and this could be causing mal-operation of the ESP. A power supply that is dropping by 0.5V when under what should be a modest load does not sound like a supply that is fit for this use. You need one that can supply 0.5A without a significant drop.

The LIPO measuring 2.8V sounds bad as well. A charged LIPO should start at about 4.2V and go down gradually to 3.3V when it discharged. Measuring 2.8V would indicate either that the battery is suspect or fully discharged or that you have high resistance power leads connecting the power to the ESP so that voltage is being dropped across them.



Hello btidey, thank you for your answer.

I was not aware that the resistor on the LED would limit the max current. In this case the red pin is more obvious because the work voltage it's a lot lower, but what would you do with green and blue pins? also use a resistor? Or it's not necessary because the work voltage is similar to the output voltage?

I managed to buy a new power supply that has stabilized output. It worked properly initially.
Right now I'm having new problems, and I think it's related to the LEDs without current control.

When I turned the power on the first few times the ESP was working perfectly. Then the behaviour change and it's not running the code anymore I guess. Even tho it turns on. If I remove the LED from the circuit before I power it, and only then plug in the LED, then it sometimes work.

Trying to figure out if I need a "booting" circuit for the rgb LED. Might create a new post for that one.

Sorry for my late late reply.

Re: Powering Esp1 giving strange behaviour

PostPosted: Sat Apr 10, 2021 3:30 pm
by btidey
You should use a resistor for all leds irrespective of the colour. They do have different voltage drops but the current will not be well defined unless you use a resistor.

See http://lednique.com/current-voltage-rel ... iv-curves/ for some typical curves.

Blue needs the lower resistor value, green yellow a bit higher, and red the highest