Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years ago.
How many leds can I setup???
Hi, is there a limit on how many leds i Can put on to my board before it will crash? I mean can it send to much current out and in from the ports??? So far I have connected 9 different exits from the board....
Jesper
Question relating to:
1 Answer
5 years ago.
Total current for all GPIO pins (KL25z) is 100mA with a maximum pin rating of 25mA. For small 'indicating' LED's you could attach 14 LED's via a series resistor of 470ohm's, thats around 7mA each LED and have them all on, or as many pins as you like but make sure no more than 14 are on at any one time. Make sure you have the series resistor between the pin and the LED otherwise you could exceed 25mA and damage the pin and/or the entire MCU. Generally you would be better driving LED's via a transistor or a specific LED driver IC.
Hi Paul, thank you very much for your reply, I'll keep that in mind when i'm working on my projects :-)
posted by 18 Nov 2019Btw, does the resistors have to be 470 ohm?? I have used 220 ohms resistors with 8-9 attatched leds and this seems to work fine...? Does the KL25z sends more than 5 V out of the pins???
posted by 18 Nov 2019You can use 220 ohm resistors, however the current will increase, check you don't exceed the LED max current as well as the MCU GPIO pin. I use 470 ohm for small SMD LED's which is sufficient, however bigger LED's may need more current.
All the platforms on Mbed are 3.3v GPIO levels.
This looks interesting and should give you more accurate information.
posted by 18 Nov 2019