Tagwhite star

Introducing: Arduino Simple Task Scheduler

I

Get the code here: https://github.com/Zuph/AVRQueue

Introducing the Arduino Simple Task Scheduler.  This is part of the balloon flight computer code I wrote for White Star, with some more polish. This library allows you to create a schedule queue of functions to be executed at specified times, on specified intervals.  For example, say you’re trying to log some sensor data and update a display in the same program. With the task scheduler, you can simply write a function to gather sensor data, write a function to update the display, add them to your queue, and let the library handle the rest.

This isn’t really useful for blinking LEDs, but it’s great for complex systems. For example, the balloon computer was gathering sensor data, sending short reports, sending long reports, monitoring vertical speed, monitoring GPS Status, monitoring flight state, managing ballast, and managing a backup high-frequency radio at the same time.  Halfway through development, it was obvious that we would need to integrate a watchdog timer to keep other systems from freezing the flight computer.  If all of these tasks had been occurring simultaneously, spread throughout spaghetti code, it would have been very difficult to add watchdog resets in all the right places.  With the task queue, I simply defined another function that reset the watchdog, and put it in the queue.  Two minutes, tops!

You can find extensive documentation and examples in the Github project.  To install, just copy the “Arduino” directory contents to the “Libraries” folder of your Arduino IDE install.  Restart your IDE, and it should pop right up.  Here’s a really simple example program:

 

 This will print “Hello: X” where X is the number of milliseconds since startup, starting 5 seconds after startup, and repeating every 1 second.
The Arduino library has some limitations, so I’ve also included an AVR “library” (just a couple of source files to include in your project).  This one’s a little easier to tweak to your specific application, and doesn’t suffer some of the same drawbacks as the Arduino library.  That said, the Arduino library will be find for almost every project out there!  The limitations are listed in more detail at the Github site.
If you find any bugs, let me know! Submit a Github issue, fork, fix and submit a pull request, or contact me directly!  If you find this useful, let me know!  It isn’t a lot, but I hope it’s well documented, and easy to use/read/understand.

How to fly across an ocean

H

This post is cross-posted from the White Star Balloon Blog

Flying across the ocean is no small feat.  It takes the concerted efforts of dozens of people, working hard at lots of difficult problems, from modeling balloon volume and flight dynamics, to planning interactions with air traffic control.  The diagram above gives a little bit of an idea of the effort involved in getting across the ocean.  Any single block represents tens to many hundreds of man-hours worth of effort.

Components in Purple represent things which will actually be flying across the ocean.  This hardware and software must perform flawlessly at all times.

Components with a red heptagon represent significant software efforts.

The red square shows the components which lie on amazon EC2, spread across three instances, with a total cost of $100 a month (during flight season) to maintain.

Pink commands are sent using PubNub, a service without whose generosity our public page would not be possible.

All of these systems are in the critical path, and a failure of any single flight system will compromise science data.  Fortunately, we always have positive control of our craft, thanks to a dead-man cutdown, which operates entirely autonomously, and a 9602 modem which will respond with rough location coordinates even if all other flight systems have failed.  Our ground systems all have hot-backups, and can all be operated from anywhere on the Internet, so these systems are as redundant as they can be.

 

White Star Balloon Tracking Page

W

Lately, most of my free time has been devoted to the White Star Balloon project.  One of the parts of the project I have become involved with is the tracking page.  This was a major portion of the project a year ago, when we still had lots of buzz and momentum going.  Unfortunately, it was a huge disaster, and we had to cobble something terrible together at the very last moment. Since then, a lot has changed. We’ve become more skilled, new technologies have matured, and new hosting solutions have become cheaper.

White Star’s tracking needs are somewhat unique among the amateur balloon community. Most balloons end up using sites like aprs.fi and spacenear.us.  These sites are great, and the guys working on them are better web programmers than I’ll ever be.  Unfortunately, they don’t meet our needs.  aprs.fi is designed to used with devices carrying APRS transmitters (which we cannot use over the ocean), and spacenear.us is designed to be used with a distributed network of receivers, which doesn’t fit our model very well.  We also wanted to plan for a contingency of getting a large number of visitors very suddenly, in case we hit CNN or Reddit.

This year’s tracking page is run entirely on the client side.  All telemetry processing is done by the client, and displayed on maps, gauges and graphs. This allows us to use static hosting for everything. I used the following resources to make this happen:

  • Twitter Bootstrap – A super quick and easy CSS framework.  Looks good out of box, if a little cookie-cutter.  Don’t have the time or the design skill to go further, though.
  • OpenLayers – More fully-featured than anything from Google. Switched to this when we thought Google was going to price us out of GMaps. One downside: It’s huge!
  • HighCharts – Very pretty, easy to use charts.
  • jsgauge – The best JavaScript gauge I could find.  There aren’t a lot out there, and most suck pretty hard.  This one isn’t great, but it gets the job done.
  • JQuery
  • Amazon S3 – Used to store all static files.
  • PubNub – Push data provider with javascript client.  Super easy to use, super nice company that really helped us out.
  • Crockford’s “JavaScript: The Good Parts” – An alarmingly thin, amazingly effective JavaScript book.

Everything is up on GitHub, and ready for inspection and shed painting. More about the specifics below.

(more…)

A Tiny Balloon Computer

A

Another PCB design gets shipped off to China for manufacture!

This is a tiny balloon computer.  Without battery or GPS, it weighs less than 40 grams.  It can transmit RTTY or CW at 25 mW on the ham 2M and 70cm bands, and will last up to 16 hours on a single AA.

This board will be Arduino compatible, and the primary goal will be to support White Star‘s superpressure balloon experiments.  A superpressure balloon maintains some pressurization above ambient in order to maintain altitude.  In order to figure out how to design the balloon envelopes, and to verify our math, we need to know what’s going on inside the balloon.  It’s difficult to pierce the balloon without generating leaks. The ideal solution is to place a second balloon computer inside.  Both will transmit pressure to the ground, and we’ll be able to compare pressure inside the balloon to ambient pressure for model verification.  The pressure sensor can sense a change as small as 4×10-4 PSI, so this should work.

This is my first attempt at real RF design.  Fortunately, operating within the ham radio bands means I don’t have to worry too much about spurious transmissions or leaky harmonics.

(more…)