Custom control panel

Parts Sources

I have found on DigiKey a load of buttons (Like this one) but they are REALLY expensive.

Anyone know of somewhere that sells clear topped, preferably illuminated, buttons? I'd need about 35! I am in the UK.

For you and others looking for parts. I can recommend two sites:

American Science & Surplus - they have a variety of switches and lots of neat stuff not sure if they ship to UK though.

Newark Electronics - Their site is down at the moment (updating?) but they do have a UK side also. When I'm researching parts on their site I tend to filter out the UK source as the shipping cost (around $20) make the small quantity of parts I order too expensive.
 
Ebay for clear tactile switches too (widen your search area to 'worldwide').

Example.

Search for 'LED tactile' or 'illuminated tactile'. Clear tactile non-illuminated also available in multi packs and are a lot cheaper.
 
For anyone interested, I am still working on my project as well.

To recap, I'm building a modular control panel system. Simply put, it comprises of a series of control panels (between 2-5 buttons per-control panel) that can be screwed into modular bays, allowing you to effectively build a dashboard.

I've almost finished the first fully functional prototype, I just need a spare 5 minutes to actually create the circuit board - which is part of why it has taken me a little longer, as I have designed a circuit board that you can actually make yourself using electric paint, which not only means you don't have to solder anything, but obviously hugely reduces costs.

The prototype panel is landing gear control. It comprises of;

1 Landing Gear toggle switch
3 Landing Gear LEDs (they flash on when landing gear is lowered, and off when raised)
1 Ship Light button with built-in LED (the button is lit when lights are on, off when off)
2 reset buttons (resets the LED's in case the game and control panel become out of sync)

I've managed to reduce it all down to just 3 pins on the Leonardo (plus 5v and GND pins), so you could actually connect 6 panels to one board (that's up to 30 buttons).;

1 analogue pin - handles up to 5 buttons (code could be changed to handle more)
1 digital PWM pin - handles flashing LED
1 digital pin - handles static LED

It works by using a resistor tree on the 1 analogue pin. Each control panel will have a specific resistor as R1 which determines the panel (i.e. Landing Gear panel might have a 100 ohm resistor as R1). There are then up to 4 additional resistors in series when a switch. So when button 1 is pressed, the 1 analogue pin will read the resistance of the first resistor - in this case, 100 ohm. It knows that 100-500 ohms is the landing gear panel range, and 100=button 1. When button 2 is pressed, 2 resistors are now live giving a resistance of 200 ohm, so again it knows it's landing gears and button 2. etc etc.

A second panel's R1 might be a 1k ohm resistor, so it knows anything between 1000 to 1400 are the 5 buttons on that panel.

The pins are also all specific so that the Leonardo knows what LED pins to fire. So in the above example, the landing gear panel is Panel 1 - so it's 1 analogue pin will be plugged into the Leonardo's A0 pin. It's standard digital pin will be plugged into digital pin 2. It's PWM pin into digital pin 3. Panel 2's anlogue would be A1. It's digital pin would be 4. It's PWM would 5. etc etc.

So in the Leonardo code, it's sniffing for the resistance values of all the 5 analogue pins. If it finds resistance on analogue pin 0, and the resistance falls within the landing gear range, and matches button 1, then it knows it needs to flash LED's on digital pin 3 on or off.

Sounds a little complex, but it's actually a very simple system.

Once I have it working correctly, I'll make all of the source code available along with printable panel faces so you can make the panel yourself, as well as printable circuits so you can make your own circuit boards! How's that for DIY? :)
 
How do you detect the initial state of the Landing Gear?

Simple answer is I can't.

Instead, I am saving the last state to the Arduino board, and if there is no previously saved state the landing gear LED's will start lit. The state will remain saved even if the PC is switched off or the Arduino is unplugged.

I think that will probably solve the issue for most people.

The other status LEDs are much harder to work with, though, since their state in game isn't persistent. Ship lights, for example, are switched off in-game if you jump into hyperspace or quit, so you'll need to remember to switch the lights off before doing either of those otherwise you'll need to reset them. For this reason I won't be saving the states for these.
 
Back
Top Bottom