ESP32 On battery not working ?!

rcarreira88
Posts: 2
Joined: Fri Feb 12, 2021 7:30 pm

ESP32 On battery not working ?!

Postby rcarreira88 » Wed Feb 24, 2021 8:43 pm

Hello, I have a WEMOS LOLIN32 v1.0.0 connected to a 4.2v Battery

-It controls 3 relays 3V, the Loads are connected directly to the 4.2v Battery.
-The GPIOs are connected directly to the coils of the relays.
-The 3V has an Electrolytic Capacitor
-I Have no pull up or down resistors

After this:

Code: Select all

digitalWrite(Valve, HIGH);
delay(100);
digitalWrite(Valve, LOW);
The ESP fails, and I need to manualy reboot.
-If I disconnect the Load, the esp32 works ok.
-if I connect the esp32 to a different Power Source works ok.


What am I doing wrong?

Best Regards
Ricardo

ESP_Sprite
Posts: 9746
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 On battery not working ?!

Postby ESP_Sprite » Thu Feb 25, 2021 1:50 am

rcarreira88 wrote:
Wed Feb 24, 2021 8:43 pm
-The GPIOs are connected directly to the coils of the relays.
This is what you're doing wrong. As soon as you switch off the relay, the magnetic field around its coil collapses and forces a load of current through the ESP32, upsetting it greatly. Suggest you at the very least add a flyback diode to the relais coil. Even better would be to both add the flyback diode as well as to switch it using a transistor or mosfet instead of directly using a GPIO.

rcarreira88
Posts: 2
Joined: Fri Feb 12, 2021 7:30 pm

Re: ESP32 On battery not working ?!

Postby rcarreira88 » Thu Feb 25, 2021 9:29 pm

Thank you for your time, will do that.
Best Regards

Who is online

Users browsing this forum: No registered users and 88 guests