The Easiest Arduino High Altitude Balloon Data Logger





Introduction: The Easiest Arduino High Altitude Balloon Data Logger

Sensors Contest 2017

First Prize in the
Sensors Contest 2017

Microcontroller Contest 2017

Runner Up in the
Microcontroller Contest 2017

Check out our 360 video from space here:

High Altitude balloons are effective tools in conducting experiments and measuring data in the stratosphere. A successful launch can cost less than $200 and give insight and video of how our planet functions.

For hundreds of years, humans believed the Earth to be flat. High altitude weather balloons prove the Earth is in fact round. The idea of high altitude balloons or HABs is to mount a payload on a giant helium balloon. The balloons are then released, flying to heights of 100,000 feet. Once at these altitudes, the balloon pops and uses a parachute to float back to the ground often many miles from where it was first launched. HABs are great vehicles to get footage from the stratosphere, conduct science experiments, and collect data from high elevations.

My high school has an astronomy club which regularly sends up these balloons. We have recovered 12 of our 14 launched balloons. Launches sent cameras, donuts, yeast, and more odd things into space. Yet, we had never gotten any data from sensors. I wanted to change this. When looking at tutorials online for building data collectors I found most of them:

1. Were extremely complicated - involved making custom shields, multiple coding languages, and other stuff I didn't want to deal with

2. Used GPS units not able to record above 60,000 ft. - What's the point of putting sensors up there if they don't work at apogee.

You can purchase HAB trackers online but they'll cost you $150. So, I decided to build my own! This logger gathers latitude, longitude, altitude, wind speeds, time, and satellites in view and logs them onto a microSD card and can be made for under $70.

This Instructable focuses on the data collector only. Another Instructable detailing how to launch a weather balloon will be coming out soon.

Step 1: Things We Need


Arduino- I've used Unos and Nanos on this build. Most Arduino boards should work.

Authentic will be about $25 but you can pick up a clone for cheap.

In the comments section users PirateKittyK and ltheoret pointed out that authentic Arduinos are rated to -40 degrees Celsius. While fakes die at about 0 degrees Celsius. Because space is cold, splurging on an authentic is probably a smart idea.

GPS- this one works at the altitude requirements and is pretty cheap and accurate


SD card logger- I went with this one cause ya know Sparkfun


1k resistors (2) for the rx lines


Battery clip, I like the ones that plug into the jack on the uno


Powersource- Space is really cold, so no alkaline batteries. Stick with lithium.

I used a 9v battery


LED (optional)

Breadboard (optional)


Perf Board (optional)

If you're looking for a professional look.


Various Wires

I'll assume you have these. Some male to male and some male to female

Micro SD Card 8-16 GB are adequate


(optional) Headers, you can use wires instead.

Total cost: About $65

If you already have everything besides the GPS and DataLogger its only $45!

Tools Needed

Soldering Iron - many components need headers or wires soldered on



Arduino IDE

Libraries Used


SoftwareSerial any software serial library should work.

Step 2: Building the Circuit

You may need to solder headers onto the GPS and Sd card holder you can learn how here:

Arduino - GPS

3.3v --- VCC


D3 ----- 1k resistor ----- RX

D4 ------ TX

Arduino -- OpenLog

Reset --- GRN

D0 ---- TX

D1 ---- 1k resistor ---- RX

3.3v ----- VCC

GND ---- GND

GND ---- BLK


Arduino -- LED

D13 ------ + (longer leg)

GND ------ - (shorter leg)

Step 3:

Step 4: Programming

You can download the libraries from the parts page of this Instructable.

Use this page to learn how to install a library if you are unsure

The programming for this is pretty easy. Most people use the TinyGPS library for communicating with GPS units but I couldn't get it to parse the characters we were producing. The library was showing we were getting characters but wasn't able to turn them into information we could use. I then took to the Arduino Forum for alternatives or solutions and the NeoGPS library was recommended. I switched to this library and it works flawlessly. My code is based off of the NMEAloc example. This example grabs latitude, longitude, satellites in contact, and wind speed. Satellites in contact is important because it shows which readings are the strongest. The more satellites, the more accurate the reading.

A software serial library is also needed because both the GPS and SD Card work through serial. I used software serial because I already had it installed but others would work just as well if not better.

I added time and altitude readings, put the GPS in flight mode (it will only work to the heights we need if in this setting), and a nice display to the code. The GPS unit gives out a reading about every second. With an average flight time of two hours this would mean we would have more than 7,000 readings to go through.

GPS readings are very fragile and messing with timing will give false readings. This means adding a delay so we get a reading every 30 seconds would ruin our data. To get around this, we take a reading every second but use a variable (i) we only allow every 30th reading to be printed to the serial port / SD card. I took every 30th reading because I wanted to keep a reading every 30 seconds but you can change this to whatever you'd like.

You'll need to change these values to your offset from GST

If you don't know yours you can find it here

static const int32_t zone_hours = -8L; // PST

static const int32_t zone_minutes = 0L; // usually zero

This line should be changed to how often you want a reading recorded. I set mine for a reading every 30 seconds.

if (i == 30) {

Attached are both versions 1.0 and 2.0 of the code. Version 1.0 is only compatible to 40,000 feet. Version 2.0 will work to 150,000 feet. Version 2.0 also blinks an LED when data is recorded to the microSD card.

Step 5: Testing

Before we run the program, we need to format the micro SD card to a fat16 or fat32.

I followed this tutorial by GoPro

To upload the code, unplug the SD card logger as those pins need to have nothing on them to upload the code. Ensure everything is plugged in right and that you have the right port selected. Once uploaded you can either plug in the SD card logger or leave it disconnected. With the SD card logger disconnected, the data will be displayed on the Serial Monitor. For the first test I like to see every reading so I change if (i == 30) to if (i == 1).

You'll notice it will start by displaying ?. This is because the unit has a cold start time of about 2 minutes. Sometimes it is longer, do not freak out! After about a minute it'll show the time. If you put in the correct time zone this should be correct after the first couple of readings. A short time after, the rest of the data will display. The altitude reading may show 0 but just give it a few seconds and it will be correct as well. Notice the altitude readings change even when the altitude stays the same. This is normal and since we are printing the altitude in centimeters a change of 1000 is only 33 feet.

Grab the latitude and longitude and search and you'll be shocked by the accuracy. I did this for the first time and not only did it drop a pin on my house but it dropped the pin specifically where I was doing the testing in my house. Pretty cool!

Next, change variable i back to 30, upload the code and plug in the SD card logger. Push the SD card into place. You can plug it into either a battery, your computer, or a power supply at this point. Every 30 seconds the blue light on the SD card logger will flash meaning it recorded data. That means it is working. Let it run for a few minutes and then cut the power and then pull out the SD card. Once you plug the SD card into your computer you should notice two files. If you hit the reset button or plugged and unplugged it in there will be more. The first is a file named config.h Do Not Delete this file. Secondly you should find a file named log. Open it up and all of your data should be there. If so, you're almost ready to launch.

If there is no file or nothing on the file, check your wiring connections.

Consider adding glue to the wire connections. The package will experience some major wind so make sure connections are tight.

Step 6: Launch

If you're using a styrofoam box as your payload, just throw the electronics in. I used a payload where the electronics are exposed so a case was needed. I was 3d printing a box but it wasn't going to finish in time so I put the electronics in a small cardboard box, wrapped the box in hand warmers, and then put all of it in a ziplock bag to make it water proof and retain heat. This was vital, the balloon sat in snow for three days before it was recovered.

Before releasing the balloon:

Plug in the battery - a fresh one

Check to see the data logger blinks a blue light about every 30 seconds - this means the system is working.

You can check out the 360 video here:

Step 7: Recovery

The balloon landed atop Palomar Mountain. Home to the famous Palomar Observatory. We drove up there and realized the balloon landed 1000 feet away from the Observatory itself! We then realized that that part of the property is off limits to the public. We talked to some workers and they told us we needed special permission from the board to have the balloon recovered. Three days and many emails later the staff at the Observatory recovered the balloon and brought it into a back room of the observatory. They told us we could pick it up whenever. Thank you for recovering the balloon Observatory staff!

Right after we received the email, multiple storms hit Palomar Mountain, closing the roads surrounding it for a week. Finally, when the snow melted, we were able to recover the balloon and bring it back to school. This was the moment of truth. I snuck out of my other classes, as in the time between launch and recovery the semester had ended, and saw the package. One of the teachers told me they had started to take apart the box for the electronics. I walked up to the box and saw a wire disconnected to the Arduino. I was now worried. Had the wire been undone the whole time? Did I have any data? I reached the microSD card, popped it out of the logger and into my computer. I open the file and saw a log. My nerves increased. Did flight mode work? Is there any data? With a group of students and teachers watching, I opened up the file.

It worked! Almost perfectly. It showed latitude/longitude/wind speed/altitude/time/satellites for about 35 minutes. It then showed all but altitude for another half hour before the battery died.

I had just collected data on one of these weather balloons for the first time. So cool!

Step 8: Analysis

Overall, this was a successful first attempt. The logger was extremely accurate, aligning perfectly with the location readings from the SPOT GPS.

The last altitude reading was at 39,000 feet this was 35 minutes into the flight. This makes sense. Weather balloons typically rise at about 1,000 feet per minute. We used extra helium and had a light package which is most likely the reason our balloon rose at 1,100 feet per minute. I was surprised the balloon rose linearly.

The wind speed data is interesting. It looks like the wind came in gusts. Once we got above 14,000 feet the wind speeds didn't seem to change with altitude. If you look at the raw data, the wind speeds jump up to 70 mph every couple of minutes, the graph is a little deceiving.

When looking at the raw data keep in mind that the higher the number is in the SAT line, the more accurate that data point is.

Step 9: Conclusion

Overall, I would call this a success. Although we lost altitude at 40,000 feet and the battery died before the end of the flight, this was proof of concept. With a few simple switches, I think we could get a full flight documented. For the next flight, I will change two things:

1. I will use a better battery - Maybe a Double AA battery pack, I'm not sure.

2. I made a hole for the GPS to stick out of for better signal - I now realize this probably wasn't needed.

I think encasing the whole unit will keep it warmer resulting in longer battery life.

If you have any questions please leave them in the comments section.

This is my first Instructable

This Instructable is in the Microcontroller contest as well as the Sensors Contest. Please vote if you enjoyed!



    • Paper Contest 2018

      Paper Contest 2018
    • Pro Tips Challenge

      Pro Tips Challenge
    • Trash to Treasure

      Trash to Treasure

    We have a be nice policy.
    Please be positive and constructive.


    2 Questions

    Hi, Amazing project.
    You said that the battery died before the end of the flight, what did you do to retrieve the balloon?
    Was the gps module independent from the battery? Did the GPS module work during the all trip?

    Location for retrieval is done with a SPOT GPS unit working separately from the Arduino data logger.


    Hey so i had this doubt cuz im sorta of a newbie to this hobby. I need a data logger as well as a tracker and both require the same gps breakout board. So is there anyway i could build both of them with one board??


    Hi! I'm having some trouble about the GPS_port and its definition. I sent you a message with the details. It would be great if you could help me out since I'm doing it for a school project. Thanks!

    I just sent you a private message, hope it helps!

    Hey Aaron, I am having the same problem. Can you please assist me. Thanks!

    Hey so i had this doubt cuz im sorta of a newbie to this hobby. I need a data logger as well as a tracker and both require the same gps breakout board. So is there anyway i could build both of them with one board??

    Is the tracker transmitting the data from the GPS breakout board? If so, having both data logger and transmitter should not be a problem as long as they don't interfere with timing, power consumption, or use duplicate hardware pins. Likely you should be successful! Wish you luck.

    I recognize San Diego Bay and Mission Bay in the photo. It's what got my attention to review your instructable. Glad it did. They brought back memories (I used live in that area.) And it's a cool and helpful project you guys did! Thanks for sharing it!

    Awesome! Thanks for the support. We got super lucky with the clear skies on that day, check out my Ultimate Data Logger to see some really cool pictures of Pacific Beach, Mission Bay, and the famous Crystal Pier!

    Wow, man, you rule!

    Please, explain: from where did you get the wind speed data? Is it measured or calculated based on changing coordinates in time?

    So in the code when I call "Serial.print( fix.speed(), 6 );" this is getting the information. I'm using a command from the library. How the GPS calculates wind speed I'm not sure. But it does!

    Based on your input I guess, that's the way it is: GPS module calculates its own speed by comparing coordinates it certain time periods (the whole GPS system cares about pricise time because it is needed in the most basic operation). And, due to the fact, that the baloon can acquire a horizontal speed from nowhere but wind, speed of baloon equals speed of wind.