Page 1 of 1
5v to 3.3v GPIO
Posted: Sun Aug 02, 2015 8:46 am
by scraff
Hi all. Just a quick question. I have searched and searched but not found a definite answer.
I have some modules designed for Arduino that output 5v. Obviously can't connect these directly to RPi's gpio pins.
I've read in various places to just put a 1k resistor in between the module and the gpio input.
Others say u have to use a 2k and 3k to split the voltage. I know this splits the voltage at a 3:2 ratio.
Is just putting one 1k resistor in there enough? What does this do exactly compared to the voltage splitter?
Thanks
Re: 5v to 3.3v GPIO
Posted: Sun Aug 02, 2015 8:55 am
by joan
I believe using a pair of resistors to form a voltage divider will be safer.
A single resistor will limit the current flow. I believe the idea is to limit the 5V current flow to something less than 0.5 mA which some believe may safely be handled by the Pi's internal circuitry.
Re: 5v to 3.3v GPIO
Posted: Sun Aug 02, 2015 9:04 am
by PeterO
joan wrote:I believe using a pair of resistors to form a voltage divider will be safer.
A single resistor will limit the current flow. I believe the idea is to limit the 5V current flow to something less than 0.5 mA which some believe may safely be handled by the Pi's internal circuitry.
It's not hard to work out the actual current flow:
Assuming the GPIO input is clamped to 3.3V, and the external device's output is 5V, then the 1000 ohm resistor will have 5V-3.3V = 1.7V across it, leading to a current flow of 1.7/1000 = 1.7mA into the GPIO pin.
PeterO
Re: 5v to 3.3v GPIO
Posted: Sun Aug 02, 2015 9:06 am
by scraff
Thanks Joan.
I had kind of assumed this but really wasn't sure.
One more question: is splitting the voltage using 2 resistors just as good as a logic level converter (eg the adafruit one)? Is a logic level converter overkill?
Re: 5v to 3.3v GPIO
Posted: Sun Aug 02, 2015 9:13 am
by joan
scraff wrote:Thanks Joan.
I had kind of assumed this but really wasn't sure.
One more question: is splitting the voltage using 2 resistors just as good as a logic level converter (eg the adafruit one)? Is a logic level converter overkill?
I've never used a device which needed more than a pair of resistors, i.e. they were all Pi inputs. The level converters may be targeted at devices where a single line is used both as an input and an output.