Page 1 of 1

Reset pins to low level on reboot??

Posted: Sun Oct 02, 2022 10:20 am
by lifefive
Good day. Please help advice. Immediately I apologize for my English. When using the ESP.restart() command, all pins remain at the same level as they were previously set. Can you tell me how can I reset some or all of the pins to a low level after using the ESP.restart() command? Thanks a lot in advance.

Re: Reset pins to low level on reboot??

Posted: Thu Oct 06, 2022 6:46 pm
by username
How about trying gpio_reset_pin(GPIO_NUM_X); on the pins you want to reset before calling ESP.restart()

Re: Reset pins to low level on reboot??

Posted: Sun Oct 09, 2022 1:02 pm
by lifefive
Unfortunately this option doesn't work for me. Since this pin should work until the reboot itself. In fact, my situation is slightly different, I just took ESP.restart as an example. My situation is as follows: my esp32 periodically turns on the electric motor, and both the esp32 and the electric motor are powered by one large battery. So, when the battery is slightly discharged, esp32 starts the electric motor, thereby causing a voltage drop and esp32 reboots, but after a reboot, the Pin that controls the electric motor remains one, respectively, the electric motor starts up again and drawdown and reboot again, and this cycle lasts until the Battery is completely discharged. I want that at the first drawdown and reboot, the pin goes to zero, and the electric motor does not start. In general, something like this) I hope you understand me.)

Re: Reset pins to low level on reboot??

Posted: Sun Oct 09, 2022 1:17 pm
by ESP_Sprite
If the voltage on the ESP32 goes too low, the ESP browns out and random stuff can happen. The proper way to fix this is to change your design: either make sure the ESP power supply is properly buffered so it doesn't dip down when the motor starts, or add a voltage monitor that properly resets the ESP if the power goes too low.