The Icarus Project
14Sep/090

Updated camera firmware

Have found a new variant of CHDK called StereoData Maker (SDM). This is a light weight version of CHDK and it supports Kite Aerial Photography(KAP). Using this I can control the camera to run scripts by varying the length of the power pulse I send down the USB cable. NB The monitor is only accurate to about 10ms so significant variation and slowness is required for satisfactory results.

Filed under: Uncategorized No Comments
1Sep/091

Humidity sensors and prototyping

Building prototype from schematic to test that all the additional connections are possible and that the system can be made to work before sending the BRD file off for PCB fabrication.

To calibrate humidity sensor I am going to use a salt bath made from the anhydrous form of the salts below.

Copper Sulphate CuS04 0% RH

Magnesium Chloride (MgCl2) 33.3% RH

Sodium Chloride NaCl (Salt) 75.6% RH

See here

Filed under: Uncategorized 1 Comment
5Aug/090

Icarus III

Designing New Icarus III Board which will use the ATmega328p micro processor made popular by the Arduino boards. The new board will have the following features:-

New features not found on Icarus II are marked with an *

  • RTTY TX using RadioMetrix
  • Lassen iQ GPS
  • UART Debug Info
  • Programming pins for serial programming Lessen GPS insitu
  • * Humidity sensor
  • * Differential pressure sensor
  • * Absolute pressure sensor(ABANDONED)
  • * USB Trigger circuit for taking pictures
  • * PWM output for server control to drive camera servo
  • * SD Card data storage
  • * Mosfet controlled Payload Cut-down
  • * Spare mosfet connection

Listener data analysis and automatic graphing of live and historical data.

Filed under: Uncategorized No Comments
1Aug/090

Surface mount components & SVN

Pretty much there now on Icarus III. Moved to surface mount components rather than push through hole. This will help reduce the size of the board. The additional space being needed for the additional sensors and circuits mentioned below.

Modified the primary data structure to use floats rather than strings to store the numeric values such as latitude and longitude. This will aid future calculations. The loss of accuracy is approximately one or two metres which should not cause any significant problems.

Abandoned the idea of having the absolute pressure sensor on board as the sensitivity of such sensors is only down to 15kPa which is only 15,000 meters (50,000 feet) above sea level. Typically a launch will exceed 30,000 meters rendering the information from such a sensor useless. Especially as the area we are particularly interested in is at apogee (The point furthest from Earth).

Set up two SVN repositories to hold development and media from the Icarus project.

Filed under: Uncategorized No Comments
1Jun/090

3Kg Balloons and a rule of thirds

Launch of 3kg balloon.

The rule of thirds to prevent entanglement on descent.

Statistics and data gathering.

Filed under: Uncategorized No Comments
21Sep/08Off

Tethered Launch

Today was the perfect day for a tethered test launch with a wind speeds of about 0.1 knot. I Got all the kit assembled with the new radio beacon working fine and sending out Morse signals of GPS coordinates.

Inflated balloon (see pictures below) and attached payload. The tether was made from three kite strings all tied together to give a maximum distance of ~125 meters.

Launch was uneventful, which is the way you want it to be.

There was some drift from the frequency being transmitted on the radio.

It's important to constantly monitor the receiving system to correct drift.

Pictures

Video

1Sep/080

Helium and Transmitters

Managed to set up an account with BOC and ordered a large L size cylinder of balloon gas. This came with a balloon filler attachment which, although adequate, would benefit from having an extension hose attached to allow the filling to occur away from the cylinder. I will try to track a 3 meter low pressure hose down from a local scuba diving shop I know in Bradford.

Today must have been my lucky day. I was searching on Ebay for a cylinder trolley to hold the helium cylinder and there it was with 15 mins left to go and no bidders. Throwing caution to the wind I immediately placed my bid for the lowest amount (£65) and then patiently waited the next fifteen minutes. As you would imagine there isn't exactly a large second hand market for cylinder trolleys and indeed no one else placed a bid. Hey presto I was now the proud new owner of a cylinder trolley. Now all I had to do was drive the 3.5 hour round trip from Wakefield to Morecambe to collect it. I must have looked a sight hurtling down the motorway at 70+ with large cylinder trolley attached to the roof bars, but what the hell I was happy. When I got home I excitedly loaded up my cylinder into the trolley and got the whole family out to have a look at my new purchase. Needless to say the wife didn't quite share my same level of enthusiasm.

Realising that I need to track my payload using radio signals I embarked on a mission to find a suitable radio which would see me well into my ballooning hobby. I phoned around a few of the on-line ham radio shops until I got to Radioworld . Now these guys were very helpful. They listened to exactly what I wanted to do with the radio and what I planed to do in the future and then recommended with justification that I went for the Yaesu FT-817ND. I have to admit not really knowing anything about radios at this point but it seemed to meet my needs so the order was placed. When it arrived it certainly looked the business. I spent the next six hours trying to find something to listen to on the air but I really was not getting anywhere fast. I eventually found a local repeater on 145.787.50 and heard a little conversation taking place. I think I'm going to get hooked on the radio as a separate hobby from ballooning. Anyhow I have decided to enrol on a foundation course so that I can obtain a call sign to legally allow me to transmit on my radio.

Having got the radio set up the next challenge was to use it to receive communications from the payload. The first step was to get hold of a transmitter. Now the Ofcom rules state that you can only transmit at 10 milliwatts from an aerial platform and only on a licence free frequency. Thankfully Radiometrix make just such a module transmitting on 434.650.10MHz. A little bit of reading about various ways to transmit data over radio lead me into realms of Morse code (continuous wave), radio Teletype (rtty) and sstv. Now the easiest and perhaps oldest way of radio communication is via Morse code and given that it is the easiest thing to program I quickly settled on using Morse code to send back information from the payload to ground control.

Apparently, thought it should be obvious, you can't just send payloads off up into the sky without first seeking permission from the Civil Aviation Authority.

GPS

Tracker

Spherachute

Filed under: Uncategorized No Comments
5Aug/080

Programmers, Timers and Temperature Sensors

Well we are only half way through the month and I have been quite productive. It started with a battle to program the Atmega32 development board. The first programmer I brought was from the same company that supplied the board. However I failed to notice that the programmer was only supported in BASCOM and I certainly had no intention of writing my microcode using BASIC. This programmer is really a rip off costing 38 pounds and is not supported under Linux or winavr or AVR Studio. If you haven't realised it yet, DO NOT BUY THIS PROGRAMMER!!!

I then happened to be in Farnells, buying some electrical components, when I noticed that they were chucking out a couple of Atmel AVRISPmkII programmers. These have the new 6 pin In Service Programming (ISP) connectors and my development board has the older style 10 pin ISP connector. Anyhow as it was a freebie and I'm not one to pass up on a free toy especially after spending a small fortune in Farnells over the past few weeks. So I took it home with a certain amount of pleasure at getting something useful for free.

After a quick look at the interface pin outs in the AVR Studio help pages I quickly knocked up a converter board to transform the 6 pin layout into a 10 pin one. The other four pins are basically linked to the ground from the 6 pin connector. I have written a newbies guide to programmers and you should read this if you want to make such a converter yourself. Having spent the best part of the morning researching and making the converter I was rather disappointed to find I could not program my development board with the programmer. I tried using AVR Studio (Atmel's own integrated development tool) but it kept throwing an error when trying to connect to the ATmega32 chip. I had another attempt from winavr but it would not recognize the USB device. In frustration I tried from Linux using avrdude. This time it recognised the device, sort of, but kept throwing an error message. I was coming to the conclusion that there is no such thing as a free lunch and certainly not a free working programmer.

With tail between my legs I went back to the Active Robots site and purchased their parallel port programmer. The only computer I own with a parallel port is my trusty Linux machine. I thought I had better go with the parallel port programmer given my abject failure with the USB ones. This programmer also had the advantage of having a older style 10 pin programming cable to match the 10 pin programming port on the development board.When it arrive i plugged it in. Copied my hex file across to the Linux box and with some trepidation executed the avrdude programming command. Eurika!!! The bloody thing worked. I quickly hacked up a flashing LED program and compiled it on winavr before uploading the hex file into the development board and hey presto it worked. I can't tell you the elation I felt when that LED first flashed. This was the culmination of hours of frustrating effort. Funnily enough though, my wife didn't share the same level of jubilation as me to this marvelous leap of technological advance. At least there was some understanding from the #highaltitude IRC group.

With the sweet taste of success in my mouth I set out to find a USB programmer which would work with the rest of my computers all of whom lacked a parallel port. From Google I stumbled across the Olimex website. Now these guys make some nice programmers according to avr freaks so I quickly purchased an AVR ISP 500 which had a USB connection and both the 6 pin and 10 pin programming cables. This really had to work. The day came. I plugged it in and ahhh! The bloody thing wouldn't work I tried everything and constantly faced the same error message again and again. Clutching at straws now and having read a review about the Atmel AVR Dragon working with avrdude. I bit the bullet and went and brought the Dragon from Farnells on the way home from work. I could have screamed when the bugger didn't work. I now had to ask myself what the hell was I doing wrong.

I re-read all the programmer documentation and then the development board documentation... and there was the answer in black and white. The 10 pin header on the development board was wired completely the opposite way around to the Atmel standard. With in a few minutes I made up a crossover cable by attaching a 10 pin IDC connector the wrong way around on one end of the programming cable. I plug it all together and tested the Olimex programmer and of course it worked. The same with the Atmel AVRISPmkII and the Dragon. I now had four working programmers. A precautionary note, the Atmel USB drivers do not work with winavr. If you are going to use this as your development tool, and I would suggest that you do, then you have to use the USB drivers provided in the winavr install directory. Read the instructions or my programmers guide here to find out how to install them and where they are.

Having finally got my programmers to work it was time to decide on which development environment to use. Atmel offer a very good free C programming language IDE called AVR Studio this can be downloaded for free from the Atmel website. There is also a BASIC compiler called BASCOM which is probably better suited to programmers less competent in C. There is a fee for BASCOM which is enough to put you off, about fifty pounds if I remember correctly. Finnally the one closest to my heart, the open source AVR development platform winavr which uses the avr-gcc and a host of other small programs. After a quick play with the first and last development tools, skipping the BASCOM option, I settled for the winavr environment. This also allowed me to choose to develop under Linux as well as Windoze.

Having read and slightly digested the ATmega32 manual I discovered that the chip is quite capable of controlling the camera servo. After a quick bit of searching around the web I found a few examples of setting up PWM (pulse width modulation) on the ATmega32 and with a little coercion manage to implement it into the main Icarus control code. The whole camera control could now me managed from the AVR processor and out could go the Pololu servo controller saving a few grams of weight and far less programming and wiring.

Rebuilt the camera cradle using the previous experience to give a neater result.

Programming a one second real time clock. This might get a bit technical but I needed to do various things in second intervals. Now on a microprocessor a second is a very long time. In fact on the microprocessor I'm using for this project it has to count up to 16,000,000 for a second to parse. When you are writing programs its not very efficient to sit there counting CPU cycles. There is a timer which does this for you whilst you can be doing other things in your program. If you use the timer to count the cycles, you then need a way for your program to stop what it doing when the timer reaches the value you requested. This is called an interrupt. What ever your program is currently doing is stopped and

The Atmega32 is attached to an external 16MHz Oscillator.

This means the cpu clock tics 16,000,000 times per second. To put it another way the processor can execute 16 million instructions per second. The challenge comes when we want to measure second intervals.

The timers have a convenient feature which allows the number of oscillations to be divided by a pre scaler. These prescalers are  8,32,64,128,256,1024. Given that we are using an 8 bit timer we can only count up to 255 before the clock rolls over back to 0. As we want to count a relatively large number of cycles we use the highest prescaler of 1024. 16,000,000 / 1025 = 15625 timer counts per second.

The next task is to find values less than 255 ( the timer can't count hight than this) which can be divided into 15625 to give a whole number. If we end up with a reminder we will not be measuring a second exactly. Once we have this divisor and the result it only a question of setting the timer to count to the divisor and counting the number of times this occurs until it reaches the result of the calculation. Phew !!! Lets look at the solution.

Dividing 15625 by 125 equals 125  a nice round number less than 255. It a shame the result is 125 as it causes confusion between the divider and result.

This means that we need to cycle around a counter up to 125, a 125 times, because 125 * 125 = 15625.

The counter counts by default from 0 to 255.

So we need to seed the counter to start at 125 cycles below 255.

255 - 125 = 130 = 0x82

The timer is seeded by setting the timer counter register to the start position each time the clock rolls over.

TCNT0 = 0x82

To test this I set up a second counter and counted the seconds over a 5 and a half hour period.

The results are as follows :-

Mon Aug 25 01:29:00 BST 2008 : Second counter = 1

Mon Aug 25 06:58:00 BST 2008 : Second counter = 19801

This shows a deviation of ~+1 second in 5 1/2 hours. Given that this was done by eye it may even be reasonable to assume the error is even less. However this will easily suffice for my needs. In future experiments I would consider attaching an external 32.768 kHz oscillator to timer2 to provide a more suitable real time clock.

Picture of current development

Moving into the last half of August ...

I wrote a guide on how to modify a Canon Ixus 400 camera for remote control and put it on the UKHAS wiki a link to which is here.

In the process of writing a  guide to selecting and using AVR programmers to prevent some one going through the nightmare experiences I went through.

Temperature sensors proved to be a little more interesting that I first thought. I search high and low for a sensor capable of recording temperatures close to minus 60 degrees. The first sensor I came across was the LM35 range of sensors from National Semiconductor. Being new to this electronics lark I found the cheapest one in the range and ordered up 10 of them given they were so cheap. It didn't take long after their arrival to discover from the data sheet that the sensors only went down to 0 deg C. Lesson learnt, read the data sheet first.

The slightly more successful purchase of an LM35CAZ gave me the temperature range of -40 to 110 deg. C. The problem with this sensor was that it need to be supplied with +- voltage to allow it to report the negative temperatures. The sensor works by outputting a voltage of 10.0mV per degree Celsius. To measure the voltage the ADC converter on the ATmega32 chip would be used.

Then out of the blue (I can't remember where) I came across the Dallas Semiconductor temperature sensors. These looked a whole lot more promising with temperature range from -55 .0 to 125.0 deg. C. I settled on the DS1821 sensor though the DS18S20 looked very interesting. In truth I brought both and was soon over whelmed by the extra programming required to manage the DS one wire protocol with multiple devices. I settled for three of the DS1821's connected to 3 separate pins on the ATmega32.

Below is a some video of the temperature sensors in action.

<SORRY NEED TO PUT VIDEO IN HERE>

Filed under: Uncategorized No Comments
1Jul/080

Aluminium Camera Cradle

Started work on construction of the aluminium cradle for the camera. The aluminium came from B&Q of all places! Spied on one of my regular DIY trips at the weekend. There are three different peices of aluminium used to make the cradle -:

  • The first is 2mm thick, 25mm wide and length 1000mm.
  • The second is U shaped 12mm wide, sides of 10mm and length 1000mm
  • The third is tubing with a diameter of 6mm and length 1000mm

The thin aluminum was bent into a U shape in which the camera slots into. The U peice of aluminium is used as a brace to hold the cradle in place this is secured to the base of the camera using an old tripod mounting screw I had kicking around. If you want to get one of these the spec is a 1/4" BSW bolt. The tubing is used as a pivot arm on the opposite side of the servo. The tubing was secured using a 4mm x 16mm bolt by screwing it into the hollow end of the tube after first passing the bolt through a hole drilled in the side of the cradle. See pictures below to get a better understanding. The servo needs to be attached to the frame using some very small bolts (M1.6x4mm). I managed to source these from a company called Precision Technology Supplies it's worth bookmarking this site if you are ever going to need very small nuts and bolts as it was a bugger to locate a supplier with a reasonable price.

Pictures of aluminium camera cradle can be found here.

Video of aluminium cradle being driven by the servo.

Spent quite a bit of time working on the website making sure that everything to date has been documented and that the structure flows.

Filed under: Uncategorized No Comments
1Jun/080

ATMega 32

An ATMega32 board has finally arrived in one piece and it seems to work. Well at least the LED lights come on when the power is attached. I'm going to have to go through a big learning curve to get this processor to do my bidding for me. On initial investigation it looks very possible to have the board monitor three temperature sensors, one in the flight box, one external and one with the camera as well  as driving the servo controller. To conserve power in the camera the ATMega32 will also control the power to the camera using a relay. This will have the added benefit of resetting the camera each time.

Had a breakthrough on the issues with the RS232 cable. I complied up the code for the Gumstix Verdex and installed the package and discovered that the servo control code worked perfectly with the supplied serial connection that came with the Verdex. This leads me to believe that either the serial cable from Maplins is faulty or there is a problem with the RS232 port on my Linux box. Taking the voltage drop between the outer casing on the cable and the Pololu servo contoller gives a 63V AC current which strikes me as wrong. It is about 3V with the butchered serial cable and I haven't yet measured the difference on the Verdex serial cable. The next step is to get the canon capture software compiled and to construct a cradle for the camera out of aluminium.

Filed under: Uncategorized No Comments