Page 1 of 1

basic electrical questions (GPIO)

Posted: Fri Jan 27, 2017 12:52 pm
by Cain89
Hi,
I thought I would have some basic electronic skills, but either I'm a Blockhead or I'm overseeing something because I have some really simple questions.

1) I can read everywhere that I shouldn't apply a voltage over 3.3V on a GPIO pin. Does it mean the literally GPIO pin or evey pin so that i have to ground the 5V somewhere else ?

2) There are some electrical components that need 5V to work (e.g. Laserdiod [KY-008] or 433 Mhz reciever). Is it save to send (e.g. Laserdiod) or recive a signal (e.g. 433 Mhz reciever) over a GPIO pin without a voltage devider or something else ?

3) I know Ohm's law (U = R * I) but if I biuld a circuit (turn on a LED, a Motor, a Sensor or whatever) where from do I know if i exceed the 16mA a GPIO pin can take, i don't know the resistance of the circuit or do I know it and simple oversee it ?

As said before I know this are really simple questions, but I ask rather a stupid question than fry my pi.
Thanks in advance.

Re: basic electrical questions (GPIO)

Posted: Fri Jan 27, 2017 1:09 pm
by FTrevorGowen
Cain89 wrote:Hi,
I thought I would have some basic electronic skills, but either I'm a Blockhead or I'm overseeing something because I have some really simple questions.
1) I can read everywhere that I shouldn't apply a voltage over 3.3V on a GPIO pin. Does it mean the literally GPIO pin or evey pin so that i have to ground the 5V somewhere else ?
2) There are some electrical components that need 5V to work (e.g. Laserdiod [KY-008] or 433 Mhz reciever). Is it save to send (e.g. Laserdiod) or recive a signal (e.g. 433 Mhz reciever) over a GPIO pin without a voltage devider or something else ?
3) I know Ohm's law (U = R * I) but if I biuld a circuit (turn on a LED, a Motor, a Sensor or whatever) where from do I know if i exceed the 16mA a GPIO pin can take, i don't know the resistance of the circuit or do I know it and simple oversee it ?
As said before I know this are really simple questions, but I ask rather a stupid question than fry my pi.
Thanks in advance.
Some brief "answers":
1) The GPIO's (as outputs) can only provide 3.3V logic "high" levels. Similarily (as inputs) their input cannot exceed 3.3V. All circuit "grounds" (0V) should be tied together "in common".
2) A resistive divider may be used to "level-shift" a device's 5V output to a 3.3V input.
3) The nominal 16mA limit is the output current limit over all GPIO's used as outputs. (Input currents are much lower - one could say that the GPIO's have a high input resistance/impedance) Proper circuit analysis requires the application of more than Ohm's law - I suggest you start with Kirchoff's law etc.
Trev.

Re: basic electrical questions (GPIO)

Posted: Fri Jan 27, 2017 1:20 pm
by BMS Doug
Cain89 wrote:Hi,
I thought I would have some basic electronic skills, but either I'm a Blockhead or I'm overseeing something because I have some really simple questions.
Hi,
Cain89 wrote:1) I can read everywhere that I shouldn't apply a voltage over 3.3V on a GPIO pin. Does it mean the literally GPIO pin or evey pin so that i have to ground the 5V somewhere else ?
GPIO pins are General Purpose Input output pins, on the GPIO header there are also 3V3, 5V and 0V power pins. Don't apply over 3V3 applies to the GPIO pins, you can use the power pins appropriately (but if you directly connect the 5V to the 0V pin the resulting deadshort should blow the polyfuse before the power supply burns out).
Cain89 wrote:2) There are some electrical components that need 5V to work (e.g. Laserdiode [KY-008] or 433 Mhz receiver). Is it safe to send (e.g. Laserdiode) or receive a signal (e.g. 433 Mhz receiver) over a GPIO pin without a voltage devider or something else ?
No, it is recommended that you use a voltage divider or opto-isolator rather than feeding a 5V signal into a GPIO pin. It might not kill the pi immediately but 5V is likely to cause damage to the Pi's processor.
Cain89 wrote:3) I know Ohm's law (U = R * I) but if I build a circuit (turn on a LED, a Motor, a Sensor or whatever) where from do I know if i exceed the 16mA a GPIO pin can take, i don't know the resistance of the circuit or do I know it and simple oversee it ?
motors should always be run through a transistor with a flyback diode, running them directly from the Pi GPIO is asking for trouble.
Current limiting resistors in your circuit will allow you to be confident about the maximum current going through an LED.
Sensor inputs should be signal only, the actual current should be tiny, again a current limiting resistor ensures that this will be the case.
Cain89 wrote:As said before I know this are really simple questions, but I ask rather a stupid question than fry my pi.
Thanks in advance.
Always better to ask and look an idiot (you didn't look like an idiot to me) than not ask and prove yourself to be one.