0
\$\begingroup\$

I'm VERY new to EE and am learning the basics. My first goal is wiring up some small lights for my son's LEGO projects, and am trying to sort out the basics here.

Right now, I'm attempting to piece together a mental model of how wiring up several LEDs work, mostly vis-a-vis attaching them to an Arduino. I've run into several hurdles here (seemingly a simple project) and keep coming back to the simplicity of a small strand of fairy LED lights.

The output of the Arduino is 5v. I'm comparing it to a strand of fairy lights I have which take 4xAA Batteries, for a total of 6V.

I've read the following:

  1. A white LED needs about 3V to operate, and requites around 20mA of current to have decent brightness.
  2. Each pin of the Arudino can only output safely 20 or 30mA. Thus, I can only safely run 1 LED, maybe 2 if I'm feeling risky, per pin on an Arduino.. Even if they're in parallel.
  3. AA batteries can output about 50mA constant current.. 4 AA batteries would be 200 mA, no?
  4. At the same time, this little pack of fairy lights on 6V can run like 50 white LEDs with no resistor as near as I can tell.

So how does the magic of the fairy lights actually work? What am I missing? Why is it that trying to wire up 6 little LEDs to my son's LEGO house is apparently going to require six separate pin connections, each with a resistor, etc.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ you can't run all 6 at 20ma each, there's a limit for the board as a whole. as far as why the fairy lights work, it's because the cheap AF wire is a resistor and the battery cannot provide enough current to roast them. They could stack 2 LEDs in series, but probably not as it would be flaky on low batteries. You could use a shift register or transistor array to drive LEDs at more power than GPIOs provide. \$\endgroup\$
    – dandavis
    Commented Jan 12, 2021 at 4:31
  • \$\begingroup\$ Two in Series pair =6V then /parallel pairs using a low side switch with NPN \$\endgroup\$ Commented Jan 12, 2021 at 4:32
  • 1
    \$\begingroup\$ Just to power LEDs you do not need Arduino. It needs to create some timed switching or control brightness using PWM . \$\endgroup\$
    – user263983
    Commented Jan 12, 2021 at 9:59
  • \$\begingroup\$ @user263983 - True, but I'm wanting to run little lighting 'programs' on them, not just keep them constantly lit. \$\endgroup\$ Commented Jan 13, 2021 at 5:27

2 Answers 2

1
\$\begingroup\$

Many LEDs, including some white ones, will make a decent light at far less than 20ma. I have some green and red ones that are unpleasantly bright at less than 1ma. White ones can be found that are relatively bright on 5ma. Some amber/yellow ones can also be ultra bright at 1ma. Red and yellow ones only take just under 2v each to light up, so you can put two in series for twice the light at the same current running from a 5v supply. Try maybe two ultra-bright reds in series, with a 1k resistor in series with them, and see what kind of light you get.

Batteries in series don't increase their current capability. Higher voltage should mean more current according to Ohm's Law but that doesn't make the internal resistance of each battery go down. 4 batteries in series, then, is also their 4 resistances in series: 4 times the voltage but also 4 times the resistance means no gain in current capability.

\$\endgroup\$
2
  • \$\begingroup\$ Awesome, thanks! This is good info! So, my fairy lights have batteries then at 6V, but even less current than I thought -- 50mA ish. So with all of those LEDs in parallel (about 50), then each is probably consuming about 1mA of current to light up? Extending this to my own setup with the Arduino, and pulling from a response above, it wouldn't be safe though to try to run more than one LED on a pin, if the pin's limit is 20mA? The LEDs I'm using say 20mA on their data sheet.. Can I assume they won't really be pulling that much? \$\endgroup\$ Commented Jan 13, 2021 at 5:26
  • 1
    \$\begingroup\$ They will "pull" that much for sure. You just don't have to "feed" them that much to get a decent light out of them. I have no idea how your fairy lights are wired, or what electronics drives them, so commenting further on that would be just guessing. What I can say, though, that just multiplying current-per-LED is an oversimplification. For example, 2 LEDs in series will share the same current, and if that current is 1ma for one it doesn't get higher just because there are two of them. With a series-parallel circuit you could run 40 LEDs at 1ma and still use only 20ma. \$\endgroup\$
    – DarylK
    Commented Jan 16, 2021 at 9:41
2
\$\begingroup\$

1: About right, but detailed values depends on the LED.

2: No, Arduino pins can't output 20-30 mA safely. It exceeds the nominal operating conditions. If it is a 5V device with Mega328P, it is 20mA tops per pin. And there is a total safe limit too, max 200mA per chip, but also different ratings for sinking and sourcing currents, and some limits for various groups of pins, so by keeping total curret below 100mA per chip, it will be within limits.

3; No, the batteries are in series, so if a single battery can provide 50mA at 1.5V, the pack of them can provide 4x1.5V=6V at 50mA, just at a higher voltage than a single battery. If the batteries are in parallel, then it is a 1.5V 200mA. If the batteriy pack can also be arranged into pack that can output 100mA at 3V. Parallel batteries are usually avoided though.

4: Sometimes they also have an electronic chip and circuitry to convert voltages, not just simple resistors.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.