Here’s How to Hack a Real Car’s Gauge Cluster to Fully Work With a Video Game

Everything works—from the speedometer and tach to warning lights and turn signals.

byRob Stumpf|
Builds photo
embeduin via YouTube
Share

0

There's no shortage of great sim racing rigs, especially as the pandemic brought about a ton of race-from-home solutions. From the budget-friendly setups made of PVC piping to ones that are a bit more extravagant than others—like Sebastian Vettel's home setup made from an F1 chassis—everyone has their own level of realism. Few are willing to go this far, though.

Recently, a video game modder decided they wanted to integrate a real instrument cluster into their gaming experience. A post on Reddit showed off the completed project in all of its glory, with the gamer firing up a copy of BeamNG along with a cluster from a Lada Granta. Thing is, that real-life cluster works in lockstep with the on-screen visuals, all the way down to the tiniest details.

Video thumbnail

The magic behind this particular mod is the OutGauge protocol, as the modder explains in a deeply technical explanation. Essentially, this takes signals that you'd expect in-game including engine RPM, speed, and warning lights, and creates a stream of messages simply informing whatever is "listening." Software like SimHub has made use of OutGauge and other protocols to essentially do the same thing for quite a few titles—Assetto Corsa, BeamNG, Dirt, Forza, and more. However, most people using SimHub will simply grab an Arduino and BMW E36 gauge cluster for ease of implementation; just connect a few pins together and you've got a physical piece of hardware from an actual car in front of you.

This Redditor went above and beyond to make their experience with BeamNG even more immersive.

Rather than use the Arduino to send signals to a few pins, the game modder decided to hook up the gauge cluster to a USB interface and completely simulate the factory messages which would be sent to the microcontrollers inside of the instrument cluster. This was achieved by reverse engineering messages sent across the car's CAN Bus network, which is exactly how the car communicates when someone is behind the wheel on an actual road.

Example CAN messages translated using a DBC database, shown in Comma AI's Cabana tool.

The CAN Bus is a broadcast network, meaning that every node in a vehicle has the ability to hear all transmissions generated by a device or microcontroller that is on the network. CAN messages are often filtered through gateways and while some messages might be exposed at the OBDII port, one won't be able to sniff all CAN traffic without tapping in elsewhere. A good example is OpenPilot, which requires hardware to interface as closely as possible with a car's factory lane-keeping camera. This allows the device to sniff CAN traffic that would not normally be visible at the OBDII port, and essentially perform a man-in-the-middle attack to intercept and modify CAN messages to adjust lane-keeping behavior.

Rather than use a precompiled script, the sim-savvy Redditor decided to reverse engineer the CAN messages produced by a Lada Granta in order to control the gauge cluster. This began by recording the CAN messages produced by the Lada as it drove around town. Once the short trip was completed, the gauge cluster was pulled from the car and set up to be bench tested. The CAN messages collected during the trip were then replayed in order to see how the gauge cluster responded, slowly allowing the Redditor to build a database that maps raw CAN data into usable information.

Now that the raw data was mapped out into a format that corresponded to human-recognizable actions, the next step was to create a program that could interpret the messages generated by the OpenGauge protocol and translate them into proper CAN messages that the gauge cluster can understand. To do this, the Redditor build a small Python script to act as the interpreter and was quickly able to get speed and RPM to move the cluster's needles.

But there was more than just knowing the current vehicle speed and RPMs. BeamNG is a rather interesting simulator that adds a few realism functions into the mix. In fact, BeamNG lets users play around with just about every vehicle variable and condition as if they were in a physical car. Turn signals? Check. Cruise control? Check. Traction control light while doing big smokey burnouts? Check.

It even allows the player to pop their own tires, which generates a TPMS event in the OutGauge protocol that this modder translated into a CAN event to be displayed on the gauge cluster. That's just the start because BeamNG also simulates traction control events, notes when the user "pulls" the emergency brake, or has a catastrophic engine event that causes low oil pressure. All of these can be translated to the Lada's cluster via CAN messages, by the way.

This project is undeniably cool and innovative. It's worth noting that someone in the comments claims to have taken a more modern approach to this project with the cluster from a Ford Fusion and a Raspberry Pi. And if that's still a bit too much to take on but you still want some more physical controls on your racing sim, you can always wire up an old BMW instrument cluster to an Arduino alongside SimHub.

Got a tip or question for the author? Contact them directly: rob@thedrive.com

stripe
BuildsCultureVideo Games