3

LED Circuit

Hi all,

In the screenshot of a circuit I've included, I'm attempting to light up 4 LEDs off of pin 2. In circuits.io, everything works great. 3 blue LEDs and 1 red LED light up and blink as planned. When I create this same circuit on a Arduino Uno Chinese clone, IF the LEDs are all blue, they all light up and blink. If I change one of them to red, yellow, or green, ONLY the red, yellow, or green one lights up. The three blue LEDs no longer light up. It also doesn't seem to matter, where the off blue LED is put.

Not sure what's wrong.

1 Answer 1

7

Use one resistor per led, not one for all of them.

This is because different color leds have different forward voltages. Red requires a lower voltage to light up. So it will guzzle up all available current, while the blue leds are waiting for the voltage to go higher (which never happens).

2
  • 2
    I'd like to note that you may want to calculate the required resistor value. One pin can't supply a lot of current.
    – Paul
    Nov 23, 2016 at 7:19
  • 1
    Good point @Paul. An Arduino pins shouldn't supply more than 20mA. That's 5mA per led, if you use 4 leds. If you use 1kOhm for each led, like in the diagram above, you should be fine.
    – Gerben
    Nov 23, 2016 at 9:55

Your Answer

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

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