These Guys Hacked Together a Raspberry Pi & Car Steering Wheel to Play Mario Kart
Oh, Mario. The guy that's been a part of our lives since as long as we can all remember. Well, Adam Ringwood and his friends did something pretty cool with one of Mario's most exciting games at the HackIllinois event in February 2016—they hacked a Chevrolet Volt's steering wheel into one big Nintendo 64 controller for Mario Kart.
This ingenious project scored the team first place in HackIllinois' top hardware hacks category, among others, and not only uses the vehicle's steering wheel as a controller, but the brakes, gas pedal, and windshield wipers, among other things. Check out the video below to see how it's all connected—and to see it in action.
The main component here is a Raspberry Pi, a tiny, inexpensive single-board computer, which they installed Mario Kart on. With a CAN bus board attachment and an OBD-II cable, which connects to the car's port to read the CAN bus data, and a few other elements, they were up and running in no time.
The main flow of the data goes from the car though the CAN bus to the Raspberry Pi. This data is then sent over UDP [a transport layer protocol or packet] using [Netcat] to the laptop that is hosting the [Nintendo 64] emulator. On board the laptop, a Python script processes the raw CAN data into useful information. This script is open source on GitHub. This information is then used to emulate the keyboard which is used to control the emulator.
The Nintendo 64 emulator looks for certain controller inputs to use to play games, and that's where the CAN bus data comes in. They used the can-utils set of tools, primarily cansniffer and candump, to capture the diagnostic data and signals being transmitted by the car's various controls when used, and then determined which controls could be used to play the game.
According to Ringwood, the hardest thing to adapt to the emulator was the steering wheel. When the steering wheel turned left or right, they had to press the button for left or right and hold it down. The person driving would "turn the wheel further but the character wouldn't turn any faster."
The further the wheel is turned to the left or right, the greater amount of time the button stays down and the further the car turns. This results in a very intuitive experience for the driver that results in control similar to driving an actual car.
The team ended up solving this problem by not always pushing the button down when turning the steering wheel.
If you think you can handle all the legwork required to get this up and running in your own car (a lot of 2003–2007 model cars will have OBD-II and CAN bus, and any 2008 or newer model will meet all of the requirements), give it a shot. Like mentioned before, the code is available online, and you can get more details at Ringwood's blog.