The holidays have been a great time to get some work done on the sim, and now I have almost every cockpit switch wired up to the simulator. One of the more interesting ones has been the keyed ignition switch, which is a real FAA-certified switch made by ACS and purchased from Aircraft Spruce.

Firing up the engine. I’ll never get bored of this!

To wire one of these up to a simulator, there are 5 terminals on the back on the switch of interest: “L” (left mag), “R” (right mag), “GND” (ground), “S” (starter), and “B” (battery).

The back of the ACS ignition switch.

Phyiscally connecting to the switch is easy – the back of the switch has 0.250″ tabs for each terminal, so a set of female quick-disconnect connectors and a crimping tool gets the job without any hassle or soldering (just make sure you’re using stranded wire – crimp connectors and solid-core wire don’t mix!). I found some great 18-gauge 6-conductor stranded cable from my local electronics supply store, so that’ll keep the back of the panel nice and clean without too many wires going everywhere.

Quick-disconnect connectors and a crimping tool – much better than soldering!

The way this switch works is fairly simple. If both “GND” and “BAT” are connected to ground, the behavior of the switch in each position is as follows:

L terminal R terminal S terminal OFF Grounded Grounded Open circuit R Grounded Open circuit Open circuit L Open circuit Grounded Open circuit BOTH Open circuit Open circuit Open circuit START Open circuit Open circuit Grounded

Wiring these up to the Teensy was straightforward, but when testing this out in X-Plane, I discovered one curious bit of behavior: on occasion, when flipping between the “L” and “R” positions, the virtual switch in X-Plane would bounce up to “BOTH” for a split second. There was some head-scratching as I there didn’t seem to be anything obviously wrong with my code on the Teensy, so I decided to hook up my oscilloscope (set to single edge trigger) to see what was physically going on with the “L” and “R” terminals when flipping between these two positions…

The state transition from the “R” to the “L” position on the switch. The yellow trace (CH1) is the “L” mag terminal, the blue trace (CH2) is the “R” mag terminal.

Aha! So in a perfect world when switching from the “R” to “L” positions with the key, the L terminal would switch on and the R terminal would switch off instantaneously (corresponding to a voltage drop to ground and a voltage rise to 3.3V in the sim, respectively). But as you can see in the oscilloscope, there’s actually a slight delay: the R terminal switches off about 12 ms before the L terminal switches on – and the microcontroller in the Teensy, running at 120 MHz, is obviously polling the input pins much faster than 12 ms!

So this raises another question: what should I do about this? One option is to write some code that introduces, say, a 20ms delay to wait for the switch to stabilize before changing any parameters in the simulator. But there’s another thing to consider: this “bouncing” effect between L/R and BOTH is the actual real-world behavior of an airplane ignition switch! Although this certainly isn’t what the virtual panel simulates in X-Plane, leaving this behavior in would cause the simulator to do exactly what a real ignition switch does. So with that, I’m leaving it in.