10

It is obvious, that 3,3 V is a HIGH, and 0 V is a LOW at a GPIO input pin. But I am looking for the exact voltage thresholds for the GPIO input pins. I have a Pi B+ and a Pi 2.

Watching this video (for an older Pi) I get:

  • LOW: 0 - 1.19 V
  • HIGH: 1.34 - 3.30 V

Based on this, I connected 1 V to the GPIO input. The GPIO was still a HIGH.

This artice (linked here) sais:

  • VIL=0.8V means that if the output is Low it will be <= 0.8V.
  • VIL=1.3V means that if the output is High it will be >= 1.3V

These values are coming from the BCM2835, which the Pi until B+ is having.

I continued reading this article:

  • "Normally the voltage threshold is about 1.8V, but it isn't guaranteed; it can be anywhere between the maximum input low and minimum input high, that is, between about 0.8 and 2.0V."

These values are coming from the ARM1176JZF, which the Pi until B+ is having.

Looking at the table, I get:

  • Input high voltage VIH > 2.00 V
  • Input low voltage VIL < 0.80 V

So: what are the real thresholds? Are they coming from the BCM2835 or the ARM1176JZF? How about the Pi 2? Are the thresholds still the same as for the Pi B+?

EDIT: This article sais, "The GPIO pins are connected directly to the BCM2835 chip at the heart of the Raspberry Pi". Because of this I guess, the values are coming from the BCM2835 and they are 0,8 V and 2 V.

EDIT2: I using wiringPI with the following code to read the LOW/HIGH value:

gpio -g mode 21 in
gpio -g read 21
Dennis
  • 201
  • 1
  • 2
  • 5

2 Answers2

4

Updated, March 2022:

These GPIO voltage thresholds for all Raspberry Pis are currently defined in the "Official" documentation. Note that there are two tables here: one for the RPi 4 (BCM2711), and another for the earlier models (BCM2835 and BCM2837). The voltage thresholds do not vary significantly; the values For all RPi models, the GPIO voltage thresholds are summarized as follows:

Binary Logic Level Worst-Case VI Voltage - BCM283X Worst-Case VI Voltage - BCM2711
Low / LO / 0 VIL ≤ 0.9 Volts VIL ≤ 0.8 Volts
High / HI / 1 VIH ≥ 1.6 Volts VIH ≥ 2.0 Volts

"Worst case" means that for any input of VI ≤ 0.9 Volts (0.8 V for RPi 4B), that input will always be seen as a logic 0. In other words, you shouldn't count on 1.0 V input to be recognized as a logic 0/LOW... it may be, or it may not be! Similarly, an input of VI ≥ 1.6 Volts (2.0 V for RPi 4B) will always be seen as a logic 1/HI. Any value of VI falling between these limits is indeterminate.

That is the case for the Raspberry Pis. However, some of the other platforms (e.g. "Compute Modules") have a configurable supply voltage for the GPIO (VDD IO) that ranges from 1.8V to 3.3V. If you have one of these, you should consult the appropriate datasheet available from The Foundation's document repository.


See the GitHub thread on this issue. N.B. "Persistence pays off".

Seamus
  • 23,558
  • 5
  • 42
  • 83
4

High Low is detected on falling or rising edge, just putting 1v doesn't produce and edge so to speak and may be inconsistent.

The GPIO inputs are floating on boot but then usually Pulled Down by default when everything is loaded up, so technically applying 1v will produce a rising edge and trigger the HIGH Input value.

If the GPIO is already pulled up or has an voltage of ~3.3v, falling from 3.3v to 1v produces a falling edge and produces a LOW. So you can see how 1v can be HIGH and LOW because its based on the Rising or Falling Edges.

This is useful for high frequency communications where the signal will rapidly change between the thresholds you mention but only edges will determine the actual value. This is why its called a Digital Input.

In logic LOW = 0 and HIGH = 1 ... what's in between? Floating uncertainty with random noise. As mentioned, these are digital inputs not analogue, you can't tell if the input is 1V or 1.5v, only 1 or 0.

Analogue inputs (don't exist on the Pi) will tell you exactly how much voltage has been applied if that is what you need.

Piotr Kula
  • 17,336
  • 6
  • 66
  • 105