Car hacking: real cars turned into racing simulators using open source software

Using Python and a Raspberry Pi, doctoral students at Darmstadt University are turning every modern car into a controller for PC racing games.

Save to Pocket listen Print view

The monitor pushed in front of the windshield shows the PC racing game, which the driver controls using the steering wheel and pedals of the VW ID.3.

(Image: Timm Lauser und Jannis Hamborg)

3 min. read
By
  • Uli Ries

Two computer science doctoral students from Darmstadt University of Applied Sciences have come up with an unusual car hacking project: with their Python-based vehicle-to-game project (V2G), they are turning modern cars into game controllers in order to control PC racing games faithfully with the steering wheel and accelerator pedal of a vehicle.

As the researchers explained during their presentation at the Def Con 32 hacker conference, V2G can be used in two different ways: Either via a Raspberry Pi upgraded with a CAN bus adapter or a laptop connected by cable to the OBD-II diagnostic port (UDS mode) or via a direct connection to the CAN bus (internal CAN bus mode). The researchers have published the code for their project on Github.

Before you can get started, reverse engineering is necessary in any case, for example to determine the CAN IDs and signal assignments. For the CAN bus mode, this can be done by reading CAN messages on the bus, which trigger the movement of the steering wheel, for example.

From bottom to top: Rasperry Pi Zero WH, RS485 CAN attachment, adapter for supplying power to the Raspberry via the OBD-II port.

(Image: Timm Lauser und Jannis Hamborg)

The UDS mode requires the necessary information to be read out using a diagnostic device: the hackers connect a tester such as the Hella Gutman Mega Macs VCI or the OBDeleven via an OBD-II splitter and thus record the communication. According to the doctoral students, they were able to read the data from a Volkswagen ID.3 and a Tesla Model 3 in this way. Per se, however, this should be possible with any car that has the appropriate interfaces.

To make the connection with the respective car easier, the researchers have developed an extension for the CAN bus adapter that supplies the Raspi with power via the OBD-II connection.

The game controller has two modes: either the computer running the racing game, which emulates the Xbox 360 controller, is connected directly to the CAN bus or the Raspberry Pi Zero WH connected via the CAN attachment emulates a Bluetooth controller, with which the computer then makes wireless contact.

For their demonstration, the researchers pushed a large monitor over the hood so that the driver can see the racing game directly behind the windscreen. The driver then controlled their virtual vehicles using the car's steering wheel and pedals. Depending on the game, objects can be dropped using the blinker lever. The switch for the high beam activates any available nitro mode.

The researchers outline how interested parties can connect their own cars to the virtual game controller from page 28 onwards in their presentation. They estimate the total cost of the setup at less than 50 euros, plus any diagnostic equipment that may be required.

(anw)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.