Friday, June 29, 2012

discovering OBD-II

Every modern car has a diagnostic port called OBD-II (On-Board Diagnostics ver. 2) which enables external devices to communicate with the ECU - the brain of the car.

Well, if your vehicle is brand-new there is no real reason to peek under the hood but if it's a second-hand then one should be prepared to encounter all sort of problems used cars might run into... with the help of live data and logged failure codes the reparation just got a small step easier.

On eBay you can find cheap bluetooth OBD-II adapter (like the ELM327) that make a perfect match with any smart-phone with proper software installed on it.

I have an Android phone and there are quite many applications just for this purpose. Most notable perhaps is the Torque by Ian Hawkins.

As modern phones have an impressive assortment of on-board sensors, it makes it a perfect drive-computer and allows all sorts of analysis be made in real time and later on, based on collected data.


Just to name a few:

- engine load (%)
- turbo pressure (kPa)
- in-take air pressure and temp

- fuel consumption (l/100 km)
- speed by ECU
- throttle position

- acceleration
- speed, direction and position (GPS)

Software on a smart-phone nicely bundles it all together and is capable of keeping a log file with for example 1 second interval.

investigating the sdr world

Gqrx tuned to local FM station at 100.0 MHz
Hardware

The RTL2832U based SDR is a very capable little gadget that anyone can set up without having to spend too much on dedicated hardware.

I got mine ("mini digital TV stick" as written on the package) from eBay for about £15. It's yet another no-name USB DVB-T dongle with just suitable hardware combination inside.

Basically it captures raw RF packets and let's the PC software to decode/demodulate those. Thus exactly what an SDR does! Still, it's a hack since some undocumented chip features are used to make it behave like one. Great thanks to Antti Palosaari for discovering this! More on that subject can be read here.

Software

Firstly, I consider only Linux here and all my suggestions are based on that.

Depending on your operating system the support out-of-the-box varies a bit but there is nothing too serious to build all the necessary tools from tarball.

Seems that setting the system up on OpenSuse 12.1 means bit more work than on Ubuntu for example since one has to build some system packages to meet the GNU Radio dependencies that have not yet reached to the official repositories.

Waterfall shows some sensor activity
For beginning the Qt based gqrx application is really neat and as many instructions on the net I also suggest starting from this.

Later on you will find yourself discovering the gnuradio-companion IDE with a certain amazement bout how truly complex and fun the SDR world really is!

As the Elonics E4000 tuner can be  tuned from 52 MHz - 2.194 GHz it really opens up the radio spectrum for any hobbyist like me never minding the 161 Mhz band-gap starting from 1.098 GHz


Applications

After having scanned the radio spectrum over and over I started to wonder what else can be done with it. And thus I decided to try to decode the wireless thermo RF ASK modulated messages captured from the air.

Work in progress...