Chapter 5. Programming and Coding

Potentially, your processor can control everything from maneuver and power through to data gathering and transmission. You do have a processor budget—how many operations per second it can run. You also want a bulletproof mission, which suggests as little processing as possible to ensure that your programs are simple, debugged, and only used when needed.

Therefore, I recommend you not use computer commanding of your power system, but rely on good power architecture. Your primary use of the processor is for three purposes: data handling, turning your radio on and off, and commanding any engineering tests.

Data handling
Process and optionally store onboard sensor/project data.
Turning the transmitter on or off
Commanding any engineering tests
Only if you have an engineering experiment—such as an ion drive—that you wish to turn on, turn off, or change the operation of during the flight. Most sensors, in contrast, will be “always on,” even if there isn’t bandwidth to transmit.

It is better to have the sensors always on, requiring no ground commanding, and throw away data if you cannot transmit it, than the alternative. The alternative is to use valuable radio time to tell the satellite to do its work. Design your satellite sensors to be always on within your power budget and you remove the need to have to code them to turn on or off.

Your DIY picosatellite will need a brain. But which brain? IOS’s kits include the BasicX processor; for Christmas I received the Arduino kit so beloved by DIY folks. Both are potentially flyable. Let’s compare.

BasicX-24: 32K memory, requires 20mA plus up to 40mA I/O loads, operates at –40°C to +85°C. Programmed in BASIC (ugh) via serial cable. See Figure 5-1.

Arduino: 32K memory, reported typical <26mA current draw plus 40mA per I/O load, operates at –40°C to +125°C (estimate based on range its optional temperature sensor functions at). Programmed in a C subset via USB port.

So we end up with a classic rocket science trade-off. There’s an easier to use, robust kit—the Arduino. And a more bare-metal rig—the BasicX—that has better power usage but is a bit harder to hook up. Both are flyable. So do I go for ease of use or performance?

I’ll clearly go for performance. The lower power requirements of the BasicX are an overwhelming plus. As a computer scientist, I’m not worried about the ground issues—hooking it up, programming it, testing. This is a first launch, and I need to ensure everything is as tight as can be.

However, were I to launch a second satellite, I’d be tempted to try the Arduino to see if it is an easier architecture to develop for. And in fact, I am working on a CubeSat using Arduino as a future project.

For any architecture, you can get into power tweaking. Our maker editor notes that “you can get pretty hard-core on this,” such as with the JeeNode Arduino clone that runs at 3.3V and 9.8mA draw (see http://jeelabs.org/2009/05/14/power-consumption-baseline/ and http://www.sparkfun.com/tutorials/309), not counting the use of a watchdog timer to get under 1mA draw by sleeping 99% of the time. For our designs, we are assuming the CPU must always be available, if only to receive potential FCC radio shutdown requests, but judicious use of sleep can result in power savings.