Play GTA with Bicycle Pedals
Exercise “bike” adapted as Xbox Grand Theft Auto controller using Raspberry Pi.
Grand Theft Auto has been entertaining gamers for literally decades. As fun as it might be, playing it for hours on end isn’t doing your cardiovascular health any favors. Creator David Program, however, has an interesting solution with his GTA/Xbox pedal adapter.
His rig takes a small standalone pedaling device, and adds six magnets to the flywheel. When each passes by a reed switch it activates a Raspberry Pi input, which is used to estimate pedaling speed. Direction is still dictated by controller input, convenient for quick responses.
The Raspberry Pi processes this input, then passes speed info along to a modified Xbox controller. As a Pi can’t generate the 0-3.3V signals needed for the controller, it instead uses a PWM output, along with a simple low pass filter setup to generate the needed voltage. The filtering/capacitor setup is outlined nicely at the 5:50 mark in the project video, and there’s a bit about the physical debounce input circuit at about 1:30 mark. Both bits are quite instructive, and since the video is in Spanish, it could be a chance to brush up on your language skills as well.
The result of this build is a rather elegant gameplay setup, which could be adapted to a full exercise bike if you were so inclined. One could also perform this operation with a simpler processing unit like an ESP32, or even an Arduino, and there’s no reason why it couldn’t be wireless either. Code is up on GitHub if you’d like to poke around for inspiration.
Engineer, maker of random contraptions, love learning about tech. Write for various publications, including Hackster!