– Ben Martens

Search Results

OBDII Trip Reports

OBDII is the standard for the diagnostics plug that is somewhere around the drivers side footwell of your car. For many years I’ve enjoyed having a ScanGauge in my car, and then for my birthday this year, Tyla got me an Automatic OBDII reader. That has been plugged into my truck for a few months, happily uploading data to the cloud.

I finally got around to playing with their API. I wrote an app that runs twice a day on my computer. It calls their API and pulls down any recent trips that I’ve made. It looks for a few places that I’ve labeled (Home, Work, Safeway, etc) and looks for trips that start and end in a named place. If it finds one, it looks how that trip ranks in terms of fuel usage and time. Then I get an email showing me my “score”. It’s a fun way to see if my fast trip to work really was my fastest trip ever, or how that extra bad stop and go traffic affected my fuel usage.

The email is pretty simple right now. I keep thinking that I’ll make it fancier with some charts, additional stats, etc but so far this has been good enough. I think the next thing that I will add as I get more data is a breakdown to show the score for all time, the current month, the day of the week, etc.

Automatic OBDII Reader

I first learned about OBDII back in 2003. It’s the on board diagnostics system in your car that lets you get all kinds of live data while your car is running. I bought all the electronics to make my own reader and then… nothing. Eventually in 2008 I realized that I was never going to build it and bought a ScanGauge. I happily used that little device in my Subaru and later in my F150. It worked flawlessly, but now it’s sitting in the garage because I got an upgrade.

For my birthday, Tyla and Elijah gave me an Automatic. It’s an OBDII reader with a built in GPS and 3g modem. While you drive, it automatically records a bunch of you car data along with your current position and it uploads it all to their cloud service. You can also connect to the device via Bluetooth to get live data displayed on your phone. Setup was a breeze and so far it has worked flawlessly.

I think the target audience for the device is someone who drives for business and needs an easy way to track their business trips. You can easily flag a drive and it gets added to a report. Personally I’m more interested in downloading my data and doing my own analysis on it. There are some nifty apps that work right out of the box as well. For example, one app shows you your min, max and average commute times to and from work. Another builds a heat map of the places you have visited. Another one draws one of those maps where every county that you have visited is colored in.

Do I need this? Nope! But I love having gadgets that collect data about random stuff in my life so this fits right in. Time to crack open their API and see how to pull my data out of their cloud.


Woo! Last night I was looking for a project. Tonight I found one. Have you ever heard of OBD-II? It's a standard that is on every car since 1996 and spits out tons of data about your car – rpm level, speed, error codes, etc. How cool is that? The connector is under your steering wheel. I went out and checked my Mustang. Sure enough, it's just to the right of where my right shin would be. So what's my project? I want to make a connector and use my Jornada to make a real-time data read out of my car's performance! Seems pretty ambitious but hopefully I'll be able to pull it off. I'm sure you'll be hearing more about this in the future. Stay tuned!

TeslaMate Review

Welcome to another¬†Tesla Tuesday!¬†The series kind of losing a bit of its luster when it’s the only set of posts happening on the blog right now, but let’s stick with it.

I’ve had a lot of fun reading data from the OBDII ports in our cars over the years, so you can imagine my excitement when I learned that Teslas have an API you can access to get tons of data. There are a variety of apps that can connect to the API and pull down data for you, but I chose TeslaMate specifically because it runs locally and I am in control of all my data. When you see how much data it collects, you can see why maybe it’s good to take a little extra precaution in who can access the data!

So just what do you get to see?

  • Drive and charging reports
  • Driving efficiency report
  • Consumption (net / gross)
  • Charge energy added vs energy used
  • Vampire drain
  • Projected 100% range (battery degradation)
  • Charging Stats
  • Drive Stats
  • History of installed updates
  • See when your car was online or asleep
  • Lifetime driving map
  • Visited addresses

You can check out the documentation link for a full set of screenshots but here are a couple:

Flipping through those dashboards should quickly give you the idea that there is a LOT of information being collected and it is collected multiple times per second! The data comes in live as the car is driving through the car’s built-in LTE connection and it is stored locally on my server in a database. If you want to see a demo the dashboards that sit on top of the data, check out the first ~14 minutes of this YouTube video.

Setup requires a bit of intermediate to advanced geekery. It runs in Docker containers, but there are some tutorials that walk through the config file manipulation and command line jobs to execute. It has been an interesting way to learn some additional technology. It’s my first time running my own Docker containers locally, my first time using Grafana, and my first time working with a PostreSQL database.

I set it up the first day we had it and I feel like I’m only beginning to scratch the surface of what it can do. For now I just like knowing that I’m collecting the data so that I can do more with it in the future.

Truck Stats

Last year, Tyla got me an OBDII data logger (Automatic) for my birthday and, of course, I ended up writing an app to download my trip data so I could analyze it. I still get those analysis reports twice per day and they continue to be interesting. For example, I don’t know why, but the last two weeks have had some of the worst traffic on my way home from work in the last year. Now that I have over a year of data, there’s enough to calculate some semi-interesting stats on my drives in our 2016 F150 3.5L Ecoboost:

    • The average trip to work takes me 26.3 minutes.
    • The average trip home takes me 33.9 minutes.
    • It feels like if I leave work a couple minutes early, I’ll avoid the worst of the traffic. Here’s my average commute time based on when I leave. (The x-axis is in 24 hour time so 17 is 5pm.) The y-axis is my average commute home in minutes. It does look like if I leave about 10 minutes before 5 my commute is generally 5-10 minutes faster.
    • My most fuel efficient trip was a 43.7mpg drive along the 3.5 mile route from my house to Home Depot. Not bad for a 5000 pound truck! (A lot of it is downhill and I like to see how little gas I can use on that route…)
      • Best fuel mileage for a trip over 10 miles: Church to Totem Lake AutoZone 28.0mpg
      • Best fuel mileage for a trip over 50 miles: Crystal Mountain to our house 24.7mpg
    • My worst gas mileage is going from Work to the butcher. It’s a short trip and when it’s really cold, my truck spends the whole time idling at stop lights and trying to warm up. I’ve gotten 3.5mpg on that route a couple times!
    • Of the days that I drive the truck, I spend an average of 69.3 minute driving.
    • The most driving in one day was 366 minutes. That was May 25, 2018 when we drove down to Ocean Park for Memorial Day.

I love having all this data! I could do this all night but I should probably cut it off here and go to bed. By the way, all of these charts and stats were created with public preview of Azure Data Explorer. We’ve been using that product internally for a couple years and it makes stuff like the stats above ridiculously fast and easy. If you’re at all involved in data engineering or data analysis, you need to get familiar with Azure Data Explorer!

ELM Chips

I ordered some chips and connectors for my OBDII project that I mentioned a while ago. Supposedly the items shipped today so maybe I'll be able to start work on this soon!