Help with basic pcb shield design for arduino mega

Hi,
I am completely new to electronics and arduino but I am trying to design my own simpit. It's has so far been a thrilling interesting journey. I am through the hardware phase, so now I am entering the electronics/software phase. There are a number of "ready-to-build" projects around but I keep getting stuck. So I decided to plot my own course. A lot of things are clearing up for me but I could use some "mentoring". I am trying to design the front part of the simpit. I will be keeping it as simple as possible. So every switch or LED,... will be connected to a single pin to keep it simple in DCS-Bios. I won't be using shift registers and things. If that means I have to use multiple arduino mega's, then that's fine.
Would someone be so kind as to check what I have made so far? The jpg "Left Eyebrow - test" is a pcb with LED's and 2 buttons. The jpg "Left Arduino Shield" is the shield for the Mega where several other switches/Led's and the "Left Eyebrow - test" will be connected to.
I was wondering if I have to add capacitors and diodes or can I do without? If I have to add these, where would they have to be placed and what value would they need to be? Also, is it possible to drive all these LED's from the arduino mega or do I have to use an external power source and what would I need to do so on this pcb design? Do you have other tips I should take into account?

Thank you so much for your support!!


That's a good question. There are basically 3 limits to be aware of:

  1. per pin
  2. per port or group of ports
  3. for all pins

These are specified in the datasheet https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/ATmega640-1280-1281-2560-2561-Datasheet-DS40002211A.pdf page 355.

Only you know what LEDs you are using and how much current they need.

There are several ways to provide current for LEDs, discrete mosfets, Darlington array such as ULN2003A, also other chips designed for driving things like LEDs.

That will depend on what is connected to all those connectors.

If that means I have to use multiple arduino mega's, then that's fine.

Think hard about that option before you design any hardware.

Thank you very much for taking the time to look at my stuff.
The LED's I use are 3528 1210 Diode SMD LED's. They won't be burning constantly but they are warning lights. So depending on my flying skills they might all light up at once. Will the power connection on the arduino mega be able to cover this?
Thank you so much for your support.

Thank you very much for taking the time to look at my stuff.
I am using common switches and buttons, the Led's are 3528 1210 Diode SMD LED's.
Would my current design be able to function or would I do good by asking a fire engine on standby when I turn this on?
Thank you very much for your support.

So including LEDs in some of the switches you have a total of 20 LEDs or more?

Those are relatively high current LEDs, I think you will quickly exceed the limits, so I would strongly suggest building in suitable drivers from the start.

Never design a PCB until you have built and tested a prototype. You are a beginner and you will get something wrong, probably several somethings.

You can use breadboards or veroboard/stripboard etc to build the prototype. These will be easy to change while you are testing and correcting errors.

You seem to be using the same value of series resistor for every led. Different LEDs will probably need different resistors depending on their colour (which determines their forward voltage Vf), the brightness required, and how much of the light they produce is lost because they are inside a switch or button. So I would get a pack of resistors with values in the 100R - 1K range and experiment to see what looks good in the ambient light levels of the "simpit" (I eventually worked out this means "simulation cockpit": not everyone on this forum will share your hobbies, so remember to explain any terms you use).

1 Like

Yes, between 10-15 LED's each on an individual pin.

Thank you, as I am a beginner..., what's the function of a driver, which one could be usefull?
Thank you for this valuable information.

Thank you very much for these tips.

A driver is a circuit or chip that provides the LED with current so that the MCU doesn't have to. This can help avoid overloading the MCU. The MCU pin sends out a signal which switches the driver on or off. Many different chips or transistors can be used for this.

But before you decide you need these, have a play around with different series resistors, as I suggested, and measure the current required for each type of led. Then calculate the total current that could be required if the maximum number of LEDs was lit at the same time. If the total is comfortably under 200mA, then you probably don't need drivers.

Modern LEDs are much more efficient than they were 1~2 decades ago. In many cases, the maximum allowed current of 20mA is far too bright and will literally leave spots in your eyes! You may find that a much lower current is more than adequate, using a higher value series resistor, and this will reduce the load on the MCU.

You need to design for the actual ammount you will have or the maximum you expect to have. Will these LED be bright enough with a 220 resistor or too bright.

You need to do a little more planning.
Also consider what I said about using two processors.

Thanks for this valuable info, would I need capacitors and diodes?

Thank you very much, so back to the drawing board.

Since you are not connecting your buttons/switches in a matrix, I can't see any need for diodes.

You could potentially use caps for debouncing, but that can also be done in your code.

Thank you very much. This is very helpfull.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.