Portable Altimeter for RC Airplanes

by JNDesigns in Circuits > Arduino

79 Views, 1 Favorites, 0 Comments

Portable Altimeter for RC Airplanes

IMG_5383.JPG
IMG_5384.JPG

I designed and built a cheap altimeter for my radio controlled airplanes. The altimeter is based on an Arduino Nano connected to an altimeter board to make the measurements, and a microSD drive to record the measurements during flight. After flying, I can read the data files on the microSD card with a laptop computer and plot them with a spreadsheet program like Excel.

Supplies

1 Arduino Nano Board (approx. $5 on Amazon).

1 BMP-388 Barometric Pressure/Altimeter Board (approx. $4 on Amazon).

1 MicroSD Card Reader Board (approx $1 on Amazon).

1 MicroSD Card 32GB or smaller to be compatible with the SD.h arduino library (approx $4 on Amazon).

1 Male servo connector cable to fit any unused auxiliary port on your airplane's receiver.

Soldering iron, solder, assorted colored wire, wire cutter/stripper, velcro, an optional 3D printed box that fits the project.

Wiring the Circuit

RC Altimeter Circuit.png
  1. Solder the connections between the Arduino Nano and the SD card reader.
  2. Solder the connections between the Arduino Nano and the BMP-388 altimeter board.
  3. Solder the connections between the Arduino Nano and the male servo connector cable to power the project. Note that the 5V+ wire is the center wire of the connector, and the GND (common) wire is on one side. Look at your airplane receiver to confirm which side is GND for your connectors.

See the diagram above that shows all the proper connections.

Project Box (Optional)

IMG_5382.JPG
IMG_5381.JPG

I used my 3D printer to make a box for my project. Note that my box allows access to the MicroSD card, the USB connector for programming the Arduino Nano, and the male servo connector for connecting it into my airplane.

Programming the Arduino

Below is a copy of the sketch I wrote that runs the project. Be sure to have the various Arduino libraries available in your Arduino IDE that are listed with #include statements at the top of the sketch. For this project I assume that you have a basic knowledge of how to use the Arduino IDE to load and use sketches to your Arduino. I will not go into the details of my program and how it works. If you take some time reading through my code, I think it is fairly easy to understand.

Step 1: Using the Arduino IDE, load the RC_Altimeter2.ino sketch onto your Arduino Nano board.

Step 2: The Arduino will save altimeter data to the MicroSD card in a file folder named "Altitude". In the root directory of your MicroSD card, create a new folder called "Altitude".

Downloads

Using the Portable Altimeter

IMG_5380.JPG
Flight Plot.jpeg

After you have loaded the sketch onto your Arduino Nano, install the project with velcro into your airplane and plug the male servo connector into an open auxiliary port on your airplane's receiver. Each time you plug a battery into your airplane, the altimeter will generate a new file on the MicroSD card, and begin recording altimeter data. With each new flight, you generate a new data file. So the project is designed so that it does NOT overwrite existing files or data. The data files are stored on the MicroSD card in the "Altimeter" file folder. Data files will have names like;


DATA1, DATA2, DATA3,...

You can have up to 255 data files, so the last data file will be DATA255. That's a lot of flights. The reason it is limited to 255 flights is that the program uses an on board EEPROM address in the Arduino Nano to store the number of the previous data file. This prevents the program from overwriting any previous flight data. Each EEPROM address is limited to numbers between 0 and 255, hence the program will max out at 255 flights. After 255 flights you will need to reset the Arduino Nano board, and I provide how to do this in step 5 of this instructable.

Each file represents an individual flight and is saved as text with each datapoint separated by a comma. Using this format it is easy to import the data into any spreadsheet program, like Excel, to display and plot the data of your flight. I show a plot of one of my flights using Excel.

Resetting Your Altimeter After 255 Flights

At around 255 flights your MicroSD card will be approaching a data file name of DATA255. As you near that point, it is a good time to reset the Arduino Nano board in your project. To do this all you need to do is the following steps:

  1. Unplug and remove your altimeter from your airplane.
  2. Plug your altimeter into your computer with the USB cable.
  3. Using the Arduino IDE, load the "RC_Alt_Reset.ino" sketch onto your Arduino Nano board. This will reset the EEPROM on the Arduino Nano board. If it is working properly, it should indicate in the serial monitor window of the IDE environment that "Filename will be: Altitude/DATA1"
  4. Using the Arduino IDE, reload the "RC_Altimeter2.ino" sketch onto your Arduino Nano board. This reinstalls the altimeter program in your project so that it can run for another 255 flights!
  5. Reinstall your altimeter into your airplane and be sure to plug it back into your airplane's receiver. Yahoo! Time to go flying!

Downloads

Additional Information

My finished altimeter with project box and velcro weighs in at 23.3 grams. I have flown with it numerous times in my E-flight mini-Apprentice trainer. It has had no detrimental effects on flight, balance, or battery life during flight.

Each time you plug your airplane battery into to start a flight, the altimeter generates a new datafile to save the flight data. It also rezeros the altimeter data at the beginning of each flight, so the flight data represents RELATIVE ALTITUDE from where your flight starts, not ABSOLUTE ALTITUDE from sea level.

Using the data in the datafile and a spreadsheet program like Excel, you can also do some simple math to determine rate of climb and rate of descent! Cool stuff!