Reset ESP32 with arduino pro mini

Hello,

I want to reset an ESP32 using an arduino pro mini.

I was not sure to connect the enable pin of the ESP directly to a pin of the arduino so I used a pin of an ULN2003a wich I use to activate some relays of the circuit.

It seems it is working but not sure if it is correct connection. The COM pin of the ULN2003a is connected to 5V wich is the voltage of the Relays.

Do you think it is OK this schema?

you could connect it directly to esp32's reset pin by using a voltage divider. a 2:1 ratio should ensure 3.3V, you don't need the uln.

Enable pin needs to be pulled down to GND to reset Esp. You can do it directly from pro mini, just make sure to not to pull it up. Remember to have common ground between two of them.

I have a similar problem I am working on a project where I use an Arduino Mega to control an ESP32 and restart it when it stops communicating because it is in a loop or stuck. The circuit is simple I go out from a pin of the mega and through a voltage leveler to adjust the signal and not compromise the esp32 I enter the pi EN of the Esp32.
The challenge I am facing is that when the Arduino Mega restarts, the ESP32 also inadvertently resets due to changes in the state of the GPIO pins that are used to control the reset line of the ESP32. This is problematic because I need the ESP32 to remain operational even if the Arduino Mega is restarted. I have tried implementing a circuit with a transistor to isolate the reset signal, but I am still having problems with inadvertent resets because I think the circuit is wrong. I am looking for a reliable solution that ensures that the ESP32 only resets when explicitly commanded by the Arduino Mega, rather than as a result of GPIO state changes during boot.

Make sure you have pullup on Esp32 reset pin

On mega side, add a line in your setup

pinMode(ResetPin, INPUT_PULLUP);
before setting your resetpin as output
pinMode(ResetPin, OUTPUT);

Don't you also have problems when one starts before the other?

You should start a topic of your own rather than tacking onto the end of a 2 month old topic that may or may not be relevent

Ditch the Mega and use one or more GPIO expanders if you need more GPIOs on the ESP32. There's nothing the Mega can do that the ESP32 cannot do, so having both in the same system makes little to no sense.

You're great! I had tried with the pull-up resistor but hadn't put it in the code

pinMode(resetESP32Pin, INPUT_PULLUP);
  pinMode(resetESP32Pin, OUTPUT);

it works now!
Thank you

Jim forgives my approach (not very standard) but as you can see with just one more post this topic has given me more opportunities to help, even others who like me will arrive at this page by searching on the internet like I did.
The topic is practically the same and now it can also help others who have my variant of the problem, and who will thus avoid writing their "new post" almost identical to this one... avoiding new work for the moderators and we are all happier ^_^... am I wrong?

There is not only black and white.
I can't abandon Mega, because it all starts from the fact that I'm adding wifi functionality to a project entirely based on Arduino Mega, wired, and 3D printed, which would mean changing everything and then starting again.

You need both. Nice that it works now.

Then mark the topic as solved so that everyone can see that there is a solution and so that other won't continually come here and read the entire post thinking you or the original OP still need help.

Forgive me again...
I'm afraid I don't know how to mark this as solved for me.

That is because you can't. Do you now see why I suggested you start a new topic.

That always looks a bit odd :wink:

@tecnopozzi, do you understand what it does and more importantly, why?

It should be handled by arduino, not a user.

@kmin

How does Arduino know that a user wants to do that?

FYI, I use digitalWrite() instead of your first pinMode().

I mean arduino basecode. Leave it floating until output is defined either high or low.

Thanks, I didn't even know you can digitalWrite before defining as output.

Long ago it was the only way to enable the internal pull-up resistor, there was not such a thing as INPUT_PULLUP :wink:

So to create an INPUT_PULLUP, you used

digitalWrite(somePin, HIGH); // enable the internal pull-up resistor
pinMode(somePin, INPUT);     // possibly redundant