LED driver: how to choose current and voltage?

In my project I have a microcontroller which has to light 3 groups of LED. Group A has 3 LED, Group B has 2 LED, Group C has 1 LED. There are all the same LED. In each group the LED are in series.

Let's consider group A :

VCC is obtained from a positive voltage regulator. The lighting of the group is controlled by an MOSFET which acts as a switch. The microcontroller is driving this transistor open or close.

I have never done this before so I have questions :

• How do I know which voltage I have to appply with the regulator for each group? Is it the sum of each forward voltage ? Let's consider each LED has a forward voltage of 3 V. I would then need to apply 9 V, 6 V and 3 V?
• Do I need a series resistor in each group?
• How do I know the current which will be drawn by the LED in each group? How do I set the current to 1 A in each group for example?
• I think you need to propose a schematic diagramatically to make sense of what you are trying to say. – Andy aka Dec 4 '19 at 16:11
• it is just a diode. if you have a 5V rail/source and the led has a 2.1v drop and a max current of 20ma then 5-2.1 = 2.9 volts across the resistor V = IR 2.9 = 0.02*r greater or equal to 145 ohms. its no more complicated than that, just work the larger circuit. – old_timer Dec 4 '19 at 23:15
• If you share the resistor to a group and some leds are lit and some arent, then it will be uneven. three lit into one resistor drops one amount of current across the resistor causing the voltage division to go one, way but two lit changes that. one, two, three will have a different brightness from the same voltage source, so it will look funny/bad. that is for them in parallel, – old_timer Dec 4 '19 at 23:16
• in series then certainly not you only need one resistor. three diodes do the math, figure out the voltage across the resistor for some current (same current flows in series through everything in that series) and V = IR. Pick the minimum resistor for that current then make it larger. – old_timer Dec 4 '19 at 23:18
• the brighness is not linear and if you are pulsing them (did you ask another question on this topic recently?) then the brightness gets even more interesting (less linear). But worst case is worst case voltage rail through the diodes and you want to not exceed the maximum current. – old_timer Dec 4 '19 at 23:19