Skip to content

Floating inputs

DANGER

We speak of a floating input when an input of a device is not determined, and can go HIGH or LOW at random. For this we need some kind of input conditioner. Be aware of floating inputs:

  • After diodes.
  • After switches.
  • Inputs of microcontrollers.
  • Digital inputs of IC's.
  • The non-inverting input of op-amp.

Explanation Pull-up & -down resistors

The common conditioner to prevent floating inputs is by using pull-up & -down resistors. Please look at the simulation below.

Explanation step-by-step

Notice the noise source. This simulates noise from the environmont acting on inputs.

  1. If you close the switch at step 1, you connect the logical input with a clear +5V / HIGH. Unfortunately as long as the switch is open, and thus the pin is unconnected, even the smallest bit of noise picked up from the surroundings can randomly affect what the input sees. That is why you see that flickering in the simulation.
  2. So why don't we just connect that logical input to ground? Look at step 2. While the switch is open, we don't see that flickering, because the logical input now sees a clear 0V signal. Unfortunatly with this we created a new problem: when you hit the switch at step 2 the simulation stops because you created a short circuit! Yikes! Don't worry it is just a simulation, but you have restart the simulation to continue testing.
  3. The solution we need: give the input a clear 0V signal when open, and a clear +5V signal when closed without creating a short circuit. At Step 3 I added a resistor for just that. This configuration is called a "pull-down resistor", eventhough the actual resistor is not pulling anything down, but is protecting the +5V power source from directly connecting to ground!
  4. You can also inverse that logic with a "pull-up resistor". See step 4.

Floating input at op-amps

Please also consider possible floating inputs at op-amps. Especially for non-inverting inputs (the +) you want to consider a pull-down resistor to prevent weird op-amp behaviour. For the inverting inputs I normally don't worry.

TIP

Maybe you don't need to add a dedicated pull-down resistor because other building blocks of the circuits before your op-amp are already indirectly doing this. Like a voltage divider or some transistor logic circuit, for example.

Unused inputs

A popular IC like the TL074 has four op-amps build within, but sometimes you don't need all four of them. Also for these unused op-amps you don't want floating inputs, because they will influence the performance of the used ones, or even damage the op-amp!

  • On the left we see an op-amp without any connections. The noise is just to simulate what happens with floating inputs.
  • Notice the flickering in the simulation.
  • On the right we created a simple non-inverting buffer circuit with the input to ground. See the difference?
  • You don't need to add a pull-down resistor, just directly connect it to ground.

TIP

If you have a spare part try to use it first for other creative purposes. Maybe you can use it for a fancy LED driver?