Jump to content

Advice on using LED's for warning light panel


lesthegrngo

Recommended Posts

Guys, as you can see from the picture, I'm knocking together a warning light panel. The idea is to use four Nano boards to drive it, with 12 outputs from each Nano.

 

From perusing the internet, I see that it's recommended to use a resistor in series with the Nano output, presumably to protect the Nano. I am planning on using either 0603 SMD LED's which run at 2.0 - 2.2v or 0805 SMD LED's that run at 3.0 - 3.2v. As the PCB that I am making will need two LED's per light in order to illuminate the area, I was thinking that maybe I could run the two LED's in series without the need for a resistor.

 

Can anyone advise whether that would be practical, or is there a danger that I would damage the Nano board doing so? Also, I believe that to run all the LED's I may have to feed the Nano with 12v to the VIN pin, is that correct?

 

Cheers

 

Les

20190612_073653.thumb.jpg.9ac6994ae988799bfd6fe0a77efeae4a.jpg


Edited by lesthegrngo
Link to comment
Share on other sites

Instead of using four Nanos you could use just one and the Max7219 LED driver chip /LedContol library to power up a matrix with up to 64 LEDs.

This should be good for the caution lights panel.

 

library: https://github.com/wayoda/LedControl

documentation: http://wayoda.github.io/LedControl/

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Always use resistors with LEDs regardless of what you might read on the Internet. There are lots of web pages to calculate resistor values for series LEDs.

 

The Max7219 is a good way to handle the caution panel and I recommend you go that route. Download the data sheet for it. Hansolo has a caution panel sketch on his google drive (see his signature) but not sure if he used a 7219.

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

LEDs are sensitive to current which is non-linear in relation to the voltage across their leads known as forward voltage commenly written as Vf. A slight change in Vf sometimes results in significant changes in the forward current which causes either visible drops in brightness or the LED being fried. A resistor on the other hand is linear and helps "soften" the impact on voltage fluctuations.

 

To calculate the ideal resistor value, use the following equation:

 

R = (Vcc - Vf)/Id

 

where:

R: resistance

Vcc: Supply voltage

Vf: LED forward current

Id: Expected LED current.

 

Typical Vf at 20mA for different colors:

Red: 1.8V

Green, Blue or Whilte: 3.2~3.4V

 

Actual voltage is negligibly lower at lower currents.

 

Most Arduino boards are 5V systems, so Vcc = 5V.

 

A typical Arduino I/O pin allows a maximum of 40mA. Maximum total current through power leads on a single chip is 200mA. (using ATmega32 as example)

 

For me in most cases where brightness is required, Id = 5~10mA. (uncomfortably bright when looked directly into)

 

The larger the package, the brighter the LED, even running at the same current and same voltage.

 

Absolute maximum ratings for forward current is typically 20mA. An indicator LED looks bright enough at 5mA, it doesn't get significantly brighter when current is further increased. But based on our observation statistically, long term failure rates start increasing when current exceeds 15mA.

 

Example:

Green LED at 10mA.

R = (5-3.3)/0.01 = 170ohm. Use 200ohm instead, actual current ends up somewhere around 8mA.


Edited by Alex_rcpilot
Link to comment
Share on other sites

The Max7219 is a good way to handle the caution panel and I recommend you go that route. Download the data sheet for it. Hansolo has a caution panel sketch on his google drive (see his signature) but not sure if he used a 7219.

 

Mine does use the MAX7219 chip and I used the code from ClayM;

 

https://forums.eagle.ru/showthread.php?t=142202

 

Good thing about the MAX7219 it that it required only resistor for the Iset.

 

 

Cheers

Hans

Link to comment
Share on other sites

Thanks Alex. As it happens, 200 ohm is what I was using for my trials, simply because that's what I had!

 

I need to study the 7219 matrix thing, if anyone has an easy to understand schematic they can point me to I'd be grateful!

 

Cheers

 

Les

 

If I might suggest, every time you purchase or intend to use a particular component, be it a 7219, a LM317, a mosfet or whatever, do a google search for the data sheet and build a library of your accumulated data sheets. There’s a data sheet on virtually every electronic component which gives you lots of info ranging from specs to schematics to pinouts. You'll find that you are frequently referring back to your library as you get new ideas on how your building that next panel.:)

Regards

John W

aka WarHog.

 

My Cockpit Build Pictures...



John Wall

 

My Arduino Sketches ... https://drive.google.com/drive/folders/1-Dc0Wd9C5l3uY-cPj1iQD3iAEHY6EuHg?usp=sharing

 

 

WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,



AIO Water Cooler, M.2 512GB NVMe,

500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display

VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals

Link to comment
Share on other sites

Thanks Warhog, that's actually what I was doing, printing off the datasheets for reference. Trouble is, my old brain sometimes takes a while to make connection between certain things!

 

As for this one, the MAX7219 info dealt with 8 x 8 matrices, and I couldn't get my head around how that would apply to a 4 x 12 matrix. The link Hans provided above, combined with a look at the sketch helped me sort of reverse engineer in my head what was going on, so (I think!) I understand what to do now

 

Cheers

 

Les

Link to comment
Share on other sites

The LED lights up when current enters the anode and exits from cathode. Built within the MAX7219 are 8 high-side drivers and 8 low-side drivers.

 

The high-side drivers can only "source" current from power supply, and the low-side ones only "sink" it into the ground. They are hard-wired in the ASIC and cannot swap functions. So it can't be applied to a 4x12 matrix. If you need 48 LEDs you may use 6x8 matrix. If for some reason there has to be 12 columns then you may cascade two MAX7219 in series so they support a maximum of 8x16 matrix.

Link to comment
Share on other sites

Looking at Hans' work has made me reasonably confident that I can make this array work, I can see it ends up as 2 off four by six arrays.

 

As for the LED's I still would like to use multiple SMD 0805 LED's in each light to give a more even lighting to the back of the light panel. I can see from the data sheet that the output of the MAX7219 is 3v, so that means I can't use resistors with the LED's. Will I have the same problem with the 0805 LED's not sharing the power equally? They are really tiny, and don't consume much

 

Cheers

 

Les

Link to comment
Share on other sites

Guys, I will ask this rather than find out the hard way! Sorry to say the cathode / anode / high / sink etc terminology confuses me!

 

Do the positive sides of the LED's on the matrix go to the lettered or the numbered pins?

 

Cheers

 

Les

Link to comment
Share on other sites

Guys, I will ask this rather than find out the hard way! Sorry to say the cathode / anode / high / sink etc terminology confuses me!

 

Do the positive sides of the LED's on the matrix go to the lettered or the numbered pins?

 

Cheers

 

Les

 

Here's a schematic of how discrete LEDs are connected in a fully populated matrix. You may leave any of those spots vacant without having any complications.

attachment.php?attachmentid=213329&stc=1&d=1562498012

 

Note: in a schematic, wires remain isolated from each other even if they cross, unless a dot (called junction node) is drawn where they cross.

 

The fancy terms are mostly caused by integrated LEDs such as 7-segment or dot matrix modules. When 7 of them are combined within a single package, they'd either share a same positive pin (common anode), or a same negative pin (common cathode). But you can skip it all if you're using discrete LEDs.

 

Here's a simplified version of what happens inside the MAX7219 if you're curious:

It hooks only one of the eight DIGIT pins to the ground at each given time.

It feeds current from the power to any combination of the SEGMENT pins at the same time.

After enough time has passed, it does the same to the next DIGIT pin with a different combination of SEGMENTs.

It scans 8 or less DIGIT pins in a loop at a rate of 500~1300 times per second so it's not observable to the naked eye.

 

Normally you won't need to mind all that, just wire up your LEDs as in the schematic and Arduino scripts take care of the rest.

197808489_ApplicationCircuit.thumb.jpg.3174cc5a516134d884ebdd4a67c2bf92.jpg

Link to comment
Share on other sites

Guys, looking at the different pictures of the CWP on the internet, I can't work out if it's supposed to be a 'dark' panel or not - in other words when the caution light is not illuminated you can't see any text, the 'light' is is an even dark colour across.

 

Is that correct?

 

Also, curiously it appears that ALL the lights are green, rather than having amber and red lights for caution - again, is that correct or is this an interpretation by DCS?

 

Cheers

 

Les

Link to comment
Share on other sites

Hi les,

 

The text is not clearly visible. There is a screen on top of the indicators so you can barely see the text until lid.

 

 

This is a simulation panel running with original 28V bulbs so whether the color is actually blue'ish in the real jet I can't say.

 

Cheers

Hans

Link to comment
Share on other sites

No, it's not that simple.

You have to adjust forward voltage and current of the LEDs by using a single resistor for the chip.

Read the documentation within the link I post hereunder.

In the part "Selecting RSet" it is well explained.

There is also an example how to choose the set-resistor.

.

 

http://wayoda.github.io/LedControl/pages/hardware.html#SelectRSet

.

.

.

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Got it. From reading that I think that as he's done, limiting to 20mA would be sensible for my setup. I'll have to get a resistor specifically for it, unfortunately it doesn't happen to be one of the ones in the Arduino kit, however as I have to get the two capacitors as well I needed to go the electronics shop anyway. While I am there I'll see if they have some nicer feel PCB mount switches, the ones I got off fleabay have a horrible clunky action to them, and maybe they have some suitable button caps too

 

On the strength of the previous comments, I made my panel the dark type, I'm quite happy with it so far. Including the matrix PCB and LEDs it is only 6mm thick, but the PCB with the MAX487 chip, Nano and MAX7219 chip will add 15 mm to that

 

 

Cheers

 

Les

20190714_165330.thumb.jpg.7ac64c437a204dcf935a916567cab9cc.jpg


Edited by lesthegrngo
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...