GladiTek
Posts: 2
Joined: Fri Dec 22, 2017 10:28 am

Setting up GPIO to supply 5V (ON or OFF)

Fri Dec 22, 2017 10:42 am

Hello, I'm a long time lurker of these forums but only now decided to register to ask you this specific question:

Is it possible to supply 5V with any free GPIOs on the board? Also is it possible to turn it ON/OFF with a script?
I have a protoype board that needs 5V supply when the value is "1" and 0V when value "0".

I'm still fairly new to python and raspberry I/O so any help is appreciated.

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

Re: Setting up GPIO to supply 5V (ON or OFF)

Fri Dec 22, 2017 1:14 pm

No its is not, at least not without more hardware.
All GPIO's (of any RPI) are 3.3V only.
There are 5V headers on the GPIO pinheader, but they just distribute 5V from the power supply directly.

Just use a transistor as a switch to control the current running through a 5V powered device.

pcmanbob
Posts: 3035
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Setting up GPIO to supply 5V (ON or OFF)

Fri Dec 22, 2017 10:08 pm

Depending on what it is you want to drive with this 5v there are other options besides a transistor.

You can use a 74HC125 or SN7407 to level shift the 3.3v of the gpio output to 5v you could also use an opto-isolator to switch the 5v.

It just depends what it is you are trying to drive with the 5v and how many outputs you need at 5v.

all the above can be driven from the GPIO using python and simple gpio output commands to give 5v or 0v.
Please only ask questions in the forum I will not answer questions sent to me directly via PM
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

GladiTek
Posts: 2
Joined: Fri Dec 22, 2017 10:28 am

Re: Setting up GPIO to supply 5V (ON or OFF)

Wed Dec 27, 2017 9:31 am

Hello, thank you for your replies.

At the end the engineer of the prototype board told me it's not important to have 5V (even though he stated otherwise before) so I just use regular 3.3v output as value "1" for now.

Still very useful info, thank you everyone.

Return to “General programming discussion”

Who is online

Users browsing this forum: reverendfuzzy and 5 guests