Resistor Placement

I’m starting to build a test board using a small perf board. I placing several LED’s on the board and basically, at this point, that is what the board will do. There are 22 LED’s and I have broken them up to use 4 LED’s per resistor. I have looked on-line and find people place the resistor at the start of the 4 and have also seen it placed at the end of the LED line.

Which is correct?

So one resistor is providing current limiting for 4 leds in series? If so either end (or even in the middle somewhere) are equivelent there is no electrical preference. Thus it is strictly a mechanical decision where ever is easiest for you to place the resistor is fine.

Peter

thanks. Yes, they are in series. I have them functioning with some coding. Currently using the Arduino Uno to test. I’d like to be able to get 4 of the LEDs to light wth only one wire instead of 4 wires.

That should be possible with 2 resistors and a series parallel circuit. The issue is that the leds take about 1.8 V (for red) to light and you only have 5 V to drive them. 4 in series needs around 8 V to drive them. Two in series (needing 3.6 V and a resistor to limit the current) in parallel with another two in series with a resistor will connect to a single Arduino port successfully as long as you don’t draw too much current. The 100 ohm resistors in this circuit draw about 14 milliamps each with red leds which draws around 28 milliamps from the Arduino port which should be fine. The arduino port connects to the blue wire on the left end of the 2 100 ohm resistors and the top rail is 5V in this sketch.

series_paralel_leds.fzz (4.1 KB)

Peter

Wiring 4 LEDs in series, and driving from a single Arduino pin could be a problem. The 3.3 or 5 volts from the Arduino might not be enough, since each LED needs a minimal voltage drop across it before it lights. That varies depending on the color of the LED, but figure 2 volts as a ball park. That would need at least 8 volts to light them up.

Instead, still using only a single Arduino pin, wire each LED in series with the appropriate current limiting resistor. Then wire all 4 sets (LED + resistor) in parallel to the single Arduino Pin. As long as the total current needed by the 4 LEDs does not max out the drive limit of the Arduino pin, that will work fine.

      |—— led —— resistor —— ground
      |
      |—— led —— resistor —— ground
pin ——|
      |—— led —— resistor —— ground
      |
      |—— led —— resistor —— ground

Edit: vanepp solution also works, and will use about half the current. As long as the Arduino pin can drive a high enough voltage to get both LEDs to light. 3.3V is likely not enough. 5V is. In each of these cases, the correct currently limiting resistor will be different: Supply voltage minus sum of LED voltage drops (at desired current) give the correct voltage drop across the resistor. That voltage and current determine the resistor value.

Edit2: the voltage and current values coming from each parallel path. For all 4 in seres, 4 x LED voltage drop; for vanepp solution 2 x LED voltage drop; for mine, 1 x LED voltage drop;

Note with 22 leds total at 10 ma (less than the 14 ma I allowed) you are getting close to a little bit over the max sink current of a 328 chip as used in the arduino (it is listed at 200 ma, 22 leds at 10ma would be 220 ma). That only applies if all 22 leds are on at the same time, but if that is going to be true you probably need to allow for it. The easy solution is to increase the resistor values to reduce the current (and thus the brightness) of the leds as far as possible. High efficiency leds (more light for less current) can help here. The more complex (but more flexible) solution is to add led drivers either in IC form or as individual transistors to reduce the current draw from the Arduino ports. Aren’t engineering tradeoffs fun :slight_smile:

Peter

https://youtu.be/P_fb6njcaoU?t=4m59s

For more on trade offs, if requirements mean additional external circuitry is needed to handle the current, then with a separate voltage source for the LEDs, and a driver that be switched by the Arduinio, the circuit could go back to the original 4 LEDs in series with a single limiting resistor. Arduino turns on/off driver with 3.3 or 5 volts, driver turns on/off string of LEDs using something like 9 or 12 volts. Here ‘driver’ could be a FET. I did that to control a 12V incandescent light bulb, which needs a lot more power than a few LEDs.

Wow, thanks for the replies. Give me a bit to digest all of this. The attached is hat I was working towards. First version. this only has 20 LEDs, but this s what I’m working towards. I reaalize this is not powered by an Arduiono, but in the end I want some kind of microcomputer connection. Maybe a HAT?

That will work fine as is. There is no Ardunio in circuit, so none of the 5 volt, 40ma, 200ma limits apply. Assuming about 20ma draw for the LEDs, that is about 100ma total for the 9 volt battery, and the sum of the LED voltage drops should be enough less than 9 volts to pick a good resistor value. Unless using LEDs with a color that has a higher voltage drop. Orange and Blue would not work.

Been to this website numerous times. Obviously, not everything is sinking in. A lot of great info at the site.

If the final device is to be battery powered then @microMerlin 's suggestion of a mosfet driver is a good one. A mosfet (it needs to have a logic level gate so a 5V micro can drive it) connected to the ground side of a string of 4 leds (or less if they are not red) both removes the current limitations and improves efficiency (i.e. battery life) as less power is wasted in the current limiting resistor.

Peter