# How many ohms do I need for LEDs controlled by an shift register?

So I've got 6 LEDs, 3 red, 3 green. I'm going to control them using a shift register and either an arduino uno, or an arduino due. Now, I know I'm supposed to use resistors for the LEDs, but I'm really confused as to how many ohms. Everywhere I've looked has told me different things. Could someone explain this to me and show me how to actually calculate this?

It depends on following three inputs:

• the signal or supply voltage $V_{s}$ (i.e. the voltage of your shift register output, e.g. 5V or 3.3V)
• the forward voltage $V_{LED}$ of your LED (depends on the semiconductor material of the LED and that depends on the color; e.g. 1.3V, 1.8V, 2V, etc.). You get this info from the datasheet of the LED.
• the current $I_{LED}$ you want to operate the LED with (the max. current is given in the datasheet; of course the signal source must be able to supply that current); e.g. 10mA

Then the resistance must be $R = \frac{V_s - V_{LED}}{I_{LED}}$

Example: you want to operate a red 1.8V LED with 10mA at a 5V source: $R = \frac{5V - 1.8V}{10mA} = \frac{3.2V}{10mA} = 320 \Omega$

• How do I find out the output voltage? I found the datasheet of the shift register but I don't know what's what...nxp.com/documents/data_sheet/74HC_HCT595.pdf – mr-matt Jul 30 '16 at 23:15
• @Matthew Inglis: If it is a component of the HC logic family: the operating voltage range is 2-6V (so you it depends on the actual circuit design). Most likely it's either 3.3V or 5V. If it is a component of the HCT logic family: operating voltage is 5V. – Curd Jul 31 '16 at 12:00

Adding to what Curd said, your typical 74HC595 shift register only sink or source 70 mA in total. You may need to reduce the LED current to the maximum current to 70 mA / (max simultaneous LEDs), or if this is not bright enough, then use the shift register to drive transistors which drive the LEDs. In a lot of cases ~6 mA is good enough for indicator LEDs. You could also select a shift register designed for LED driver that can handle higher current, such as this part.

It's because of design choices like these that one does not tend to find general values of current limiting resistance for LEDs. The resistance you select depends on the application.