Jump to content

Which Arduino is best for simpit?


Recommended Posts

Hello,

I've been avoiding arduinos for as long as possible, since I hate programming, but now it's time to try it out atleast!

 

I've been reading up for a while, but I'm not any wiser on which arduino's to use and exactly how.

 

So!

I'd like to use a nano or micro on each panel, use minimal wiring and as few USB connectors as possible, so i2c seems to be the way to go?

 

If so, should the master be a bigger arduino, and then use smaller ones as slaves?

Do I need to hook up 5V to each slaved unit?

If a panel need more i/o than the arduino have, should I use multiple arduinos, or are there any other way other than matrix to extend that number, expansionboards etc.?

 

I might use a couple LED's, a couple of displays (8 digit osram), perhaps some smaller oled screen too.

Other than that, toggleswitches, rotary encoders/switches and maybe a few pots as axis.

 

I'm making a "multirole" simpit, so I won't use DCS BIOS, only as a regular USB joystick.

 

Alot of text that's non-specific, but the "big question" is what is the best way to use arduinos , and which one to use, when you have lots of switches and some displays.

 

Regards

Robin

Link to comment
Share on other sites

I believe the two options for HID (joystick) emulation are the Uno and Mega. I'm using a couple Megas in my pit. I also bought a clone Uno but it's missing some sort of bootloader so I can't put it into DFU mode to turn it into an HID.

Intel 9600K@4.9GHz, Asus Z390, 32GB DDR4, EVGA RTX 3070, Custom Water Cooling, 970 EVO 1TB NVMe

34" UltraWide 3440x1440 Curved Monitor, 21" Touch Screen MFD monitor, TIR5

My Pit Build, VKB Gunfighter Pro w/WH Grip, TMWH Throttle, MFG Crosswinds W/Combat Pedals, Cougar MFDs, Custom A-10C panels, Custom Helo Collective, SimShaker with Transducer

Link to comment
Share on other sites

Hi Robin,

There are many ways to add what want. I find the easiest is to use a pro micro

 

http://www.ebay.com/itm/New-Pro-Micro-ATmega32U4-5V-16MHz-Replace-ATmega328-Arduino-Pro-Mini-/140972980117?hash=item20d2a4f795:g:MTwAAOSw241YfeGn

 

or the Leonardo if you don't want to solder on a small board

 

http://www.ebay.com/itm/Leonardo-R3-Pro-ATmega32U4-W-Cable-For-Arduino-Micro-USB-/262724799722?hash=item3d2b9e4cea:g:BL4AAOSwux5YL3Jo

 

They both use the ATmega32U4 and are natively recognized as USB HID devices. I find this libriary works very well and is simple to use.

 

https://github.com/MHeironimus/ArduinoJoystickLibrary

 

I would start with just basic button inputs until you get familiar with it. Once you get the hang of it, it is very versatile. We just built a VR panel for my friend using a 5 x 8 diode matrix that can read 40 switches as 80 separate joystick buttons. the 5 X 8 matrix was done for simplicity of wiring because it closely matches the panel layout. A SPST switch is read as 1 joystick button when switched ON and another joystick button when switched OFF.

 

Here is a good reference on switch matrixes

 

http://pcbheaven.com/wikipages/How_Key_Matrices_Works/

 

Like I said, there are many ways to this, but, I like this one because it does not require any other software or updating any firmware on the micro controller. The MHeironimus library can read up to 128 buttons, 2 hat switches and 6 or 8 axis. The pro micros also easily reads shift registers.

 

Good luck


Edited by MilesD

Now shipping up to website Pre-Order Form date 2022/06/01

Pre-Order  Form Submission https://pointctrl.com/preorder-form/

PointCTRL Support Discord https://discord.gg/jH5FktJ

PintCTRL Website https://pointctrl.com/

PointCTRLsmall.jpg

Link to comment
Share on other sites

If you want a HID, best options are Arduino's based on the ATmega U (like the ATmega16U4 & ATmega32U4), example of those are the Arduino Pro Micro & Leonardo.

Those chips have build-in USB support.

 

Arduinos based on the ATmega328P (such as the Uno) use an extra chip for the usb-serial translation. Meaning you will either have to do some magic with the extra chip (that often is one of the U series) to get windows to see it as a HID device.

 

I like to use Arduino Micro's because they (clones) are cheap ($3 delivered from ebay) and are nice and compact and can be easily soldered on some veroboard. Only reason to go for a 328P / 2560 based one would be (in my opion) for DCS-BIOS. I you want to brew a joystick device, take a usb one.

 

For the micro (and Leo) all you need to do is load up a joystick HID library and you are good to go.

I like this one: MHeironimus ArduinoJoystickLibrary. But there are tons of other ones out there.

 

 

For extra ports, there are some options, most easiest to use in my option are:

Matrix (handy for panels with a large of switches clustered together, a pain to wire up for other stuff)

IO expanders (I2C ones you can just string together on 2 data lines + power) or Shift registers (both for input & output)

 

Just be aware of HID Joystick limitations, if you smack 300 virtual buttons on there it probably won't work :D

 

If you want to use multiple arduino's on a single USB connection, you could string them together using I2C, but be warned that if your wiring gets longer then a foot or 2 between the two boards, your maximum speed (and reliability) will drop considerably. CAN bus might be a more flexible option, but, your master node (the one connected via USB) will still be limited to the HID limits. So no point in slaving 300 buttons worth of devices on a single arduino.

 

*edit*

Once again, I am to slow typing stuff out :D So pretty much exactly what MilesD said.


Edited by CrashO
sniped
Link to comment
Share on other sites

Thanks guys, great and straight forward info!

 

Will order a couple of Pro Micro and Leonardo's and try it out, can probably get away with <4 USB connections then.

If I string a couple of micros in I2C, do I need different resistors between each one of them also?

( Pardon my crappy "electr-english" :) )

Link to comment
Share on other sites

You can save the work of dealing with Arduino code sketch if:

 

Get a PRO Micro (6$) and use MMJoy2 firmware - 8x 8 bits axis (analog) or in 12 bits (digital), up to 128 buttons/encoders, 1 HAT.

Firmware developed by MegaMOZG that now is behind VirPil T-50 joystick electronics.

 

Or get Arduino STM32F (~4$) and use Easy Joy 32 One firmware - 8x 12 bits axis, 128 buttons, 4 HAT.

 

Both has topic there.

Link to comment
Share on other sites

You don't have to necessarily bother with I2C? I would just run each one as a separate controller, just like the Thrustmaster MFDs do. Like CrashO said, you will run up against the max buttons of only 1 joystick controller even though you have multiples arduinos linked. Don't discount using the diode matrix. Often it can make wiring simpler if you put the diodes right on the switches. If you are going to have only a few buttons on each box then you can just use one arduino and run multi conductor wire or even Ethernet cable wire with connectors. I like to use 5 conductor solid strand copper phone wire that is available here in the U.S. for these types of projects. It is easy to screw to switches and terminal board like this one without the need to tin the ends with solder to keep them from fraying.

 

http://www.ebay.com/itm/1-Set-Terminal-Adapter-Board-for-the-Arduino-Nano-V3-0-AVR-ATMEGA328P-AU-Module-/171772068561?hash=item27fe69c2d1:g:GNIAAOSwgkRVUhfe

 

With (2) of these 5 conductor cables you can make a 5 x 5 matrix that will give you 25 separate SPST switches and 50 corresponding joystick buttons, or just use (1) 5 conductor cable will give that will give you 6 switches. You can also easily wire a three position switchs (on off on) to give you three separate joystick button presses for each state.

 

You can be creative with your matrix. Example being: 3 button boxes each with a 5x5 matrix would require 30 arduino inputs. The arduino only has 20 inputs. By combining the rows of each matrix you end up with a 5x15 matrix which only requires 20 arduino inputs put gives you 75 switch inputs. While not as efficient as a square matrix (10x10 matrix equals 100 switches with 20 arduino inputs it often makes wiring easier.

 

Miles

Now shipping up to website Pre-Order Form date 2022/06/01

Pre-Order  Form Submission https://pointctrl.com/preorder-form/

PointCTRL Support Discord https://discord.gg/jH5FktJ

PintCTRL Website https://pointctrl.com/

PointCTRLsmall.jpg

Link to comment
Share on other sites

I'd like to use a nano or micro on each panel, use minimal wiring and as few USB connectors as possible, so i2c seems to be the way to go?

 

I went through the same lines of thought with DCS-BIOS and eventually settled for RS-485 instead of I2C. To handle multiple Arduino boards, I considered four alternatives:

 

Connect each board directly via USB

Cost: the cost of the USB cables and hubs

This is fine for a few boards, but quickly runs into problems.

  • One USB root controller can theoretically handle up to 128 devices (each hub counts as a device). In practice, some pit builders have already experienced problems at 20 devices total and had to install another USB card.
  • For DCS-BIOS, which uses serial ports to communicate, there is also the problem that Windows likes to renumber them for various reasons and dozens of those would be very annoying to handle
  • The Windows control panel seems to have a limit of 16 HID devices. I ran into this with my first project, which showed up as a huge composite device. I don't know if this limitation applies to DirectX or not.

 

 

Use I2C

Cost: free, it's already integrated into the microcontroller

I had planned to use I2C as well because it is easy to wire up and does not need any additional components. After some discussion with Gadroc and others, I decided against I2C.

 

I2C was designed for communication within the same circuit board assembly. When running it over larger distances, due to the open drain design, the possible number of devices decreases as the added wiring adds capacitance to the bus. The single-ended open drain signalling will also become susceptible to pick up interference on longer wires.

 

There are circuits and transceiver chips that can mitigate these problems, but at that point, I2C loses its complexity and cost advantage over other solutions.

 

 

CAN bus

The CAN bus looks quite attractive from a software developers point of view. The hardware handles a lot of the details for you and the bus is fast enough that you will never have to worry about bus contention. Differential signalling makes it robust against interference (it was designed to work in a car, which is a very electrically noisy environment -- e.g. ignition coils).

 

I ruled out the CAN bus for several reasons:

  • The CAN bus needs two pieces of hardware to function: a CAN controller and a CAN transceiver. The AVR processors on most Arduino boards do not include a CAN controller, so you'd have to wire up two additional chips.
  • CAN is a relatively complex protocol, so there are no dirt-cheap transceiver chips (the combination of a controller and a transceiver chip could be more expensive than the Arduino Nano clone they get attached to)

 

 

RS-485

RS-485 has been used in industrial automation for decades. Transceiver chips are available dirt cheap on eBay and AliExpress ($0.15 to $0.20 a pop), they might be clones, surplus stock or the stuff that got rejected in QA, but most of them work fine (WarHog has encountered one batch of bad chips that did not work at all). RS-485 uses differential signalling as well (it was designed to run next to huge industrial machines and their motors).

 

If you want to use the cheap half-duplex transceiver chips, you will need one I/O pin to switch it between transmit and receive operation.

 

 

TL;DR: USB is impractical, I2C is too unreliable. CAN bus is what I might use on a commercial product where I didn't care about an extra $2 per board, could choose a microcontroller with an integrated CAN controller peripheral, and cared about time-to-market and the cost of developer time. RS-485 is what I chose for DCS-BIOS because of low cost and because the Arduino boards that are most suited for simpit panels (small size, low cost) do not have a CAN controller.


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

Hey Sokol1,

I really do need to look at MMJoy2. I am so used to coding the arduino I never bothered, but it does sound like a great package.

 

MMjoy2 or Easy Joy 32 One advantages for novices is be a "almost ready to use" solution, simple load firmware through USB cable and customize the new "joystick controller" like want in a Windows interface.

 

Besides be a "universal" games solution and not exclusive for DCS.

 

For MMJoy2 this interface allow use different types of calibration, axes inversion, set type of switches, e.g. a toggle ON/OFF send only momentary press, filters, set curves and save all in firmware. Probable Easy Joy One 32 do the same.

 

Need to improve on my electronics skills though :)

 

For deal with Arduino+MMjoy2 the electronics skills that you need know is how to to solder (and have proper tools). And that basic electricity rule: "+ an - can't be mixed". :D


Edited by Sokol1_br
Link to comment
Share on other sites

  • 2 months later...
Ian;3085275']

RS-485

RS-485 has been used in industrial automation for decades. Transceiver chips are available dirt cheap on eBay and AliExpress ($0.15 to $0.20 a pop), they might be clones, surplus stock or the stuff that got rejected in QA, but most of them work fine (WarHog has encountered one batch of bad chips that did not work at all). RS-485 uses differential signalling as well (it was designed to run next to huge industrial machines and their motors).

 

If you want to use the cheap half-duplex transceiver chips, you will need one I/O pin to switch it between transmit and receive operation.

 

 

TL;DR: USB is impractical, I2C is too unreliable. CAN bus is what I might use on a commercial product where I didn't care about an extra $2 per board, could choose a microcontroller with an integrated CAN controller peripheral, and cared about time-to-market and the cost of developer time. RS-485 is what I chose for DCS-BIOS because of low cost and because the Arduino boards that are most suited for simpit panels (small size, low cost) do not have a CAN controller.

 

Dear Ian! Can you give examle of rs-485 on mega2560 and 2 nano like as serial example. CODE and IMAGE. You can draw it on the paper and foto it - its enought.

 

I will be grateful to you for any manual on This subject:helpsmilie:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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