Nada Labs

Copper Tree

by nada on May.09, 2010, under Projects

For Mothers Day this year I made an ornamental tree from copper wire. This post documents the steps that I took to build it.

(continue reading…)

Leave a Comment :, , more...

Converting a GeoRSS file to a Google Earth kml

by nada on May.04, 2010, under Hacks, Software

I had a need to convert GeoRSS files used with iMapPlot to a Google Earth kml which I accomplished with the following shell script. It’s ulgy but gets the job done. The script can also be downloaded: rss_process.zip

#!/bin/bash
infile=$1
outfile=`echo $infile | sed -e 's/\.xml/.kml/'`
grep -E '^<(title|description|georss\:(point|line)|link)>(.*)</\1>' "$infile" | sed -r -e 's/(-?[0-9]{2,3}\.[0-9]{1,}) (-?[0-9]{2,3}\.[0-9]{1,})/\2,\1,0/g' -e 's|<(title)>(.*)</\1>|\t<Placemark>\n\t\t<name>\2</name>|' -e 's|<(georss:point)>(.*),(.*),0</\1>|\t\t<LookAt>\n\t\t\t<longitude>\2</longitude>\n\t\t\t<latitude>\3</latitude>\n\t\t\t<altitude>0</altitude>\n\t\t\t<range>500</range>\n\t\t\t<tilt>0</tilt>\n\t\t\t<heading>0</heading>\n\t\t</LookAt>\n\t\t<Point>\n\t\t\t<coordinates>\2,\3,0</coordinates>\n\t\t</Point>\n\t</Placemark>|' -e 's|<(georss:line)>(.*)</\1>|\t\t<LineString>\n\t\t\t<tessellate>1</tessellate>\n\t\t\t<coordinates>\2</coordinates>\n\t\t</LineString>\n\t</Placemark>|' -e '1 s|.*<Placemark>|<?xml version="1.0" encoding="UTF-8" ?>\n<kml xmlns="http://www.opengis.net/kml/2.2">\n<Document>\n|' -e '$ s|(.*)|\1\n</Document>\n</kml>|' -e 's|<(link)>(http://.*)</\1>|<description><a href="\2">\2</a></description>|' | sed -r -e '/<\/description>/ {
N
/\n.*<description>/ {
s/<\/(description)>.*\n.*<\1>//
}
}' | sed -r -e 's|<(description)>(.*)</\1>|<\1><![CDATA[\2]]></\1>|' > "$outfile"

An attempted explaination

The grep command only grabs the tags from the RSS file that we are interested in.

The first sed statement 's/(-?[0-9]{2,3}\.[0-9]{1,}) (-?[0-9]{2,3}\.[0-9]{1,})/\2,\1,0/g' finds two sets of numbers seperated by a space and swaps their order while seperating them with a space and appending ,0. This converts the ‘latitude longitude’ coordinates into ‘longitude,latitude,altitude’ as used by Google Earth.

The second statement converts the title block into a Placemark and name block.

The third formats a point placemark, providing look at information while the fourth converts a line placemark.

The fifth inserts the kml header while the sixth inserts the kml footer.

The seventh sed statement converts a link block into a description block with a HTML link in it.

The second sed command merges two description blocks into one by removing the first close block and the second open block.

sed -r -e '/<\/description>/ {
N
/\n.*<description>/ {
s/<\/(description)>.*\n.*<\1>//
}
}'

This is accomplished by looking for the </description> block and loading in the next line if it is found. The next line is then checked for the <description> tag and if found a replacement is performed removing the two tags and any characters in between.

The third sed command wraps the description in a CDATA block to allow HTML to be included in the description.

Leave a Comment :, , , , more...

Curtains for the Crusier

by nada on Apr.16, 2010, under Landcruiser, Projects

As I travel around Australia I will need to be able to sleep in the ‘cruiser and store items in it out of sight so I made some curtains to cover the 4 side windows, the 2 back windows and to divide the front and back. Thinking about how to mount the curtains (continue reading…)

Leave a Comment :, , , more...

Introducing the Landcruiser

by nada on Apr.09, 2010, under Landcruiser

I purchased a 1995 Toyota Landcruiser HZJ75 Troopcarrier with the intent of decking it out to travel around Australia beginning June/July 2010. This particular one I found through the Quokka with almost 400,000km on the clock with a new engine 120,000km ago, rebuilt gearbox and various other work done to it. It’s a stanard straight 6 4.2L Diesel and still has the bench seats in it.

My Landcruiser Troopy (continue reading…)

Leave a Comment : more...

GPS Logger VI – PCB Layout and Case

by nada on Apr.06, 2010, under GPS Logger, Projects

Progress has been made on the GPS Logger over the last month. A sutiable case for the project was purchased, components ordered from Mouser and the circuit board designed. Once the component footprints have been checked off the design will be sent to BatchPCB for manufacture.

PCB Artwork for the GPS Logger

(continue reading…)

Leave a Comment :, , , , more...

GPS Logger V – Full hardware

by nada on Mar.05, 2010, under GPS Logger, Projects

Having determined the battery and power requirements, a full schematic of the GPS logger was made. Buck regulators and Li-Ion battery chargers were investigated from a variety of manufacturers. The TC105 3.3V Buck regulator and the MCP73863 4.2V Li-Ion battery charger, both from Microchip, were chosen to provide the power needs for the project. The circuit is capable of detecting if a USB port is a Charging Port and adjusting the battery charge current to suit.

GPS Logger Schematic implementing battery charging and USB Charger Port Detection

(continue reading…)

Leave a Comment :, , , , , more...

GPS Logger IV – Power and Batteries

by nada on Mar.03, 2010, under GPS Logger, Projects

The prototype is at the stage of being able to successfully achieve GPS lock, log the received coordinates, waypoints and go to sleep. The power usage of the system needed to be analysed in order to specify the battery requirements. The current draw was monitored after the 3.3V regulator as the device was put into its various modes.

Looking at the current draw of the PIC, SD Card and GPS receiver (continue reading…)

Leave a Comment :, , , , more...

GPS Logger III – NMEA Processing

by nada on Feb.20, 2010, under GPS Logger, Projects

The GPS Logger is currently able to access files and directories on a FAT16 filesystem, contained on a SD card. This post covers processing NMEA with a finite state machine and some of the problems encountered so far with the logger. (continue reading…)

Leave a Comment :, more...

Using the BusPirate with a SD card

by nada on Feb.11, 2010, under Hacks, Hardware

As part of my GPS Logger project I needed to make sure that I could initialise and talk to a SD card over a SPI bus. The BusPirate is an excellent tool for testing  the physical and datalink layers. All parameters can be checked and adjusted on the fly without having to write any code. When the time comes to write code for the GPS logger, it will work first time as all the kinks and quirks were quickly worked out with the BusPirate.

This post covers SPI bus setup, card initialisation, reading and writing individual sectors.

BusPirate and a SD card, together at last

(continue reading…)

2 Comments :, more...

GPS Logger II – GPS Interfacing

by nada on Feb.10, 2010, under GPS Logger, Projects

The system is now up and running. It is capable of communicating with the GPS receiver to get it into a known protocol (NMEA) and baud rate from an arbitrary starting configuration. I had to determine the pinout for the receiver as it was a USB GPS receiver. A check with the multimeter quickly identified the pinout of the four wires, TX was easy to spot as it was a constantly changing voltage whereas RX only changed when a command was sent. Once the prototyping is finished the USB receiver will be restored to its former glory. A few challenges were involved in figuring out the receivers startup configuration. It looks like at reset it outputs NMEA at 4800 baud but expects to receive NMEA configuration commands at 9600. This ‘interesting’ configuration was overcome by sending NMEA and SiRF configuration commands to the receiver at all supported baud rates. (continue reading…)

Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...