0

I only learnt about the attiny85 microprocessor a few days ago, but I'm very amazed with its capabilities, so I would like to start making some toys with them. However since I'm very new at it, I have several questions.

For my first project, I would like to connect 10 LEDs of 2 different colours to it - 5 of one colour to one pin, and 5 of another colour to another pin. As the website I bought the LEDs from didn't mention the current it uses, is it safe to assume that it draws a typical 20 mA?

The user from this article did mention that his (or her) attiny IC burnt out after connecting 8 LEDs to it.

Hence I would like to know if connecting the LEDs in the manner I described earlier would work? I also do have the concern that the maximum output voltage of 5V is insufficient to power all the LEDs.

Thank you all in advanced!

  • FYI, the ATtiny85 is a very old chip. For about half the price you can get a modern ARM Cortex-M (for example, STM32F030) which is 32-bit, 48MHz, more RAM/FLASH, peripherals etc. – Jon Oct 30 '17 at 10:51
  • 2
    @Jon if I look on digikey, I find ATtiny85s in one-off quantities for 85 cents (how appropriate). The STM32F030, on the other hand is available for 116 cents in singles. So, more expensive. Also, the tiny comes in DIP and is 5V-tolerant (which matters for beginners). Don't get me wrong, cheap ARM chips are great, but they're not appropriate everywhere :) – marcelm Oct 30 '17 at 11:27
  • AVRs also have twice the drive strength, which is important for some applications. – Ignacio Vazquez-Abrams Oct 30 '17 at 11:31

1 Answers1

1

All of the electrical limits are given in the appropriate Electrical Characteristics section in the datasheet. Most AVRs have a limit of 40mA per pin and 200mA per "bank", where a bank may include one entire port, one entire port and part of another port, or two partial ports.

Note that running the LEDs with less current or using a driver of some sort will allow you to use more LEDs.

Ignacio Vazquez-Abrams
  • 48,282
  • 4
  • 73
  • 102
  • 1
    Please that the limit of 40mA means that the engineer must design the circuit so that no more than 40mA is consumed from the tiny, to guarantee no damage. It does _not_ mean that the tiny will automatically limit the current to 40mA. That responsibility lies 100% with the circuit designer. – marcelm Oct 30 '17 at 11:18