Jump to content

Controls box for Virpil Desk Mount (Arduino)


Recommended Posts

UPDATE APRIL 2019

Did some upgrades on my setup, two additional Arduino Leonardo-based new boxes. I'm still waiting for the delivery of the last encoders.

 

rio-3-partial.jpg?w=809

 

IMG_20190401_182747802.jpg

 

The Radar box (left of the UFC) has 121 buttons; the Master Switch doubles the base number and, depending on its status, some 3-way momentary work as 3-way toggles for their in-game equivalent since many buttons bindings are still missin in the RIO seat. The top "flat" box has 67 buttons at the moment but I still had to add the 4 missing encoders (should be delivered shortly). I didn't add any Master Switch since it would have exceed the HID limit of 128 buttons. I thought about "masking" some buttons as POV but still..

I tested the box with friends and on Hoggit and I'm quite happy about it, makes RIOing much faster and efficient.

 

UPDATE FEBRUARY 2019

7" LCD screen up and running! Definitely very nice for ABRIS. Plus, added the 3rd MFD.

IMG_20190108_162833010.jpg

 

UPDATE OCTOBER 2018

UFC done, I've found a 7" 800x600 LCD monitor and I plan to use it for the Shkval. This is the current status of my setup:

setup-201810-complete.jpeg

I'm quite happy about the UFC, I don't care about the F/A-18 but I can now easily control both the PVI-800 and the ABRIS and, by toggling the master mode, easily use the PRTz.

 

UPDATE 23/09/2018

I've decided to build a F/A-18 UFC. I don't know why, I don't like fixed wing..

Anyway, I've build an auxiliary panel for lights & co. At the moment it supports 70 buttons but I can easily expand it even more. This is the test of the buttons:

This is how my desk looks like at the moment:

cockpit_0918.jpeg

 

 

UPDATE 01/08/2018

I'm about to build my 3rd control box. It will use tension dividers and other simple circuits to support different functions such as 2 and 3-way latched and momentary buttons. Once it's done I will update the thread.

 

I have applied the tension divider to the radio box already to support 2x 3-way non momentary switches:

IMG-20180728-WA0000.png

 

Meanwhile I played with DCS-BIOS a bit to build a TFT based on Arduino Uno:

 

 

/******************************************************************************************/

/******************************************************************************************/

 

This thread is about Arduino and how easy is to create a control boxes fitted with whatever type of control you want: push-buttons, momentary buttons, 2/3 way switches, rotary encoders, etc.

I've promised in the Vipil T-50 thread that I was going to open this thread like a month ago but never had time (or, probably, I've just forgot :P )

 

 

Virpil Desk Mount is a massive piece of metal. It's heavy, big and.. empty. In my strugge to avoid using the mouse at all costs, I thought it'd be cool to convert the empty area inside the Desk Mount and add some controls there. I though about using a 8/16 bits microcontroller since I've worked on them for a decade, then I found Mr Arduino. A quick research and google suggested me this video.. Eureka!

 

That video is the perfect place to start: it was easy to understand, it has both the source code and the libraries. The idea is to configure Arduino I/O pins as inputs and use them to control a wide range of switches and buttons by means of a button matrix. Moreover, it also supports rotary encoders. The sketch linked in the video doesn't support potentiometers.

 

PLANNING

Since the control box is for DCS I decided to use momentary-switches. I have a Saitek TPM which mounts 9x 2-way non-momentary switches and I had to use DCS Bios in order to make them work (I reckon Black Shark 1 hardly digested non-momentary buttons, I don't know if 2.5 / 1.5.x are different) and emulate a keyboard. Hence I went for momentary switches + 4 encoders.

By using this firmware, Arduino is seen by windows as a gaming peripheral, not different from any other commercial joystick. It allows for direct mapping in DCS without the necessity of emulating the keyboard (this also mean no additional programs running in background)!

 

BOXES DETAILS

I have built two control boxes, one is held into Virpil's desk mount for their MongoosT-50, the other box is a radio/lights controls box with 6 rotaries. Unfortunately when I moved abroad I didn't carry all my DIY stuff with me, so I had to buy everything again. If you have a drill, soldering iron, wires, boxes and screws you have already saved a good amount of money.

 

“Virpil’s” control box is fundamentally a copy-paste of the video aforementioned. I have modified the wiring and added two standard pushbuttons + a few 3-way momentary switches because I didn’t like push-buttons encoders here. Software-wise, it’s basically the same. It has:

- 9x 3-way momentary switches;

- 4x rotary encoders;

- 6x standard momentary buttons.

 

The second box's wiring is even simpler, having a smaller matrix (3×3→9 buttons). It mounts:

- 4x rotary encoders;

- 2x rotary encoders + push buttons;

- 3x standard momentary buttons;

- 3x 3-way momentary switches.

 

PICS

NOTE: I'll add some decent pics later on. These are low quality, quite old and the encoders caps were still missing.

 

"Controls Column"

Soldering!

IMG_20180304_105922.jpg

IMG_20180316_133807.jpg

IMG_20180316_132206.jpg

(the only pic with caps atm)

IMG_20180413_130858.jpg

 

"Radio Box"

NOTE: I don't have proper tools to cut the plastic and the result is far from ideal. Any way, as long as it works, I'm happy :)

This pic was still WIP, I was waiting for the delivery of caps and the last 3-way momentary push-button.

IMG-20180325-WA0000.jpg

 

Complete setup

IMG_20180326_180253.jpg

 

 

MAPPING

I've linked a couple of my setups in this post: https://forums.eagle.ru/showpost.php?p=3458989&postcount=1963

Those configs are actually quite old, I have ordered Virpil's Throttle and I'm waiting for its delivery (it will take ±40 days at least, unfortunately) before changing them. Unfortunately the Shark has some poor controls options by default (I'll get a beer to whoever manages to add some more via lua!) and the Harrier is still WIP.

As already mentioned, Arduino is seen by windows and DCS as any other gaming device. You can assign controls right into the Controls Options menu in-game. No other programs or keyboard emulators are required.


Edited by Karon
Update
full_tiny.pngfull_tiny.png
full_tiny.png

"Cogito, ergo RIO"
Virtual Backseaters Volume I: F-14 Radar Intercept Officer - Fifth Public Draft
Virtual Backseaters Volume II: F-4E Weapon Systems Officer - Internal Draft WIP

Phantom Phamiliarisation Video Series | F-4E/F-14 Kneeboard Pack

Link to comment
Share on other sites

This is an awesome post. I've not yet started messing with Arduino, how long did it take to get a grip on programming? I've done C+/++, Cobol in my 20's (about 15 years ago now), so not totally clueless with programming, but otherwise, starting form scratch.

 

I'm ordering the table mounts for just this purpose, though still working out how I'll actually mount them in my simpit (seems easier than designing a whole new mount setup).

 

Thanks for the head start with the link, BTW...

 

Z...

Link to comment
Share on other sites

Is this something you’ll be producing to sell? It looks fantastic and for people like me who have none of your experience and programming skills would be a godsend. Cheers

MSI M5 z270 | Intel i5 7600k (OC) 4.8GHz | MSI GTX1080ti Gaming X 11Gb | 500gb Samsung 970 Evo NVME M.2 (DCS World) | 500gb Samsung 850 Evo SSD (OS and Apps) | 32Gb 2400MHz DDR4 - Crucial Ballistix | Be Quiet Silent Loop 240mm | NZXT H440 case |

 

Thrustmaster Warthog - 47608 with Virpil Mongoose joystick base | MFG Crosswinds - 1241 | Westland Lynx collective with Bodnar X board | Pilot's seat from ZH832 Merlin | JetSeat | Oculus Rift S | Windows 10 | VA |

Link to comment
Share on other sites

If you use the sketch made by the guy I've linked (maybe give him a +1 :) ) you really don't need anything else. Code is C, as you can see here: https://github.com/AM-STUDIO/32-FUNCTION-BUTTON-BOX/blob/master/ARDUINO_BUTTON_BOXV2.ino

 

I have written my own version, changed and adjusted pins and other things such as timers: encoders send an input of 50ms by defaul, it's too long if you aim to controls HUD/HMS/ABRIS brightness for instance. 35 or 40 are a better spot, although the more encoders you have, the higher that timer must be.

 

You don't need any coding skills though and if need any help, just ask :)

 

 

These are two parts you will probably change if you want more or less buttons or encoders:

byte buttons[NUMROWS][NUMCOLS] = {
 {0,1,2,3,4},
 {5,6,7,8,9},
 {10,11,12,13,14},
 {15,16,17,18,19},
 {20,21,22,23},
};

rotariesdef rotaries[NUMROTARIES] {
 {0,1,24,25,0},
 {2,3,26,27,0},
 {4,5,28,29,0},
 {6,7,30,31,0},
};

The meaning of those values is in the scruct. Encoders for example are defined by:

struct rotariesdef {
 byte pin1;
 byte pin2;
 int ccwchar;
 int cwchar;
 volatile unsigned char state;
};

So, the first line of the rotariesdef type var rotaries ({0,1,24,25,0}) is:

0 → first pin soldered;

1 → second pin soldered;

24 → the input sent to the PC when turning counter clockwise;

25 → the input sent to the PC when turning clockwise;

0 → it's status, zero by default.

 

So, you define that array as {0,1,1,2,0}, it will be:

soldere to pin 0 and 1 of Arduino and seen by DCS and the PC as button 1 and 2 of your peripheral.

 

 

This is the definition of the button matrix:

byte rowPins[NUMROWS] = {21,20,19,18,15}; 
byte colPins[NUMCOLS] = {14,16,10,9,8}; 

just change the values according to what you have soldered.

Exempli gratia, my radio box uses a 3x3 (total 9 buttons). Values are something like (I don't remember atm but it doesn't matter for the sake of this example):

byte rowPins[NUMROWS] = {21,20,19}; 
byte colPins[NUMCOLS] = {18,15,14}; 

The flow of the program is very simple: it's a loop that checks the status of the I/O pins of arduino and send a message via USB to the PC if something changes.

 

 

Is this something you’ll be producing to sell? It looks fantastic and for people like me who have none of your experience and programming skills would be a godsend. Cheers

No mate, I don't plan to build and sell them (lack of spare time + lazyness :P).

I'm happy to help you though, you really don't any need programming skill (see the top part of this reply).

full_tiny.pngfull_tiny.png
full_tiny.png

"Cogito, ergo RIO"
Virtual Backseaters Volume I: F-14 Radar Intercept Officer - Fifth Public Draft
Virtual Backseaters Volume II: F-4E Weapon Systems Officer - Internal Draft WIP

Phantom Phamiliarisation Video Series | F-4E/F-14 Kneeboard Pack

Link to comment
Share on other sites

That is a very nice post you have made @Karon :thumbup: What is the push button board you have on the right side on the last picture?

And if I understand the setup correctly it will work with momentary switches/push buttons only since there is no diodes, right?

 

But great and cheap setup to make some stuff for the pit. Great work Sir.

 

Cheers

Hans

Link to comment
Share on other sites

Yep it's an ancient CH MFP.

 

@Hansolo: I decided to use momentary switches only, it's a more flexible solution for different modules and I have no issues with DCS. You can use non momentary switches though (I haven't tried but I guess you can modify the firmware in order to have them send a signal for a defined period - such as 50ms).

 

EDIT:

I'll stress it again: my goal was a flexible, cheap solution independent from 3rd party software (such as DCS bios) because I plan to use it in Il2, Star Citizen and every game that can benefit from additional controls.


Edited by Karon
full_tiny.pngfull_tiny.png
full_tiny.png

"Cogito, ergo RIO"
Virtual Backseaters Volume I: F-14 Radar Intercept Officer - Fifth Public Draft
Virtual Backseaters Volume II: F-4E Weapon Systems Officer - Internal Draft WIP

Phantom Phamiliarisation Video Series | F-4E/F-14 Kneeboard Pack

Link to comment
Share on other sites

I bought those boxes from amazon but you can get them amost anywhere. IIRC the desk mount is ~70mm wide.

full_tiny.pngfull_tiny.png
full_tiny.png

"Cogito, ergo RIO"
Virtual Backseaters Volume I: F-14 Radar Intercept Officer - Fifth Public Draft
Virtual Backseaters Volume II: F-4E Weapon Systems Officer - Internal Draft WIP

Phantom Phamiliarisation Video Series | F-4E/F-14 Kneeboard Pack

Link to comment
Share on other sites

  • 4 months later...

You can find boxes almost everywhere: amazon, ebay, tons of chinese makes. Just google something like "abs enclosure".

I use a screw gun. I wish I had more appropriate tools of course.

 

 

Also, I've updated the first post with the new control boxes (in a few days another one will join the party. A F/A-18 UFC). This is my current setup:

cockpit_0918.jpeg


Edited by Karon
full_tiny.pngfull_tiny.png
full_tiny.png

"Cogito, ergo RIO"
Virtual Backseaters Volume I: F-14 Radar Intercept Officer - Fifth Public Draft
Virtual Backseaters Volume II: F-4E Weapon Systems Officer - Internal Draft WIP

Phantom Phamiliarisation Video Series | F-4E/F-14 Kneeboard Pack

Link to comment
Share on other sites

Nice setup was great you found a box that worked with the mount. I’m thinking of printing some boxes and panels r a huey vr setup

BlackeyCole 20years usaf

XP-11. Dcs 2.5OB

Acer predator laptop/ i7 7720, 2.4ghz, 32 gb ddr4 ram, 500gb ssd,1tb hdd,nvidia 1080 8gb vram

 

 

New FlightSim Blog at https://blackeysblog.wordpress.com. Go visit it and leave me feedback and or comments so I can make it better. A new post every Friday.

Link to comment
Share on other sites

Why use andrino over the leobedar boards I understand you can program them for different tasks I have one or two in my kit but I prefer the simplicity of Leo boards and to be able to make each board unique to the aircraft by assigning switch functions in dcs since there boards are plugs play where it is seen and the ability to use them in zp11 also without any special software or configuration other than button assignment.

BlackeyCole 20years usaf

XP-11. Dcs 2.5OB

Acer predator laptop/ i7 7720, 2.4ghz, 32 gb ddr4 ram, 500gb ssd,1tb hdd,nvidia 1080 8gb vram

 

 

New FlightSim Blog at https://blackeysblog.wordpress.com. Go visit it and leave me feedback and or comments so I can make it better. A new post every Friday.

Link to comment
Share on other sites

Why use andrino over the leobedar boards I understand you can program them for different tasks I have one or two in my kit but I prefer the simplicity of Leo boards and to be able to make each board unique to the aircraft by assigning switch functions in dcs since there boards are plugs play where it is seen and the ability to use them in zp11 also without any special software or configuration other than button assignment.

 

Damn mate, who stole all your commas? :P

 

Well, with arduino I write the code. I can have it do whatever I want (almost). For instance this morning a friend asked me to implement the use of a big red button - you know, the emergency one, something like that:

F8264397-01.jpg

in the cockpit he has build and I've written to code for. He wants to use it as the Eject button but that thingy has a sort of lock that prevents it to come in the original position once pressed. It cannot therefore be pressed 3 times but, since I write the code, I can have it send 3 times the "button pressed" message to the computer in one go by adding no more than a dozen lines of code. I can also have another input to work as a safety or stuff like that.

 

 

Also, I don't understand this part:

and to be able to make each board unique to the aircraft by assigning switch functions in dcs since there boards are plugs play where it is seen and the ability to use them in zp11 also without any special software or configuration other than button assignment.

My boards are HID. Each of them is seen by the computer as a different joystick/game device with its name, PID and VID. You can play FIFA, Star Citizen, ArmA3 using my UFC as keyboard (sort of, I haven't implemented the multi-keypress because it wasn't needed - but you've got my point I hope).

 

I think you are assuming I use DCS-BIOS for my boards. Not at all! I love DCS-BIOS but flexibility is more important for me. Take a look at my gaming devices in windows, for instance:

unknown.png

So no "special software or configuration other than button assignment", exactly as you said :)

I use DCS-BIOS for my TFT of course, since it has to display info straight from the game.

 

Speaking of UFC, I've finished it and did a quick test. Yep my webcam sucks..

I still have to find a way to place some decent decals on though.

 

I have also opened a small blog and currently writing a step by step guide about Arduino. It will take a while to cover every step of the building process (building it is faster than writing about it, for sure) and I'd appreciate if you can give me some hints about what to write or topics you'd like to see covered. URL: https://karons.home.blog/

full_tiny.pngfull_tiny.png
full_tiny.png

"Cogito, ergo RIO"
Virtual Backseaters Volume I: F-14 Radar Intercept Officer - Fifth Public Draft
Virtual Backseaters Volume II: F-4E Weapon Systems Officer - Internal Draft WIP

Phantom Phamiliarisation Video Series | F-4E/F-14 Kneeboard Pack

Link to comment
Share on other sites

Karon that UFC box is a great idea, I think I'll have to give that a try. A couple extra buttons for master mode and master caution would be perfect, too. I don't know anything about DCS-BIOS, but were I to make a box with lit buttons for master mode and master caution, could the arduino board be configured to dynamically change the lights? Ideally, I could do just what you did and follow that amstudio tutorial to start, then maybe delve into DCS-BIOS if I have the time.

 

Also, for the ignorant, now that you've made a few of these do you recommend the Pro Micro or a different Arduino board?

Link to comment
Share on other sites

can i ask how did u wire the switches to an arduino ? what was the coding to the arduino and how did the connect to the simulator ? im guessing from the actual swith, u wired it to a port or slot on the arduino, then from the arduino u have plugged it in usb to the computer. then from there i get lost, how did the simulator pick it up ?

ICEMAN2647

Link to comment
Share on other sites

Lads, I have opened a blog about Arduino, DCS and hardware. I'm writing a step by step guide about Arduino (a simple UFC with 3x 3-way momentary switches).

The plan is covering every step from planning to wiring and coding, I will then upload the firmware and the wiring diagram.

As you can imagine is quite empty now (I've been quite busy in the last few days) but I hope you will enjoy it anyway: https://karons.home.blog/

I'm happy to get feedback and ideas about new posts.

As usual forgive me for the poor grammar :)

 

Karon that UFC box is a great idea, I think I'll have to give that a try. A couple extra buttons for master mode and master caution would be perfect, too. I don't know anything about DCS-BIOS, but were I to make a box with lit buttons for master mode and master caution, could the arduino board be configured to dynamically change the lights? Ideally, I could do just what you did and follow that amstudio tutorial to start, then maybe delve into DCS-BIOS if I have the time.

 

Also, for the ignorant, now that you've made a few of these do you recommend the Pro Micro or a different Arduino board?

 

yep, you get get the data you need from DCS-BIOS, then have arduino turn on and off the LEDs you want. The only problem I see is the number of pins you would require to both control a big number of buttons and keys and control back-lighting. Also, I'm not sure about how many LEDs Arduino can control and power by itself. You'll probably need to power them with an external power source and then control them by means of transistors. Another solution might be controlling back-lightning via a different arduino board (working via DCS-BIOS instead of HID) and use it as a dedicated controller for led and cockpit lighining.

 

I use Leonardo for control boxes. I find it both easy to work with and cheap. The result is a HID peripheral that can work with any game or module you want.

I have used an Arduino Uno just to control a TFT for sake of experimenting with DCS-BIOS.

 

can i ask how did u wire the switches to an arduino ? what was the coding to the arduino and how did the connect to the simulator ? im guessing from the actual swith, u wired it to a port or slot on the arduino, then from the arduino u have plugged it in usb to the computer. then from there i get lost, how did the simulator pick it up ?

Which switches, mate? Momentary, 3-way momentary, 2/3/+ way latched or something else?

Arduino Leonardo "talks" to any game you want via HID (same as mice and keyboards, for instance). It's no different from your HOTAS Warthog or Virpil T-50.

 

You can use different wiring techniques depending on the type of switch. I plan to cover them on my new blog but of course it takes time.

Momentary can be wired to a pin with the IN_PULLUP on (meaning, the pin is set as input and the pullup resistor is toggled ON) or be part of a button matrix or again part of a net made by a series of resistors. I normally wire 2-way latched "straight" to a pin with IN_PULLUP on but I know that a button matrix with diodes can be used as well. Finally, I usually control 3-way latched via simple tension dividers.

 

im trying to build the f18, is this rite for this plane

Arduino can do whatever you tell him to do. If you plat to build a dedicated cockpit only for the F/A-18 then you should probably rely on DCS-BIOS instead of HID. If that's your plan I suggest you to look for the posts of Mr Hansolo, a fellow pilot of the 132nd Virual Wing. His work is terrific, this is his Youtube channel: https://www.youtube.com/channel/UCwpIaNrBMUUcnPiFQPl8YSg

full_tiny.pngfull_tiny.png
full_tiny.png

"Cogito, ergo RIO"
Virtual Backseaters Volume I: F-14 Radar Intercept Officer - Fifth Public Draft
Virtual Backseaters Volume II: F-4E Weapon Systems Officer - Internal Draft WIP

Phantom Phamiliarisation Video Series | F-4E/F-14 Kneeboard Pack

Link to comment
Share on other sites

  • 3 weeks later...

Quick update: UFC done but I'm already planning to expand my setup. I've found a 7" 800x600 LCD monitor and I plan to use it for the Shkval. This is the current status of my setup:

setup-201810-complete.jpeg

I'm quite happy about the UFC, I don't care about the F/A-18 but I can now easily control both the PVI-800 and the ABRIS and, by toggling the master mode, easily use the PRTz.

 

setup-201810-ufc.jpeg

 

 

I am now posting most of the stuff on my blog here: https://karons.home.blog/

The step by step guide to build a Control Box based on Arduino is almost done.

full_tiny.pngfull_tiny.png
full_tiny.png

"Cogito, ergo RIO"
Virtual Backseaters Volume I: F-14 Radar Intercept Officer - Fifth Public Draft
Virtual Backseaters Volume II: F-4E Weapon Systems Officer - Internal Draft WIP

Phantom Phamiliarisation Video Series | F-4E/F-14 Kneeboard Pack

Link to comment
Share on other sites

  • Recently Browsing   0 members

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