Hello all, I have been working on my Multi-Comm panel design for my 737-800. This is my first home sim project and while I know I can basically just buy this panel from 737DIY, I wanted to do this one myself to overcome some of the learning curves. I've been making good progress but I'm stuck on the backlighting so I'm looking for some help & advice.
I am making some assumptions about how many LEDs I need and where to put them, as I've not done this before. In my CAD drawing screenshot I have indicated where the LEDs are. The X's are tactile switches with LEDs in them, the rectangles are where I intend to place LEDs for backlighting the lettering on the panel, avoiding directly behind them to limit any hot spots. I intend to use these LEDs.
Since I am unable to find tactile switches that contain amber/orange LEDs, I plan to solder leads onto these same LEDs and then insert those into the tactile switches I have, so unless the advice I get changes my current thinking, I will have 16 of these LEDs on my board that need to be lit and dimmed all together.
My plan was to use the arduino PWM to control dimming, either through a MOSFET or through a step-up (boost) LED driver IC like the AP3031 IC. I intend on having a separate 12V DC source to power the LEDs from.
Thought #1 is to do 4*4 LEDs connected through an N-channel logic level MOSFET which is switched via the Arduino PWM. General idea of this design is captured in one of the attached screen snips. The reason this is idea 1 and not my solution is I don't really know if there are issues with this arrangement I may not be familiar with. If this solution is viable, I have a few follow-up questions about the design. I am about out of characters here, so I will have to finish in a reply to myself.
#I could use some help with lighting design for my panel. PWM dimming, MOSFET vs. Boost Driver
1 messages · Page 1 of 1 (latest)
For the MOSFET circuit, is it advisable to add a decoupling capacitor between +12V and ground?
Would this same circuit work if the number of LEDs was not evenly divisible? Say I add one more LED, so 17 total, are unequal series strings okay so long as the resistors are still adequate for limiting current? What happens if an LED fails, will I end up with an overload in the remaining strings?
The 2nd option I have been exploring, as stated in my first post is a boost converter LED driver, such as the AP3031 device. I could input my 12V into that and step up to drive perhaps 2 or 3 strings of LEDs. The biggest issue I'm facing here is I've never used these types of devices and I'm getting a bit overwhelmed in exploring them and their data sheets. I seem to come away with more questions than answers, but I am really quite intrigued by them as a solution. An example of a question I have about these devices, specifically the AP3031 is, in looking at the Typical Application circuits in the data sheet, the 3x13 WLEDs example just says "Vout" ahead of the LED strings. What controls the actual output voltage here? Is it the value of the inductor or do these devices work by simply stabilizing at enough voltage to drive the load at the current specified by Riset, so long as that voltage doesn't exceed the maximum SW voltage specified? Another question pertains to the switching frequency for PWM dimming. Arduinos I think have a PWM frequency of 490Hz, is that too low for these kinds of devices?
I realize this is something of a long post, but I have been diving into youtube videos, and internet searches, and datasheets for weeks now and I feel like I'm just spinning my wheels, so it's time to ask for help.
ok, this is interesting, but unfortunately I have never came across this chip.
I have done backlighting with a logic-level N-MOSFET in the GND line for dimming and used 12V and 3 leds + 1 resistor in series, and as many as I need of those groups of 3 leds in parallel.
for smaller panels I use the usb 5V pin on the arduino (max 500mA) and just have single LED + resistor combos in parallel, this can work maybe up to maximum of 20 leds in one arduino (20 * 20mA = 400mA so preferably a bit less, and no other devices that use more power, but even 10 leds can backlight a small panel quite well. My radio panel uses ~12 leds for backlight and has two MAX7219 chips, in addition to that, but it is not a bad idea to be conservative with the power requirements, especially the MAX7219 is cranky if it does not get a solid supply of power.
My comm panel design will also incorporate two of the MAX7219 chips.
Also, I did not realize that the 5V pin on the arduino could do up to 500mA. I was under the impression that each pin would do about 40mA, and 400mA total for the board, but perhaps that is just for the I/O pins.
the 5V pin is direct USB 5V
so of course that 500mA is shared with everything on that arduino
the cpu, the other devices that might use power
but in practice if you calculate a bit it often works for backlight
and if you need lots, you want 12V maybe so you can do 3 leds + 1 resistor groups
5V is a lot of resistors too
this is how I do it
Leds are
12V ---- led ---- led ---- led ---- 120ohm ---- BACKLIGHT_GND
|--- led ---- led ---- led ---- 120ohm ---|
|--- led ---- led ---- led ---- 120ohm ---|
|--- led ---- led ---- led ---- 120ohm ---|
`--- led ---- led ---- led ---- 120ohm ---`
I think my mindset in doing a separate supply using 12V was that, this is one panel that ties into a much larger system. Thinking of a 2-seat 737 cockpit center pedestal has a lot of individual panels that are all backlit and all dimmed using one knob. I figured if I incorporated a separate 12V PSU into the cockpit that I would save myself a ton of powered USB hubs to drive all of that from 5V sources.
yeah
there are probably many ways to do this
all my panels are kinda self contained units
its a bit duplicated stuff but on the other hand I can move and rearrange them in my setup if I want
Tons of ways to achieve the same result I suspect is the nature of our hobby. I appreciate your replies. I'll look into your solution and read up a bit on your Q4 device. Is the part number for that correctly labeled on your schematic, the BS170?
Disregard, it does appear to be, I just looked it up.
yea also I use IRL744 and also there are fet modules on aliexpress
The approach I'm using is to provide 12V power to every panel from a central power distribution board that is itself power from an old PC power supply. The board itself will look roughly like this:
I'm in the process of adding the PWM dimming circuit to the board. For my application all the panels plugged into the PDU board above are dimmed together. The blue trimmer pots are to allow me to balance the brightness of each panel individually so they (at least roughly) match each other.
If this approach makes sense for what you're doing I'll be happy to share the KiCAD design files.
this looks like a nice approach yeah
I agree, this looks like a great approach. I was planning to power all the backlighting LEDs for all the panels from a separate central 12v supply like this so this connector board makes a lot of sense. Thanks for the suggestion!
That should work well. You will need a common ground GND for both 5V and 12V.
Check the forward voltage of your LEDs - white LEDs are 3V to 5V so you might be limited to 3 LEDs for 12V. But experiment, starting with higher resistors for safety.
Ideally use a bench power supply that measures current and voltage.
Regarding boards with sockets....every socket is a potential failure point. Direct soldering is much cheaper.
I strip old mains cable and use the copper Earth wire for ground - its rigid and easy to support multiple ground connections.
@deft seal my designs are mostly individual, self-contained panels with an arduino and leds etc in one pcb that usually runs off the usb 500mA if that is doable, or with an external power supply for that panel. But there are a few things I seem to be doing as "standard" now:
-
I do the backlight with the N-MOSFET from one pwm LED output pin. This regulates the ground connection and the leds are all wired from the +5V and have one resistor each. I could do a led driver, but kind of feel it is easier to route and place led + pcb combos around the panel if space is tight. LED driver chips would free me from the resistors, but the chips themselves need to be placed somewhere too. Maybe I'll give it a go sometime though, but SMD placement of the "basic" resistors at jlcpcb is not really a big cost factor.
-
I also do annunciators as a separate (similar) circuit: another FET from a PWM output pin. The exception being the annunciator leds are all connected to their own output pins in the anode (+) side, so they can all be turned on/off as leds, but the dimming happens on the ground side. This way any output pin can be used, they are all dimmed together.
I do this because during daylight, you generally might keep your backlight off, but the annunciator and indicator lights cannot be fully dimmed. So it is good to be able to adjust those independently, so that they never get fully dark, while backlight can.
When I have several panels with their own led backlights and indicators, of course they brightness levels might not match - so then I have a Transform modifier that multiplies $ with say 0.8 or 1.2 or such, to get each panel brightness adjusted to match the other panels.
How do you handle global dimming? On the Challenger 650, for example, there is one knob on one of the lighting panels on the pedestal that dims every panel on the pedestal -- roughly 15 of them-- as well as the FCP on the glareshield. Similarly, the 15-16 overhead panels are all dimmed by a single knob. There is no backlight dimming for individual panels.
@deft seal If possible, always treating the simulator as "truth". So the dimmer potentiometer sends the value to the simulated dimmer knob simvar
and then the mobiflight configuration reads this simvar in as an output config
I have been focusing a lot on designing panels and stuff lately so my current setup is a bit of a mess but basically you read the plane's dimmer value, then you have another simvar or simvars to define whether the panel even is powered. In MSFS, for example the "CIRCUIT GENERAL PANEL ON" simvar exists as a preset, which often works for many planes, but of course there are those that want to do their fully own logic, so you need to look it up from the particular plane if it doesn't work.
So you have two things:
- dimmer value
- logical ON/OFF config that determines somehow that the backlight should be on.
You then can bring in the logical on/off config as a config reference to the dimmer config, so it shows the dimmer value, or, when the plane is "cold and dark", shows 0. This can be done with modifiers, like in Transform or Compare to set the value to 0 when there is no power present.
This way you get one reference that you can use with any panel, and set the output pin of each panel. At this point you can multiply each panel value with a "correction multiplier" if one is too bright compared to others, for example.
So each panel has an arduino, each arduino has one dedicated pin for that panel's backlight dimming. And all the backlight dimmer pins on all panels are configured to read from that one main "dimmer value" output config.
OK, I see what you're doing. Clever.
Can you show me the actual circuit you're using for the per-panel dimmer? I like this methodology enough that I'm going to adopt it for all future panels and will likely build an adapter board for the four panels that are already done.
its the mosfet thing, I will look it up but away from pc now
but basically a N-fet is connected between the GND wire and the gnd of leds
and the gate of tbe get gets driven by the pwm led output pin
1k resistor on the pwm pin and 10k pulldown on the gate pin yo gnd so it stays off when the pin is not active
@deft seal
I dont know what R11 is in this
let me show you
its essentially the same
or like this
warning lights work the same, but they are powered by the led output pins
NOTE that a led driver shift register likely makes more sense here
but if you have just a few of those this also works ok
they are just all powered from the microprocessor pins, so even though you essentially can make dimmable led outputs from all pins of a mega, you cannot really do that because it will just use too much current for the mega to handle if you light them up at once
I've got no problem with supplying an external 12V source, so I'll stick with my 3LED + R strings for the backlighting. What you're doing for the warning and annunciator lights makes good sense, though. Thanks for sharing the details!
I see that an output using PWM has 256 levels available, but what is the actual PWM frequency range that spans?
Yes, on my schematic R11 is the end of my 4th string of LEDs, it's just located elsewhere on the schematic.
I think the PWM frequency remains constant. It is the width of each pulse that is varied from 0 (no pulse) to 255 (fully on). According to Google, the frequency is about 490 Hz for most pins.
Ah, gotcha - and that's what I wanted to know (the 490 Hz value). Fast enough that flicker won't be a problem, slow enough that we don't really have to worry about MOSFET switching time.
servo pwm is 50Hz I think, but the idea like Jaime said is the pulse width. The pulse can be long or short, but it is still fast enough that the eye does not see the flicker, but the amount of the time the led is on results in a sense of brightness
On the schematics above, what size resistor are you using 1/4W? 1/2W?
If you're asking me, I have them sized at 1/4W. The LEDs I'm using are 20mA and 2.0Fv typical so the 220ohm resistor should be dissipating about 88mW.
yeah, pretty much like that too. The led calculators also tend to suggest 1/4W
Sorry, I should have been more specific (though maybe the answer is the same) -- I meant the resistor pair R17, R18 in this bit of the schematic:
the 10k is just pulldown that keeps the fet off when arduino is off
1k is in theory to protect the pin from current spikes but there are people who say it is not needed even, but read about flyback diode and it night give something to look into, I dont know it enough to explain it well unfortunately
When using a logic-level MOSFET with an MCU pin, a common resistor pair would typically consist of a single resistor placed between the MCU pin and the MOSFET gate, usually ranging from 100 ohms to 10k ohms depending on the desired switching speed and the specific MOSFET's gate capacitance; a lower resistance value allows for faster switching but can draw more current from the MCU pin.
Key points about choosing the resistor value:
Logic level MOSFETs:
These are designed to be driven directly by standard microcontroller logic levels, so you don't need a large resistor value.
Switching speed:
A lower resistance value will lead to faster switching, but can stress the MCU pin if the current draw is too high.
Gate capacitance:
The MOSFET's gate capacitance influences how quickly the gate voltage can change, so a smaller gate capacitance may require a lower resistance value for fast switching.
To be transparent, the above text was copied from a Google search about selecting gate resistors for logic level MOSFETs, I am not as knowledgeable as the above answer. As best as I can tell, this resistor protects the MCU against reverse current leakage and aids in stabilizing the switching action from noise. Given the info above, having a resistor present here seems ideal, and given the stated range, 1k seems a safe value. Our usage of this mosfet here would certainly not require anything more than a 1/4W value.
Good information (wherever it came from 🙂 ) and definitely tells me what I needed to know -- thanks!
@vapid steppe from what I've been reading to help me with a different issue, flyback diodes (and variations on such things) are mostly needed when the load you're driving has the potential to generate significant reverse current, the most common examples being anything with an energized coil (a DC motor, a solenoid). When energized, the coil builds an electromagnetic field around it. When turned off, the field collapses, sending sometimes significant levels of current back into the controlling circuit. I don't totally understand this yet (and I need to, because one of my panels needs to control solenoid) -- but that's the gist of what I'm reading so far.
yeah
and I think while leds are not coils, long led strips can work like coils and have induced current when switched on and off
thus the resistor
The AO3400A MOSFET has a typical gate resistance of 3 ohms and low gate capacitance of 670pF
The additional 1k gate resistor limits ringing on the input and, as mentioned, limits the transient current drawn from the logic pin and the current/voltage reflected back to the logic pin.
For LED dimming at 490hz the 1k value is not critical, just SOP when driving MOSFETS from sensitive MCU pins.
@open fjord thanks - also good to remember a lot of us dont really know much about electronics when starting this hobby
so this kind of explanations and also just having people to ask for feedback when designing stuff is what makes it good to have a community of different backgrounds and skills
This is instrumental to me.