Grounding unused input only pins?

kbaud1
Posts: 71
Joined: Wed Jan 17, 2018 11:55 pm

Grounding unused input only pins?

Postby kbaud1 » Fri Mar 18, 2022 11:42 pm

I am using the WROOM module and my design has one unconnected pin (GPIO36 aka SENSOR_VP) that cannot be software-configured as an output or with an internal pull-up or pull-down. I can't figure out whether it would be better to ground this pin, or leave it floating. The problem with floating is that it could drift or maybe even oscillate and create noise and draw more power. Grounding the pin seems to go against best practices for MCU's, though the reason always seems to be the risk of bad software driving the pin high as an output, which doesn't seem possible with this pin. Another problem with grounding is that it may be harder to use in the future if the design needs to change, but I am not concerned about this.

Note that even if I do ground this unconnected pin, I can't access and ground the other 2 unconnected pins on the WROOM module (GPIO37 aka SENSOR_CAPP and GPIO38 aka SENSOR_CAPN), so I am forced to leave them floating. However they are at least capacitively coupled to other pins, which should at a minimum greatly decrease the speed at which they could drift or oscillate.

I don't want to add an external resistor to my PCB design, so I am really just wanting to know whether it would be better to leave this pin unconnected or to ground it. I also don't care about the fact that grounding the pin makes it harder to improvise some future use for the pin onto the PCB.

User avatar
jaderrosa
Posts: 3
Joined: Sun Feb 27, 2022 10:41 am

Re: Grounding unused input only pins?

Postby jaderrosa » Mon Mar 21, 2022 4:17 am

Hi kbaud1,

May this other post could help you:
https://www.esp32.com/viewtopic.php?t=19749
Jader Rosa
Embedded Systems Engineering
www.iotzone.nz
info@iotzone.nz

kbaud1
Posts: 71
Joined: Wed Jan 17, 2018 11:55 pm

Re: Grounding unused input only pins?

Postby kbaud1 » Mon Mar 28, 2022 10:37 pm

Thank you jaderrosa,

I read that post before creating mine. It only recommended using a pull-down resistor in critical applications, "to keep all pins in a known state." This leaves unanswered my question about which of two specific scenarios would be better: grounding the pin (directly, not with a resistor) or leaving it floating. It is not a highly critical application or one that requires low power consumption. However I can't see any benefit of leaving it floating (besides making it easier to "frankenstein" an additional input into an old PCB down the road), so I am really just wondering if there is any risk or downside in directly grounding this input-only pin.

cald0s
Posts: 4
Joined: Sun Jul 05, 2020 3:10 pm

Re: Grounding unused input only pins?

Postby cald0s » Tue Mar 29, 2022 5:47 am

If you don't require low power, critical safety or forwards compatibility, then you might be overthinking it. I would say to tie it to ground as like you said, the pin physically cannot go output. I never considered the possibility that it could couple noise and draw more power, so I'm also interested in what others think.

PeterHouse
Posts: 1
Joined: Sun Feb 05, 2023 5:02 pm

Re: Grounding unused input only pins?

Postby PeterHouse » Mon Feb 06, 2023 7:42 pm

My previous experience (>30 years) with other microcontrollers has always been to set unused pins as either output, input with internal pull-up, connect them to ground, or tie them to ground or Vcc directly or with an external pull-up or pull-down resister.

The reason for so many different methods is it is dependent on several factors: the microcontroller fab process, the cost of the external resistors, and can also be complicated by low power designs where putting a pull-up or pull-down on an input pin can cause the quiescent current to be drastically different.

I just solved a problem with an ESP32-S2-WROOM where the design had an input connected through a 3" wire to an external switch near a 5v coil relay switching mains AC. The design was for the esp to use an internal pull-up for this pin and for all the other unconnected pins. The problem on manifested itself near the end of the project when the wires were added and came near the relay and the device was line powered. The esp32-s2 would not program! The input was IO18 and the esp would mostly respond to the esptool commands and would then just go silent. Depending on the input wire position the unit would program if the wire were away from the relay and would not program if the wire was near the relay. Only 13 of the 42 pins in this design are used and I am trying to figure out what to do with the rest of the pins so they do not cause any future problems.

This is the first time an unconnected, unused input has caused a microcontroller to fail programming.

I would love to hear ideas on this from someone with more esp32 experience.

Who is online

Users browsing this forum: No registered users and 170 guests