emirp.net

R/C-Plane altitude recorder

This is a circuit to record the altitude of a R/C-plane. The data is saved on a SD-Card. It uses an ATmega8 microcontroller and a SCP1000 chip to measure temperature and (more important) atmospheric pressure.

If you decide to build and use this circuit, you do so at your own risk. This is just a hobby project, so I don't take liability for any damage or harm it might cause.

Circuit and components

The circuit is powered by battery or the R/C receiver (5V). The LM317 regulates the voltage to 3.3V, which is the operational voltage of SD-Cards and just high enough for the ATmega8. The atmospheric pressure is measured by the SCP1000-D01 from VTI, which has an SPI interface. The single chip is available only in a SMD version, which cannot be handled manually. Luckily, it can also be bought premounted on a PCB carrier. The SD-Card shares the SPI bus with the SCP1000. The bus lines are held up by pull-up resistors. In addition to the ICs there are two status LEDs and a button to start and stop the recording of data.

Schematic of the circuit

PCB-Layout

At first I wanted to build the circuit on a stripboard, but because of the many connecting lines the board would have been far too large to fit into my R/C-glider. So a PCB was necessary, which I desinged with KiCad and then ordered from a manufacturer. Because the SCP1000 in the PCB version is quite expensive, it is not soldered to the PCB, but plugged in two rows of multipoint connectors.

PCB layout

Software

The the main tasks of the microcontroller software is to request and receive the temperature and pressure data from the SCP1000 and store the data on the SD-Card. I was a little lazy here and did not implement a file system. After the initialization of the sensor and the SD-Card, the microcontroller searches for a certain byte-mark on the card. It writes recorded data in raw bytes onto the card beginning from the marked position. When recording stops it writes the mark in the first position of the next free block.

During initialization only status LED 2 (red) lights up and starts flashing if an error occurs. When initialization is completed successfully, LED 2 goes out and LED 1 (green) turns on. The user can then start recording by pushing the single button. During recording LED 2 flashes while LED 1 is on. When the button is pressed again, recording stops. If an error occurs both LEDs start flashing.

Before using the SD-Card, I made sure it is completely empty and freshly formatted in FAT16. After that I created a single text file containing the mark and trailing spaces, which fill all the availably memory on the card. This way the recorded data is stored in the file, even though the microcontroller doesn't know a thing about FAT.

In every dataset atmospheric pressure and temperature are stored separated by commas. The datasets are separated by the newline character. The recorded data can be copied directly from the file into a spreadsheet. After that the altitude can be calculated with the barometric formula. Near ground level the atmospheric pressure decreases roughly 1 hPa every 8 meters.

Photos

Here are some photos of the test setup and the PCB:

Test and development setup on a breadboardThe PCBThe complete board

And the board in the R/C-plane: (The plane is a Parkzone Radian by the way.)

The board in the R/C-plane (1)The board in the R/C-plane (2)

First flight

The first flight took place in the late afternoon of a nice summer day. In the plot below you can see the recorded altitude. After take-off the motor took the Radian up to about 70 meters above the ground. (This is the steep linear increase of altitude in the plot.) I was lucky and immediately caught a thermal, which brought the plane to about 160 meters. After that the plane continuously lost altitude before the motor brought it back up. From there it came down again for the landing.

Altitude in meters

Downloads