Turn a Car Into a Game Controller

The CAN bus has become a staple of automotive engineering since it was introduced in the late ’80s, but in parallel with the spread of electronic devices almost every single piece of equipment inside a car has been put on the CAN bus. While there are opinions on whether or not this is a good thing, the reality is that enough data is gathered on this bus to turn an unmodified modern car into a video game controller with just a little bit of code.

The core of [Scott]’s project is a laptop and a Python program that scrapes information about the car from the car’s CAN bus, including positions of the pedals and the steering wheel. This information can be accessed by plugging an adapter into the OBD-II port (a standard for all cars made after 1995). From there, the laptop parses the CAN data into keyboard and mouse commands for your video game of choice.

This is an interesting investigation into the nitty-gritty of the CAN bus, but also a less dangerous demonstration of all of the data available from the car than some other cases we’ve seen. At least [Scott]’s Mazda (presumably) lacks any wireless attack vectors!

19 thoughts on “Turn a Car Into a Game Controller

  1. I couldn’t tell if he had anything under his front tires or not from the video. Turning your wheels on pavement while not moving (dry steering) is supposedly bad. I’ve seen shops use something that looks like a big metal lazy susan under each tire while doing alignments and such where they’re turning the wheels a lot. I’m sure it has a name but I can’t find it now.

    Other than that nitpick, the project looks like excellent work!

      1. The ignition appeared to be on and there was a fair amount of starting movement in some of the game cottage. So I presume the lock was off. Also many can buss parameters require engine on to operate.

        On smooth concrete the steering force is relatively low – the worst thing would be the wear in one patch of the tires – but even that would be fairly minimal. ( if this was a serious gaming machine it would be a different story. )

        As for the power brakes – most of the cars I own from 1999 onwards use vacuum pumps for the brakes so don’t rely on the manifold vacuum. I’m not familiar with the Mazda In particular but there waited be a fair chance it also would have a vacuum pump.

        1. Author here. The ignition was set to on with the engine off, and in this 2007 Mazda 3 the steering lock is engaged if the engine isn’t running. So no movement of the tyres in this case; I might go back and add a caveat advising to add a tarp or something underneath each front wheel if a vehicle turns on power steering.

    1. Steering probably won’t be too easy to move without engine running either. Dry steering isn’t all that bad, except if you’re doing 3 point turns several times a day, everyday… but the alignment shops probably have the swivels just so there’s no spring/backlash from tyre rubber to the ground.

      Do this with a scrap car.. Ie disconnect steering rack and replace brake booster with spring/damper and it could be that extra bit of real. Otherwise pretty cool as it is.

    2. Also no H-pattern manual cars have a full gear position sensor or clutch position sensor, so you won’t get manual shifting control that way, although many have a neutral switch and a full clutch depression switch. Paddle shifters could be used though.

      This reminded me of Future GPX Cyber Formula where the cars were also their own simulator rigs, they’d be parked on a multipost suspension dyno in front of a big screen and away you go!

      1. I found your declaration “Also no H-pattern manual cars have a full gear position sensor or clutch position sensor” a bit too assertive.

        I have already see modern manual car indicating what gear is set and if you need to increase or decrease your gear…
        (It can be done from road speed and motor speed, so I want be as peremptory as you are, but probably position sensor at clutch or gearbox level…)

      2. To install a $5 cruise control in my 2009 Toyota Yaris w/ 5 spd, I figured it was worth springing an extra $50 for the correct clutch switch – now I have 2 switches on my clutch – full press (for starting) and barely pressed (to disengage the cruise). The car was wired for the switch, right up to the pedal – just had to install and connect….

      3. You sure that no h pattern manual cars have a full gear position sensor? I’ve worked on a number, that do.
        Without that info, blip shift don’t work. And it does work great in those cars.

  2. The car itself isn’t operating mechanically but it looks like his can bus is still getting control commands. I guess that design makes it easier to debug/test devices on the bus without actually … like crashing.

    1. Cars with electric power steering (as opposed to hydraulic) theoretically can do that…practically, it depends if it’s connected to CAN. All cars with parking assist are able to this.
      BUT – the power steering needs power (who would’ve thought…), a fair bit of it. Unless it’s a hybrid, you’d need the engine to run.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.