0
\$\begingroup\$

I want to light up 8 LEDs where I should be able to control intensities of the LEDs as well. Since I want the circuit to be as small as possible on a printed circuit board (PCB,) I am using an Attiny85 IC for the following problem.

For all the 8 LEDs, I would like to light them up with a very good brightness level. So say, current of each LED is 20mA.

The Attiny85, has two PWM pins (PB0 and PB1)(i.e., pin 5 and pin 6.) But since the maximum output of each pin on the Attiny85 (or Arduino Uno) is 40mA, if I connect 3 LEDs to a single Attiny85 pin, the current will be divided and the intensity of LED is lower.

I am planning to use a 74HC595 shift register IC so that I can connect the PWM pins of micro controller as the input to 74HC595 IC and control 8 LEDs with the 8 output pins of 74HC595 without any current dividing factor.

Is this a good idea, or will the low current (low intensity of LED) issue on each output pin of 74H5C95 still exist since we are using only 3 pins of the Attiny85 to control all the LEDs with a 74HC595 IC?

Basically, I want to know how much current output will be getting from each pin of 74HC595.

Any other thoughts would be very helpful.

\$\endgroup\$
5
  • \$\begingroup\$ I think you will find this interesting: Is there such a thing as a PWM expander like there is a GPIO expander. \$\endgroup\$ Oct 8, 2020 at 11:58
  • \$\begingroup\$ The answer is in the HC595 datasheet. Did you not find the datasheet or the current values you need? For example TI datasheet, look at pages 5 and 6. \$\endgroup\$
    – Justme
    Oct 8, 2020 at 12:04
  • 1
    \$\begingroup\$ Do you actually need independent control of the LEDs? You didn't make that quite clear. There are I2C chips specifically designed to PWM multiple LEDs/segments. Using surface mount versions will be key to compact size, put the chips and LEDs on opposite sides of the board. \$\endgroup\$ Oct 8, 2020 at 14:12
  • \$\begingroup\$ Search "PWM" at Adafruit, compare specs and package size of the several different chips they have on boards, try their board and offered Arduino code, if you like it put the chip on your own custom board and port the code or re-write it from scratch. \$\endgroup\$ Oct 8, 2020 at 14:16
  • \$\begingroup\$ Yes, I need independent control of all the LEDs as each LED has its own use in my circuit \$\endgroup\$ Oct 10, 2020 at 9:58

1 Answer 1

2
\$\begingroup\$

74H5C95 has 6mA output with a 5v supply according to the datasheet. If you want to run your LEDs at 20mA, you will not be able to with just the shift register. You could use a transistor for each LED as a switch controlled by the shift register pin and the other pins of the transistors attached to your supply voltage if you are married to the 74H5C95.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks... :) Could you also let me know what is the maximum current that can be drawn from each pin of Attiny85 IC and the total maximum current of whole IC.... \$\endgroup\$ Oct 10, 2020 at 10:00

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.