I'm having trouble figuring out the proper resistors for this setup (see attached schematic, but ignore the resistor values).
as a simplification, just assume 1 LED. i'm using one pin to turn on all the LEDs in a RGB led. are the resistors in parallel? The red LED will need a different resistor, but will I be able to do that?
i'm using one pin to turn on all the LEDs in a RGB led
OK, why?
If you expect the three pins to produce three different colours then the resistor values need to be different. The values will depend on what colours you want.
I'm thinking the three resistors (per led) are working in parallel because of this setup.
Yes they are but why is this important to know this? It does not affect the resistor calculations.
All the current is sourced from one pin so you should restrict the LED current to about 10mA each.
Do i still need to use three resistors per RGB led, then?
Thanks for your responses, btw. This is not a typical way to use RGB LEDS and I couldn't find any examples of anyone using them this way. I'm just making a colorful mobile for my 4 month old son.
Quite a clever little design! When I first read the thread, I thought, "you can't do that without either 9 pwn pins, or multiplexing the LEDs". But you have done it. The 3 rgb leds will be 120° out from each other in hue.
The resistors are not in parallel. They are connected at one end, the Arduino pin, but the other ends are connected to 3 different LEDs. They would have to be connected to each other at both ends to be considered "in parallel".
As Mike said, you can afford about 10mA per led to avoid overloading the Arduino pins. To calculate the resistor values, you need to know the forward voltages of the red, green and blue leds. If you don't have that data, it's easy enough to measure it with a DMM.
it's like 3 phase AC, i guess. it makes the program simpler, too.
So the diode is keeping it from being parallel?
Typically, each led would be driven by a separate pin, so using 3 different value resistors wouldn't be a problem. but in this case it's a single pin, and that's confusing me.
worst case is i burn out an LED too quickly, so this is really more a thought problem.
yeah the slow flashing LEDs would work but they don't stay in sync. the mobile i'm making has three arms, and i want the color to spin around the arms. the effect would be lost if i used slow flashing. Also, i can vary the speed and make it reverse, or react to sound. but that comes later.
Yes, the diodes mean that the resistors are not in parallel. But the 3 "resistor-diode-pairs", attached between a pin and ground, are in parallel. They connect to the same point at both ends.