I would like to connect 48 leds in arduino mega, but it´s like the power is not sufficient to supply all the leds. How can solve it?
Welcome to the forum
Use addressable LEDs and an external power supply
Increase the value of the series resistors.
Assuming you are powering the Mega with USB, and the LEDs are red, the maximum current that can be supplied is 500mA, less, say, 50mA for the Mega. However, the Mega's pins can only supply about 400mA in total, if I remember correctly (please correct me), leaving about 8mA for each LED.
Red LEDs have a forward voltage of about 1.8V. To have 8mA flowing, the resistors should be (5.0-1.8)/0.08 = 400R. The nearest, higher, common resistor value is 470R or maybe 430R.
Actually, the total current allowed for the chip is only 200mA, with 40mA "absolute maximum" from any single output pin.
So... Tell us more... Do the LEDs need to be individually addressable? Are you using any particular LEDs? What are your other-special requirements.
Addressable LEDs like WS2812 have a built-in driver circuit so they are super-easy to use (on the hardware side) you can control an almost unlimited number of LEDs, only limited by memory and speed (you might see a lag at the end of a long string). The software is complicated but the hardest part is handled by a software library.
.
I appreciate the response. I'm using common diffused LEDs.
I'm developing a research project related to thermal comfort in poultry houses that requires each LED to be connected to an individual pin, allowing me to program them to light up based on the temperature variation inside the different experimental plots to be established
No, that's not true. There are lots of ways to achieve the same thing without using one pin for each led. Some of these ways can significantly reduce the components and wiring required.
For example, I would suggest:
- A max7219 chip/module. This can drive the LEDs you already have.
- WS2812 strips/leds, as mentioned by @DVDdoug
When I read this, I thought "oh, okay, he's distributing the LEDs around a chicken-coop" - or worse, the industrial equivalent. That means many(perhaps hundreds) feet of wire out-and-back for each LED. That, in turn, means a 7219 won't suffice(too much capacitance), and even the WS2812 solutions might not suffice, due to long distances between LEDs. But it's all conjecture, because @vpitoro doesn't know enough about forum etiquette to clearly define the project for us so we can evaluate PRACTICAL or POSSIBLE options.
So, @vpitoro , it's time you stop wasting peoples time, and give us enough information so that we can give you useful help. Extracting project details from you by proposing solutions, only to have you trot out one more project detail that makes the new suggestion impossible, is incredibly frustrating for the helpers here, and most will soon turn away from your request for help.
Ball's in your court.
Hi, @vpitoro
So you are using the LEDs as a temperature indicator?
A line of LEDs, say four in a line, the number turned ON represents that plots comfort level..
Tom...
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.