Smart Brake Light Proof Of Concept

Photo of Al Linke

Made by Al Linke

About the project

An Android controlled smart brake light that displays rapid brake events and signs to other drivers

Items used in this project

Software apps and online services

https://play.google.com/store/apps/details?id=com.ledpixelart.pixelopenxc https://play.google.com/store/apps/details?id=com.ledpixelart.pixelopenxc

Story

Note: Rear facing LED displays are not legal in the United States and thus this project is intended as a proof of concept only. 

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.

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-IIfor 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.

Step 1: Materials

Materials

Optional if interfacing with a real car

Disclosure: I am the creator of the PIXEL LED display and receive a portion of revenue from its sales.

Step 2: Using the OpenXC Android Library

The OpenXC  Android library documentation and example code is quite good so there’s no reason to repeat here. Here’s the gist on how it works: You first setup some Listeners for the specific rel="nofollow">PIXEL Guts LED display which combined with the IOIO board has built in Android support making the integration with OpenXC quite easy. The Android phone is talking Bluetooth to the OpenXC Vehicle Interface and Bluetooth to the PIXEL LED display. I wasn’t sure how well this would work with parallel Bluetooth connections going, both streaming a fair amount of rel="nofollow">PIXEL LED Display Make your own PIXEL LED Display If you happen to own a PIXEL display and don’t have the OpenXC Vehicle Interface, here’s how to set things up using the OpenXC Enabler simulator allowing you to see the display with real driving rel="nofollow">this one along with a DC jack to USB cable.

Step 5: Android App Source Code

Here's the Android app source code on Github ==> code here . The app has the following features:
  • Bars on PIXEL LED display proportional to the gas pedal position
  • Brake Light Image
  • Sci Fi sound effects for certain car events (high beams, gear shifts, ignition on and off...)
  • A few ECO features like trip cost and cost of a rapid acceleration
  • Rapid Deceleration Brake Image (using the vehicle speed data)
  • Thank you animation (for someone who lets you merge in) with voice recognition
  • Tongue animation (for the guy who didn't let you merge in) with voice recognition

Code

Smart Brake Light GitHub

Credits

Photo of Al Linke

Al Linke

Geek Dad

   

Leave your feedback...