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
6
  • You should clarify how you have set the pin as an input and how you are reading the state.
    – goldilocks
    Commented Apr 24, 2015 at 16:01
  • I added the informations
    – Dennis
    Commented Apr 24, 2015 at 16:15
  • I do not agree that there will be one threshold consistent between Pis - it doesn't seem to make any sense - wouldn't each chip respond uniquely?
    – joan
    Commented Apr 24, 2015 at 16:52
  • And it might depend on what else is going on within the chip, or how warm it is, or stray EM, cosmic rays etc (as per the interesting photoelectric effect with the pi2 power supply)
    – paddyg
    Commented Apr 24, 2015 at 18:33
  • 1
    Yesterday I just had an analogue signal, e.g. a photoresistor. "High Low is detected on falling or rising edge" - this makes a lot of sense. Therefore I added a Schmitt-Trigger between the photoresistor and the Pi. Now I am getting perfect falling and rising edges. Thanks for the hint @ppumkin
    – Dennis
    Commented Apr 25, 2015 at 14:01

2 Answers 2

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.

4
  • I have to ask again: "GPIO input hysteresis (Schmitt trigger) can be on or off". Because of the hysteresis, the input pins must have a voltage threshold to detect LOW or HIGH. See elinux.org/…
    – Dennis
    Commented May 5, 2015 at 12:04
  • Sorry, was that a question? The GPIO is usually pulled down to 0v (after boot and set to LOW) when nothing is connected, but hysteresis is about lag between detecting these voltages, and usually has to do with high speed Pulse Width Modulation problems. Not sure what you mean.
    – Piotr Kula
    Commented May 5, 2015 at 18:19
  • 1
    Certainly there has to be some voltage limit below which it is always considered 0 and another above which it is always 1? It would make no sense that fluctuation e.g. between 0-0.5V would be considered jumping between 0 and 1. This page states that the limits are not properly specified, but provides guidance: mosaic-industries.com/embedded-systems/microcontroller-projects/…
    – Sampo
    Commented Dec 22, 2018 at 21:02
  • It seems that the RPi community still lacks definitive thresholds for GPIO inputs. The passage you've cited in your answer (in the blockquote) is interesting, but lacks a reference. I know it's been a while, but do you recall the source for this?
    – Seamus
    Commented Feb 16, 2022 at 21:00
3

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".

8
  • The linked data is correct BUT the above misinterprets it. Vil MAX 0.6V only applies for VDD IO = 1.8V. As ALL Pi use VDD IO = 3.3V this is the correct spec to use - i.e. 0.9V
    – Milliways
    Commented Feb 17, 2022 at 1:34
  • @Milliways: You prefer "worst worse case"? :) lol You are probably correct, but the documentation never says exactly what VDD IO is. In any case, I'd like to see a reference if you have one.
    – Seamus
    Commented Feb 17, 2022 at 1:58
  • All the Raspberry Pi Ltd documentation says GPIO voltage is 3.3V. The Broadcom chip can use voltages from 1.8 to 3.3. Admittedly the voltage on banks 1, 2 is not specified AFAIK but of academic interest as the pins are inaccessible (and undocumented).
    – Milliways
    Commented Feb 17, 2022 at 2:26
  • @Milliways: I agree - but until that is spelled out, [VDD IO == 3V3/GPIO] has to remain an assumption. FWIW, I'm trying to get an answer, but progress in the Documentation repo is apparently slow.
    – Seamus
    Commented Feb 17, 2022 at 4:08
  • @Milliways: I think it means 3v3/GPIO supply rail - but what's that got to do with it?
    – Seamus
    Commented Feb 17, 2022 at 4:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.