Thursday, October 14, 2010

Schematic (II)

Hello! This is a second iteration over my previous schematic.

There are some additions:

Click on the picture to enlarge it, or just download the EAGLE .sch and libraries from my repository.

Friday, July 2, 2010

Using two balloons for controlled descent instead of a parachute?

It has always come to mind that using 2 balloons would provide a slow and controlled descent of the payload. Parachutes won't open at high altitudes because the atmosphere is too thin. So usually, after the balloon pops, the payload starts plummeting and spinning like crazy until it reaches an altitude where the pressure allows the parachute to open. During its crazy nose-dive, the payload, the load line and the parachute itself are very likely become an entangled mess with the whole thing hitting the ground at free-fall speed. Plus I fear the antenna will break as well.

How to prevent this?

Well, Kyle has reported his experience using 3 balloons. The theory is that when 2 of them pop, the 3rd one doesn't have enough lift and starts going down smoothly. I'm really looking forward to him elaborating more on his blog.

Also check out Todd's write up. He used a parachute and a ring to prevent the parachute lines from tangling during descent.

Wednesday, June 9, 2010

Schematic

This is my first attempt at designing the tracker board. It basically consists of a barebones Atmega328P, a GPS, a radio, temperature sensors and a cut-down (aka the "suicide") mechanism. Click to enlarge:

Also check out this pin mapping reference between the Arduino and the Atmega328P.

I wanted the option to use both the Radiometrix HX1 and SRB MX146 radios, so I wired them both, but only one can be really used at a time.

As you can see, the connection from the AVR chip to the HX1 is straight-forward, just wires and no additional components.

The MX146, however, requires a couple of BS170 mosfets to translate I2C's TTL 3.3 <-> 5v levels, a transistor to drive the PTT and a voltage divider to convert the audio input down to 500 mV peak-to-peak. The MX146 also has its own 8V regulator, since I've got the 8V version. You can absolutely leave these components out if you're only going to use the HX1.

The GPS is a Venus 634FLPx. I bought it from Sparkfun. Since this is a 3.3V device, it needs some level conversion (via the diode method described here) and its own 3.3V regulator.

I also added a couple of LM60 sensors, since I want to measure both on-board and external temperatures. The external sensor can be connected via a terminal block (X2). I also planned for a capacitive humidity sensor (X3), but I don't think I'll use it on my first flight.

A MOSFET 22nf031 controls the "suicide" mechanism that cuts the rope if the balloon somehow refuses to burst. It has its own power source (X5) to avoid draining the main Vcc, and the nicrom wire goes to yet another terminal block (X6).

Lastly, X7 is the main Vcc source, coming from a pack of lithium AA batteries.

I have the Eagle .sch file and libraries for the MX146, the Venus GPS and the HX1 if anyone is interested.

Next step: create the .brd file for a PCB house. I'm really struggling with this, since it must match the PCB house specs (I'm thinking Olimex).

Sunday, May 9, 2010

How I built my cheap 2m Yagi antenna

I wanted to build a Yagi antenna so that I could point it at the balloon and track it from the ground. Apparently, VHF propagation improves hugely with height so, if the balloon is high enough, even a low-gain omni antenna will pick it up. I did, however, not want to leave anything to chance, so I built the yagi even though I might not need it.

The antenna described here has a 8.8 dBd gain, ie. it has a 8.8 dB gain over a dipole, which in turn means the power of the signal will look 7.6 times stronger than if I were to use a regular dipole. This is what it looks like:

I used this great Yagi Calculator by John VK5DJ to design the antenna. The author says that the program is meant for long antennas (over 10 directors), but mine has 4 directors and it works great.

Here are the ingredients. This shouldn't be more than 10€ provided you have basic tools.

  • 5 square aluminum rods (1m long, 8x8 mm section) for the directors and the reflector. The cross section looks something like this: |_| (ie, one of the sides of the square is missing). I guess I could use fully squared rods, but they would be heavier.
  • 1 rectangular rod (2m long, 16x8 mm section) for the boom. I attached the elements to the long (16mm) side for stability. The cross section looks like this: |_|_|
  • 2 round, hollow rods (1m long, 6 mm thick) for the radiator. I think hollow ones are easier to bend, and lighter too.
  • 1 round, hollow rod (1m long, 8mm thick). The 6mm rod must fit into the 8mm rod.
  • 3 mm machine screws of different lengths to hold everything in place, bolts and washers.
  • RG-58 cable for the balun
  • 1 SO-239 female connector (aka PL connector).
  • 1 plastic / prototyping box. This will contain the SO-239 connector, the balun and the connections with the dipole.
  • Drill and bits (at least 3 and 6 mm)
  • Any bottle that is 50mm across. Any aerosol can, deodorant spray, sun-tan lotion bottle, etc will work. I used it to bend the rod.

First, I tried to bend the rods. I feared they would collapse or they'd be too stiff, but they bent just fine. I just put the rod on the kitchen counter, right next to the wall. I held the aerosol can firmly, pushing down and against the wall, and bent the overhanging end of the rod around the can. The wall keeps the other end still, so you only need to focus on holding the aerosol with one hand and bending the rod with the other. It works pretty well, of course there are more sophisticated methods.

At 144,8 MHz, the total length of the unfolded dipole is 2043 mm. I could only get 1m long rods, so my dipole is actually made of two 1m rods, plus a small piece of a 8mm rod to "close" the loop. You can see it here, with a preview of the box that will hold everything together:

Next, I cut the square rods to their lengths. I labeled them D1, D2, D3, D4 and R. I used one of the leftover pieces and drilled two holes 8mm apart on it, so that I could use it as a pattern. Then, I used that pattern to drill the holes on the boom, the directors and the reflector. I actually had to build a couple more patterns, since after a few drillings, the holes grew wider. Anyhow, this is the hardest part since the holes on the boom and the elements must match.

After drilling the holes, I put all the elements in place. I like this part since the former bunch of scrap starts to look like an actual antenna!

Back to the dipole. We left it at the point where we just had two 6mm rods hooked together by an 8mm rod. Now is the time to build the box that will hold all the connections and the rods together. Again, I followed this excellent article (I'd be happy to give credit to whomever wrote it, but I can't find its author). This is the basic idea:

First, I drilled two 6mm holes on the sides of a plastic box I had around. Then, I flattened the ends of the dipole that go inside the box, and drilled 3mm holes through them (it's much easier when the rod is flat). Now the flat part won't fit in the 6mm holes of the box, so you'll have to mount them the other way around, ie. introducing the round end from the inner side of the hole and pulling all the way. It's kind of hard to explain, but it will become obvious when you face the problem.

Next, I mounted the SO-239 connector. This needs 4 x 3mm holes, plus one bigger hole in the middle. I chose to put the SO-239 plug on the outside so as to not clutter the inside of the box too much. And finally, the balun. The balun is just a piece of RG-58 coax cable. The yagi program will give you the exact length and the proper way to connect it. I drilled two more holes, since most of the balun will be left hanging outside. Click on the picture to zoom in:

As you can see in the picture above, the dipole ends are hooked to a couple of two long 3 mm screws. The cables are clamped with washers and bolts, so I didn't use any solder except on the pin of the SO-239 connector. The whole thing looks like: bolt, washer, cable, washer, bolt, flattened rod, bolt. To keep the box in place, I drilled two more holes. I used the same 8 mm pattern above. I just took care of not shorting the boom with the radiator by making sure the mounting screws don't touch anything else in the box.

You can zip tie the balun along the boom, but it's not really necessary and it won't affect the performance of the antenna anyway. I just left it hanging. The two zip ties at the far end are my cheap and dirty mast mount. And that's it. Here is the end result, happily tanning in the sun:

 

 

Tuesday, April 13, 2010

Hot wire polystyrene cutter for perfectly straight edges

I'm building the box that will contain the balloon's payload out of a polystyrene sheet. Polystyrene can be bought in construction supply stores such as Leroy Merlin in Europe, maybe Home Depot in the US. I've got a 160 x 60 cm sheet for about 2€ from Leroy Merlin (you have to go to the construction supply area, not the main shop).

You can cut polystyrene with a regular knife, but the easiest way is using a hot wire. At the right temperature, the wire melts the foam like butter, leaving the cleanest cut behind. And best of all, with no fumes!

There are some cool solutions out there based on soldering irons, these are ideal to cut small pieces of foam in shapes, but I want perfectly straight edges because I need to glue the box sides together. This is what I did:

Ingredients:

  • Nicrom wire. This is the cutting wire. Get it from a hairdryer or an electric heater. You can go to a recycling center and dig for one among the electronics garbage. That's how I've got mine, every time I go to the recycling place I bring more trash home than I drop off there :)
  • Car battery, or something capable of delivering 3-4 amps at 9-12 volts. I used my car's old battery. It won't power the starter, but it definitely melts the polystyrene.
  • A couple of battery cables with clamps.
  • 2 aluminum rods. 1 m long, 6-8 mm thick is enough. Hollow ones are cheaper, lighter and better. I've got them from a local hardware store for ~1.50€ each.
  • Small machine screws and bolts. I used 3mm across, 12mm long screws.
  • Two vises. Mine are small, the ones that will hold on to the bench with a clamp, rather than screws.
  • Drill or dremel tool. And a 3mm bit.

First, clamp the vises to the bench, one facing up and the other facing down. These will hold the rods.

Use one of the vises to clamp and flatten the tip of the rods. Just flatten the last 1-2 cm, this will make it easier to drill through it.

 

Cut the nicrom wire. The wire acts as a resistor, and the shorter you cut it, the hotter it will get. Hotter will cut the foam faster, but it does not have to be incandescent. In fact, if it's too hot, it can break. So it's better to err on the generous side, and if it doesn't get hot enough, you can cut it shorter later. I used about 50cm. My wire looked like a spring, so I decided to straighten just 15-20 cm and leave the rest coiled up.

Drill two holes with the 3mm bit on the rod's tips. Insert a screw through the hole and secure the nicrom wire to the rod with a bolt. Do it with both rods. The total length of the wire between the rods is 15-20 cm, so I have some coiled-up wire overhanging.

 

Clamp the two rods, one with each vise. Make sure the wire is tight. The aluminum rods are very flexible, so just tighten the wire until the rods bend a little. Also, make sure the wire is at a right angle with the bench. Try to straighten the wire as much as you can (at least the stretch that will cut through the polystyrene). Just press it between two fingers and slide the fingers down repeatedly.

Make sure the rods or the vises don't touch each other, or they will short the battery!

Now, hook up the cable clamps to the battery. You can try connecting the clamps directly to the rods, but the stretch of wire between them will probably be too short and the wire will get glowing hot in seconds. So I chose to hook up one clamp to a rod, then the other clamp to the overhanging wire. Just remember the closer the clamps are on the wire, the hotter it will get.

 

 

That's it... Use a plank as a guide (sort of like a T-square) if you need parallel edges. You can clamp the plank to the bench, so that you don't have to hold it and can focus on the cutting. Try not to stop as you cut, or you'll start melting a hole around the wire (check the fourth picture below, can you see the dents?). Just keep constant speed. You'll be surprised how extremely clean the cut is!

 

Saturday, April 10, 2010

Audio with an Arduino and PWM

The Arduino doesn't come with a DAC (digital-to-analog converter), so the two options to generate an analog signal are a resistor ladder (remember the Covox Speech Thing?), or PWM. Some commercial trackers, like the TinyTrack, use a 4-bit resistor ladder, but I thought it would be more fun to use PWM. It gets more complicated on the programming side but it takes less external components and only one output pin.

The Arduino has 3 timers capable of doing PWM. Some timing functions in the Arduino library (delay and millis) use Timer 0, so we don't want to disturb them. Timer 1 and 2 both have about the same capabilities, but Timer 1 can count up to 16 bits and Timer 2 only goes up to 8 bits. There is a great write-up by Michael Smith on generating PWM with Arduino and two timers. It uses Timer 1 to feed samples (at whatever the sample rate is) and Timer 2 to do the actual PWM (at the maximum rate possible, 16 MHz / 256 = 62500 Hz). But, by keeping the playback interrupt short enough, it is possible to do away with just one timer and simplify the code a bit. All it takes is telling the AVR to trigger an interrupt when the PWM timer overflows and feed samples from the interrupt service routine. The ISR will be called every 256 clock cycles, but that's long enough for a couple of table look-ups. A code excerpt:


void modem_setup()
{
// Configure pins
pinMode(SPEAKER_PIN, OUTPUT);

// Set up Timer 2 to do pulse width modulation on the speaker
// pin.

// Source timer2 from clkIO (datasheet p.164)
ASSR &= ~(_BV(EXCLK) | _BV(AS2));

// Set fast PWM mode with TOP = 0xff: WGM22:0 = 3 (p.150)
TCCR2A |= _BV(WGM21) | _BV(WGM20);
TCCR2B &= ~_BV(WGM22);

// Do non-inverting PWM on pin OC2B (arduino pin 3) (p.159).
// OC2A (arduino pin 11) stays in normal port operation:
// COM2B1=1, COM2B0=0, COM2A1=0, COM2A0=0
TCCR2A = (TCCR2A | _BV(COM2B1)) & ~(_BV(COM2B0) | _BV(COM2A1) | _BV(COM2A0));

// No prescaler (p.162)
TCCR2B = (TCCR2B & ~(_BV(CS22) | _BV(CS21))) | _BV(CS20);
}

void modem_start()
{
// Key the radio
radio.ptt_on();

// Enable interrupt when TCNT2 reaches TOP (0xFF) (p.151, 163)
TIMSK2 |= _BV(TOIE2);
}

void modem_stop()
{
// Release PTT
radio.ptt_off();

// Disable playback per-sample interrupt.
TIMSK2 &= ~_BV(TOIE2);
}

// Service routine for TIMER2's overflow interrupt.
// This is called at PLAYBACK_RATE Hz to load the next sample.
ISR(TIMER2_OVF_vect) {
// [...] load the next sample
OCR2B = next_sample;
}


And that's it. We call modem_setup() once at the beginning to set Timer 2 to the proper mode. Then we call modem_start() to transmit and modem_stop() to stop. You can see the real implementation here. These are the results:


PWM filtered/unfiltered

 


Received signal (MX146)

Received signal (HX1)


On the first image you can see the PWM output (below) and the same PWM signal filtered by an RC low-pass filter with cut-off frequency = 2800 Hz (above). Can you see the phase offset between the two signals? That's a consequence of the RC filter. There is some ripple at 62.5 KHz resulting from the PWM itself, but the transmitter and receiver's own filters took care of it as you can see in the the other two pictures. One thing I noticed is a bigger gain of the signal transmitted with the MX146 compared to that of the HX1. Perhaps I am overmodulating the MX146?

 

Testing a Radiometrix HX1 radio

I've got these 3 modules from Radiometrix. Look how nicely packed these came!

  • HX1: VHF transmitter, hard-tuned to 144.8 MHz, outputs 300mW. Consumes 120mA at full RF.
  • NRX1: VHF receiver, hard-tuned to 144.8 MHz
  • UHX1: VHF transceiver, can operate on any frequency in a 2 MHz range, outputs 500mW (adjustable).

I've tried the HX1. It outputs 200mW according to my power meter. The 100mW loss might be due to the dirty connection I made from the breadboard to the SO-239 connector, bad shielding or the meter itself but I still haven't figured it out completely.

I've got the HX1 partly inspired by VE6SBS Barry's page. He successfully tracked a balloon using an HX1 radio from 600 km away. Not bad for 300 mw! I have been able to reach digipeaters in the ~35 Km range with ~50% success rate using the HX1 and a DIY 6 elements yagi antenna. With my trash-dug omni antenna, though, the success rate goes down to ~0.01% (success rate with the SRB MX146 @500mW and the omni was ~4%) , even though I have direct line of sight with the remote digipeater. I fear losing the ballon after it goes a few kilometers high, but apparently altitude has a huge impact in VHF propagation, and Barry's experience is a good proof of it.

The other issue Barry was worried about is the high frequency drift this device experiences with temperature. I think there is little to do here except taking care of good thermal insulation. I'm actually thinking of using the HX1 as a heat sink for the voltage regulator...

 

Monday, April 5, 2010

Source code is up!

You can find the source code of the APRS tracker here: http://code.google.com/p/trackuino/downloads/list

Current functionalty:
  • Reads GPS NMEA messages from Arduino pins 0 and 1 (serial RX/TX)
  • Outputs APRS position messages including latitude, longitude, altitude, course, speed and GPS time
  • Can connect to an SRB MX146 via pins 3/4 using I2C and interface with its controller to change frequency or read the temperature sensor.
  • Generates an AX.25 standard AFSK 1200 baud signal. The Arduino doesn't include a DAC, so analog signals must be generated by either using a resistor ladder or PWM. I chose the latter, since it involves less additional electronics.

Testing the SRB MX146

I just got an SRB MX146 module! It puts out 0.5 watts and operates on any frequency from 144 to 148 MHz. The frequency can be chosen from among a set of pre-programmed memories, or interfacing directly with the controller using I2C. Changing frequencies on-flight would allow transmitting position messages on the APRS frequency, then switch to a different frequency and send non-APRS data (real-time photos, for example).

This is my current set-up:


The rig

MX146 outputting 1/2W

LDO regulators


On the first picture:

  • An Arduino, the "brain" of the system. I use the internal UART to interface with the GPS and four pins for the radio, one carries an AFSK 1200 baud signal modulated with PWM, another controls the PTT, and two more for I2C.
  • The GPS (the little red board) is a Venus 634FLPx I got from here. It is supposed to work above 18 Km according to their datasheet. Plus, they have a very responsive tech support (I actually confirmed the CoCom limits with them). It fixes the position 5-30 seconds after a cold start, but you can feed it the ephemerides of the next 7 days and it will then fix in less than 5 secs. This is a 3.3 volts device, so it needs some kind of voltage conversion. The easiest and safest way to convert 5v to 3.3v is by using a diode as explained in this nice tutorial. The 3.3 volts don't need conversion back up to 5, since 3.3 volts is enough for the AVR chip to consider it a logical high.
  • On the breadboard, there is also a low-pass filter to get rid of the PWM high-pitch frequencies. PWM is done at the maximum rate allowed by the AVR's timer 2, ie. 62.5 KHz (16 MHz / 256), so this is probably not needed anyway.
  • The MX146 module is connected to the output of the LPF via a coupling capacitor and a voltage divider to bring the 5 volts off of the Arduino down to the 500mV peak-to-peak required by this device. The PTT is internally pulled-up to 3.3v by the MX146, so an open-collector transistor justs shorts it to ground on transmission.
  • Finally, I had to use three different regulators, since all 3 devices take different input voltages. In order to save some power, I used LDO regulators rather than the classic 78xx family. The LDOs usually require around 1-1.5 volts less than the matching 78xx, which means one less battery cell to lift!

 

Trash-digging at its finest: A 1:1.1 SWR VHF antenna for 2€

I followed these WA7YFF's instructions to build this fantastic 2m antenna using just a SO-239 panel-mount connector and 5 wire hangers I found in the trash around the neighborhood. I straightened the hangers with a vise, cut them for 144.8 MHz and mounted the radials overlapping with one another as suggested. I attached the radials to the connector with M3 screws and soldered the radiator to the center pin. The antenna looks very sturdy, and it's very easy to match the impedance of the transmitter by just bending the radials somewhere between 30-40 degrees. Click to zoom:


The end result is a great antenna with a 1:1.1 SWR at 5W. I have managed to reach a digipeater that is 36 Km away with my tracker and a SRB MX146 module that produces just 0.5 watts. I am at sea level, so it's not bad at all!

 

Monday, January 11, 2010

So... this is what I'm trying to do

Sending a balloon to the outer space is quite easy. The difficult part is to make sure that you can find it when it comes back, so the balloon must be constantly reporting its position. Extreme weather might cause malfunction to the electronics, so this is probably the hardest part.

For the tracking, I am planning on using an AVR microcontroller that modulates a standard AX.25 signal and sends it through a small VHF transmitter. Since I'm a licensed radio amateur, I can transmit in the European APRS frequency (144,800 MHz). The advantage to this is that the base station only requires standard amateur equipment (basically a 2m transceiver and a TNC or AGWPE). This also means others can help chase the balloon!

Currently I am in the phase of building the transceiver. I am evaluating Radiometrix's devices since they operate in amateur frequencies and have been used in similar projects before.

I am also waiting for an Arduino board to start developing the tracker software. The AVR will be responsible of reading GPS data, sending it to the TX module and other functions, such as triggering a cut-down mechanism in case the balloon never reaches its burst altitude.

The photo gear will be a Canon A570IS with CHDK and a variation of the intervalometer script, which instructs the camera to take pictures automatically every so often. Since the camera operates autonomously, there's no need to solder wires and trigger the switch externally. It's also less work for the "balloon brain" (the AVR) and less chances of failure (yes, recovering the camera only to find no pictures in it will be considered an absolute failure of the mission :)

The GPS receiver must be chosen carefully. The CoCom limits prevent GPS from being used with ballistic purposes, so all GPS receivers must stop reporting if they are over 18.000 ft. and move faster than 1000 knots. Unfortunately some manufacturers just shut down the device if either one happens. I am evaluating the Trimble Copernicus, which has been reported to work nicely over 18.000 ft.

I'll keep posting as I start getting things on my mail!

Warming up!

I am trying to send a camera to the stratosphere and take some photos from there. This looks like the next NASA mission but it's, in fact, something quite possible to achieve on a reasonable budget, some consumer electronics and a lot of planning. High altitude ballooning is not new. Weather stations launch them twice a day to gather data from different layers of the atmosphere. And a lot of amateurs do it just for the fun and the challenge of it. The view of the earth from 40 Km away is astonishing: you can see the curvature of the planet, a thin blue atmosphere, and a pitch dark sky. And since getting oneself there is quite difficult as of now, I am just sending a camera to get a picture and come back for me :)