Bits and Droids logo
Mail icon

How to build your own Flight sim throttle

3/30/2024 | by Bits and Droids

Hi guys! In this guide, I will walk you through creating your throttle for Microsoft Flight Simulator 2020. The things we need for this project:

  • an Arduino board (any will do, I went with a Nano)
  • a potentiometer (any will do; I went with a 10k potentiometer)
  • male-male and male-female wires
  • my input handler, which can be downloaded from www.bitsanddroids.com/downloads

Wiring for our potentiometer

Our potentiometer has 3 pins (ground, output, and power Input). We need to connect the ground and power(5v) to the respective pins on our board. 

Potentiometer wiring diagram

The middle pin(output) must be connected to an Analog pin on our Arduino. I've included the A0 pin in the schematic, but every analog pin should suffice. The output pin will give us a signal reading that changes depending on how far we open or close our potentiometer. This value will be used to determine at which percentage our handle is positioned.

Base values

Now that everything is wired up, we can start coding. To determine the percentage position of our handle, we first need to determine the max and min values of our potentiometer.

cpp
//place where we plugged our potentiometer int potPin = A0; int value; void setup() { //declare the potentiometer as an input pinMode(potPin, INPUT); Serial.begin(9600); } void loop() { //read the analog value value = analogRead(potPin); //print the returned value Serial.println(value); delay(100); }

Let's upload this code to our Arduino and see what values it returns. Now, it's time to fully rotate to both sides and note the values. One should be 0, while the other could vary depending on the potentiometer. In my case, the max value was 1023.

If 1023 is the max, we can pass this data to our connector using the following code: First, we have to create a new connector object and include the library.

cpp
#include <BitsAndDroidsFlightConnector.h> BitsAndDroidsFlightConnector connector = BitsAndDroidsFlightConnector(true);

Now, we're able to combine both code blocks.

cpp
#include <BitsAndDroidsFlightConnector.h> BitsAndDroidsFlightConnector connector = BitsAndDroidsFlightConnector(true); int potPin = A0; void setup() { pinMode(potPin, INPUT); Serial.begin(115200); } void loop() { //This line is all that is needed with the latest connector connector.simpleInputHandling(potPin, 1023.0); //connector.advancedInputHandling(A0,A0,A1,A1,A1,1023.0); //supersuperAdvancedInputHandling(int percentage eng1,int percentage eng2,int percentage eng3, int percentage eng4, int percentageMixture) //int value = analogRead(potPin); //connector.superAdvancedInputHandling(value,80,80,80,80); //delay(400); }

Passing the data to our game

The next step is to run the Connector from

www.bitsanddroids.com/downloads.

It will ask which com port it should listen to. Here, you have to provide the port your Arduino is connected to. If you're unsure which port your Arduino is using, go to the Arduino IDE -> click Tools -> Port and note to which port the Arduino is connected. The program will only work when the game is loaded (this will all be worked out in future releases).

It's important to note that you only send the throttle data over the serial of your Arduino. You have to remove all other logging in your code to ensure the Arduino will set the throttle correctly.

Was that it?

Yes, that was it. This is simple, yet one of the better improvements you can make doesn't need a lot of work to complete. The programming will only take 10 minutes max (and that's generous). The only part that might take longer is assembling or designing the throttle.