User avatar
Alphabet
Posts: 17
Joined: Fri Jun 17, 2016 8:28 pm

Preventing Damage to the PI

Sat Jun 25, 2016 12:24 pm

Hello,

I'm trying to teach myself basic electronics using my Raspberry PI 3. I purchased this kit https://www.amazon.co.uk/gp/product/B01 ... UTF8&psc=1, however, the tutorial I'm following for a basic LED circuit suggests using a 1K resistor to prevent damage to the pi, below is the diagram provided.

Image

Will any of the following sufficiently substitute the 1k resistor?

10k resistor
330 ohm resistor

I imagine neither will, but I figured it's worth asking...

Thanks!

SonOfAMotherlessGoat
Posts: 690
Joined: Tue Jun 16, 2015 6:01 am

Re: Preventing Damage to the PI

Sat Jun 25, 2016 12:31 pm

Your image is quite large and cut off, so it may be displaying the LED but I can't see it. So what color is the LED? (And did the kit specify a FV for the LED?)
Account Inactive

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Preventing Damage to the PI

Sat Jun 25, 2016 12:47 pm

The 330 Ohm resistor should be good. Even if your LED is a very low voltage one (1.0v), with a 330R resistor you would get under 7mA flowing through it when driven from a 3.3V GPIO which is well within the capabilities of the GPIO.

The spec for the LED would help, but the calculation is fairly easy.

Subtract the LED forward voltage from the GPIO supply voltage (3.3V) to get the resistor voltage.
(3.3 - 1.0 = 2.3)
Divide the result by the resistor value in Ohms (1K = 1000 Ohms).
(2.3 / 330 = 0.006969...)
Multiply that result by 1000 to convert from Amps to Milliamps.
(0.006969 * 1000 = 6.969 mA)

pksato
Posts: 295
Joined: Fri Aug 03, 2012 5:25 pm
Location: Brazil

Re: Preventing Damage to the PI

Sat Jun 25, 2016 1:03 pm

Hi,
Ask for led circuit, but show a switch circuity?
Need answer to led or switch circuity?

If is about led:
Some blue and white led not work with 3.3V.
Red and green are fine to use with 3.3V.
Current limiter series resistor is calculated using Ohms law. For that need to know led drop (forward) voltage, typical is from 1.8V (red) to 3.3V (blue).
Rs=(3.3V - 1.8V)/0.005A
Rs=300 (near common values are 270Ohms or 330Ohms).

If about switch:
Again Ohms law, but now need to calculate short circuit current, in case of set pin mode to output. The 1k resistor is used to limit current on this condition. Recommended draw current do each pin is 8mA (0.008A).
Rp=3.3V/0.008
Rp=412.5Ohms (390Ohms or 470Ohms)

But, maximum current per pin is 16mA.
Rp=3.3V/0.016A
Rp=206.25Ohms. (220Ohms)

So, any resistor from 220Ohms are fine to replace 1k resistor on switch circuit.
330Ohms is ok, 10k also works, but can be unstable.

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

Re: Preventing Damage to the PI

Sun Jun 26, 2016 9:33 am

Because the original picture is huge, here's a smaller version
gifTZX11.png
gifTZX11.png (29.61 KiB) Viewed 1633 times

User avatar
HawaiianPi
Posts: 5838
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Preventing Damage to the PI

Sun Jun 26, 2016 11:11 am

Still no LED in that picture, and the circuit would only really need a single resistor to drive an LED (and no 3.3V connection).

[GPIO]-----[LED]-----[Resistor]-----GND

The LED lights when the GPIO pin goes high.

The circuit in your picture looks more like some kind of button input.
Last edited by HawaiianPi on Sun Jun 26, 2016 11:21 am, edited 1 time in total.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Preventing Damage to the PI

Sun Jun 26, 2016 11:17 am

HawaiianPi wrote:So I'm not sure what that is a picture of, but it's not an LED circuit.
It's a very sensible design for a switch with a 10K pull-down and a 1K current limiting resistor.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
HawaiianPi
Posts: 5838
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Preventing Damage to the PI

Sun Jun 26, 2016 11:23 am

DougieLawson wrote:It's a very sensible design for a switch with a 10K pull-down and a 1K current limiting resistor.
Yup. You posted that while I was editing my earlier post.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

MrEngman
Posts: 4032
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Preventing Damage to the PI

Sun Jun 26, 2016 12:04 pm

Alphabet wrote:Hello,

I'm trying to teach myself basic electronics using my Raspberry PI 3. I purchased this kit https://www.amazon.co.uk/gp/product/B01 ... UTF8&psc=1, however, the tutorial I'm following for a basic LED circuit suggests using a 1K resistor to prevent damage to the pi, below is the diagram provided.
Thanks!
Where can I find the tutorial you are using?



MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

User avatar
Alphabet
Posts: 17
Joined: Fri Jun 17, 2016 8:28 pm

Re: Preventing Damage to the PI

Sun Jun 26, 2016 1:19 pm

Hi apologies for the delayed response, I seemed to have jumped the gun a little bit when I posted this.
DougieLawson wrote:
HawaiianPi wrote:So I'm not sure what that is a picture of, but it's not an LED circuit.
It's a very sensible design for a switch with a 10K pull-down and a 1K current limiting resistor.
This is correct! Here's the video I was following!

https://www.youtube.com/watch?v=NAl-ULEattw
Last edited by Alphabet on Sun Jun 26, 2016 2:36 pm, edited 2 times in total.

Return to “Beginners”