The Easiest Arduino High Altitude Balloon Data Logger

30,966

294

65

Published

Introduction: The Easiest Arduino High Altitude Balloon Data Logger

About: I'm a 16 year old passionate about building, coding, and space science. Join me as I collect data from space, build experimental rocket motors, and self driving boats!

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

Parts

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

https://store.uputronics.com/?route=product/produc...

$30

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

https://www.sparkfun.com/products/13712

$15

1k resistors (2) for the rx lines

http://www.ebay.com/itm/like/171673253642?lpid=82&...

75¢

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

https://www.amazon.com/Battery-Power-barrel-connec...

$2.50

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

I used a 9v battery

https://www.amazon.com/Odec-9V-Rechargeable-Batter...

$1.20

LED (optional)

http://www.ebay.com/itm/200-pcs-3mm-5mm-LED-Light-...

Breadboard (optional)

https://www.adafruit.com/product/65

$4

Perf Board (optional)

If you're looking for a professional look.

https://www.amazon.com/dp/B01N3161JP?psc=1

50¢

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

$5.85

https://www.amazon.com/SanDisk-microSD-High-Capaci...

(optional) Headers, you can use wires instead.

https://www.amazon.com/15Pcs-2-54-Single-11MM-Head...

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

Solder

Programs

Arduino IDE


Libraries Used

NeoGPS

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:

https://learn.sparkfun.com/tutorials/arduino-shiel...

Arduino - GPS

3.3v --- VCC

GND --- GND

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

D4 ------ TX

Arduino -- OpenLog

Reset --- GRN

D0 ---- TX

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

3.3v ----- VCC

GND ---- GND

GND ---- BLK

Optional

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

https://www.arduino.cc/en/Guide/Libraries

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 http://www.timetemperature.com/tzus/gmt_united_sta...

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

https://gopro.com/support/articles/sd-card-reforma...

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!

Sensors Contest 2017

First Prize in the
Sensors Contest 2017

Microcontroller Contest 2017

Runner Up in the
Microcontroller Contest 2017

Share

    Recommendations

    • Oil Contest

      Oil Contest
    • Planter Challenge

      Planter Challenge
    • Casting Contest

      Casting Contest
    user

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

    Tips

    3 Questions

    0

    how was it found back?

    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.

    0

    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??

    65 Comments

    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!

    3 replies

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

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

    Same issue. Is it because I don't have the NMEAGPS.h library?

    Great project!

    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??

    1 reply

    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!

    1 reply

    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?

    5 replies

    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.

    But that's not true: Balloon speed does not equal Wind speed. The balloon gets all it's movement from the wind, but does not travel the perfectly with the wind. Isdubkov: you're talking about ground speed: GPS relative to ground locations.
    I was wondering too, how the wind speed was measured, since the balloon is not pushed perfectly by the wind. I wondered if there was an airspeed sensor on board. See: http://ardupilot.org/plane/docs/airspeed.html

    That's super cool! Thanks for looking into it.

    Hi,

    For info I attended a Ham meeting last night where the guest speaker discussed flying balloons around the world. Amazing stuff. He described ten milliwatt transmitter chips bought from Texas Instruments using surface mount components and GPS for tracking from Blox - or a name close to that. The GPS must be able to work at high altitudes. All components were controlled by an ARM microprocessor. Amazing construction weighing only 20 Grams but so small required magnification to assemble to solder parts. With temperatures at 14 KM around -60C parts have to be reliable. Balloons were small, maybe a meter in diameter but filled to just provide a small amount of lift.

    Now if you want to have fun with a short duration flights at low levels, I suggest you google milliwatt transmitters that conform to your countries codes of frequencies allowed with no license. As well get to know some hams, get your license, and learn how to build to your requirements. Hams have free software allowing digital transmission of data. Google WSPR and FLDIGI are just two of many. Good Luck!

    Thank you so much for posting!

    My friends and I are using this to get our GPS up and running.

    What was the justification for the 1k resistors ?

    1 reply

    Sorry for the late response,

    The purpose of the resistors is to bring the 5 volts supplied by the Arduino on the serial communication lines down to 3.3 volts. The GPS unit can be damaged by 5 volts so the resistor is necessary for safe use. We only use resistors on the receiving lines of the GPS and microSD card lines because those are the lines where the Arduino is supplying data. If you use an Arduino or micro controller that runs on 3.3 volts rather than 5 volts, the resistors are not needed.

    Thanks for the question!

    user

    Hey, I'm really impressed. This is a pretty awesome thing to be able to do with so few parts.

    Will you do it again?

    1 reply

    Thank you and funny you say that. We actually launched a balloon containing a new variation of this data logger yesterday. Expect an Instructable detailing the new data logger in the following days.

    Hi there Spaceshark, as you know you and I both got the runner up award in the microcontroller contest. I don't know if it's just me, but these technology contests seem rigged. For example, your Instructable should have been in at least second place, but look at this Instructable who beat both of us.
    https://www.instructables.com/id/Bluetooth-Controlled-LED-Snake-Table/

    If I were to be a judge, I would have given you a higher reward. You really do explain and tell a great story during your Instructable.
    I know a majority of us runner-ups feel upset for not winning at least 2nd place, but seeing others have less detail really confuses me. How are we going to know what the judges want?

    1 reply

    At the German contest for technology (Jugend Forscht), a good friend of me built a High-End Tube Amplifier with Bluetooth, wifi, aux, chinch and much more (2.1 Amplifier) all on himself (except the Bluetooth/WIFI Module) and got only 2nd Place. And the guy that was the first place just built a Sudoku Solving machine with an arduino...

    Its very often that the judge is only a normal person that didn´t know how complicated some stuff is...