I had the honor of an invite to a hack-a-thon event put together by Boing Boing
and Ford. The theme of the hack-a-thon was applications using real time driving data. This Instructable is about my hack-a-thon project.
I was curious to hear what Ford would be bringing to the table. It turns out Detroit based Ford has a research lab in Palo Alto who have created an open source real time data platform called OpenXC
. At the moment, OpenXC
supports Android and Python.
In my view, OpenXC
represents a significant milestone in Maker history as Ford is the first car manufacturer to make real time vehicle data available to consumers. At the moment, just Ford 2010 and newer vehicles are supported but Ford has made the platform open so there is nothing stopping other car manufacturers from supporting the platform. Let’s hope more jump in!
Modern vehicles have a dedicated network called a CAN bus. The CAN bus is one of the primary components of OBD-II, a vehicle diagnostic standard mandatory for all cars sold in the United States since 1996. You'll always find the ODB-II port by the driver's knees. Your mechanic will use a handheld ODB scanner to read vehicle diagnostic codes or clear the check engine light. Using the ODB-II port with a piece of hardware OpenXC calls the “Vehicle Interface”
, one can listen to the CAN bus and capture desired data into an Android app.
If you’re like me and don’t own a Ford, the good news is you can still create a cool app using a simulator containing real driving data. Ford has written an Android app called the “Enabler
” which allows you to load trace files filled with driving data. Running as a service on your Android device, the Enabler streams driving data to your app. Whether this data is coming from a trace file or real time via Ford’s “Vehicle Interface
” device over USB or Bluetooth, your app doesn’t know. Based on the ChipKit32 board, the “Vehicle Interface” hardware is open source as well. You’ll find the parts and instructions to build your own Vehicle Interface on the OpenXC site at a cost of around $110. At the time of this writing, there is also a pre-made Vehicle Interface you can buy from a company called Cross Chasm
. Note that each car model requires a unique firmware. To obtain the firmware specific to your Ford model, you’ll need to first register at developer.ford.com
and then will find the firmware downloads.
Note that you can buy inexpensive ODB-II Bluetooth dongles
and use them with smart phone apps today like Torque
which begs the question, why OpenXC? The reasoning is that OpenXC provides access to more sensors than are exposed through standard ODB-II. Ford has a detailed explanation on the data set differences between OpenXC and ODB-II
for those interested. In addition at least from my research, I wasn't able to find any libraries available to developers for developing custom applications using the inexpensive ODB-II Bluetooth dongles.
The OpenXC documentation is quite good, you’ll find all the supported data signals on the OpenXC site. As you’ll see, the OpenXC data set
is pretty broad so it’s really up to your imagination on what you can create.
My idea was to utilize the driving data for a smart brake light proof of concept. Smart meaning a rear display that can do more than just turn on and off when braking. For example, if the driver hard brakes, let’s show an urgent symbol letting the driver behind you know to slow down quickly. If someone was kind enough to let you merge in, we can speak a voice command to display a thank you message.
I also added a multi-color bar graph relative to the gas accelerator position which serves no useful purpose but looks pretty cool.
One very handy piece of data is trip fuel consumed which tells you precisely how much gas was used per trip. I used this in combination with the ignition data to automatically speak, using Android text to speech, the cost of the trip when the ignition is turned off.
You might notice in the video there are a few times where the Android app wrote back to the car. I set the cabin temperature based on the user’s preference stored in the Android app and also forced the hybrid vehicle to switch from gas to electric and vice versa. The write signals are not part of the standard OpenXC platform and were just available at the hack-a-thon using a modified Ford vehicle. It was pretty cool to be able to control the car from my Android phone. We’ll see if Ford adds support for this in the future. The obvious challenge is safety.
I had an idea to enhance the car with audio effects triggered by car events. Turning on high beams triggers a laser sound. Shifting up plays a power up sound and shifting down a power down effect. A water drop signifies each 1/10 gallon of gas consumed. When piped into your car’s audio via a line in or stereo jack from your phone, the experience is compelling.