Jump to content

DCS-Bios + Arduino + MAX7219 = Caution Light Panel


ClayM
 Share

Recommended Posts

Warhog

 

Great how much info you can find and learn here. So can you tell me how your designs uses less current than mine. I ask because I am not 100 percent sure about my resistor value. Maybe I can learn something again!

 

Thanks

 

Clay

Link to comment
Share on other sites

Updated to ver 0.3.0 of DCS-Bios.

 

Sorry I guess i should have done that before.

 

Once again everything seems to function great! Running at 250000 as per sketch. Changed nothing except pin numbers.

 

Great job Ian! Very happy with how it functions. After testing I could not find any issues.

 

Thanks

 

Clay

Link to comment
Share on other sites

Did some more testing with the rest of the pit running. Absolutely no issues. I think I will change to two leds per indicator though. So I would call this a success!

 

Thanks Ian!

 

I now have all input types working. Finally have rotary encoders working.

 

Time to figure out seven segments with 74hc595's.

 

Already have CMSP display (I use a 20 x 2 VFD) working from a stand alone program.

Searched cmsp files to find out who to give credit to.

 

Looks like it was IAN!

 

Ian do you recall that sketch? I think it was about 2 years ago. It has worked great for me and was the first display I built for my pit. The fact that I (or actually You) managed to get that to work was why I kept building. I thought OK if I cannot get this one thing to work then stop and go no farther!

 

Thanks

 

Clay

Link to comment
Share on other sites

Did some more testing with the rest of the pit running. Absolutely no issues. I think I will change to two leds per indicator though. So I would call this a success!

 

Thanks Ian!

 

I now have all input types working. Finally have rotary encoders working.

 

Time to figure out seven segments with 74hc595's.

 

Already have CMSP display (I use a 20 x 2 VFD) working from a stand alone program.

Searched cmsp files to find out who to give credit to.

 

Looks like it was IAN!

 

Ian do you recall that sketch? I think it was about 2 years ago. It has worked great for me and was the first display I built for my pit. The fact that I (or actually You) managed to get that to work was why I kept building. I thought OK if I cannot get this one thing to work then stop and go no farther!

 

Thanks

 

Clay

Hi Clay

 

Sorry I haven't responded sooner...Been under the weather.

 

Question for you. Why use shift registers? You don't need to get so complicated. This is where the MAX7219 really shines...with 7 seg displays. I have used them for the ILS, TACAN, UHF Repeater, both VHF radios and I will use them with the UHF as well.

 

 

IMG_0441.jpg

 

They work so well and require very little effort. They even have PCB's already made for you and also for 7 seg displays. They must have seen us coming because these are new and I have never seen these months ago.

 

http://www.ebay.com/itm/171462457882?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

 

I've even ordered a bunch to try out. How can you beat that price. It only takes me 10 minutes to cut one on my mill, but the design time to draw it up can be quite a bit especially when you don't know what you doing like me.:smilewink: Check ebay for 7 seg PCB's as they are also inexpensive and worth looking into.

 

BTW, you were asking about current on my design. They way I figured it was the less LEDS on a row the less current required to drive them. Someone correct me if I'm wrong but the MAX7219 scans row by row, turning on and off the row of LEDS at an extremely fast rate. As it works on a row by row basis then the the smaller the number of LEDs it has to deal on a row, the less current it requires to drive that row.

 

With regard to the value of the current limiting resistor, I calculated its value based on what the the data sheet offered but what I may not have taken into account is that I'm not using 7 segs in a row so I might have over valued it. :doh: That resistor calculation is a little bit black magic and the explanation on how to determine it is not well explained. At least..it confused me but then I' am easily confused now a days. :huh: :pilotfly:

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

Warhog

 

Hope your felling better and thanks for your reply. a few points id like to address here

 

Did you get clp working? I hope Ians latest contribution helped you out!

 

Once again very nice work. ILS looks great! Hope to reach that level someday.

Thinking of investing in cnc router. Do you have one or laser?

 

Sorry off topic again.

 

I as well am having a hard time with resistor val for 7219. especially when i think i may go with 2 leds per indicator. I think yours looks great but i dont think i will have the build quality of yours and need a little extra help.

 

Also i think I should start new thread for 7 seg. what does anybody think?

 

Anyways,

 

I purchased 74hc595's after seeing some of felm's work but after trying to build some circuits I think warhog is correct in using MAX7219. The only issue i had was that i purchase most components from digikey and a MAX7219 is $15.00 I think i paid under a dollar for 595's. But with adding all the resistors I may go nuts! Trying to get UHF radio working first. So MAX7219 would save about 42 resistors.

 

Thanks for the input warhog i will do it your way.

 

Clay

Link to comment
Share on other sites

I bought 10 7219 for $5.00.... Chinese, but they are still 7219 and they work great. Plus free shipping. :music_whistling:

 

http://www.ebay.com/itm/140803886130?_trksid=p2060353.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

 

The shift registers, I think I bought 10 for what you paid for one. I save Digikey for those specialty items such as 45 degree rotary selector switches which no one seems to have on eBay...only 33 degrees. Otherwise everything I buy is from China. The cost savings is simply enormous and in ll good conqence, I could not afford this project otherwise.

 

You were asking what I use for machining...it is a Taig CNC Mill made in the USA. I also have a full size manual mill, a 10 x 12 lathe and a Taig Micro Lath, not to mention the usual belt sanders, micro table saw, band saw etc. Finally, at age 60, I have a shop that can let me build pretty much anything I wish. I would however like to add a laser cutter and a gantry style rotary mill that is not Chinese made. They simply cut to many corners in the name of cost savings to be able to produce a quality (read: accurate) milling machine. One day though...maybe.

 

My CLP is on the back burner just untill I get back to full working order, still not 100%. Probably, a mild flu.

 

BTW Clay, where are the photos? It would be nice to see your work. It really helps not only yourself but others who get ideas on how to do things.


Edited by Warhog

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

Now that we have been talking about circuits I just realized that I calculated my current limiting resistor based on using all 8 segments of the 7219. Except I'm only using 6 . I wonder if that might be part of the problem I'm having. Maybe not as that would just make them all dim.

 

The value for R_SET is independent of the number of used segments.

(If you use the "segment limit" register to reduce the number of segments that the MAX7219 controls to three or less, the maximum output current you are allowed to set will be lower than 40 mA to prevent overheating the digit drivers, but the relationship between R_SET and the current through each LED is still the same.)

 

From the datasheet:

The current per segment is approximately 100 times the current in ISET.

 

Let's do an example.

Say we have these green 5050 LEDs which are rated for 30 mA and have a forward voltage of 2.0 V.

 

To get each segment driver to output 30 mA, we want the current going into the I_SET pin to be 30/100 mA = 0.3 mA, so R_SET would be:

 

R_SET = 5 V / 0.3 mA = 16666 ohm, so about 17 kOhm.

 

Table 11 in the datasheet confirms this: for V_LED = 2.0V and I_SEG = 30 mA it tells us to use R_SET = 17.1 kOhm.

 

Now what happens if we use these LEDs instead, which still want 30 mA but have a forward voltage of 3.4 V?

Our calculation does not involve V_LED at all, so we still arrive at R_SET = 17 kOhm. However, Table 11 in the datasheet tells us to use 14 kOhm (for V_LED = 3.5 V).

 

Take a look at the "SEGMENT DRIVER OUTPUT CURRENT

vs. OUTPUT VOLTAGE" diagram on page 4. In an ideal world, those lines would all be parallel to the X axis, but whatever piece of black magic they use in each segment driver that looks at the I_SET current and makes the output current be 100 times as much does not behave that way (in other words: its amplification factor depends on the output load).

 

Exercises:

 

1) Try to pick a few combinations of I_SEG and V_LED from table 11, look them up in this diagram and then see how close you got to the value that is listed in the table.

 

2) Why is table 11 limited to V_LED values from 1.5 to 3.5 V?


Edited by [FSF]Ian
Link to comment
Share on other sites

Warhog

 

 

I purchased 74hc595's after seeing some of felm's work but after trying to build some circuits I think warhog is correct in using MAX7219. The only issue i had was that i purchase most components from digikey and a MAX7219 is $15.00 I think i paid under a dollar for 595's. But with adding all the resistors I may go nuts! Trying to get UHF radio working first. So MAX7219 would save about 42 resistors.

 

Thanks for the input warhog i will do it your way.

 

Clay

 

I'm not using the 595s for 7segments, the MAX7219 handle those. I used the 595s for some indicator leds (gun read, master caution etc) but you can easily substitute a MAX7219 in there, the principle is exactly the same!

Link to comment
Share on other sites

I'm not using the 595s for 7segments, the MAX7219 handle those. I used the 595s for some indicator leds (gun read, master caution etc) but you can easily substitute a MAX7219 in there, the principle is exactly the same!
OR you can try this.

 

I needed to light all of the indicators from one Pro Mini and many LEDS were of a much higher power than the board could handle so I elected to do this:

 

IMG_0460.jpg

 

You must realize that most of this (electronics) is new to me and I am on a learning binge. My solution was to use logic level MOFSETs (30N06L) to act as a switch for every LED indicator that the A10C has including AOA indexer, AAR Status indicator, Guns, Nose Wheel, Beacon, Canopy, Fire and the list goes on. One pin per indicator on the Arduino board, 12v in for the indicators, header pins to attach each indicator and everything labelled on the board in case I forget. What do I mean "in case I forget" ... when I forget. Its an easy circuit and if any one wants a copy I can put a PDF up.

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

Sorry felm

 

My comment did make it sound like your using 595's for 7 segs but that's not what I had intended it to.

 

I just noticed from your code examples you where using 595s for output but I thought I'd give them a try with 7 seg. Now I see why you used 7219.

 

Warhog

 

I'll post some pics soon but please don't expect the level of mine to come close to yours or others we have all seen here!

Link to comment
Share on other sites

Hi ClayM

stumbled on your thread and read with a voracious need for information. I am at the 'downloading Fritzing' to start my design stage of the electronics. I have made the physical panel for the caution and also the left outer.

 

Any wiring diagrams you are willing to share would be greatfully received!

 

Neal

 

1998592755_photo(2).thumb.JPG.eacea31892cba194ab5bd8144d8bda02.JPG

 

1447_photo1.thumb.JPG.325f11a7c180755906a8dd780b5b0de7.JPG

Desktop PC:

Intel i9 9900K, Gigabyte MOBO, 32 GB RAM , GPU Nvidia RTX 2080

Windows 10, TM Warthog, Crosswind rudder peddles, Occulus Rift S.

Link to comment
Share on other sites

Bluethornton

 

Sorry I have no detailed schematic to share but here is what i did hope it helps.

 

Uno R3

 

Proto shield on top of Uno with Max7219 (google arduino with max7219 all info is there for arduino to MAX7219 connections)

 

I use DB9 connectors a lot so two of those between max7219 and CLP leds.

 

Leds are wired up like in post #10 of this thread.

 

Connection descriptions are pretty self explanatory. Get datasheet for Max7219 first!

 

Come back if you need more help.

 

Maybe I'll see if I can draw something up. Haven't used fritzing before.

 

Clay

Link to comment
Share on other sites

Here you go

 

 

[ATTACH]116706[/ATTACH]

 

I'd say you were off to an excellent start Clay. Still lots to do which is good.

 

Don't be afraid to post close ups of your wrk. And please don't think you need to compare your work with others. What's most important is it lets everyone see how problems are solved. We each have different ways of doing things with the resources we have at our disposal. Not everyone wants an exact duplicate panel either. By sharing like this, it lets others develop ideas and techniques that get passed on to help those with similar needs and resources. In the end, you have a forum that generates "ideas" by sharing results.

 

Keep up the good work Clay. Looking forward to more pics.:)

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!

 

BTW took picture far away on purpose.

 

At this point its a very functional pit. MFCDs work (that was easy) UFC work great. CMSP fully functional.AHCP ELEC Landing gear all working. UHF inputs working (now need 7 seg) missing seat arm and fuel gauge check for full start up sequence (oh and MIP knobs like HSI ADI ).

 

So far all work is proof of concept only. Once everything actually works together will I then build proper panels. When I first starting building the pit it did not seem that there would be a suitable hardware software setup to get everything to work. But 2 years later it seems very possible for me to get it working!

Link to comment
Share on other sites

OR you can try this.

 

I needed to light all of the indicators from one Pro Mini and many LEDS were of a much higher power than the board could handle so I elected to do this:

 

IMG_0460.jpg

 

You must realize that most of this (electronics) is new to me and I am on a learning binge. My solution was to use logic level MOFSETs (30N06L) to act as a switch for every LED indicator that the A10C has including AOA indexer, AAR Status indicator, Guns, Nose Wheel, Beacon, Canopy, Fire and the list goes on. One pin per indicator on the Arduino board, 12v in for the indicators, header pins to attach each indicator and everything labelled on the board in case I forget. What do I mean "in case I forget" ... when I forget. Its an easy circuit and if any one wants a copy I can put a PDF up.

 

John m8, I would be interested in a copy of the pdf if possible. Kinda fits round my way of thinking. Could you oblige. Many thanks

 

weeb

Windows 7 64 Home Premium, i5 3570K (3.4 @ 4.4GHz), Asus P8Z77-V LX, 16GB dual channel 1600 ram, EVGA Nvidia GTX980ti, 240 GB OCZ SSD, 3 TB Raptor, Thrustmaster Warthog Hotas and Throttle, Saitek Pro Combat Rudder pedals.

Link to comment
Share on other sites

weeb...I have attached 2 PDF's with a number of pictures of this board in various stages of construction. The PCB is also attached.

 

You should know that I have not done a complete test of this circuit yet. At most I hooked up the four indicators I built for the dash and tried them and they worked fine. These are what I used for my test in conjunction with DCS-BIOS and an Arduino Pro Mini. It worked beautifully.

 

IMG_0106.jpg

 

 

Nothing got hot, no blue smoke, no smell and no fire. :smilewink:

 

I post this information for reference only.

 

If you copy it and use it, you take full responsibility if it explodes and your house burns downs. :(

 

:music_whistling:

 

:lol:

 

On a more serious note, I do suggest you understand the circuit before you do anything more with it. Essentially i have taken one pin from the Arduino board over to the gate of the MOFSET. When that pin goes high it sends 5V to the MOFSET which allows current to flow from drain to source. The header pins on the board pick up the LEDS I use. I send 12V+ to the LED through one of the header pins to the anode of the LED (indicator). The cathode of the LED has the current limiting resistor on it and that is then attached to the other header pin which is attached to the drain. When 5V is applied to the Gate, the circuit is closed and the LEDs turn on.

 

Thats how its suppose to work and so far it has tested fine with those indicators. I haven't tried it with all of the indicators attached but I see no reason why it shouldn't work with everything connected.

 

If anyone sees a problem please let me know. I hope you find this useful.

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

Cheers John, appreciated m8, gives me something to study in hospital. :)

Windows 7 64 Home Premium, i5 3570K (3.4 @ 4.4GHz), Asus P8Z77-V LX, 16GB dual channel 1600 ram, EVGA Nvidia GTX980ti, 240 GB OCZ SSD, 3 TB Raptor, Thrustmaster Warthog Hotas and Throttle, Saitek Pro Combat Rudder pedals.

Link to comment
Share on other sites

Cheers John, appreciated m8, gives me something to study in hospital. :)

 

Oh! ...:shocking:

 

Been there/done that ...don't like it.

 

Hope it's not serious weeb.

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

Nothing too serious John, smashed my leg to bits several weeks back and it has an external fixing with 3 pins directly into the shin bone. Got kinda infected so back in to get mended. Means i'm lying around doing nothing constructive, so I have a chance to read and study up. More frustrating than painful m8.

Windows 7 64 Home Premium, i5 3570K (3.4 @ 4.4GHz), Asus P8Z77-V LX, 16GB dual channel 1600 ram, EVGA Nvidia GTX980ti, 240 GB OCZ SSD, 3 TB Raptor, Thrustmaster Warthog Hotas and Throttle, Saitek Pro Combat Rudder pedals.

Link to comment
Share on other sites

Nothing too serious John, smashed my leg to bits several weeks back and it has an external fixing with 3 pins directly into the shin bone. Got kinda infected so back in to get mended. Means i'm lying around doing nothing constructive, so I have a chance to read and study up. More frustrating than painful m8.

 

Your getting to old for that shit my friend. Just take it easy and get well.

 

And your right, time to catch up on all that reading you've been putting off.

 

Be well. Talk to you soon.

 

John

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

  • 5 months later...

Hello all!

 

New to the forum and a little bit new to the simulator too.

I'm lifting this older thread because I'm trying to get the CLP panel to work with this setup.

I have both the Arduino Uno and the Mega. I get the same result with both of them. Nothing happens and then suddenly all the led light up for a while and then go off again.

 

I have been testing my setup with the 7219 and leds with a loop that test all the leds and that works fine so I don't think there is anything wrong with the hardware.

 

I've been using the ino sketch posted earlier in this thread or I found it somewhere else.

https://gist.github.com/jboecker/1f37b5c0b44aec0d3f80/revisions

Is it working with that sketch and with which one of the revisions? The latest?

 

I also found something in another thread about this and that the Arduino can't handle the load of all the LEDs. Don't remember where though. Could that be the problem for me?

Do I need to power the LEDs separatly?

__________________

Intel i7-7700K @ 5.1GHz, Gigabyte Z170XP SLI

32 GB Corsair Vengeance @ 2666 Mhz (Stock 2400 Mhz), Gigabyte GTX 1080 Windfoce OC , PSU 650W Seasonic

EK Watercooling (Open loop)

Windows 10 Pro x64

Thrustmaster HOTAS Warthog + MFG Crosswind + Thrustmaster MFD

Link to comment
Share on other sites

This sketch is written for a serial baudrate of 250000 bps. The default in the current DCS-BIOS version is 500000. You either need to change the sketch ("Serial.begin(500000)" instead of "Serial.begin(250000)") or modify the BAUDRATE= setting in the connect-to-serial-port.cmd script.

 

You don't need to power the LEDs separately, the MAX7219 takes care of driving them at the correct current. If you have not already, it is also a good idea to add a small capacitor (about 100 nF) across the Vcc and GND pins as close to the MAX7219 as possible.

Link to comment
Share on other sites

Snowman, I would read through the attached PDF. See page 10 for capacitors and pg8 for resistor.

 

There are 3 additional components you will require, a 10uf electrolytic cap and a .1uf ceramic cap. As Ian said, install both caps as close to the chip as possible. There is also a resistor required to go between RSET and VCC (data sheet refers to VCC as V+). I think the minimum is a 10K resistor but read the data sheet to make sure.

 

Thats about it. Let us know how you make out.:)

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

 Share

  • Recently Browsing   0 members

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