I am programmer that just started learning electronics and Arduino. I built this simple circuit on Autodesk Circuits earlier. Originally I used 220 ohm resistors. Then when I ran the simulation and turned on more than 4 of the leds the simulator warned that I exceeded the max current for the shift register.

I then upgraded to 560 ohm resistors which solved the problem.

What I would like to know is how can I calculate the current through the shift register for each n-number of leds I turn on? That way I can calculate the right resistor that I need before I burn out my electronics.

There's a voltage drop across the shift register, too, but that may not be worth worrying about. VLED may be most simply measured in operation - or else, calculating based on VLED=0 would somewhat overestimate the current, which isn't really a bad thing to do when comparing against a limit, since it just builds in some margin. But if the LED were blue with a high forward voltage, then VLED would be very large - if the supply were only 3.3v it would actually be the majority of the voltage drop.
– Chris StrattonOct 16 '16 at 17:36

2

Of course, the correct thing to do is throw away the poxy shift register and use a proper LED driver with constant current sink... Many are identical in operation from a programming and interfacing perspective, and remove the need for all the resistors completely.
– Majenko♦Oct 16 '16 at 17:37

Thanks. I looked through the data sheet. Can find Iq only Icc and Io for each pin. I also have no idea what the specs are for the leds the simulator does not provide specs. I will just make sure I know the specs before I put together a real circuit.
– Heinrich KrugerOct 16 '16 at 18:04