How to: Weather balloon

Hey, This “guide” is from dummies: Robin and (especially) me, for dummies and maybe some experienced fella’s.?This ‘how to’ will show what we have done and are still doing because it’s a work in progress. The reason why I’m writing this…. There is not a 1 page which includes everything in detail. First of all, I show you what components we use for the project. After that a small guide with what we did to make it happen.

Note: the Raspberry Pi?does not?like 5v. It uses only 5v to power usb/gpio. Use whenever possible 3,3v!

The payload setup:

The idea is to solder all on one ?home designed shield and plug it in the “general purpose input/output” on the Raspberry Pi. Because testing is done on a?bread board?with some loose cables. And i don’t want a faulty connection at an altitude of 30 km and lose the payload. The manufacturing will find place at OSHPark.com , schematic and drawing are done in eagle cad (freeware). All files will be?uploaded to? Github .? Pcb design at the manufacturer OSH Park .

All components on the bread board, allot of loose wires and allot of weight.

All components on the bread board, a lot of loose wires and a lot of weight.

The unassambled board

The unassembled board Picture of the breakout board on the rpiPicture of the breakout board on the rpi

The RPI setup.

First of all: acquire a rpi, rev. a for low energy consumption or a rev. b if you going to use it also for other projects.
We’ve installed Raspbian wheezy 7.0 (2013-05-25) because of a bug in the kernel 3.10. The bug gives the camera an error when the temperature sensors are active.
To check what kernel you use:

uname -r

Setup with the settings you like in raspi-config.

Just use: ‘apt-get update’ for the latest packages you are going to install. Do not use: ‘apt-get upgrade’ as you will be upgrading the kernel.

Raspberry Pi Camera

The official raspberrypi.org has a great page about it. For use in the balloon flight is a script handy. If you wish you could use the

raspistill -o timelapse%04d.jpg -t 5000 -tl 1000 &

This will make a time-lapse run for 5 seconds (5000 milliseconds), taking a picture every 1 second (1000 milliseconds). It will create files called timelapse0001.jpg, timelapse0002.jpg to 0005. (It uses 4d to say ‘number to 4 places’). When there is an ‘&’ at the end, the script will be run in the background and you will be given a process id. You can kill the process by going to

top

and press ‘k’ for killing process, and then the process id (it will be described as python).

Note:
It seems the pi camera interferes with the gps signal. I’ve shielded the ribbon cable with normal aluminium foil. It works allot better now, but it is wiser not to put them too close together.

Applied some tape over the contacts to prevent short-circuiting in cause of moisture

Applied some tape over the contacts to prevent short-circuiting in case of moisture

GPS

I prefer UART above usb, easy with the ntx2 later on. Adafruit has a nice and? good tutorial ?on how to connect it to the rpi and how to get something out of it. The difference with the adafruit tutorial is that we do not connect the RX on the gps to the TX of the rpi.
To initialize the gps daemon on boot rpi.

dpkg-reconfigure -plow gpsd

Yes, Yes, /dev/ttyAMA0, no extra arguments, enter and gpsd will start-up on boot.
reboot and run cgps -s to check if you can get a lock from startup.

We need to write a script to capture just like the temperature the data in a .csv file for later analysis.
Now it’s still only printing the values.

NTX2

Tricky one, comes a bit later.

ADXL345

We’ve wired the adxl up to i2c.

Rpi GPIO?|?ADXL345
GND | GND
3V3 | VCC
3V3 | CS
SDA | SDA
SCL | SCL

How we set i2c up to get it at least working:? here . follow the guide till example, then use the example in HAB/code/adxl/example.py

We have to write a script for like the temperature data output for analysing.

Temperature sensors

We have chosen the digital 1 wire interface sensors for the job. Again Adafruit has a very good? tutorial ?on how to get it working. We’ve optimized the provided code from Adafruit to work with 2 sensors. One placed for the outside temperature and one directly mounted on the breakout board. Our code is found at? github . The output data is saved as a universal .csv file (comma separated value file).

Battery

Powerbank which lasts about 10 hours (not yet tested with all the sensors/transmitter active)

Stripped out of the aluminium casing for weight issues.

Running scripts from startup

We can automate the startup of scripts each time it is powered up. To do we need to edit /etc/rc.local. This will mean on each boot of the Raspberry Pi the script will activate.

Insert before exit 0:

(sleep 10;python scriptname.py)& 
exit 0

Of course change scriptname to the correct pathway where you have the script.

Save this script (CTRL + X) and “Y”
Rebooting the device will mean this script executes.