Pegasus IV

Pegasus IV was never launched, it had random errors right up until launch and it was decided that it was too risky to launch. The flight computer then returned to its day job as a router. Perhaps one day…

Step 0 - The theory

Basically we need a device that will take its position from a gps module, log it and then format it and then send it via sms back to us therefore informing us of its location allowing retrieval.

GPS —> Flight Computer —→ Mobile Phone - - - - > Us

This device will be put into a payload box (probably made out of polystyrene) with a paracute and attached to a totex weather balloon and launched. The flight computer will also need to have a way of triggering a camera to take pictures at particular intervals (though a seperate circuit could be used that would require assembly etc.

Instead of the phone you could use a 434 mhz 10mW transmiter which would allow you to maintain contact through out the flight, see here.

Step 1 - Gathering parts

The plan is to use a a linux based wireless router that is supported by OpenWrt (http://wiki.openwrt.org/TableOfHardware/) In theory you can use anyone of the routers that has 2 available serial ports. The two serial ports will be for the gps and also to connect to the mobile phone. There are a few other mods that can be added such as using the GPIOs to trigger cameras and even added an i2c bus therefore allowing a whole range of applications.

Parts list

  • OpenWrt compatible router with 2 serial ports - I'm going to use Motorola WR850G router which I got off ebay for £15 + £5 p&p. The one i'm getting is v2 (thankfully the ebay advert said this). All versions of the WR850G will work apart from v1 which doesn't actually have any onboard UARTs which makes it very hard to actually build a serial port (beyond this project). The WR850G has a Broadcom 4712 @ 200MHz, 4Mb of flash and 16mb of ram. It also has (unsuprisingly) a wireless card (which we'll use later :-D) and 4 network ports which I'm uncertain of what they could be easily used for (might have to be turned off to reduce power consumption.
  • TTL GPS module - I'm using a Rockwell Jupiter GPS module which I got off ebay (seeing a trend?) for £10.00 + £1.99 p&p. Most GPS modules these days are usb (which we can't use) or serial - serial could work but it would require the production of a small circuit to change the voltage levels which is a bit of extra work and also a waste of power. TTL GPS module runs at the same level as the router and therefore allows us to skip conversion. This will be attached to one of the serial ports.For more info see here
  • MCX GPS antenna - the gps module I'm using has a MCX socket to add an aerial to which I'll need to purchase - they are about £5.
  • Nokia Serial Data Cable - £2.25 + £1.99 p&p. This actually allows you to connect a mobile phone to a computer with the conversion circuitry in the cable itself. As we are using the TTL voltage levels of the router we don't need this (the phone also runs at TTL) so the plan will to remove this and directly wire up. The actually reason for getting the cable is for the phone connector bit.
  • Nokia 5110 (or compatible) with sim card - This one i'm not going to buy but instead use one of the ones at home. They can be got off ebay for about £10 and a couple more pounds for the sim card.
  • Batteries - Not sure how many batteries will be required - will look into this further into the project.
  • Other parts:
    • Camera - triggered by GPIO
    • Parachute
    • Balloon
    • Helium

Most of these parts have been ordered off ebay so will put some pictures up when they arrive and then start to work on step 2 - installing OpenWrt.

Step 2 - Installing OpenWrt (8/11/06)

Well my Motoroloa WR850G arrived today so first i took a few pictures:

Connected by ethernet to my laptop running the motorola firmware, here

Removing the only scew, here

Disassembled here

Serial Port 1 location (ttyS0) here

Serial Port 2 location (ttyS1) on bottom of the board, RR93 (tx) and RR94 (rx) here For more infomation about which pins do what see here (Section 5.2)

Reflashing using the motorola interface here

Right so this is how to do it:

  • Plug in the router and connect a ethernet cable between port 1 and your computer, you should then change your ip address to something like 192.168.10.2 and therefore be able to ping the router (if its the same as this one, if not check the OpenWrt site) which has a default address of 192.168.10.1
  • Go to http://www.openwrt.org and get the correct firmware - I used openwrt-wr850g-squashfs.bin.
  • Rename it to *.trx
  • Login in to the router (http://192.168.10.1 in a web browser) and then got to control panel, firmware update, browse and select the openwrt image.
  • It should then upload and reflash the router - follow the instructions.
  • It'll restart and then after a bit of time you should be able to refresh your browser and get the OpenWrt web interface - from here you should set the password
  • Once the password has been set its now possible to ssh in to the router and do what every you want: ssh root@192.168.10.2 and the password will be what you set up in the web based interface.
  • Done!

You now have a router that has an easily customised version of linux running. Take some time to explore the system both the web based interface and also ssh. E.g. running df -h will show you how much space is left:

root@OpenWrt:~# df -h
Filesystem 	Size 	Used 	Available 	Use% 	Mounted on
/dev/root 	896.0k 	896.0k 	0 	100% 	/rom
none 	7.0M 	116.0k 	6.9M 	2% 	/tmp
/dev/mtdblock/4 	2.3M 	752.0K 	1.5M 	33% 	/jffs
/jffs 	896.0k 	896.0k 	0 	100% 	/

What i've done as I only have one ethernet port (which is used for my internet) is to set up my wireless connection to the router. This was pretty simple as the stock OpenWrt runs a dhcp server so you with a bit of fiddling it should be easy!

Step 3 - Adding Nokia 5110 (18/11/06)

I decided to start by adding the mobile phone interface to the router. Firstly I removed the DB9 serial connector from the data cable i had bought. Inside there should be three wires, Txd, Rxd and GND which I identfied by carefully opening up the actually phone connector and recording which pins attach to the wires. I compared this to this pinout here to work out what does what. I then soldered the appropriate wires to correct holes on the first serial port (picture here and pinout here)

Remember that TX on the router wants to go to RX on the phone and so on!

Now that the cable is connected its a matter of sorting out the software part. We are going to use gnokii and convinently there are binaries available. First you will need libusb which you can download here and then gnokii can be downloaded from here. Getting them onto the router isn't to difficult - I used scp to copy them to /jffs (writeable partion) so for example:

scp gnokii_0.6.14-1_mipsel.ipl root@192.168.10.1:/jffs/gnokii_0.6.14-1_mipsel.ipl

On the router to install all thats required is:

ipkg install /jffs/gnokii_0.6.14-1_mipsel.ipl

Next step is to move the console from being on the first serial port as it messes around with communication with the phone. Firstly makesure that you can easily access the router by either wireless or ethernet. I then changed the file /etc/inittab to use tts/1 rather then tts/0 - it will eventually change as tts/1 is for gps but for now this allows us to rescue via the 2nd serial port.

Now its necessary to find or write a gnokii config file which resides in /etc/gnokiirc, for example:

[global]

port = /dev/tts/0

model = 5110

initlength = default

connection = serial

bindir = /usr/local/sbin/

Now everything should be set up so turn on the phone and then type:

gnokii –identify

If everything has been correctly set up it should easily identify your phone.

Picture here

Step 4 - Adding GPS (17/25/06)

While trawling ebay I came across a batch of £10 Jupiter OEM GPS units so I quickly bought one. Conveniently there is an excellent site that details exactly how to set it up: Rockwell Jupiter GPS module. The first step was to get the correct socket for the 2mm pitch header - luckly rocketboy was getting some so he ordered me two 1×10 and then stuck them together.

First I connected the correct cables up, attached it to a 4.5v powersupply and attached an LED between Tx and Gnd and watched it flicker with what i assumed were the NMEA sentences being transmitted. Next it was necessary to connect it to the second serial port on the router, this is quite hidden as described earlier Rx is at RR94 and is the pad closest to the network switch rather then all the led lights. I soldered the Tx wire from the gps to here and also added a common ground (used one of exposed point where the screws go).

It was next necessary to set up the serial port, firstly I had to comment out the line in inittab which was running the console through /dev/tts/1 (second serial port) (I had changed this from the first serial port when I added the phone, it does mean no that there is no console access but wireless is working so well i'm not to worried. - could perhaps added a bit of code that after a while it reverts the console back onto one of the serial ports). Some software is necessary, setserial (here) and stty (here, its a gzipped binary which will need to be moved to /jffs/ and also its permission changed chmod 777 stty will do) Next it was necessary to give the serial port an IRQ value with the command:

setserial /dev/tts/1 irq 3

Next the speed of the port needs to be set: stty -F /dev/tts/1 speed 4800

Might as well have these commands run at boot so a script in /jffs/etc/init.d/ called S99custom and containing:

#!/bin/sh

setserial /dev/tts/1 irq 3

stty -F /dev/tts/1 speed 4800

If all goes well it you

cat /dev/tts/1

Magically NMEA strings will appear on your console!

Will post pictures later.

Step 5 - Power Supply (22/12/06)

First it was necessary to work out what power would be required. It seems that the 850g router only requires more then 5v so the plan is to use 4xAA lithiums (total = 6v) however this needs to be tested - I constructed a custom power connector which is able to easily attach to a 4 pack of AAs. A couple of test have shown that with wireless the router draws 0.30A and with it turned off 0.24A - It ran for 3.5 hours on 4 AA Nimh batteries so should run for longer on lithiums.

The GPS unit requires more then 4.5v so I'm going to also power this with 4 lithiums however AAAs should be sufficient and also will save on weight. There is also a 9v battery which powers both the camera trigger circuit and also the cutdown device.

The phone and the camera have their own batteries.

Step 6 - Flight Case

Thanks to my sister for my birthday I now have a glue gun and therefore a way of glueing polystyrene. The flight case is therefore made out of two ends of scrap packaging glued together with some addition hollowing out. The lid is a different piece of polystyrene. While the glue appears to be very strong the case will also be reinforced with duct tape and also held together by the payload velcro straps.

Step 7 - Camera

The Samsung Digimax S600 is a 6MP camera (with a 512mb card and running on 2 AA lithiums) and unhelpfully requires the shutter button to be half depressed to focus. I've constructed a circuit out of a DPDT relay and a 555 timer which when is triggered by a gpio from the router activates the focus and then the shutter to take a picture - this runs of a 9v battery which is shared with the cutdown device. To tell the truth I've rather lost track of how exactly it works but as the saying goes if it ain't broke…

Step 8 - Software

I'll add more to this later but this is the basic system:

  • GPS comes in at /dev/tts/1 and is parsed by a NMEA parser written in perl (microperl is the binary)
  • The parser logs this to a file every 10 seconds
  • A shell script using tail passes the coords to gnokii which sends it by text message

Other bits of software include a perl script that will record the network info, signal strength and mobile phone battery strength every few minutes, camera trigger (every 120 seconds), cutdown parameters (compares long and lat to predetermined square - if outside cut down (still to be written)).

 
missions/pegasus4.txt · Last modified: 2008/08/19 08:53 by jamescoxon
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki