# How to measure voltage of a floating GPIO (Raspberry Pi)

I would like to measure that voltage of a floating GPIO on a Raspberry Pi 3. When I use a multi meter or an oscilloscope it looks like the pin is pulled to ground and shows 0.

Another way of asking the question is, 'How can I determine if a GPIO pin is floating using an oscilloscope or multi-meter?"

How can I use an oscilloscope to measure the voltage of a floating GPIO pin on a Raspberry Pi?

One simple way is to measure the voltage to ground and then measure it to Vdd (which is 3.3V on the Raspberry Pi SOC).

Since most voltmeters have something like 10M input resistance you've effectively got a resistor across the meter input. simulate this circuit – Schematic created using CircuitLab

If the meter reads about zero both ways then it is relatively high impedance (if there was 10nA leakage it would read 0.1 Volt). Leakage in the high impedance state is typically very loosely specified but it is normally extremely low at room temperature, so this method does work.

If it reads non-zero but both voltages add up to Vdd then it is probably fighting another output or is being switched at a high frequency (an oscilloscope will tell you the difference). This is the 4th combination of measurements, the first two are obviously high and low.

• I wish I could upvote twice... This is the correct answer. Sep 9, 2018 at 19:17
How to measure voltage of a floating GPIO (Raspberry Pi)

The most practical answer is "You don't".

A floating CMOS input is very high impedance. That is usually 10s of MΩ at least, often 100s of MΩ in reasonable humidity with clean boards.

Your question then really comes down to "How do I measure a voltage with a few 100 MΩ impedance?". Again, the realistic answer for someone that has to ask here is "You don't".

Typical voltmeters and oscilloscopes with 10x probes have 10 MΩ input impedance. It should be obvious that connecting 10 MΩ to a 100 MΩ source is going to drastically change the source voltage.

There is specialized equipment and specialized techniques that can measure voltages at such high impedances, but these are not easily accessible to amateurs.

Then there is the question of what the purpose is? After all, it's floating, so can pick up any random voltage for unpredictable reasons. What information would you get out of knowing what the voltage is at one particular time? Your whole question therefore makes little sense.

With "floating" I think you meant the Z mode (high impedance) of a tri-state pin.

This is difficult to measure, since if you touch it, it stops being high impedance
Ideally you need a SMU (source measure unit), a fancy power supply, to measure the leakage current of the GPIO.

With those numbers you can calculate the expected "floating voltage".

Since a SMU is expensive equipment, few people have access to this high end equipment.
Broadcom has measured these numbers in their characterization, and these are published in the datasheet of the BCM2837B.

However, it's is generally recommended to avoid the high impedance mode on any gpio, except analog. Either use external pull-up/down resistors, or enable the internal weak pull resistor when you're able to.
"Floating" pins can cause sporadic issues in the field when the pins are used by hardware or code.
Pins that are not in use are sometimes left "floating" to save energy, but on an RPI3 this is insignificant.

Assumptions for the purposes of this answer. Nothing is connected to the pin (open circuit). You have set the pin to float in the code. You want to check if the code has actually set the pin floating.

How can I determine if a GPIO pin is floating using an oscilloscope or multi-meter?

To check if the GPIO pin is floating, attempt to pull the pin up to the logic voltage supply (or down to ground) using a resistor. If the voltage follows the pull, then the pin is floating. If the voltage stays low when you try to pull it high (or stays high when you try to pull it low) then the pin isn't floating.