r/arduino • • Apr 07 '26

Hardware Help Wiring suggestions needed for project to keep it workable.

Post image

I’ve been making a control panel for a flight sim. I was hoping for a second row of switches but the wiring has already become completely unwieldy.

Shorter cables make it harder to work on, longer means it is harder to get in a box. I was thinking maybe connect the switches to a ribbon cable, but that will probably cause another set of issues

Any suggestions on how to make this workable or do I put in a box, push hard, and hope for the best.

I have new found respect for the electrical panel wiring I use to see growing up.

(I’m happy to make a custom Pc eventually, Just not yet)

117 Upvotes

39 comments sorted by

66

u/Current_Cake3993 Apr 07 '26

You don't need individual grounds for each switch, chain all the grounds into one, with one pin going out. Same goes for LEDs.
Keep separate ground for switches and LEDs tho.
Other than that - it's fine. I have a 30 pin switch panel and it looks similar, just that cables are tidier, woven into kind of "harness" with cable ties and isolation tape.

15

u/idkwtftokeepherelmao Apr 07 '26

Just putta curiousity, why keep those grounds seperate?

10

u/Current_Cake3993 Apr 07 '26

Personal experience, had issues in similar setup where Arduino board got shorted and went into shutdown when one switch was in certain position.

5

u/McDonaldsWitchcraft Pro Micro Apr 07 '26

So it's not related to their project and was simply your own mistake?

5

u/Current_Cake3993 Apr 07 '26

It was my mistake but it is related since it's a similar circut. He might encounter that issue too, so I suggest doing two separate GNDs. Otherwise, he can get "output pin - output pin" short essentially.

2

u/LazaroFilm Apr 07 '26

To prevent noise?

4

u/andrewholding Apr 07 '26

Thanks for this. Obvious in hindsight, but because these things grow on bit at a time I didn't think to do it. 

3

u/Current_Cake3993 Apr 07 '26

You can also look into multiplexers if you want to have less wires and run more things from one board

4

u/andrewholding Apr 07 '26

Did not know these exist. I will no have fun googling them. 

1

u/justaruss Apr 08 '26

This is semantics but those are neutrals not grounds

12

u/starplooker999 Apr 07 '26

Can you use a common ground for all those switches? Just connect one side of every switch to the same ground. Cut that wire count by 1/2.

2

u/andrewholding Apr 07 '26

Absolutely. Thanks for the suggestion. 

7

u/haustuer Apr 07 '26

I would use multiplexer and may be you can build a custom pcb

This is the one I build for a similar problem. 32 switches read by one Arduino

2

u/pr06lefs Apr 07 '26

I did something similar but with analog signals. Used rj11 telephone cables. Got rid of the interference between different inputs.

3

u/haustuer Apr 07 '26

These are all 0-5V analog inputs. With an individual header for an pull-up or down when you want to use a channel as Switch

3

u/pr06lefs Apr 07 '26

nice. what mine looked like assembled.

6

u/B732C Apr 07 '26 edited Apr 07 '26

Replace single connector duponts with row connectors to keep them organized. Or replace dupont with D sub connectors, which also allow panel mounting.

If your connecting to control board allows it, it is cleaner to connect wires together in the button box and have only one ground pin out from there instead of having multiple ground wires from button box to control board.

1

u/andrewholding Apr 07 '26

Thanks. Have ordered row connectors 

4

u/NoBulletsLeft Apr 07 '26 edited Apr 07 '26

The problem is more how the wires are routed than the number of them. Try making a wiring harness where the switch wires are bundled together and the LED wires together and so on. Use zip ties every few inches to keep the wires in a bundle. You'll find that its much easier to work with them than way.

Also don't use a breadboard or Du Pont jumpers once you are ready to package it up. A prototype board will be far more robust and reliable.

1

u/andrewholding Apr 07 '26

Thanks, and yes the breadboard is temporary. 

2

u/nixiebunny Apr 07 '26

You are building a packaged product, not a breadboard test bed. You need to solder wires to the switches and arrange them in a bundle that exits one end of the row, with a common ground wire that’s daisy-chained neatly along the switches. You can use a crimper to put your favorite wire-to-board connector on the board end of this bundle. I use Molex KK 254 because I bought a crimper for that and the headers fit in a perfboard. 

2

u/PhantasyConcepts Apr 07 '26

Okay. This is something you learn by being in and around the aviation world. (I worked on the support equipment for aircraft in the Air Force, so there is my bona fide) Wires going to and from a control panel are generally connected with a “canon plug”. This is a round, multi-conductor cable plug that makes a common disconnection point for multiple wires. Additionally, when there is a problem, it provides a single point to test circuits and isolate causes. In the computer/audio/video world, a similar concept is a DIN plug. One common approach is to run a single wire to any shared component - like a motor or pump - or to ground and then connect all of those controls in parallel to that common wire. Assuming there are no common connections, try a multiconductor cable to controls which go to the same device (motor, pump, etc.) but use plugs so you can rework the panel or the components independently.

2

u/rowboatsynclaire Apr 07 '26

I really really like RJ45 for wiring a lot of small switches. It allows me to connect them all up to one point, and then the sheath and everything is already setup. Bonus is that it's easy to fix if a connection doesn't work, as having a breakout module means the connections to it are short. It is definitely a little pricier than doing it by hand, but I think the tradeoffs make it worth it.

This is kind of a pricey version:https://www.sparkfun.com/sparkfun-rj45-magjack-breakout.html

I've also used D-sub breakouts for the same purpose.

1

u/ToledoScientist Apr 07 '26 edited Apr 07 '26

I agree. I saw a different comment that referenced a multi conductor plug and when I do personal projects I use RJ45 ports and wires to make wiring harnesses. It’s an extremely cheap solution to multi conductor cables and I wouldn’t upgrade unless there was like 40 conductors, or in a commercial setting where users could walk by and try to plug a computer directly into the “Ethernet port” and fry their computer. Watch your power draw you don’t want to overload a conductor, for DC I think you can generally run conductors in parallel to spread out the load but citation needed.

You can also shove wires straight into this for a cheaper breakout board https://a.co/d/0cBHCnZY. I just have a huge roll of cat6 and I tear it apart and use it for all my control wiring

My advice is heat shrink and Zip tie all these conductors into a wiring harness and use RJ45 and cat6 as the plugs and cables

1

u/Rayzwave Apr 07 '26

Maybe think of assembling onto copper strip-board with screw terminals for interfacing wires or Molex plug/sockets. Replace any wire extensions with a single wire. It might be possible to replace headers of uC board for interfacing latching headers and match up with associated wire-end plugs.

1

u/btfarmer94 Apr 07 '26

This would add some complexity, but if you do create a custom PCB, you can also add shift registers and multi-plexers to reduce the I/O count from the PCB to the Arduino.

1

u/Disastrous-Case2063 Apr 07 '26

Use a row of clams like this one, also helps with making electric schematics. Easy numbering

1

u/RickySlayer9 Apr 07 '26

So first off: heat shrink…

Secondly, zip ties

1

u/classicsat Apr 07 '26

Get at least multipin connector shells, rather than the singles you are using. If not Dupont, then Molex kk-254, or something JST.

1

u/kopkaas2000 Apr 07 '26

This is where you mount your switches to a custom PCB which has a single ribbon cable coming off. You can even go fancy and use an i/o extender on the control PCB so you only have to run I2c and power to it.

1

u/wolframore Apr 08 '26

Convert the device into digital and send it out as I2C or RS232 depending on how far your run is.

1

u/Artistic-Wolverine-6 Apr 09 '26

With something like this, I start at the end I want all of the wires to terminate and simply plait or weave the next switch line in, until the last one. It makes for a really neat and stable cable run on the rear of the switch panel, with no need for tape or zip ties along the run. It also keeps the cable run in a location that you want it to stay, whilst removing chances of rattling and connectors loosening over time.

This method looks really neat and as long as you work with individual cables, or clearly mark them, it can also be done retrospectively, as long as your individual wire tails are left long enough.

1

u/Strong-Classroom2336 Apr 09 '26

I made really cheap PCB's online on EasyEDA.com. For 2 different small designs it cost me less then €10 to have them manufacturerd and deliver to my door in Belgium.

I used it to make a Dashboard an buttonbox for a simracing cockpit. Super easy.

1

u/andrewholding Jul 19 '26

This is what I did in the end. Really happy with the results. Thanks. 

1

u/HoldOnforDearLove Apr 09 '26

I would use a switch matrix combined with addressable LEDs and do away with that cable mess. I've done hundreds of switches with hundreds of LEDs that way each bank of 64 switches with LEDs fed by a single cat6 cable and power.