Which resistor?

I’m found a video that uses a PIR and a blue LED. While the presenter does a great job of explaining things, she doesn’t mention which resistor she uses. If I enlarge the screen, it looks like she’s using a 100 Ω resistor. I don’t have that but I believe a 220 Ω resister would work. Very new to working with electronics and don’t want to fry anything.

Here’s the link to the video: https://youtu.be/-jPw4BWou5s?si=6iqpSiVV4kCMDusn

Cheers,
Mike

It does look like it’s 100ohm but a 220 is fine too. It will look much more dim but it should work just fine.

Thanks!

Is there a general rule about which resistor to use with an LED?

There is a formula, yes. See here

Each led is different and so needs a different resistor value to get the peak brightness without burning it out.

But that referred formula has not talkd anything about I (current). Let us take it as 6 mA to 10 mA.

That’s what I thought. Thanks.

While I was waiting, I found a project that uses a PRI and an LCD screen. I’m going to try that first just because. lol. PIR Sensor and LCD Interface to Arduino : 5 Steps (with Pictures) - Instructables

True. Which is why many tend to go between 10-20ma. I usually just stick to 15ma as it’s right in the middle. However if I am skeptical, I will use a 1K pot and tweak it to where the brightness is acceptable and just measure the value of the pot afterwards.

  • Generally speaking, a 220R resistor will work fine in a circuit powered by 5V.



  • Once you get further into this hobby get a resistor substitution board and use it to determine which standard resistor value gives the brightness you desire.

  • I made this version a while back, it has all the common 1206 SMD values you can buy.




  • These are available too, you should buy one for electronics experimenting.

I’m mostly working from the Arduino Starter Kit R4, which came with the following resistors:

  • 11 x Resistors 220 ohm
  • 3 x Resistors 560 ohm
  • 3 x Resistors 1 k ohm
  • 3 x Resistors 4.7 k ohm
  • 11 x Resistors 10 k ohm
  • 7 x Resistors 1 M ohm
  • 3 x Resistors 10 M ohm

Two 220R resistors in parallel will be close to 100R:

1/(1/220 + 1/220) = 110

You need to understand that 100R is OK for connecting a blue led to an Arduino pin because the current will be about

(5-3.2)/100 = 0.018A = 18mA

This is because the pin will supply about 5V and most blue LEDs have a "forward voltage" of about 3.2V. The pins on many models of Arduino (but not all) can supply up to 40mA before damage occurs.

But with other colours of led, the forward voltage will be different. Red and infra-red LEDs have the lowest forward voltages. For a (visible) red led with a forward voltage of 1.8V:

(5-1.8)/100 = 0.032A = 32mA

In theory, most Arduino pins can supply this, but the led itself might have a maximum of 20mA or 30mA, and might be damaged.

It's also important to understand that LEDs do not last forever. They slowly get dimmer and dimmer over their lives. The higher the current and brightness of the led, the shorter it's life will be. If you run a led at its maximum rated current & brightness, then after only a few years it might be only half as bright as when it was new. But if you choose lower current and brightness, by using higher resistors, then it will be many years before the led becomes noticeably dimmer.

So, it is a warning that damage will occur soon to the DPin of UNO R3 if the pin starts sourcing 40 mA (absolute max rating) current. Therfore, we should limit the source current to 20 mA (the safe IOH at VOH).

Another totally useless instructable video.
The code they give is for a DHT temperature sensor and they left out one very important step.

Here is another instructable by the same author

I am very afraid that the younger generation believes everything on the internet. Critical thinking is mostly dead or at least missing in action.

Thanks for the explanation, Paul. I'm very new to electronics and am realising more and more that I need to either take a class either in person or online if I'm going to really understand this stuff.

I unsubscribed from her channel. She was just confusing and, as you pointed out, omitted key information. No wonder I was getting confused.

I use 1k for basically all my leds. That causes a hard limit of 5ma through the led (a bit less because of the Vf of the led, which is pretty safe for most microcontroller outputs, and has acceptable brightness for essentially all modern leds.

@skybear Rather than giving you simplistic, or downright wrong, guidance about pin currents, here's a link to a specific datasheet about the UNO processor, and a page reference that you should become familiar with:
328P datasheet
Specifically, page 258, wherein we are told that the absolute maximum for any one pin is 40 mA, the typical max is 20 ma, and that there are significant limitations when setting pin multiples.
Of importance are the notes below the table. 100 ma Max sinking for the aggregate current on several ranges of pins, and 150 ma max sourcing on similar ranges;
and, finally, note the last statement for each of the sinking and sourcing ranges:

Pins are not guaranteed to source current greater than the listed test condition.

Of course, the meaning of that is...open to interpretation. The device might simply limit the output current, no big deal. Or, some internal connection might fry, disabling one, or more likely, a whole range of pins.

Now, the above is all about manufacturers guarantees, givens, and druthers, and many will rush to present examples where all of the above have been violated with impunity. Surely, the manufacturer makes a chip that is more robust than the stated guarantees; firstly, it must survive the gauntlet of min-to-max thermal and environmental criteria which no hobbyist has the ability to test/recreate, and secondly, manufacturing being what it is, not every internal feature is identically robust, even when the chip works as advertised. Tiny example - a functional, yet limited, wire connection from pin to chip may test fine, but evaporate under stresses just beyond the maxima stated, while 1000 devices from the same lot will survive. If you choose to run your device 'at or beyond the maxima', you can expect to find those limits.

Most of this won't be delivered in any series of introductory electronics courses, until you get deep into the nitty gritty, so I think you'd be better off conversing with a few greybeards, here and elsewhere. Much of what I've gleaned across the years(and forgotten much of) came from a wide variety of industry magazines, etc. such as Electronic Design, Electronic Design Notes, Analog Design, Circuit Cellar, Nuts and Volts, and a variety of other pubs, as well as all the leading manufacturer's excellent databooks - Nat Semi, Analog Devices, Siemens, Harris, Texas Instruments, Fairchild, Intel, and the list goes on.

Very little of that remains today, though there are places where the info can be found. I recycled all my databooks, because they're mostly out there on the web, but it's not the same...
My friends thought I was weird, because for years I had a bookshelf of databooks in my bathroom, for reading selection... I'm sure they were looking for Playboy and Penthouse.

old guy, insomnia rattling.

Wrong data sheet!

Which data sheet is wrong -- the one referred in #17?

Yes