MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

icon
Avatar
TheFrenchSpy
Posts: 2
Hi guys, i was wondering if it is possible to change the led limit to 50 if i am using an external power source. I hope it's possibe. B)
2017-05-17 12:36
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3521
Supporter
Hi !

Basicly i think this is no problem on Software side..... Mobiflight increase the Limit of Switches from 40 to 50 in the past, too. Just with a little Update patch !

BUT:

We talk about this some time ago in the german Board section and see there is a special limit for Power on a Arduino ! This limit is on the GROUND side ( Not on 5v) ... So a external Power will bring your 5 v over the 500ma Limit of the USB Power BUT it not increase the Limit of the GRD ( 20ma per Pin, 200ma per GRD Line, 800ma per Board ).

Whith the standard 20ma LED the Limit of Board ( 800ma) is reached exact with 40 LED..... Maby this is the reason for the Limit in Mobiflight !
(Yes if you use low power LED you can set more then this without getting to the cap..... But then a not adavanced User is able to kill his board without this boarder and maby 50 High Power LED.)

Lets wait for a awnser of Sebastian.... Maby he got alternate plans for this !

Please stay patient until he reply.
Good Luck !
2017-05-18 08:19
Avatar
StephanHo
From: EDDG, Germany
Posts: 1522
Supporter
Hi together,

basically pizman is right.
The limits of a MEGA can be read in the data sheet:

http://www.atmel.com/Images/Atmel-2549-8-bit-AVR-Microcontroller-ATmega640-1280-1281-2560-2561_datasheet.pdf

Have a look on page 355. The max limit of an output port is 200mA. BUT: 8 pins are sharing one port and the max current of a pin is 40mA.
Statement from Atmel with regard to this maximums (p 355):

Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.

Everybody is good consulted not to exceed these limits. 20mA per pin is a good guideline.
Normally LEDs were driven with 20mA. In my opinion this is to much. I got good experiences with 10-15mA/LED, sometimes less. Your LEDs will thank you with a longer life ;)

Do you use all your LEDs at the same time with this high current or did you use them variably?
The limit of 50 LEDs is in my opinion a good one. It preserves the users not to damage their MEGA accidential and it limits error rates for Sebastian not to search for errors which have their reasons not in the software.
Grüße,
Stephan
2017-05-18 11:06
Avatar
pluckas
Posts: 90
Supporter
Hi Stephan,

If using more than the 'recommended' number of LEDs per board, is there anything to be gained by using specific pins to 'spread the load'. In other words, is there a pin to port mapping recommendation?

Paul
2020-06-18 05:26
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1522
Supporter
Hi Paul,

there is no "recommended" number of LEDs. The firmware limits the number of outputs per mega to 40. More is not possible. Just because the manufacturer guarantees 40mA per output, this limit does not have to be used. It must also be borne in mind that the USB interface can only deliver 500mA according to the specification. It is possible to supply the Mega with an external power supply, but this need is not necessary

As I said before, I recommend high brightness LEDs that ensure better light output with less power consumption. So everyone is served: less stress on the mega, less power consumption, no external power supply.

In my opinion it makes no sense to pick out the ports with the corresponding pins in order to achieve an "optimal" power utilization of the Mega. It is entirely sufficient to keep the LED current low by selecting the right components in order to achieve an optimal system design.
Grüße,
Stephan
2020-06-18 10:04
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3521
Supporter
the basic policy is clear..... Simply NOT overdrive the Limits.
As i say multiple times, splitting the Outputs with a good planing ( always try to use Inputs and outputs on every board to decrease the number of power needed devices on each board)

Whatever lets talk about the limit.
Like every limit also this is conservative.
Pretty sure a load of 10.000 mA (10A) will burn your Mega and your wires also if you just do this only for 1 second.
Otherwise a load of 830mA for 10 seconds will pretty sure be no problem.

A interesting factor is the difference between the theoretic and the real max usage of power !
Limit is 800mA...... If you use 40 LED with 40mA then you got in theory 1600mA that is way to much...... BUT if you can garantee only 20 LED are ON at same time then this will work cause then you only got 800mA and be within the limitation.

So simply example you use Red/Green Lights for 20 Functions. With a logic that only one is on ( red or green) there can never be a situation you overdrive.
But if this System got a "Lighttest" logic and you press a button and all 40 LED light up same time you again overdrive.

Solution: Not only add all parts together to calculate the Power.... Also think about what is the "most stressfull" situation that can ever happen..... And THIS is finaly your Limit !
Good Luck !
2020-06-18 14:45
icon