Understanding Hanging Pins and Their Potential

  • Thread starter Thread starter raybuzz
  • Start date Start date
  • Tags Tags
    Potential
AI Thread Summary
Hanging pins in microcontrollers and CMOS circuits can lead to unpredictable behavior, as floating inputs may cause parasitic currents and noise, significantly affecting circuit performance. It is crucial to avoid leaving CMOS inputs unconnected, as they can float to mid-rail voltages due to environmental influences, resulting in erratic switching. The discussion highlights that while high input impedance in devices like JFETs can lead to noise issues, the source impedance is a critical factor in determining susceptibility to interference. Proper termination of unused inputs and the use of pull-up or pull-down resistors are recommended best practices to mitigate these problems. Leaving pins floating is considered poor design practice in both digital and analog circuits due to the potential for noise and instability.
raybuzz
Messages
21
Reaction score
0
Hi everyone,
I am not getting a hang of the potential at hanging pins. Here a few stuff i did which raised this doubt:

1. In a microcontroller i wrote a program to input data to a port. The input was through switches one ended of which was grounded. Hence if switch is on then, the controller pin is grounded, else if off, it is hanging. I initially assumed that the state of hanging pin is logc 0, but it didnt work. i then assumed that the state would be logic 1 , it worked.

2. The same goes for an comparator chip, i tested.

3. Also in JFETs in our analysis of calculating the gate to source voltage(Vgs), we consider Vgs = - ( Vsource). cause the input impedance of JFET is very high and hence current through Rg( gate resistance) is 0.
Then what is the need of putting Rg , as putting Rg will result in lowering of input impedance of the JFET amplifier, as a whole? Cant we take out Rg, as Vgs remains unaffected, and hence both the large and small signal analysis.

Explanation??
 
Engineering news on Phys.org
You must always do something with CMOS inputs. It is very bad practice to leave them open, for two main reasons. First, when the input to a CMOS gate is floating, the pin can float to mid-rail, and that turns on both the input pullup and pulldown stages some, which causes a parasitic current to flow from Vdd to Vss. In a low power circuit, this parasitic current can be more than the whole rest of the cirucuit is consuming -- that's a very bad thing. Second, with the input floating, it can be influenced by small E field changes in the area, and can cause the gate to switch noisily and generally rattle around, creating noise on the PCB.

Always terminate unused CMOS inputs to Vdd or Vss, optionally through a resistor. Note that with many uCs and CPLDs and FPGAs, you can enable on-chip pullup (or pulldown) resistors, which saves you having to use an external resistor. Also, your switch input circuit should have a pullup resistor, if the switch grounds the input.
 
berkeman said:
You must always do something with CMOS inputs. It is very bad practice to leave them open, for two main reasons. First, when the input to a CMOS gate is floating, the pin can float to mid-rail, ...
... Second, with the input floating, it can be influenced by small E field changes in the area, and can cause the gate to switch noisily and generally rattle around, creating noise on the PCB.

How can the pin float to mid-rail region? Say midrail is between 2V to 3V, the circuit noise , E interference, cannot produce a voltage in the hanging pin of more than a few millivolts.
 
raybuzz said:
How can the pin float to mid-rail region? Say midrail is between 2V to 3V, the circuit noise , E interference, cannot produce a voltage in the hanging pin of more than a few millivolts.

Well, static charge in the air is one way. I've seen floating inputs change the output state, based on how close you move your hand to the PCB! That one had me going for a while, until I realized that there were some unconnected inputs on that hand-built prototype board. 50/60Hz E-field noise from nearby AC Mains circuitry is another way.
 
berkeman said:
Well, static charge in the air is one way. I've seen floating inputs change the output state, based on how close you move your hand to the PCB!
Did this really happen with digital circuits? I have experienced similar problems with analog circuits, and always thought it was because by moving hand to PCB, we are adding capacitance to it, between the circuit and Earth ground. For example moving your hand over a radio receiver, will result in an observable noise from the speakers.
 
Last edited:
raybuzz said:
Did this really happen with digital circuits? I have experienced similar problems with analog circuits, and always thought it was because by moving hand to PCB, we are adding capacitance to it, between the circuit and Earth ground. For example moving your hand over a radio receiver, will result in an observable noise from the speakers.

Yes, that example was a 74HC245 buffer circuit driving some LEDs, but I'd left 4 of the inputs floating. Waving my hand near the circuit made those 4 LEDs change ON/OFF/ON, and I could make them buzz with certain hand positions.
 
Ok. But why doesn't the same phenomenon affect circuits which are all connected, and no pin is left hanging. Say i am driving a transistor gate with a micro controller. The current sourced by the controller is low. So isn't there a good chance of static, E interfering with the digital circuitry?
 
raybuzz said:
Ok. But why doesn't the same phenomenon affect circuits which are all connected, and no pin is left hanging. Say i am driving a transistor gate with a micro controller. The current sourced by the controller is low. So isn't there a good chance of static, E interfering with the digital circuitry?

When an input is connected to a logic output, it is being driven high or low by a low impedance, typically in the few tens of Ohms. Even when an input is pulled high or low by a passive resistor, that resistance is typically in the 1k to 10k Ohm range, which is plenty to hold the input at a rail. The issue is the very high input impedance of the CMOS inputs themselves (small capacitance with a tiny leakage current) -- when they are left disconnected, even small nearby influences can change the input gate voltages.
 
During development of a product we had left the window on an EPROM uncovered because the firmware was changed routinely. Some upper address pins were accidentally left open and when the EPROM was in the dark it the whole thing would crash. When the window was exposed to light everything would work fine. Leaving pins floating in digital circuits is BAD BAD practice.
 
  • #10
berkeman said:
When an input is connected to a logic output, it is being driven high or low by a low impedance, typically in the few tens of Ohms. Even when an input is pulled high or low by a passive resistor, that resistance is typically in the 1k to 10k Ohm range, which is plenty to hold the input at a rail.
But consider a JFET amplifier , in any bias configuration. The input is applied at the gate , which has an large resistance Rg of the order of 1Mohm going to the ground (as good as an hanging pin). Though this may not be an digital circuit, won't the same static charge stuff, cause votage fluctuations? The source voltage used is in the order of millivolts.
 
  • #11
raybuzz said:
But consider a JFET amplifier , in any bias configuration. The input is applied at the gate , which has an large resistance Rg of the order of 1Mohm going to the ground (as good as an hanging pin). Though this may not be an digital circuit, won't the same static charge stuff, cause votage fluctuations? The source voltage used is in the order of millivolts.

The source voltage is not the issue -- the issue is the source impedance. If it is very high, then yes, you are going to have noise problems. Johnson noise is an important consideration in the design of FET amplifiers:

http://en.wikipedia.org/wiki/Thermal_noise
 
Back
Top