Ian's Air Data Instrument

Posted March 17, 2011
Updated March 18, 2011

Obsolete page

This page is now obsolete. The current and updated ADI page is here:

http://www.dangerpants.com/labs/adi/

I moved it to dangerpants.com since I like the name "Dangerpants Labs" better than "Obairlann Labs." Easier to spell, too.

Executive Summary

I decided to build an Arduino-based air data instrument: it would tell me my current airspeed, altitude, air temperature, and vertical speed via a small character LCD. The project is to be mounted on a motorcycle. This page follows progress on the project.

Background

I got my private pilot's licence in 2002. I've long been interested in flying, and the pilot's license was a logical progression along that path. In ground school, I found that my knowledge of aircraft systems and functions was complete enough already that I was correcting the instructor.

I'd been riding motorcycles since 1999, and occasionally found myself wondering how much of a headwind I was riding into. In 2006, I came perilously close to building a biplane, and actually started my acquisitions with the purchase of a $50 airspeed indicator from a fellow homebuilder. I found myself dreaming of lashing that ASI onto the motorcycle somehow, but it's a huge device, and there's no space in the motorcycle's dashboard. Anyway, it starts at 40 MPH, and I wanted a bit more sensitivity than that -- 40 MPH is halfway to the bike's top speed.

I looked occasionally at the selection of airspeed indicators at Aircraft Spruce, but could never justify spending money on the idea.

Then, in early 2011, I was exposed to an Arduino board for the first time. I was struck with how ridiculously simple the whole system was to work with, and decided I would try my hand at it. It was only a couple of days later that I decided I'd try to build an airspeed indicator around an Arduino -- thus was born the Air Data Instrument.

In-depth Explanation

Components

The Air Data Instrument (which I'll abreviate to ADI for the rest of this document) consists of several major components:

Arduino Uno - the brains of the operation. This will likely be replaced by a Nano in the final, installable version.
Freescale MPXV5004DP differential pressure sensor - DIYDrones actually seems to be phasing out the 5004 in favor of a different pressure sensor, but the 5004 is the one I'm using. Differential pressure is used to measure airspeed.
Bosch BMP085 barometric pressure sensor - for reading barometric pressure, and measuring altitude. As a nice side-benefit, it also reads out air temperature.
Red on Black 16x2 LCD module - for outputting data to the user. Red and black matches the motorcycle's existing instrument panel.

Interconnections

This project makes use of three of the most common data formats for the Arduino: I2C (communicating with the BMP085), direct voltage (the differential pressure sensor) and parallel communication (to the LCD).

Firmware

The firmware is written in Processing, the standard Arduino programming language (near enough C that I am already effectively fluent).

There are, functionally speaking, two major components to the firmware: display mode, and menu mode. Display mode is, as you would expect, a constantly-updated display, showing airspeed, altitude, temperature and vertical speed. Menu mode is accessed by pressing the SET button.

Once you press the SET button, the ADI shows the first menu item (and the most likely to be changed): Kollsman value. If you're not familiar with aircraft altimeters, this is the current value of sea level pressure. See the note below about finding the Kollsman value.

Pressing the SET button cycles through the remaining menu options, which are mostly to do with display units (menu options are likely to change over time, so I won't spend much time detailing them here -- check the code for a current list).

Each menu item can be modified with the + or - buttons, as you'd expect. The Menu Timeout time determines how long the ADI will wait between the last button press and reverting back to the live display.

Barometric pressure is read using the sample sketch posted by Sparkfun, over I2C. Differential pressure is read via one of the Arduino's ADC inputs, with the AREF pin set to about 2.5 volts (which lowers the maximum indicated airspeed to 111 MPH, but increases resolution up to that speed).

Altitude and barometric pressure functions are split out into the pressure.pde file. Airspeed functions are split out into the airspeed.pde file. Each has a corresponding .h header file. The main file is adi_main.pde. The file called notes details circuit connections and a few other notes. The simulate.pl script is used to simulate data points at various AREF settings, and report on which airspeeds aren't covered.

The source code (tar.gz format) - This is the latest version of the firmware.

Physical Installation

(Note: I haven't actually installed the ADI yet, so this is all theoretical for the time being.)

The ADI has four important connections: pitot pressure, static pressure, control head, and power. Pitot and static are air pressure, and are connected with tubes. Power and control head are electrical.

The pitot tube will be mounted under the nose of the bike, above the shockwave from the front tire. The static port will most likely be mounted to the side of the fairing, although if experimental data suggests that the air inside the fairing is of a stable pressure, that will likely be used, as one less hole will be required in the fairing.

The brain box will most likely be installed inside the fairing at the front of the bike, and the control head mounted near the speedometer and tachometer. The control head will contain the three buttons and the LCD display. Power will come from one of the accessory leads which is switched with ignition.

None of the menu options should be needed while underway, so the control head needn't be especially accessible while riding.

Usage

Finding the Kollsman value: this number is readily available online: ADDS carries METARS -- enter a nearby airport code into the "Latest METARS" box on that page, and you want the number that's "A2992" in the raw METAR, or "29.92 inches Hg" in the translated METAR. You can find airport codes at this FAA site, or a variety of others. US airports are three letters (like BFI for Boeing Field in Seattle), or four letters (the same thing plus K: KBFI).

The firmware also shows you the indicated altitude as you adjust the Kollsman value, so if you know your current altitude, you can determine what the Kollsman value should be by adjusting up or down until you find your altitude.


Resources Available

The source code (tar.gz format) - This is current as of July 11, 2011. Includes all required features according to the initial spec. Still needs a code cleanup, but is into solid Beta territory.

A short video - This very brief video describes how things work. It's already out of date compared to the code snapshot above, but not too far (mostly the menu now contains a backlight level item).

Pictures - These were taken at the same time as the video.

Future versions

One of the potential markets for something like this (note: I don't intend to ever formally market this project, but I'd put it together in a form useful to DIY folks) is aircraft homebuilders. I was almost one, and may be one in the future.

The list of things I'd want an aircraft version to do:

  • Airspeed
  • Altitude
  • Vertical speed
  • Skid/slip, G-meter
  • Engine speed (RPM)
  • Cylinder head temperature
  • Exhaust gas temperature
  • Gyro functions (artificial horizon, gyro direction indicator)
  • Magnetic compass
  • Graphical display of information

This is definitely a wishlist, but it's not impractical. With a larger display and a more-capable CPU (with more inputs), none of these functions are particularly difficult. The graphical display would be useful because you could then have bargraphs for some information, which are more readable at a glance -- a potentially important consideration in an aircraft. The magnetic compass is probably overkill, particularly as most aircraft will already include an unpowered mag compass.

This list of features would definitely increase the price of the final project, as you'd need more sensors (thermocouples, accelerometers, gyros), and a more-capable CPU, such as one of the new Digilent 32-bit CPUs. A bigger display costs more. It would all take more power. It would be considerably more complex to program.

Still, it's an interesting idea, isn't it?


Copyright © 2011. Created by Ian Johnston. Questions? Please mail me at reaper at obairlann dot net.