<?xml version="1.0" encoding="windows-1252"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Blogging Protagonist &#187; General</title>
	<atom:link href="http://www.SWHarden.com/blog/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.SWHarden.com/blog</link>
	<description>A collection of thoughts in technological degradation</description>
	<lastBuildDate>Tue, 27 Jul 2010 21:45:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Idea: vdFSK modulation</title>
		<link>http://www.SWHarden.com/blog/2010-07-22-idea-vdfsk-modulation/</link>
		<comments>http://www.SWHarden.com/blog/2010-07-22-idea-vdfsk-modulation/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 17:39:54 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.SWHarden.com/blog/?p=2350</guid>
		<description><![CDATA[My goal is to create a QRPP (extremely low power) transmitter and modulation method to send QRSS (extremely slow, frequency shifting data) efficiently, able to be decoded visually or with automated image analysis software. This evolving post will document the thought process and development behind AJ4VD&#8217;s Frequency Shift Keying method, vdFSK.
Briefly, this is what my [...]]]></description>
			<content:encoded><![CDATA[<p><table><tr><td style="text-indent: 25px; background-color: #E5E5E5; padding: 10px; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 7px;border-top-style: solid; border-right-style: solid;border-bottom-style: solid;border-left-style: solid;border-top-color: #B5B5B5; border-right-color: #B5B5B5;border-bottom-color: #B5B5B5; border-left-color: #B5B5B5;border-right-width: 1px;background-image: url(http://www.swharden.com/graphics/layout_2006_08_12/quotes.jpg); background-position: left top; background-repeat: no-repeat;">My goal is to create a QRPP (extremely low power) transmitter and modulation method to send QRSS (extremely slow, frequency shifting data) efficiently, able to be decoded visually or with automated image analysis software. This evolving post will document the thought process and development behind AJ4VD&#8217;s Frequency Shift Keying method, <b>vdFSK</b>.</td></tr></table></p>
<p><b>Briefly, this is what my idea is.</b> Rather than standard 2-frequencies (low for space, high for tone) QRSS3 (3 seconds per dot), I eliminate the need for pauses between dots by using 3 frequencies (low for a space between letters, medium for dot, high for dash). The following images compare my call sign (AJ4VD) being sent with the old method, and the vdFSK method.</p>
<p><b>Traditional QRSS:</b><br />
<a href="http://www.SWHarden.com/blog/images/traditional.PNG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/traditional-525x65.PNG" alt="traditional" title="traditional" width="525" height="65" class="alignleft size-medium wp-image-2352" /></a></p>
<p><b>Again,</b> both of these images say the same thing: AJ4VD, (.- .&#8212; &#8230;.- &#8230;- -..). However, note that the above image has greater than a 3 second dot, so it&#8217;s unfairly long if you look at the time scale.  Until I get a more fairly representative image, just appreciate it graphically. It&#8217;s obviously faster to send 3 frequencies rather than two.  In my case, it&#8217;s over 200% faster.</p>
<p><b>vdFSK method:</b><br />
<a href="http://www.SWHarden.com/blog/images/modulation.png" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/modulation.png" alt="modulation" title="modulation" width="350" height="156" class="alignleft size-full wp-image-2351" /></a></p>
<p><b>This is the code to generate audio files</b> converting a string of text into vdFSK audio, saving the output as a WAV file. Spectrographs can be created from these WAV files.</p>
<pre class="prettyprint python">
### generate_audio.py ###
# converts a string into vdFSK audio saved as a WAV file

import numpy
import wave
from morse import *

def makeTone(freq,duration=1,samplerate=5000,shape=True):
    signal = numpy.arange(duration*samplerate)/float(samplerate)*float(freq)*3.14*2
    signal = numpy.sin(signal)*16384
    if shape==True: #soften edges
        for i in range(100):
            signal[i]=signal[i]*(i/100.0)
            signal[-i]=signal[-i]*(i/100.0)
    ssignal=''
    for i in range(len(signal)): #make it binary
        ssignal += wave.struct.pack('h',signal[i])
    return ssignal

def text2tone(msg,base=800,sep=5):
    audio=''
    mult=3 #secs per beep
    msg=" "+msg+" "
    for char in msg.lower():
        morse=lookup[char]
        print char, morse
        audio+=makeTone(base,mult)
        for step in lookup[char]:
            if step[0]==".":
                audio+=makeTone(base+sep,int(step[1])*mult)
            if step[0]=="-":
                audio+=makeTone(base+sep*2,int(step[1])*mult)
            if step[0]=="|":
                audio+=makeTone(base,3*mult)
    return audio

msg="aj4vd"
file=wave.open('test.wav', 'wb')
file.setparams((1, 2, 5000, 5000*4, 'NONE', 'noncompressed'))
file.writeframes(text2tone(msg))
file.close()

print 'file written'
</pre>
<p>And the other file needed&#8230;</p>
<pre class="prettyprint python">
### morse.py ###
# library for converting between text and Morse code
raw_lookup="""
a.- b-... c-.-. d-.. e. f..-. g--. h.... i.. j.--- k-- l.-.. m--
n-. o--- p.--. q--.- r.-. s... t- u.- v...- w.-- x-..- y-.-- z--..
0----- 1.---- 2..--- 3...-- 4....- 5..... 6-.... 7--... 8---.. 9----.
..-.-.- =-...- :---... ,--..-- /-..-. --....-
""".replace("\n","").split(" ")

lookup={}
lookup[" "]=["|1"]
for char in raw_lookup:
    """This is a silly way to do it, but it works."""
    char,code=char[0],char[1:]
    code=code.replace("-----","x15 ")
    code=code.replace("----","x14 ")
    code=code.replace("---","x13 ")
    code=code.replace("--","x12 ")
    code=code.replace("-","x11 ")
    code=code.replace(".....","x05 ")
    code=code.replace("....","x04 ")
    code=code.replace("...","x03 ")
    code=code.replace("..","x02 ")
    code=code.replace(".","x01 ")
    code=code.replace("x0",'.')
    code=code.replace("x1",'-')
    code=code.split(" ")[:-1]
    #print char,code
    lookup[char]=code
</pre>
<p><b>Automated decoding</b> is trivial. The image above was analyzed, turned into the image below, and the string (AJ4VD) was extracted:<br />
<a href="http://www.SWHarden.com/blog/images/produced.PNG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/produced.PNG" alt="produced" title="produced" width="300" height="100" class="alignleft size-full wp-image-2359" /></a></p>
<p><b>The code to do this:</b></p>
<pre class="prettyprint python">
### decode.py ###
# given an image, it finds peaks and pulls data out
from PIL import Image
from PIL import ImageDraw
import pylab
import numpy

pixelSeek=10
pixelShift=15

def findPeak(data):
	maxVal=0
	maxX=0
	for x in range(len(data)):
		if data[x]&gt;maxVal:
			maxVal,maxX=data[x],x
	return maxX

def peaks2morse(peaks):
	baseFreq=peaks[0]
	lastSignal=peaks[0]
	lastChange=0
	directions=[]
	for i in range(len(peaks)):
		if abs(peaks[i]-baseFreq)&lt;pixelSeek:
			baseFreq=peaks[i]
		if abs(peaks[i]-lastSignal)&lt;pixelSeek and i&lt;len(peaks)-1:
			lastChange+=1
		else:
			if abs(baseFreq-lastSignal)&lt;pixelSeek:c=" "
			if abs(baseFreq-lastSignal)&lt;pixelSeek:c=" "
			if abs(baseFreq-lastSignal)&lt;pixelSeek:c=" "
			directions.append([lastSignal,lastChange,baseFreq,baseFreq-lastSignal])
			lastChange=0
		lastSignal=peaks[i]
	return directions

def morse2image(directions):
	im=Image.new("L",(300,100),0)
	draw = ImageDraw.Draw(im)
	lastx=0
	for d in directions:
		print d
		draw.line((lastx,d[0],lastx+d[1],d[0]), width=5,fill=255)
		lastx=lastx+d[1]
	im.show()

im=Image.open('raw.png')
pix=im.load()
data=numpy.zeros(im.size)
for x in range(im.size[0]):
	for y in range(im.size[1]):
		data[x][y]=pix[x,y]

peaks=[]
for i in range(im.size[0]):
	peaks.append(findPeak(data[i]))

morse=peaks2morse(peaks)
morse2image(morse)
print morse
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.SWHarden.com/blog/2010-07-22-idea-vdfsk-modulation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>High Altitude Balloon Transmitter</title>
		<link>http://www.SWHarden.com/blog/2010-07-14-high-altitude-balloon-transmitter/</link>
		<comments>http://www.SWHarden.com/blog/2010-07-14-high-altitude-balloon-transmitter/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 13:05:46 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Circuitry]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[Radio]]></category>

		<guid isPermaLink="false">http://www.SWHarden.com/blog/?p=2283</guid>
		<description><![CDATA[SUMMARY: A small group of high school students taking an AP class for college credit launched a high-altitude weather balloon with a small payload.  In addition to a video transmitter and GPS transmitter, they decided to include a simple transmitter built from scratch.  This is the story of the project, with emphasis on [...]]]></description>
			<content:encoded><![CDATA[<p><table><tr><td style="text-indent: 25px; background-color: #E5E5E5; padding: 10px; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 7px;border-top-style: solid; border-right-style: solid;border-bottom-style: solid;border-left-style: solid;border-top-color: #B5B5B5; border-right-color: #B5B5B5;border-bottom-color: #B5B5B5; border-left-color: #B5B5B5;border-right-width: 1px;background-image: url(http://www.swharden.com/graphics/layout_2006_08_12/quotes.jpg); background-position: left top; background-repeat: no-repeat;"><b>SUMMARY:</b> A small group of high school students taking an AP class for college credit launched a high-altitude weather balloon with a small payload.  In addition to a video transmitter and GPS transmitter, they decided to include a simple transmitter built from scratch.  This is the story of the project, with emphasis on the simple transmitter&#8217;s design, construction, implementation, and reception (which surprised me, being detected ~200 miles away and lasting the entire duration of the flight!) [<a href='http://www.SWHarden.com/blog/images/beeps.ogg'>sample.ogg</a>]</td></tr></table></p>
<h1>6/16/2010 &#8211; TRACKING</h1>
<p><b>I&#8217;m completely amazed</b> at how well the transmitter/receiver worked!  For only a few milliwatts, I was able to track that thing all the way from takeoff to landing in Gainesville, FL a few hundred miles away. Here is the data assembled in a special, annotated way!</p>
<p><a href="http://swharden.com/tmp/balloon/view2.html">CLICK HERE to view the signal tracked from Gainesville, FL<br />
<img src="http://www.SWHarden.com/blog/images/balloon_track-525x613.jpg" alt="balloon_track" title="balloon_track" width="525" height="613" class="alignleft size-medium wp-image-2345" /></a></p>
<p><b>ANALYSIS:</b> the text on the image describes most if it, but one of the most interesting features is the &#8220;multipathing&#8221; during the final moments of the descent, where the single carrier signal splits into two.  I believe this is due to two Doppler shifts: (1) as the distance between the falling transmitter and the receiver is decreasing, producing a slight in increase in frequency, and (2) a signal reflected off of a layer of the atmosphere above the craft (the ionosphere?) before it gets to the receiver, the distance of which is increasing as the craft falls, producing a decrease in frequency. I&#8217;ll bet I can mathematically work backwards and determine how high the craft was, how fast it was falling, and/or how high the layer of the reflecting material is &#8211; but that&#8217;s more work than this dental student is prepared to do before his morning coffee!</p>
<p><b>HERE IS SOME AUDIO</b> of some of the strongest signals I received. Pretty good for a few milliwatts a hundred miles away! [<a href='http://www.SWHarden.com/blog/images/beeps.ogg'>beeps.ogg</a>]</p>
<h1>6/16/2010 &#8211; THE FLIGHT</h1>
<p><b>The launch:</b><br />
<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/qjLrytsDPjw&amp;hl=en_US&amp;fs=1?color1=0x006699&amp;color2=0x54abd6"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/qjLrytsDPjw&amp;hl=en_US&amp;fs=1?color1=0x006699&amp;color2=0x54abd6" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p><b>This is the design team:</b><br /><a href="http://www.SWHarden.com/blog/images/DSC_7127.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7127-525x306.jpg" alt="DSC_7127" title="DSC_7127" width="525" height="306" class="alignleft size-medium wp-image-2334" /></a></p>
<p><b>Walking the balloon</b> to its launch destination at NASA with an awesome rocket (Saturn 1B &#8211; identified by Lee, KU4OS) in the background.<br /><a href="http://www.SWHarden.com/blog/images/DSC_7210.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7210-525x348.jpg" alt="DSC_7210" title="DSC_7210" width="525" height="348" class="alignleft size-medium wp-image-2335" /></a></p>
<p><b>The team</b> again, getting ready for launch.  I&#8217;ve been informed that the reason their hands are up is to prevent the balloon from tilting over too much.  I&#8217;d imagine that a brush with a grass blade could be bad news for the project!<br />
<a href="http://www.SWHarden.com/blog/images/DSC_7232.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7232-525x382.jpg" alt="DSC_7232" title="DSC_7232" width="525" height="382" class="alignleft size-medium wp-image-2336" /></a></p>
<p><b>Last minute checks</b> &#8211; you can see the transmitter and battery holders for it taped to the Styrofoam.<br />
<a href="http://www.SWHarden.com/blog/images/DSC_7248.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7248-525x348.jpg" alt="DSC_7248" title="DSC_7248" width="525" height="348" class="alignleft size-medium wp-image-2337" /></a></p>
<p><b>The transmitter in its final position.</b> Note the coil of yellow wire.  That serves as a rudimentary &#8220;ground&#8221; for the antenna&#8217;s signal to push off of.  I wasn&#8217;t very clear on my instructions on how to make it.  I meant that it should be a huge coil wrapped around the entire payload (as large as it can be), which would have probably produced a better signal, but since I was able to capture the signal during the whole flight it turned out to be a non-issue.<br />
<a href="http://www.SWHarden.com/blog/images/DSC_7250.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7250-525x348.jpg" alt="DSC_7250" title="DSC_7250" width="525" height="348" class="alignleft size-medium wp-image-2338" /></a></p>
<p><b>The antenna</b> can be seen dropping down as a yellow wire beneath the payload. (arrow)<br />
<a href="http://www.SWHarden.com/blog/images/DSC_7253.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7253-525x348.jpg" alt="DSC_7253" title="DSC_7253" width="525" height="348" class="alignleft size-medium wp-image-2339" /></a></p>
<p><b>Awesome photo.</b><br />
<a href="http://www.SWHarden.com/blog/images/DSC_7279.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7279-525x113.jpg" alt="DSC_7279" title="DSC_7279" width="525" height="113" class="alignleft size-medium wp-image-2340" /></a></p>
<p><b>Launch!</b> Look how fast that balloon is rising!<br />
<a href="http://www.SWHarden.com/blog/images/DSC_7294.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7294-525x264.jpg" alt="DSC_7294" title="DSC_7294" width="525" height="264" class="alignleft size-medium wp-image-2341" /></a></p>
<p><b>It&#8217;s out of our hands</b> now.  When I got the text message that it launched, I held my breath.  I was skeptical that the transmitter would even work!<br />
<a href="http://www.SWHa rden.com/blog/images/DSC_7297.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHa rden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7297-525x423.jpg" alt="DSC_7297" title="DSC_7297" width="525" height="423" class="alignleft size-medium wp-image-2342" /></a></p>
<p><b>One of the students</b> listening to my transmitter with QRSS VD software (score!)<br />
<a href="http://www.SWHarden.com/blog/images/DSC_7365.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7365-525x348.jpg" alt="DSC_7365" title="DSC_7365" width="525" height="348" class="alignleft size-medium wp-image-2333" /></a></p>
<p><b>Video capture</b> from an on-board camera was also attempted (900MHz), but from what I hear it didn&#8217;t function well for very long.<br />
<a href="http://www.SWHarden.com/blog/images/DSC_7334.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7334-525x348.jpg" alt="DSC_7334" title="DSC_7334" width="525" height="348" class="alignleft size-medium wp-image-2343" /></a></p>
<h1>6/15/2010 &#8211; IMPROVED BUILD</h1>
<p><b>Here you can see me</b> (center arrow) showing the students how to receive the Morse code signal sent from the small transmitter (left arrow) using a laptop running <a href="http://www.swharden.com/blog/qrss_vd/" >QRSS VD (my software)</a> analyzing audio from and an Icom706 mkII radio receiver attached to a dipole (right arrow).<a href="http://www.SWHarden.com/blog/images/DSC_7082.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSC_7082-525x348.jpg" alt="DSC_7082" title="DSC_7082" width="525" height="348" class="alignleft size-medium wp-image-2332" /></a></p>
<p><b>I amped-up the output of the oscillator</b> using an octal buffer chip (74HC240) with some decent results. I&#8217;m pleased!  It&#8217;s not perfect (it&#8217;s noisy as heck) but it should be functional for a 2 hour flight.<br />
<a href="http://www.SWHarden.com/blog/images/72hc240_qrp_amplifier.jpg" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/72hc240_qrp_amplifier-525x535.jpg" alt="72hc240_qrp_amplifier" title="72hc240_qrp_amplifier" width="525" height="535" class="alignleft size-medium wp-image-2344" /></a></p>
<p>Closeup of the transmitter showing the oscillator at 29.4912 MHz, the Atmel ATTiny44a AVR microcontroller (left chip), octal buffer 74HC240 (right chip), and some status lights which blink as the code is executed.<a href="http://www.SWHarden.com/blog/images/01_closeup.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/01_closeup-525x393.jpg" alt="01_closeup" title="01_closeup" width="525" height="393" class="alignleft size-medium wp-image-2293" /></a></p>
<p><b>This is my desk</b> where I work from home. Note the styrofoam box in the background &#8211; that&#8217;s where my low-power transmitter lives (the one that&#8217;s spotted around the world).  All I needed to build this device was a soldering iron. <a href="http://www.SWHarden.com/blog/images/02_workstation.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/02_workstation-525x393.jpg" alt="02_workstation" title="02_workstation" width="525" height="393" class="alignleft size-medium wp-image-2294" /></a></p>
<p><b>Although I had a radio,</b> it is not capable of receiving 29MHz so I was unable to test the transmitter from home.  I had to take it to the university to assess its transmitting capabilities.<a href="http://www.SWHarden.com/blog/images/03_room.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/03_room-525x393.jpg" alt="03_room" title="03_room" width="525" height="393" class="alignleft size-medium wp-image-2295" /></a></p>
<p><b>At UF I used an oscilloscope to measure the waveform of the transmitter.</b> <a href="http://www.SWHarden.com/blog/images/04_measure.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/04_measure-525x393.jpg" alt="04_measure" title="04_measure" width="525" height="393" class="alignleft size-medium wp-image-2296" /></a></p>
<p><b>I connected the leads to the output of the transmitter, shorted by a 39ohm resistor.</b>  By measuring the peak-to-peak voltage of the signal going into a resistor, we can measure its power.<a href="http://www.SWHarden.com/blog/images/04_measure2.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/04_measure2-525x393.jpg" alt="04_measure2" title="04_measure2" width="525" height="393" class="alignleft size-medium wp-image-2297" /></a></p>
<p><b>Here&#8217;s the test setup.</b> The transmitter is on the blue pad on the right, and the waveform can be seen on the oscilloscope on the upper left.<a href="http://www.SWHarden.com/blog/images/05_lab.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/05_lab-525x393.jpg" alt="05_lab" title="05_lab" width="525" height="393" class="alignleft size-medium wp-image-2298" /></a></p>
<p><b>Here&#8217;s a closer view.</b><br /><a href="http://www.SWHarden.com/blog/images/06_scope.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/06_scope-525x393.jpg" alt="06_scope" title="06_scope" width="525" height="393" class="alignleft size-medium wp-image-2299" /></a></p>
<p><b>With the amplifier off</b>, the output power is just that of the oscillator.  Although the wave should look like a sine wave, it&#8217;s noisy, and simply does not.  While this is unacceptable if our goal is a clean radio signal with maximum efficiency, this is good enough to be heard at our target frequency.  The PPV (peak-to-peak voltage) as seen on the screen is about 100mV.  Since I&#8217;m using a x10 probe, this value should be multiplied by 10 = 1V.  1V PPV into 39 ohms is about <b>3 milliwatts!</b> ((1/(2*2^.5))^2/39*1000=3.2). For the math, see <a href="http://www.swharden.com/blog/2010-05-28-measuring-qrp-radio-output-power-with-an-oscilliscope/" >this post</a><a href="http://www.SWHarden.com/blog/images/07_no_amp.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/07_no_amp-525x393.jpg" alt="07_no_amp" title="07_no_amp" width="525" height="393" class="alignleft size-medium wp-image-2300" /></a></p>
<p><b>With the amplifier,</b> the output is much more powerful.  At 600mV peak-to-peak with a 10x probe (actually 6V peak-to-peak, expected because that&#8217;s the voltage of the 4xAAA battery supply we&#8217;re using) into 39 ohms we get <b>115 millivolts!</b> (6/(2*2^.5))^2/39*1000=115.38. <a href="http://www.SWHarden.com/blog/images/08_amp1.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/08_amp1-525x393.jpg" alt="08_amp" title="08_amp" width="525" height="393" class="alignleft size-medium wp-image-2302" /></a></p>
<p><b>Notes about power:</b> First of all, the actual power output isn&#8217;t 115mW.  The reason is that the math equations I used work only for pure sine waves.  Since our transmitter has multiple waves in it, less than that power is going to produce our primary signal.  It&#8217;s possible that only 50mW are going to our 29MHz signal, so the power output assessment is somewhat qualitative.  Something significant however is the difference between the measured power with and without the amplifier.  The 6x increase in peak-to-peak voltage results in a 36x (6^2) increase in power, which is very beneficial.  I&#8217;m glad I added this amplifier!  A 36 times increase in power will certainly help.</p>
<p><b>The final schematic</b> is here:<br />
<a href="http://www.SWHarden.com/blog/images/balloon_transmitter_final.png" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/balloon_transmitter_final.png" alt="balloon_transmitter_final" title="balloon_transmitter_final" width="290" height="281" class="alignleft size-full wp-image-2304" /></a></p>
<h1>6/14/2010 &#8211; THE BUILD</h1>
<p><b>Last week I spoke with a student in the UF aerospace engineering department who told me he was working with a group of high school students to add a payload to a high-altitude balloon being launched at (and tracked by) NASA.</b>  We tossed around a few ideas about what to put on it, and we decided it was worth a try to add a transmitter.  I&#8217;ll slowly add to this post as the project unfolds, but with only 2 days to prepare (wow!) I picked a simplistic design which should be extremely easy to understand by everyone.  Here&#8217;s the schematic:</p>
<p><a href="http://www.SWHarden.com/blog/images/balloon_transmitter.png" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/balloon_transmitter.png" alt="balloon_transmitter" title="balloon_transmitter" width="484" height="340" class="alignleft size-full wp-image-2285" /></a></p>
<p><b>The code is as simple as it gets.</b>  It sends some Morse code (&#8221;go gators&#8221;), then a long tone (about 15 seconds) which I hope can be measured QRSS style.  I commented virtually every line so it should be easy to understand how the program works.</p>
<pre class="prettyprint c">
#include &lt;avr /io.h>
#include &lt;util /delay.h>

char call[]={2,2,1,0,2,2,2,0,0,2,2,1,0,1,2,0,2,0,2,2,2,0,1,2,1,0,1,1,1,0,0};
// 0 for space, 1 for dit, 2 for dah

void sleep(){
  _delay_ms(100); // sleep for a while
  PORTA^=(1&lt;&lt;PA1); // "flip" the state of the TICK light
}

void ON(){
 PORTB=255; // turn on transmitter
 PORTA|=(1&lt;&lt;PA3); // turn on the ON light
 PORTA&#038;=~(1&lt;&lt;PA2); // turn off the ON light
}

void OFF(){
 PORTB=0; // turn off transmitter
 PORTA|=(1&lt;&lt;PA2); // turn on the OFF light
 PORTA&#038;=~(1&lt;&lt;PA3); // turn off the OFF light
}

void ID(){
        for (char i=0;i&lt;sizeof(call);i++){
                if (call[i]==0){OFF();} // space
                if (call[i]==1){ON();} // dot
                if (call[i]==2){ON();sleep();sleep();} // dash
    sleep();OFF();sleep();sleep(); // between letters
        }
}

void tone(){
 ON(); // turn on the transmitter
 for (char i=0;i&lt;200;i++){ // do this a lot of times
  sleep();
 }
 OFF();sleep();sleep();sleep(); // a little pause
}

int main(void) // PROGRAM STARTS HERE
{
    DDRB = 255; // set all of port B to output
 DDRA = 255; // set all of port A to output
 PORTA = 1; // turn on POWER light

 while (1){ // loop forever
  ID(); // send morse code ID
  tone(); // send a long beep
 }
}
</pre>
<p><b>I&#8217;m now wondering if I should further amplify this signal&#8217;s output power.</b>  Perhaps a 74HC240 can handle 9V? &#8230; or maybe it would be better to use 4 AAA batteries in series to give me about 6V. [ponders]  <a href="http://www.SWHarden.com/blog/images/balloon_transmitter_amplified.png" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');">this</a> is the schematic I&#8217;m thinking of building.</p>
<h2>UPDATE</h2>
<p>This story was featured on <a href="http://hackaday.com/2010/07/27/200-mile-rf-transmitter-and-high-altitude-balloon/" onclick="javascript:urchinTracker ('/outbound/article/hackaday.com');">Hack-A-Day</a>! Way to go everyone!<br /><a href="http://www.SWHarden.com/blog/images/hackaday_swharden.png" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/hackaday_swharden.png" alt="hackaday_swharden" title="hackaday_swharden" width="488" height="759" class="alignleft size-full wp-image-2365" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.SWHarden.com/blog/2010-07-14-high-altitude-balloon-transmitter/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Coder&#8217;s Block</title>
		<link>http://www.SWHarden.com/blog/2010-07-12-coders-block/</link>
		<comments>http://www.SWHarden.com/blog/2010-07-12-coders-block/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 03:36:03 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Radio]]></category>

		<guid isPermaLink="false">http://www.SWHarden.com/blog/?p=2279</guid>
		<description><![CDATA[It&#8217;s inexplicable, yet undeniable.  I simply can&#8217;t code anything useful right now.  I&#8217;m currently memorized by the idea of writing a truly powerful set of tools for scientific frequency analysis (more than just turning audio into images), and I keep starting over re-coding things from scratch.   I develop too much, too [...]]]></description>
			<content:encoded><![CDATA[<p><b>It&#8217;s inexplicable, yet undeniable.</b>  I simply can&#8217;t code anything useful right now.  I&#8217;m currently memorized by the idea of writing a truly powerful set of tools for scientific frequency analysis (more than just turning audio into images), and I keep starting over re-coding things from scratch.   I develop too much, too quickly, and half way in I get overwhelmed and mentally blocked. I do it to myself. <b>I&#8217;ve taken about a week off and will continue to take a few more days off to reset my mind.</b>  I&#8217;m trying to improve my coding by reading books (e-books) about advanced Python programming.  Perhaps when it&#8217;s time to return, I&#8217;ll write gorgeous and functional code.  I always seem to have one or the other, but never both [sigh]<a href="http://www.SWHarden.com/blog/images/qrss_aj4vd_belgium.jpg" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/qrss_aj4vd_belgium-525x284.jpg" alt="qrss_aj4vd_belgium" title="qrss_aj4vd_belgium" width="525" height="284" class="alignleft size-medium wp-image-2280" /></a></p>
<p><b>The photo above is</b> the signal of my (AJ4VD) little homemade transmitter in Gainesville, Florida, USA (using a 20-ft piece of wire inside my apartment as an antenna) detected by ON5EX in Belgium. It makes me happy.  It reminds me that some of the projects I work on succeed, which gives me motivation to continue pursuing the ones which currently challenge me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.SWHarden.com/blog/2010-07-12-coders-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fighting to Make GTK+, Glade, and Python Play in Windows</title>
		<link>http://www.SWHarden.com/blog/2010-06-28-fighting-to-make-gtk-glade-and-python-play-in-windows/</link>
		<comments>http://www.SWHarden.com/blog/2010-06-28-fighting-to-make-gtk-glade-and-python-play-in-windows/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 14:46:26 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.SWHarden.com/blog/?p=2274</guid>
		<description><![CDATA[These screenshots show me running the Py2EXE-compiled script I wrote last weekend on a Windows 7 machine.  Additionally there is a screenshot of the &#8220;Add/Remove Programs&#8221; window demonstrating which versions of which libraries were required.
]]></description>
			<content:encoded><![CDATA[<p><b>These screenshots</b> show me running the Py2EXE-compiled script I wrote last weekend on a Windows 7 machine.  Additionally there is a screenshot of the &#8220;Add/Remove Programs&#8221; window demonstrating which versions of which libraries were required.<a href="http://www.SWHarden.com/blog/images/glade_exe.png" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/glade_exe-525x328.png" alt="glade_exe" title="glade_exe" width="525" height="328" class="alignleft size-medium wp-image-2276" /></a><a href="http://www.SWHarden.com/blog/images/needToInstall.png" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/needToInstall-525x328.png" alt="needToInstall" title="needToInstall" width="525" height="328" class="alignleft size-medium wp-image-2275" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.SWHarden.com/blog/2010-06-28-fighting-to-make-gtk-glade-and-python-play-in-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Script with GTK+ GUI Compiled with Py2EXE</title>
		<link>http://www.SWHarden.com/blog/2010-06-27-python-script-with-gtk-gui-compiled-with-py2exe/</link>
		<comments>http://www.SWHarden.com/blog/2010-06-27-python-script-with-gtk-gui-compiled-with-py2exe/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 04:16:05 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.SWHarden.com/blog/?p=2271</guid>
		<description><![CDATA[Wow, that&#8217;s a mouthfull.  This is a total hack, but it works &#8212; and barely I might add!  I spent all night jumping through hoops to get this thing to run on Windows.  The problem is that I designed my previous UI in a version of GLADE which is newer than that [...]]]></description>
			<content:encoded><![CDATA[<p><b>Wow, that&#8217;s a mouthfull.</b>  This is a total hack, but it works &#8212; and barely I might add!  I spent all night jumping through hoops to get this thing to run on Windows.  The problem is that I designed my previous UI in a version of GLADE which is newer than that supported by Windows.  It looks like it&#8217;s not backward-compatible, so I have to re-design the GUI from scratch using an earlier version of GLADE.  I&#8217;ll probably stick to GTK version 2.12 and Python version 2.6 because they play nicely on Windows.  It&#8217;s a quick and dirty script, but I was able to make the following run on Windows as a single EXE file!<a href="http://www.SWHarden.com/blog/images/glade_windows_python.PNG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/glade_windows_python-525x362.PNG" alt="glade_windows_python" title="glade_windows_python" width="525" height="362" class="alignleft size-medium wp-image-2272" /></a></p>
<p><b>WHAT A NIGHTMARE</b></p>
]]></content:encoded>
			<wfw:commentRss>http://www.SWHarden.com/blog/2010-06-27-python-script-with-gtk-gui-compiled-with-py2exe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
