blippy
Posts: 13
Joined: Fri Nov 03, 2017 3:07 pm

Confused about voltages

Fri Feb 16, 2018 7:36 pm

Am I right in thinking that all the GPIO pins are 3.3V tolerant, but not 5V tolerant?

If so, isn't the 5V GPIO inviting a lot of trouble?

For example, the blinkt uses the 5V pin. How comes it doesn't cause damage to the other pins that it uses for SPI communication? Does the blinkt have a built-in voltage divider for example?

Or it is that the voltage on the SPI lines is pulled up to 3.3V by the Pi, which is then only ever grounded?

It seems that there are lots of opportunities to fry you pins if you try to connect two devices together for the purposes of communication over, say, SPI or I2C. And how do you work out what the line voltage is

PhatFil
Posts: 618
Joined: Thu Apr 13, 2017 3:55 pm

Re: Confused about voltages

Fri Feb 16, 2018 7:48 pm

Not all the pins in the 40 pin gpio header are gpio pins. its just quicker/easier to say gpio rather than gpio and power rail/sources.

its a bit of a confusing name in that respect. the gpio pins are pins that are connected to the pi for either input or output, the 5v, 3.3v and ground pins are not gpio pins but pins that are connected to the respective power rails used by the board.

the fact that you can power some low power 3.3v components by switching a gpio pin to output and high may have helped in the confusion.

but only the specified gpio pins are gpio;) and the gnd 5v 3.3v pins are just that power pins..

with the blinkt https://learn.pimoroni.com/tutorial/tan ... ith-blinkt it plugs into the whole header, im sure if you delve into its documentation it will tell you if its using /connected to the 5v supply and if it is it will be for the power to drive the leds, the control circuitry connected to the spi bus will be limited to the 3,3v level the pi uses for gpio pins..

when using the 5v pin on your pi you MUST pay attention to protect your gpio pins from that voltage. check out optoisolators/optocouplers and logic level shifters
Last edited by PhatFil on Fri Feb 16, 2018 7:59 pm, edited 2 times in total.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4630
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Confused about voltages

Fri Feb 16, 2018 7:53 pm

blippy wrote:
Fri Feb 16, 2018 7:36 pm
Am I right in thinking that all the GPIO pins are 3.3V tolerant, but not 5V tolerant?
If so, isn't the 5V GPIO inviting a lot of trouble?
For example, the blinkt uses the 5V pin. How comes it doesn't cause damage to the other pins that it uses for SPI communication? Does the blinkt have a built-in voltage divider for example?
Or it is that the voltage on the SPI lines is pulled up to 3.3V by the Pi, which is then only ever grounded?
It seems that there are lots of opportunities to fry you pins if you try to connect two devices together for the purposes of communication over, say, SPI or I2C. And how do you work out what the line voltage is
The 5V "GPIO" is not a (SoC) GPIO connection it's the 5V power connection. To put it another way - when referring to "GPIO voltage levels" one is not referring to the GPIO connector pins but to the GPIO ports of the SoC to which some, but not all, of the connector pins are physically connected**. So "Am I right in thinking that all the GPIO pins are 3.3V tolerant, but not 5V tolerant?" is incorrect but, yes, the SoC GPIO ports that are connected to some of those pins are not 5V tolerant. Of course some of the connector pins are connected to GrouND (0V), common to the 5V & 3.3V power supply and the 3.3V GPIO signals. What is "the blinkt"? (link/picture perhaps?). W.r.t. "It seems that there are lots of opportunities to fry you pins if you try to connect two devices together for the purposes of communication over, say, SPI or I2C. And how do you work out what the line voltage is" - that's why datasheets exist and need to be read & understood.
Trev.
** Some of the SoC's GPIO ports are used to control other devices on the Pi's PCB and are thus not available for external use.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

User avatar
Burngate
Posts: 5522
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK
Contact: Website

Re: Confused about voltages

Sat Feb 17, 2018 10:11 am

You're right, the GPIO pins that Pimoroni's blinkt uses (pins 16 & 18, GPIOs 23 & 24) aren't 5v tolerant.

To find out all the grubby details, you'll need to find a spec-sheet for APA102 LEDs - otherwise known as DotStar.
But I'm fairly certain Pimoroni wouldn't allow 5v anywhere near the GPIOs

EDIT: AdaFruit have a link to https://cdn-shop.adafruit.com/product-f ... PA102C.pdf
Nowhere on that does it imply 3v3 will register as High - in fact the lowest voltage taken as High is 0.7 Vdd, so 3v5!

Possibly Pimoroni have done something subtle to bring that down

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11096
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: Confused about voltages

Sat Feb 17, 2018 1:39 pm

if Vdd is NOT 5Volt, but lower (say 4.5V) then ViH would also become lower (4.5 x 0.7 = 3.15V) so that would solve it. That is, IF Vdd can be lowered with impunity (with the device still working from it). If not, some level converter must be used to lift the high output voltage above the ViH limit.

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 4630
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: Confused about voltages

Sat Feb 17, 2018 3:20 pm

mahjongg wrote:
Sat Feb 17, 2018 1:39 pm
if Vdd is NOT 5Volt, but lower (say 4.5V) then ViH would also become lower (4.5 x 0.7 = 3.15V) so that would solve it. That is, IF Vdd can be lowered with impunity (with the device still working from it). If not, some level converter must be used to lift the high output voltage above the ViH limit.
Somewhat like I did here: http://www.cpmspectrepi.uk/raspberry_pi ... iPlus.html but for different devices to those of the O.P. , as a "viability test". For other devices YMMV.
Trev.
Still running Raspbian Jessie on some older Pi's (an A, B1, B2, B+, P2B, 3xP0, P0W) but Stretch on my 2xP3A+, P3B+, P3B, B+, A+ and a B2. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Return to “Beginners”