Weather Balloon 2016

Panorama1

This article follows on from the attempt to fly a tethered weather balloon in July 2015, see the blog here.

An opportunity arose early in 2016 to fund another flight of our Helium filled Weather Balloon. This time it was to be used to observe the Isle of Wight Festival. The school I work at is used each year, along with other parkland, for this large music festival. As part of a community involvement by the organisers, the school is given a number of tickets for the event and these are given to students in return for them becoming involved in various projects. This year the Geography Department wanted to look at the environmental impact that the festival has on our community, in particular the problems of litter and the waste generated by the festival.

I was approached to see if the weather balloon could be used to photograph the festival site and the quest for funding started. I had several short meetings with the Geography teacher running this project, but it was not until funding was confirmed in April/May 2016 that planning began in earnest. The price of Helium had increased since 2015, but I managed to track down a supplier who sold us five 0.42 cubic metre balloon gas cans for just over £120. These cans are supposed to fill 50 x 9 inch balloons and from experience will provide about 250 gms of lift.

From our experience the biggest problem was to stop the electronics package from spinning and the original idea was to suspend the package from the balloon, then attach the kite string to the bottom of the package. However, I was concerned about the package surviving the forces involved and went for attaching it as we had done last year (see the blog here). A suggestion was made that we use a wind sock to stop the package from spinning, but as with everything else involved in this project we had nothing to guide us. Eventually we settled on a wind sock about fourteen inches long with the mouth about four inches in diameter (see the photograph below). Four pieces of cord were used to attach the windsock to the end of the package.

We were limited to one of four days, 4th to 7th June as the festival started on the 8th June. The long term weather forecast at first did not look too promising  but by the week before it seemed that Tuesday 5th looked our best bet. It was forecast to be overcast with only a small chance of rain, but more importantly the wind speed was forecast to be about 2km/hr. When the day arrived it was warm and sunny with partial cloud cover, and almost no wind.

It took about an hour to fill the balloon and we used four and a half tins to fill the balloon and provide about 1200 gms of lift. The balloon was then walked to the geography department where the electronics package was started, set to record video then attached to the balloon. The wind sock was fitted to the end of the package and we walked the balloon down to the field alongside the festival.  Weather conditions were perfect and the balloon rose easily to about 100 feet, but the wind sock was too heavy and simply hung below the package, blocking the camera. We brought the balloon back down and stuffed the wind sock onto the top of the package and sent the balloon up several hundred feet.

20160607_142915

showing the windsock mounted in the best position

Lady Luck was certainly on our side because the wind blew the wind sock off the package in such a way that it was supported on the top of the package. At this point it did exactly what it was designed to do and kept the electronics package perfectly still! Over the next two hours we sent the balloon up to various heights and it was not until the end of the day that increasing winds started to move the balloon horizontally. On the last time we brought the balloon down we pulled it down, laying the kite string on the ground, with out winding it onto the reel and this allowed us to measure the height that it reached.

At the end of the day we decided to burst the balloon rather than try to store it overnight, much to the delight of several classes of students who had come out to watch the balloon.

Conclusion:

We achieved all our aims with this flight as far as the balloon was concerned, we were able to control it with ease and confirmed that each container of Helium gave about 220 to 250gms of lift. However,  the electronics package did not perform as expected. I had been testing it for almost a year, running it on battery power for up to eight hours at a time, and it performed perfectly. As I wanted to control it using the LPRS radios I would start the python program using VNC or ServerAuditor on my iPad. However, when the iPad went into screen saver mode it shut down the python program. The solution is to start the python program using  WiFi, then to turn off the router.  VNC or ServerAuditor can be switched off and the python program will continue to run, I have no idea why the python program stops when the header less  control program is shut down, it just does!

The day before the launch, the control of the Raspberry Pi became erratic (it later turned out to be one of the small heat sinks plugged onto the back of the USB sockets that had fallen off and was rolling across the Pi, shorting out connections as it went). As I seal the package with cable ties and wanted to make sure we were filming I set the video to run for 30 minutes. It performed perfectly, it just took 20 minutes of video of the ground as we fitted it to the balloon then walked it to the launch site. For the remaining 10 minutes it filmed the wind sock as it flapped about in front of the camera. As a result we recorded almost no useful video.

The students took plenty of video and still pictures of the event and I am sure the report they write will justify their festival tickets. The students were fascinated by the balloon and followed us wherever we went. Teachers brought their classes out to watch and I am sure the students appreciated the chance to lie on the grass in the sun rather than be stuck in a classroom.

Bursting the Balloon small

bursting the balloon at the end of the day. The white substance is the French Talc in the balloon.

I would like to thank Ann and Toby for their help and suggestions and to Caroline for coming up with a project that allowed us to fly the balloon again.

Advertisements

Flying the weather balloon

image
The day finally arrived to fly the balloon. From what I could find on the internet each cubic foot of helium will lift 28gms and although it was difficult to confirm, it seemed that the party balloon gas contained about 14 cubic feet of Helium. I needed about 1 kg of lift, so I would need three to four containers of gas. These gas containers were supposed to fill around 50 x 9 inch balloons.

I used a 5kg spring balance to measure the lift and discovered that each container of Helium gave about 250gms of lift and not the calculated 440 gms. I filled the balloon with six containers of gas giving 1.3kg of lift, which as it turned out was a little too much! I purchased a kite winder from Amazon and two spools of a lightweight kite string. This string had a breaking strain of 3 to 4 kg and 300 feet weighed 83 gms. The total weight of balloon, string and electronics package was 733 gms.

The balloon took about 45 minutes to fill and was just under five feet in diameter. The filling  tube was a thicker material than the main balloon and just over an inch in diameter. I used a large rubber bung with a hole in it and attached 2 metres of rubber tube. I connected the rubber tube to the valve on the container directly and did not use the balloon filling valve that is normally used to fill party balloons.

By the time the first container was empty the balloon had started to rise, I tethered it to a table. I measured the lift after each container had emptied by tying a loop in the tether string and a 5kg spring balance was hooked onto this. Pulling the spring balance down and the reading on the balance gave the lift. After five containers of gas had been used the lift was just over 1 kg, but adding in the weight of the balloon this gives 1200 gms, or 240 gms of lift per container of gas. This would have been more than enough to lift my payload, but I decided to add one more container of gas to give a lift of 1300 gms (total 1500 gms with the balloon weight).  The filling tube was folded over and cable ties used to seal it. Kite string was passed through the loop formed and the electronics payload suspended from this loop.

It was surprising how hard it was to pull the ballon down by the string and obvious that for safety sake thick protective glove should be worn to avoid injury from the kite string pulling through the fingers. The electronics package was attached. The wind speed had increased from 2km/hour to about 14km/hour by the time I was ready to fly the balloon and it was extremely difficult to handle. The payload was spinning wildly around the balloon kite string and a completely different means of hanging from the balloon will be needed next time.

The balloon was allowed to rise slowly by controlling the kite string reel, but this needed some effort. The balloon was stopped at about 50 feet to take photographs, but the payload was spinning wildly around the balloon string. Allowing the balloon to rise to about 100 feet had to be stopped as the strong wind was carrying the balloon horizontally as well as upwards. It was decided that it was not safe to continue and the balloon was brought back down to the ground.

The balloon probably had too much lift and probably should have been left at about 1 kg lift. Next time I would not attempt to fly a balloon if the wind speed was above 5km/ hour. To stop the payload spinning wildly I think it should be suspended so that the kite string went through the centre of the payload.

image

The electronics package hanging from the ballon.

What about the performance of the payload? The electronics consisted of a Raspberry Pi model B+ fitted with. BMP 180 pressure sensor, a DHT11 humidity sensor (temperature could be read from either of theses two). Plugged into the USB sockets was a WiFi dongle, an 8gb memory stick for pictures, a LPRS 900mhz radio and a FTDI adaptor. A UBLOX Neo 6 GPS connected to a logic level converter was connected to the FTDI adaptor. A Raspberry Pi camera was used to take pictures.

A python script was used to collect data from the sensors and send and receive data from the ground station using the LRPS radio. WiFi could be used to control the camera up to about 100 feet which allowed an Android phone (using raspiCAM Remote) to take pictures or BerryCam on an iPad. However, the main control was over the LRPS radio using a VB6 program on a Windows laptop. This program was described in an earlier blog.

One of the planned activities was to measure the height of the balloon using GPS, atmospheric pressure and from the ground by measuring a distance of about 50 feet from the point where the ballon was tethered, the measuring the angle from the ground to the balloon. Trigonometry was used to calculate the height of the balloon. All three methods gave different results!

Photographic results: The spinning of the payload gave some interesting still images. Straight lines were strongly curved and the image blurred as the camera moved. The best result was from video, the camera faced straight down and the violent spinning made watching the video a little uncomfortable. However, some good still frames were extracted and next time I will shoot video at 90 frames per second ( so it can be slowed down to reduce the effects of spinning) and extract stills rather than trying to take still images.

The cost: I purchased the Helium from Amazon at £25 per container and the weather balloons at £3 each, so to launch the balloon costs £153. However, I felt that only five Helium containers were needed reducing the cost to £128. The kite reel, kite string and electronics package are all reusable and cost around £70.

Further thoughts: Wait for still weather, the original plan was to let the balloon rise to 300 or more feet, but with any wind the balloon could travel some way horizontally and become impossible to control. The balloon could be used over several days, if somewhere safe to store it overnight could be found. Some modification of the software is needed, the ability to use 90 GPS for video needs to be added. Using VNC to talk to the Raspberry Pi caused the Python script to close when the Pi lost the WiFi, but experiments have shown that running the Python using SSH may prevent this happening.

Measuring the Broadcom chip temperature on the Raspberry Pi

The electronic package for my weather balloon project is now complete and housed in a lightweight plastic cage. I have reduced heating problems by using 25 cm male to female USB connectors to connect the LPRS radio and the GPS/FTDI to the Raspberry Pi, now the 4 way USB block runs at a reasonable temperature. I can monitor the internal temperature of the LPRS radio and the ambient temperature, but I was concerned that in the cramped conditions in the container the Broadcom chip may overheat. Early experiments with the Pi in a case and all four USB sockets used showed that the system would behave erratically as the temperature rose above 30C.

A quick scan of the Internet seemed to show that although the Broadcam chip has temperature sensors they could not easily be accessed. However, it seems that although this was true in early versions of the Raspberry Pi later versions allow the temperature to be read. Open a terminal window and type in the following:

/opt/vc/bin/vcgencmd measure_temp

and receive the reply

temp=48.7'C

Using

/opt/vc/bin/vcgencmd measure_temp| egrep "[0-9.]{4,}" -o

Will just return

48.7

My Python code sends ACK after each requested data has been sent back to the master unit and I intend to add the Broadcom temperature to this monitor the Raspberry Pi.

Using the code with Python

To use this code with Python use the following:

include os

cmd = '/opt/Vcc/bin/vcgencmd measure_temp'
coreTemp = os.popen(cmd).readline().strip()

This will return a string similar to

temp = 44.6'C

If you need just the temperature value you can add the following line to the above

temperature = coreTemp.split('=')[1].split("'")[0]

temperature will then contain the value. It seems the Broadcom processor runs at about 40 to 50’C, but could operate up to about 80’C.

BMP180 and Raspberry Pi

Update: I found this gave incorrect readings, see this post for the method I used to correct problems with height measurements.

The I2C pins on my Raspberry Pi for the Weather Ballon project were tied up with a Real Time Clock. However, this stopped working after a week and so I decided to add the BMP 180 atmospheric pressure sensor. This would not only give the pressure but would provide an air temperature reading that the onboard thermometer in the radio could be compared against. There does not seem to be too much information on the Internet about using this sensor on the Pi and using Python, so I went over to the Adafruit site and followed their instructions.

I added the the library but as soon as I tried to run the script in IDLE it showed an error. When I tried the Adafruit example it worked perfectly as long as I ran the script directly. If I loaded into IDLE and tried to run it would not work. So, I made the alterations to my weather balloon script and saved the file. I shut down VNC and opened up connection via SSH. I use Serverauditor on my iPad, and once it was running I used the following commands:

Cd /home/pi/Weather_Balloon

Sudo Python remote_camera.py

Once the programme was running I could monitor the output from the slave on my iPad.

I made some alterations to the main control panel software running on my laptop and now the local pressure, sea level pressure and height (measured on the balloon) are shown. I am hoping to be able to show how pressure decreases with height above sea level.

Remote control of Raspberry Pi camera using LRPS easyRadios



The electronics package that will be used for my Weather Balloon project is now complete. It consists of a Raspberry Pi Model B+, fitted with a Real Time Clock module and a camera. Power is supplied by a USB power ‘brick’ that provides 5 volts at 2 amps and should do that for 6 to 8 hours. An EA900TRS radio, a WiFi dongle, an 8gb USB memory stick and a GPS consisting of a USB FTDI board connected to a logic level converter then to a Ublox NEO6 GPS.

The total current consumption is about 450ma rising to about 750ma when the camera operates. The total weight is under 400gms and it will be packaged in a container constructed from foam board.

A python program reads the Serial Data stream from the EA900TRS radio. This consists of commands from the ground that can take single images, timelapse video and video files. The location and height can also be sent back to the ground from the balloon.

On the ground a laptop fitted with another EA900TRS radio runs a control programme written in Visual Basic.



This control programme allows the following:

Taking single pictures, Timelapse video and Videos. The interval and runtime for timelapse videos and runtime for videos can be altered from drop down lists.

GPS data showing location and height can be requested and it is a simple matter to input the latitude and longitude readings into Google Earth to show the location of the balloon.

A number of diagnostic data can be sent back from the balloon, the temperature of the EA900TRS, signal strength at the balloon and data from the radio on the PC, temperature, baud rate, channel number, Tx power output and signal strength.

A countdown timer is useful for determining if contact with the balloon has been lost. The balloon sends a response back to the ground when the requested action has been completed. If the signal is lost this response will not be received and the control panel will ‘lock up’ waiting for a signal that will never come. To get around this a BREAK button is provided, pressing this will stop the console looking for a response from the balloon.

A Sync button resets both the ground unit and the balloon to ensure the variables on both units match, this is used after contact has been lost, then regained. A ‘Find Me’ button can be used to confirm that communication exists between the balloon and ground.

The Raspberry Pi runs ‘header less’ and a WiFi Access Point is used in the field to allow the Raspberry Pi to be set up, and to allow an iPad to take pictures using Berrycam. The expected range for this is at least 100 feet.

All images are stored on an 8gb nano USB memory stick.

One example of the need for through testing occurred when I took the unit outside to test the range of the radios. The Raspberry Pi was set up using WiFi, then taken outside, everything went well until I returned inside. The Raspberry Pi did not reconnect to the WiFi and the only way to shut it down was to pull the power plug – not the best thing to do. The answer was to add another button (not shown in the image above) that shut the Pi down. The control panel sends a shutdown command, the Pi receives this and uses

os.system("sudo shutdown -h now")

to shutdown the Raspberry Pi.

Weather Balloon 4 – taking pictures and video using EasyRadio

I need the Raspberry Pi in the balloon to act as a slave, waiting for commands from the master on the ground. The LPRS easyRadio Python example seems to sit in a loop waiting for keyboard entry, it only prints received data after it sends data, or the command flush is sent. If I have missed something then I apologise, so I decided to write my own code.

I took delivery of the new Rasperry Pi 2 and spent the last few days setting it up. I started with a clean install of Raspian and that has had an upgrade, the desktop looks good now. It’s difficult to say if it feels any faster than my B+ but I have not had much time to try it out.

As the easyRadio software is written in Python I decided to use the Python PiCamera software, I did the usual update then tried to install picamera, but I was told I had the latest version. However, when I tried to use the camera it generated an error report that ended in this unit can only be used on a Raspberry Pi! Now I don’t know if this is something to do with the Raspberry Pi2 or the new version of Raspian, but I decided to use Raspivid and Raspistill instead. These have to be called through os.system, I may come back later and look at this, but for now everything is working as I wanted.

The programme sits in a listen ending loop waiting for an input, once it is received the variable incomming holds this data. The easyRadio sends data in packets of 180 bytes and as I only expect to receive short messages only up to 180 bytes is read from the Serial Buffer. I also decided to use capitalisation for commands, it’s not necessary but I thought it might stop commands being sent accidentally. Once incomming has a command it is compared with the list of commands and the correct command routine is called. At the moment PRINT takes a single photograph, VIDEO takes a short video, GPS turns on the GPS and transmits the data back to the ground. STOP shuts the programme down.

GPS has not yet been implemented as I am not sure if I will use an Arduino to gather sensor and GPS data that is then sent over a serial line to the Raspberry Pi for transmission to the ground. The command set can easily be expanded. The programme sends a Balloon ACK back to the ground to show it received the signal.

I have not been able to test the range yet, but I hope to be able to test that during the coming week. The Python code is shown here for Python 2, I can’t say if it will work in Python 3, that’s something else to try.


# easyRadio slave unit. this unit is mounted on the balloon
# it sits in a receive loop waiting for commands

# Chris Rouse February 2015

import serial
import os

def printPicture():
"Takes a single photograph"
os.system("raspistill -vf -hf -o 'image.jpg'")

return

def takeVideo(numSecs):
"Takes vide for numSecs seconds"
os.system("raspivid -o 'video.h264' -t 3000")
return

def runGPS():
"Starts the GPS"

return

def closeProg():
"Shuts this program down it cannot be restarted over easyRadio"
ser.close
exit()
return

# set up the serial port, this will be ttyUSB0 for the easy radio
ser = serial.Serial("/dev/ttyUSB0", 19200, timeout = 0.5)

# main loop
while True:
numbytes = ser.inWaiting()
incomming = ""
if numbytes >0: # wait for a singnal to come in
# easyRadio sends up to 180 characters
incomming = ser.read(180) # read in up to 180 characters
if incomming != "":
print(incomming)

# now check for commands

if incomming == "PRINT":
print("Takes a single picture")
printPicture()

if incomming == "VIDEO":
print ("Takes a video")
takeVideo(60) # change this value to suit, this is 1 minute

if incomming == "GPS":
print("Starts collecting GPS data, and send back live data")
runGPS() # could add a time to run here

if incomming == "STOP":
print("WARNING this stops communications")
closeProg()

# end of commands

incomming = "" # reset text string

# now send ACK to master unit to show the command was received

ser.write(">>> Balloon ACK\r\n")

Using LPRS EasyRadio with Raspberry Pi – part 2

This part deals with the program that runs on the PC, any two or more devices can communicate, but the software provided by LPRS will only run on a PC. You should have downloaded and installed the EasyRadio Companion as detailed in part 1. Before running this software, and before plugging in a radio open up Control Panel, go to System Hardware and open up the COM port list. Make a note of the items listed then plug in a radio, Windows will install the necessary drivers. Once these have been installed the radio will show up as a USB serial port, make a note of the COM port number. Now run the EasyRadio companion

2015/02/img_1620.jpg

You will need to set up several parameters as the program does not do this automatically. Click on Settings in the top menu bar, then click RS232 Settings. Click on the radio button alongside Device 1, in the drop down box alongside Port select your COM port number (the correct port is NOT selected automatically). For the moment leave Baud set at 19200, Data Bits at 8, Stop Bits at 1 and Handshaking at None as these match the values in the Python sketch on the Raspberry Pi. Click on Store, then Exit.

2015/02/img_1618.jpg

Click on settings again, then Select Device, click on Device 1. Make sure UART Baud Rate is set to 19200 and click Update. Make sure Frequency Channel is set to C0 and click on Update.

2015/02/img_1619.jpg

Click on the button marked Send Command and the Device I’d will be shown. Click on Read Module and the Serial Number and date of manufacture will be shown. Make sure the tab ERA Modules is highlighted and click on the Communication tab.

Fit a radio to a Raspberry Pi and start up the Pi. Once the desktop is displayed start Idle and load the Python script that you downloaded in part one of this post. run the script.

Type something at the cursor and press enter, this text will appear on the PC in the large box on the Communication Test page. Now type something in the box marked -enter your text here-.

Nothing will appear on the Raspberry http://wp.me/p4Suyg-7jPi as the Python script is waiting for a keyboard entry, however the text sent from the PC has been stored. Type something into the Python script followed by enter. The contents of the received buffer will now be printed.

That’s is it, two way communication has been achieved!