Set PIN to GND with transistor

Hi, I have a device with a keypad and ESP32 that is locked in a box and is connected to a rpi with UART through GPIOs. I'd like to be able to reprogram my ESP32 using this connexion to avoid opening my keyboard device. RPI and ESP32 conenxion is working well, but in order to reprogram the ESP32 it has to boot in flash mode. This can be done by pressing the boot button or connecting GPIO0 to GND at boot time but I don't have acces to the inside of the box once it is sealed.
So, I'd like to be able to bind GPIO0 to GND if I press one of my keypad key at boot time. The problem is that I want that ONLY at boot time and dont want this behaviour at run time.

So here is my idea :
use the fact that ESP32 sets GPIO3 to 3.3V at boot time, connect one end of my special key to GPIO0 and the other end to some switch (NPN ?) that would connect to GND when GPIO3 is up.

To summerize : I'd like to connect some pin to GND on 3.3V. I imagine that is what one can do with an NPN transistor but I didn't figure out how this works when it comes to let GND flow.

Can you help ?

It does not. No ESP32 pin is set to an output at reset.
It is an input with a weak pullup to 3.3V like many of the pins. The weak pullup may not provide enough current to turn on a transistor.
You would have to experiment.

Do you need GPIO0 for any other purpose? If not, what's stopping you from having that key connect it to GND during runtime?

As long as that pin is set to INPUT it won't affect the rest of your circuit.

Damn. I had misleading information. It seems you are right.

You are right, there is no PB with gpio0. The problem is with the Keypad button that is used for other purpose and cannot be left connected to gnd as It requiers input pins to be controlled in order to work properly.

You convinced me to abandon this idea. I will add a 4th wire tu my UART connection to control gpio0 from the outside. Thanks.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.