
How To...Add Switches To MS Flight Simulator With A USB Interface
By Steve W. Sokolowski (18 April 2006)
Ever go on a trip using one of the major airlines? Ever wonder what
goes on in the cockpit during takoff? Here's a fanciful scenario of
one such flight. The captain and first officer have clearance to
begin their takeoff roll down the runway at Tampa International. They
apply full throttle; the GE power plant begins to come to life with
the 'roar' of unbridled power. You start your fast but short trip
down the runway. Ever increasing in speed until the first officer
gently pulls back on the yoke, lifting your aircraft into the deep
blue skies of western Florida. The altitude of about 200 feet (AGL)
is reached within seconds; the first officer wishes to retract the
landing gear. He might start wondering, "Do I press shift-G. Or maybe
it's ctrl-shift-G. No, it's a right button mouse click". No way!
Commercial as well as general aviation pilots "press buttons", "flip
switches", "turn knobs". Why not you! Why should the flightsimmer
population be content with keyboard input and mouse clicks to get
their virtual airplane to do the same things that the "seasoned
pilots" do every day!
With this article, I show you how to easily and inexpensively add
spring return, rocker and toggle switches as well as a keyed rotary
switch to your copy of Microsoft's Flight Simulator 2000, 2002 and
2004. I'll also show you how to make use of the "Assignment Window"
that can be found in all versions of Flight Simulator. And best of
all, no additional software, .dll, or .exe programs need to be
purchased to get these designs up and running.
Gameport
All computers have a number of ways to input data. These may include
the keyboard, mouse, gameport, USB and many other ways needing
additional hardware and software that is quite expensive. I did
mention that adding these switches will be an inexpensive venture so
let's eliminate the need of additional plug-in hardware (this also
includes Ethernet connections) right from the start. We also want to
eliminate the keyboard and Mouse. This leaves us with the gameport
and USB.
The gameport is a 15 pin connection on the back of a computer,
usually running Windows 95 or 98. The gameport is usually designed as
part of the sound card. Newer computers do not have gameport
connections or even plug-in sound cards. All audio connections and
electronics are already part of the motherboard inside the computer.
To add another soundcard to this configuration will mean
re-programming the computer's BIOS, which is not recommended.
Besides, a gameport connection only allows you four connection points
(see table 1) that can be used as switches (for this article; the X
and Y axis are not considered switch connection points). Another
drawback to using the gameport is that you can connect only one set
of four switches. Not very practical for use as a Flight Simulator input
commands.
USB
With a gameport interface looking more and more dismal, the USB has a
brighter outlook, but it does have its own drawbacks. So let's look at
the 'up' side of using the USB port for a moment.
Unlike the gameport, all newer computers have multiple USB ports, so
a number of USB based devices can be connected at the same time. More
ports can be added by purchasing a USB extension card or hub. The
card is easily plugged onto the computer's motherboard. Usually the
extension card can be automatically detected by Windows XP and the
appropriate driving software can then be loaded. If I'm not mistaken,
you can have up to 254 USB devices connected to your computer at any
given time. So far, the USB port is looking pretty good. But...
The Downside
When the cash-flow allows, you purchase a
CH Products
Yoke and Rudder Pedals both connected to the USB port and you're
flying into the 'wild blue yonder'. But comes the time, you want to
add your own switch arrays and program them to perform needed cockpit
functions instead of mouse clicking and keyboard pressing. Here's the
problem: designing a USB interface that allows you to connect
switches to your FS is extremely complicated. Protocols need to be
addressed, programs need to be written, circuit boards need to be
designed. Not a small task for the Sunday flightsimmer, especially
for one that lacks an engineering degree. So flight simmers came up
with a number of novel approaches (which can be seen elsewhere on
this web site) to adding switches. Keyboard emulators, voltage
controlled solenoids with plungers pressing selected keys and so
on.
The Upside
Desktop Aviator comes to the rescue.

Figure 1
|

Figure 2
|
While surfing on the Internet, I came across a new Flight Simulator
site called 'Desktop Aviator'
(http://www.DesktopAviator.com)
and they came up with a novel approach to adding toggle, rocker and
rotary switches to your virtual cockpit using a USB port. It's called
the "USB to 10 Button INTERFACE (Model 805)". As the name implies,
this device allows you to connect up to 10 switches to your Flight
Simulator. By purchasing a number of these interfaces, you can add
20, 30, 40+ switches using your computer's USB port. Figure 1 shows
the USB to 10 Button INTERFACE. From this photo, you can see that the
INTERFACE has the USB Connector protruding from its plastic case;
this is the connection to the USB port on your computer. Also in
Figure 1, you will see a standard 15 pin MALE connector. It is here
where we will make our switch connections through a 15 pin female
mating connector on one end and open wires on the other (Figure 2).
Figure 3 illustrates how the pins of the MALE Connector are arranged.
While Table 2 shows how each pin of the USB to 10 Button INTERFACE is
wired to external switches and/or buttons.
By using the USB to 10 Button INTERFACE, you can let your imagination
run wild and create that cockpit you've been dreaming about for
years. "How do you wire the switches?"; just read on. I'll show you a
few tricks using easy to understand electronics and readily available
parts.
Let's Get Started

Figure 4
|
Before I get any further, first let me say that I will assume you are
knowledgeable in the assigning of keyboard buttons to perform flight
requirements like turning on/off pitot tube heat, fuel pump, nav
lights, etc. The USB to 10 Button INTERFACE, when connected to the USB
port of your computer will be sensed as USB joystick. Furthermore, pin
numbers 1 to 10 on the interface 15 pin cable will also indicate the
switch assignment through the USB port. Example: SW1 connected to pin
1 (common ground - pin 15) will be assigned position #1 by the USB
port. SW2 connected to pin 2 (again with a common ground - pin 15)
will be assigned position #2 by the port. This will be true for all
ten switches connected to the USB port through the interface.
A faster way to test your switch wiring is making use of your XP's
"Game Controller" window. To access this window, click on the "Start"
icon located in the lower left corner of the screen. Then click on
"Control Panel" then "Game Controller". When selected, a smaller
window appears. With the USB to 10 Button INTERFACE connected to a
USB port, locate and click on "USB Joystick", then "Properties". A
second smaller window will appear as seen in Figure 4. Notice the 10
red circles on the bottom of the screen. These red circles will light
up when its corresponding switch is closed. Example: If pin 1 of the
interface's cable is shorted to pin 15, the #1 red circle will light.
Pin 2 shorted to pin 15, the #2 red circle will light, and so on. A
quick and easy of checking your wiring. If it works here it will work
with your Flight Simulator.
Spring Return Push Button

Figure 5
|
The first and the easiest to implement is the spring return push
button (normally open). Figure 5 illustrates an inexpensive push
button. It can be purchased for about $0.30 USD each from the vendor
listed at the end of this article. Switches of this type come in two
varieties: 1) normally open, 2) normally closed. A normally closed

Figure 6
|
switch is a switch that the internal points are in electrical contact
with each other without any pressure applied on the button top. When
pressed, the contact points inside the switch open. A normally open
switch is just that, open when there is no pressure on the button
top. When pressed, the internal switch contacts close, making an
electrical connection between them. The normally open switch is the
device we will use in our panel designs.
Figure 6 shows a schematic using four normally open switches
connected to the interface's 15 pin cable. The wiring is
straightforward. One of the two available solder terminals on the
buttons is soldered together using a piece of solid wire, then
terminated to pin 15 of the interface cable. The now unused terminal
of each button is soldered to pins 1, 2, 3, etc. of the interface.
Then when the interface is connected to an available USB port, select
"USB Joystick" from the "Game Controller" window; notice that the red
circles will light as the corresponding button is pressed as
mentioned above. The red circles will remain lit as long as you keep
pressure on the button. If you wish, you can continue to wire the
remaining buttons to the interface by referring to table 2.
Idea Box #1
The 10 buttons from this project can then be mounted on a plastic
panel, measuring 3 inches by 8 inches, wired and soldered as
discussed using the USB interface. Add small labels above each button
(example; taxi, nav, pitot heat, etc.) and using the Flight Simulator's
"Assignment" window, program each of the ten buttons to perform its
indicated function. Then mount on your virtual aircraft avionics
panel.
Relay Pulse Circuit

Figure 7
|
Figure 7 shows a circuit you might be familiar with; it was featured in:
How To... Use Toggle Switches With Cockpit Keyboard Emulation
by Eric Edelman.
Eric did such a fine job in describing the operation of the circuit
there is no need for me to re-invent the wheel. Just visit Eric's
article if you more information on this circuit.

Figure 8
|
So here goes my contribution to pulse circuits. Figure 8 shows a
device called a miniature toggle switch (single pole double throw) or
SPDT for short. By using this toggle switch in place of the push
button discussed earlier, our avionics panel can look more like the
real thing. The toggle switch is basically two independent switches
in one case. Flip the toggle up, the center and upper contact short
together. Flip the toggle down, the center and lower contact short
together while the upper connection is removed. Great for our
avionics panel, but it cannot be wired directly to the USB interface
without the addition of an inexpensive circuit.
In Figure 9, you will find a circuit very similar to the one found in
Eric's article, but here's the twist. I use a device called an
"opto-isolator" (IC1 H11AA2). This small 6 pin integrated circuit
takes the place of the relay in Figure 7. Across pins 1 and 2 of IC1
are two very small light emitting diodes (or LEDs for short). With a
small DC voltage applied, the LEDs create a small amount of light
that is directed to a "light sensitive" transistor (pins 4 and 5).
When the transistor detects light, pins 4 and 5 are basically shorted
to ground through a 1000 ohm resistor. A voltage drop from 5V DC to
about .5V can be seen at IC1 pin 5. The length of time that this
grounding pulse is created depends on the size of the series
capacitor/resistor combination (220uf capacitor / 330 ohm resistor).
The larger the capacitor, the longer will be the output pulse. The
smaller the capacitor, the shorter the output pulse.

Figure 9
|
|

Figure 10
|
So here's what happens: with the toggle switch in position "B", 5VDC
is delivered to the 220uf capacitor and 330 ohm resistor. With this
voltage applied, the capacitor charges at a rate governed by the
value of its series resistor, in this case, the 330 ohm. When the
capacitor is charging up, a voltage its also applied to one of the two
internal LEDs located within the opto-isolator IC. The LED generates
a pulse of light for about 1/2 second (time needed for the capacitor
to charge). This light is detected by IC1's internal transistor (pins
4 and 5). A ground pulse is created at pin 5 of the IC. This pulse
can be seen with a volt meter connected from Ground to pin 5 of IC1.
Now, if the toggle switch were flipped to position "A", the now
charged capacitor discharges through the 330 ohm resistor to the
second internal LED of the IC, but now in the opposite polarity.
Again, the LED flashes and pins 4 and 5 are shorted to ground
(through the 1000 ohm resistor), thus creating another pulse. It is
here where we can connect one of the ten available USB interface cable
wires (pins 1 to pin 10). For this example, let's connect the pulse
circuit's output to pin 1 of the USB interface's mating cable. Also
note that this circuit requires that pin 15 from the interface be
connected to pin 4 of IC1. Figure 10 shows how you can wire multiple
circuits to the USB interface. Basically just wire up to ten pulse
circuits in parallel. The 5VDC power required for the circuit can be
borrowed from the USB port. The USB to 10 Button INTERFACE already
allows for these connections. +5v DC can be found on pin 11. System
ground is found on pin 12. Note: system ground and the ground
connection on pin 4 of IC1 must be connected together for proper
operation.
To test this circuit, let's go back to your computer's "Game
Controller" window (Figure 4). Unlike the push button switches wired
previously, the red circle associated to toggle switch #1 will
"pulse" with the flipping of the toggle. Now flip the toggle in the
opposite direction. The red circle will flash again. Do the same for
all other circuits you wired. You will see "flashing" on all toggle
switch settings.
Now all you need to do is to program a function for each toggle using
the Flight Simulator's "Assignment" window. Some suggestions for
these switches are "carburetor heat", switching your "GPS" and "Radio
Stack" display on and off, "lower landing gear", switch between
"fuel tanks"... What you do with the toggle switches is up to you! Use
your imagination.
Idea Box #2

Figure 11
|
So far I discussed using a spring return push button and the
miniature toggle switches, but for added realism you can substitute a
"rocker switch" for any of your toggle pulse generating circuits
discussed above. Figure 11 shows this type of switch. Priced at $1.00
each, the rocker measures about 1.0 inch by 0.5 inches. Notice that
this design requires a hole to be drilled in your panel faceplate,
which is a much easier task then trying to first drill and then cut
out a rectangular hole for most other rocker switch configurations.
Also note that the switch in Figure 11 is called a DPDT (or double
pole double throw). Fancy terminology to let you know that there are
two independent switches in one casing that are being controlled by one
rocker assembly. The wiring for the DPDT switch is the same as shown
when we wired the toggle, just that one set of contacts are not used.
Not any difference in the wiring but the "finished look" of your
panel will be worth the added expense.
In Closing
Well we covered quite a lot of ground; discussed how and why relays,
capacitors, opto-isolators do what they do and how to use them to
create that dream cockpit panel. So here is a compiled listing of
where you can purchase the parts and items I mentioned. So until next
time, happy flying!
Steve Sokolowski
Steve34613@yahoo.com
Parts And Where To Get Them
You can visit any or all of the above vendors via the Internet, they
will be glad to send you a free catalog of all their products.