jackson1990 wrote: ↑
Sat Jan 04, 2020 12:22 pm
Seems that in tri-state condition the Raspberry 3B pulls down the voltage level to GND internally.
On Raspberry 4B the voltage level seems to be pulled up to 3V3 in tri-state condition.
When I added an external 10k pull-down resistor in conjuntion with 4B it works fine.
Tri-state is when an output is high impedance (neither pulled high nor low). The Pi GPIOs only support this by switching to input mode with no pull. But the phrase is not relevant to inputs.
An input is naturally high impedance (or should be). The state in the absence of a signal is not guaranteed. If you are using a single contact to connect to GND, then you need a pull the 3V3 to guarantee correct operation (and, conversely, a pull to GND if switching to 3V3). As you found, a hardware resistor works, but the Pi input can have a programmed pull that saves you the extra hardware. Details depend on the particular GPIO library you are using, check its documentation.