Make your own free website on Tripod.com

 

HOW to . . Add Switches to MS Flight Simulator with a USB INTERFACE

 

by: Steve Sokolowski

 

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 Flight Simmer 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 & Toggle Switches to your copy of Microsoft's Flight Simulator 2000, 2002 & 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.

 

Inputting Switch Data into Your Computer

 

Gameport

 

All computers have a number of ways to input data. This includes 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 lets eliminate the need of additional plug-in hardware (this also included

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 is 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

4 connection points (See Table 1) that can be used as switches (for this article; the X and Y Axis is not considered switch connection points). Another drawback to using the

Gameport is that you can connect only ONE set of 4 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 lets 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. 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 address, programs needs to be written, circuit boards need to be

designed. Not a small task for the Sunday Flight Simmer, 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 website) to adding switches. Keyboard emulators, voltage controlled solenoids with plungers pressing selected keys and so on.

 

The Upside

 

Desktop Aviator Comes to the Rescue

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 2 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.

 

 

                 

                                                                                        Figure 1

 

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.

 

 

Figure 2

 

Figure 3

 

 

Lets Get Started

 

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 ect. 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 10 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 way of checking your wiring. If it works HERE it will work with your Flight Simulator.

 

Figure 4

 

 

Spring Return Push Button

 

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.30USD each from the vendor listed below. Switches of this type come in two varieties; 1) NORMALLY OPEN 2) NORMALLY CLOSED. A NORMALLY CLOSED 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 3 Normally Open Switches connected to the INTERFACE's 15 Pin Cable. The wiring is straightforward. One of the 2 available solder terminals on the Buttons are 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 and 3 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 7 Buttons to the INTERFACE by referring to Table 2.

 

 

 

        Figure 5

===============================================================================================================

Figure 6

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 (Ex; TAXI, NAV, PITOT HEAT ect.) and using the Flight Simulator's "ASSIGNMENT" Window, program each of the 10 buttons to perform its indicated

function. Then mount on your Virtual Aircraft Avionics Panel.

 

Relay PULSE Circuit

 

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.

 

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 can not 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 22000 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 (470uf Capacitor / 330 ohm Resistor). The larger the Capacitor, the longer will be the Output Pulse. The smaller the capacitor, the shorter the Output

Pulse. The duration of the pulse is also dependent on the H11AA2 itself. ( NOTE: At the present time, I am using a 1000uf capacitor with a 10000 ohm resistor (Connected to pin 5 of the IC). This generates a pulse of about 1/4 second.)

 

So here's what happens:  With the Toggle Switch in Position "B", 5VDC is delivered to the 470uf 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 is 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 2200 ohm resistor), thus creating another Pulse. It is HERE where we can connect (through a 1N4148 Glass Diode) one of the 10 available USB Interface cable wires (Pins 1 to Pin 10). For this example, lets connect the Pulse Circuit's                                                                 Figure 7

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 10 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, lets 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 Shack" Display On and Off. "Lower Landing Gears", Switch between "Fuel Tanks". What you do with the Toggle Switches is up to you! Use your imagination.

Figure 9

 

==========================================================================================

Figure 10

 

Idea Box #2

 

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 2 independent switches in one casing that is 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.

 

 

 

                                                          

 

                                                                         Figure 11

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

 

                        USB to 10 Button INTERFACE             Opto-Isolator (H11AA2, DIP-6)

                        Part Number: 805                       Part Number: 320434

                        Desktop Aviator                        Jameco Electronics

                        http://www.DesktopAviator.com          http://www.jameco.com

                        Hernando, Florida                      Belmont, California

 

                        Rocker Switch                          Toggle Switch

                        Part Number: G2239                     Part Number: G2268

                        Electronic Goldmine                    Electronic Goldmine

                        http://www.goldmine-elec.com           http://www.goldmine-elec.com

                        Scottsdale, Arizona                    Scottsdale, Arizona

 

                        Spring Return Push Button (open)    1000 ohm / 330 ohm Resistors 1/4W

                        Part Number: SWT1002                   Part Number: RES1000 / RES330

                        BG Micro                               BG Micro

                        http://www.bgmicro.com                 http://www.bgmicro.com

                        Garland, Texas                         Garland, Texas

 

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.

 

ADDED 01/29/2007

 

For those of you who purchased the optional Mating Cable

HERE is the Wire Colorcode for each Pin 

 

 

 

 

Click HERE to go back to Desktop Aviator Home Page