Given a properly-wired Arduino Leonardo and Logitech G27 pedals, this Ardunio sketch allows your standalone G27 pedals to act as a rudder control via USB. I like to use my pedals as my Flight Simulator and Elite Dangerous rudders.
- Logitech G27 pedals
- This might work with other Logitech racing wheel pedals, but I only own the G27.
- An Arduino Leonardo
- ~$20 on Amazon
- A Micro USB cable to go from the Arduino to your PC
- Find one lying around your house, or grab some for ~$10 on Amazon
- A DB9 female connector
- If you're lucky, find one at a local electronics store, or buy more than you need for ~$8 on Amazon
- A soldering iron and some solder
- Maybe you already own this gear from previous hobby projects. If not, here's a $23 soldering kit and some $9 solder on Amazon.
- Some male-to-male jumper wires
- These are probably cheaper to buy locally or find in your hobby drawer, but here's some $6 jumper wires on Amazon.
- The Arduino IDE
- Free!
- A copy of the Arduino Joystick Library in ZIP format on your hard drive.
- Free!
If you need to buy everything from above, this project will cost you around $76 plus the cost of the G27 pedals.
Look at the rear of your DB9 female connector:
- The row of 5 pins is the "top"; pin 1 is the top-left pin.
- The row of 4 pins is the "bottom"; pin 9 is the bottom-right pin.
- DB9 pinout ASCII art:
_________________________ \ 1 2 3 4 5 / \ 6 7 8 9 / \___________________/
We'll use this information below.
Use your soldering iron, solder, and jumper wires to wire the following DB9 pins to the corresponding Arduino Leonardo pins:
- Pin 1 ->
GND
- Pin 2 ->
A2
- Pin 3 ->
A1
- Pin 4 ->
A0
- Pin 5 no connection
- Pin 6 ->
5V
- Pin 7 no connection
- Pin 8 no connection
- Pin 9 ->
5V
- If there's only one
5V
pin on your Arduino, it's okay to solder one jumper wire to another, then plug the resulting exposed wire into5V
. It won't be pretty, but it'll work!
- If there's only one
- Plug your G27 pedals into your DB9 connector (the DB9 connector is wired to your Arduino).
- Plug your Arduino into your computer via Micro USB.
After you've plugged it all in and wired it all up, make sure you've downloaded and installed the free Arduino IDE.
- Open the Arduino IDE.
- Click
File -> Open
. - Open
LogitechPedalsToArduino.ino
from this repository. - Click
Sketch -> Include Library -> Add .ZIP Library...
. - Navigate to and open the Arduino Joystick Library .ZIP file.
- Click
Tools -> Board: * -> Arduino Leonardo
. - Click
Sketch -> Upload
or press the Upload button in the IDE toolbar. - Wait for the programming to finish.
- You can now close the Arduino IDE.
Now your clutch pedal and your accelerator pedal are working to create the Rudder axis on a virtual joystick!
Importantly - you must now calibrate the "controller" from within Windows:
- Click Start.
- Search for "controllers" and press enter.
- Click the
Arduino Leonardo
controller, then clickProperties
. - Click the
Settings
tab, then clickCalibrate...
. - Follow the instructions to calibrate the rudder axis.
You're all set! Now you can bind an input in your favorite flight games to your new rudder axis. Enjoy!