<?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; Microcontrollers</title>
	<atom:link href="http://www.SWHarden.com/blog/category/microcontrollers/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>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>PWM Junk in CKOUT?</title>
		<link>http://www.SWHarden.com/blog/2010-05-29-pwm-junk-in-ckout/</link>
		<comments>http://www.SWHarden.com/blog/2010-05-29-pwm-junk-in-ckout/#comments</comments>
		<pubDate>Sat, 29 May 2010 19:23:13 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<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=2112</guid>
		<description><![CDATA[I&#8217;m fighting with this! No matter what I do, I can&#8217;t seem to get a clear CKOUT signal as long as PWM is activated.

]]></description>
			<content:encoded><![CDATA[<p><b>I&#8217;m fighting with this!</b> No matter what I do, I can&#8217;t seem to get a clear CKOUT signal as long as PWM is activated.</p>
<p><object style="height: 344px; width: 425px"><param name="movie" value="http://www.youtube.com/v/9XCk16EOHI4"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"><embed src="http://www.youtube.com/v/9XCk16EOHI4" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></param></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.SWHarden.com/blog/2010-05-29-pwm-junk-in-ckout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pushing and Pulling</title>
		<link>http://www.SWHarden.com/blog/2010-05-26-pushing-and-pulling/</link>
		<comments>http://www.SWHarden.com/blog/2010-05-26-pushing-and-pulling/#comments</comments>
		<pubDate>Wed, 26 May 2010 12:42:39 +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=2049</guid>
		<description><![CDATA[I found a way to quadruple the output power of my QRSS transmitter without changing its input parameters.  Thanks to a bunch of people (most of whom are on the Knights QRSS mailing list) I decided to go with a push-pull configuration using 2 pairs of 4 gates (8 total) of a 74HC240.  [...]]]></description>
			<content:encoded><![CDATA[<p><b>I found a way</b> to quadruple the output power of my QRSS transmitter without changing its input parameters.  Thanks to a bunch of people (most of whom are on the Knights QRSS mailing list) I decided to go with a push-pull configuration using 2 pairs of 4 gates (8 total) of a 74HC240.  I&#8217;ll post circuit diagrams when I perfect it, but for now check out these waveforms!</p>
<p><a href="http://www.SWHarden.com/blog/images/qrss_amplified1.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/qrss_amplified1-525x393.jpg" alt="qrss_amplified" title="qrss_amplified" width="525" height="393" class="alignleft size-medium wp-image-2056" /></a></p>
<p>First of all, this is the waveform before and after amplification with the 74HC240.  I artificially weakened the input signal (top) with a resistor and fed it to the 74HC240.  For the rest of the images, the input is 5v p-p and the output is similar, so amplification won&#8217;t be observed.  The wave I&#8217;m starting with is the output of a microcontroller which is non-sinusoidal, but this can be fixed later with lowpass filtering.</p>
<p><a href="http://www.SWHarden.com/blog/images/qrss_74hc2401.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/qrss_74hc2401-525x393.jpg" alt="qrss_74hc240" title="qrss_74hc240" width="525" height="393" class="alignleft size-medium wp-image-2055" /></a></p>
<p>Here you can see the test circuit I&#8217;m using.  It should be self-explanatory.</p>
<p><a href="http://www.SWHarden.com/blog/images/qrss_inPhase1.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/qrss_inPhase1-525x393.jpg" alt="qrss_inPhase" title="qrss_inPhase" width="525" height="393" class="alignleft size-medium wp-image-2057" /></a></p>
<p>Here&#8217;s the output of the microcontroller compared to the in-phase output of the 74HC240</p>
<p><a href="http://www.SWHarden.com/blog/images/qrss_out_of_phase1.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/qrss_out_of_phase1-525x393.jpg" alt="qrss_out_of_phase" title="qrss_out_of_phase" width="525" height="393" class="alignleft size-medium wp-image-2058" /></a></p>
<p>Here are the two outputs of the 74HC240.  4 of the gates are used to create output in-phase with the input, and the other four are used to create out-of-phase wave.  Here are the two side by side.  The top is 0 to 5v, the bottom is 0 to -5v, so we have a push-pull thing going on&#8230; woo hoo!</p>
<p><a href="http://www.SWHarden.com/blog/images/qrss_out_of_phase_overlap1.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/qrss_out_of_phase_overlap1-525x393.jpg" alt="qrss_out_of_phase_overlap" title="qrss_out_of_phase_overlap" width="525" height="393" class="alignleft size-medium wp-image-2059" /></a></p>
<p>The waves, when overlapped, look similar (which I guess is a good thing) with a slight (and I mean VERY slight) offset of the out-of-phase signal.  I wonder if this is caused by the delay in the time it takes to trigger the 74HC240 to make the out-of-phase signal?  The signal I&#8217;m working with is 1MHz.</p>
<p><b>Okay, that&#8217;s it for now.</b>  I&#8217;m just documenting my progress.  73</p>
]]></content:encoded>
			<wfw:commentRss>http://www.SWHarden.com/blog/2010-05-26-pushing-and-pulling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solar Powered QRSS Beacon</title>
		<link>http://www.SWHarden.com/blog/2010-05-24-solar-powered-qrss-beacon/</link>
		<comments>http://www.SWHarden.com/blog/2010-05-24-solar-powered-qrss-beacon/#comments</comments>
		<pubDate>Mon, 24 May 2010 12:47:01 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<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=2042</guid>
		<description><![CDATA[Haray! I&#8217;m making awesome progress with my QRSS transmitter design.  Because my current transmitter (previous few posts) was randomly freezing-up (likely due to the oscillator stopping its oscillating due to being overloaded) so I moved the oscillator from in-chip to an external oscillator.  It&#8217;s been made small enough to fit in an altoids [...]]]></description>
			<content:encoded><![CDATA[<p><b>Haray!</b> I&#8217;m making awesome progress with my QRSS transmitter design.  Because my current transmitter (previous few posts) was randomly freezing-up (likely due to the oscillator stopping its oscillating due to being overloaded) so I moved the oscillator from in-chip to an external oscillator.  It&#8217;s been made small enough to fit in an altoids tin, and I already tested it with the solar panel and it works! Awesome!  Here are some photos.  Again, when I perfect the design I&#8217;ll post final schematics.</p>
<p><a href="http://www.SWHarden.com/blog/images/DSCN0537.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSCN0537-525x393.jpg" alt="DSCN0537" title="DSCN0537" width="525" height="393" class="alignleft size-medium wp-image-2046" /></a></p>
<p><a href="http://www.SWHarden.com/blog/images/DSCN0533.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSCN0533-525x393.jpg" alt="DSCN0533" title="DSCN0533" width="525" height="393" class="alignleft size-medium wp-image-2044" /></a></p>
<p><a href="http://www.SWHarden.com/blog/images/DSCN0539.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSCN0539-525x393.jpg" alt="DSCN0539" title="DSCN0539" width="525" height="393" class="alignleft size-medium wp-image-2047" /></a></p>
<p><b>Sticking out</b> are wires for power and an antenna on each side.  The goal is to hang the device between two trees by its own antenna.</p>
<p><a href="http://www.SWHarden.com/blog/images/DSCN0535.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSCN0535-525x393.jpg" alt="DSCN0535" title="DSCN0535" width="525" height="393" class="alignleft size-medium wp-image-2045" /></a></p>
<p><b>That&#8217;s my new chip development board.</b> I made it with what I needed on it.  It&#8217;s so convenient!  It uses 5v of power from the USB port too!</p>
<p><a href="http://www.SWHarden.com/blog/images/DSCN0532.JPG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/DSCN0532-525x393.jpg" alt="DSCN0532" title="DSCN0532" width="525" height="393" class="alignleft size-medium wp-image-2043" /></a></p>
<p><b>Alltogether</b> I&#8217;ve tested the device and confirmed it transmits radio when the solar panel is illuminated.  I&#8217;m thinking of making it more effective by adding more panels&#8230; but that&#8217;s it for now!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.SWHarden.com/blog/2010-05-24-solar-powered-qrss-beacon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debut of the AJ4VD QRSS Gator</title>
		<link>http://www.SWHarden.com/blog/2010-05-22-debut-of-the-aj4vd-qrss-gator/</link>
		<comments>http://www.SWHarden.com/blog/2010-05-22-debut-of-the-aj4vd-qrss-gator/#comments</comments>
		<pubDate>Sat, 22 May 2010 23:41:54 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[C/C++]]></category>
		<category><![CDATA[Circuitry]]></category>
		<category><![CDATA[Microcontrollers]]></category>
		<category><![CDATA[Radio]]></category>

		<guid isPermaLink="false">http://www.SWHarden.com/blog/?p=2033</guid>
		<description><![CDATA[I re-wrote the code from the previous entry to do several things.  Once of which was to make a gator rather than a fish.  It&#8217;s more appropriate since I&#8217;m planning on housing the transmitter at the University of Florida.  To do it, I drew a gator in paint and wrote a python [...]]]></description>
			<content:encoded><![CDATA[<p><b>I re-wrote the code</b> from the previous entry to do several things.  Once of which was to make a gator rather than a fish.  It&#8217;s more appropriate since I&#8217;m planning on housing the transmitter at the University of Florida.  To do it, I drew a gator in paint and wrote a python script to convert the image into a series of points.  I&#8217;ll post it later.  One thing to note was that size was a SERIOUS issue.  I only have two thousand bytes of code, and every point of that gator was a byte, so it was a memory hog.  I helped it dramatically by using repeating segments wherever possible, and some creative math to help out the best I could (i.e., the spines on the back) Here&#8217;s what it looks like, and the code below it&#8230;</p>
<p><a href="http://www.SWHarden.com/blog/images/aj4vd_gator.PNG" onclick="javascript:urchinTracker ('/outbound/article/www.SWHarden.com');"><img src="http://www.SWHarden.com/blog/images/aj4vd_gator-525x46.PNG" alt="aj4vd_gator" title="aj4vd_gator" width="525" height="46" class="alignleft size-medium wp-image-2029" /></a></p>
<pre class="prettyprint c">
#include &lt;avr/io.h&gt;
#include &lt;util/delay.h&gt;

// front top LED - PA0
// inside top LED - PA1
// inside bot LED - PA2
// front bot LED - PA3

unsigned long int t_unit; // units of time
const int tDit = 100; //units for a dit
const int tDah = 255; //units for a dah
char fsk; // degree of frequency shift to use for CW
char fsk2; // degree of frequency shift to use for HELL

char light = 0; // which lights are on/off

void delay(){
        _delay_loop_2(t_unit);
        }

void blink(){
	return;
	if (light==0){
    	PORTA|=(1&lt;&lt;PA0); //on
    	PORTA|=(1&lt;&lt;PA1); //on
		PORTA&#038;=~(1&lt;&lt;PA2); //off
		PORTA&#038;=~(1&lt;&lt;PA3); //off
		light=1;
	} else {
    	PORTA|=(1&lt;&lt;PA2); //on
    	PORTA|=(1&lt;&lt;PA3); //on
		PORTA&#038;=~(1&lt;&lt;PA0); //off
		PORTA&#038;=~(1&lt;&lt;PA1); //off
		light=0;

	}
}

void tick(unsigned long ticks){
        while (ticks&gt;0){
                delay();
                delay();
                ticks--;
        }
}

void pwm_init() {
    //Output on PA6, OC1A pin (ATTiny44a)
    OCR1A = 0x00; //enter the pulse width. We will use 0x00 for now, which is 0 power.
    TCCR1A = 0x81; //8-bit, non inverted PWM
    TCCR1B = 1; //start PWM
}

void set(int freq, int dly){
        OCR1A = freq;
        tick(dly);
}

void fish(){
	char mult = 3;

	char f2[]={2, 3, 4, 5, 6, 7, 4, 3, 7, 4, 7, 7, 6, 5, 4, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 3, 3, 3, 2, 2, 2, 3, 4, 5, 6, 7, 8, 4, 9, 5, 9, 6, 9, 6, 9, 6, 9, 8, 8, 7, 7, 6, 5, 4, 3, 3, 3, 4, 5, 5};

	for (int i=0;i&lt;sizeof(f2);i++) {
		OCR1A = f2[i]*mult;
		blink();
		tick(20);
		OCR1A = 1*mult;
		blink();
		tick(20);
		}

	char f3[]={1,2,3,4,3,2};

	char offset=0;
	while (offset&lt;9){
		for (char j=0;j&lt;3;j++){
			for (char i=0;i&lt;sizeof(f3);i++){
				char val = (f3[i]+5-offset)*mult;
				if (val&lt;mult || val &gt; 10*mult){val=mult;}
				OCR1A = val;
				blink();
				tick(20);
				OCR1A = 1*mult;
				blink();
				tick(20);
				}
			}
		offset++;
	}

}

void id(){
        char f[]={0,0,1,2,0,1,2,2,2,0,1,1,1,1,2,0,1,1,1,2,0,2,1,1,0,0};
        char i=0;
        while (i&lt;sizeof(f)) {
                blink();
                if (f[i]==0){OCR1A = 0;tick(tDah);}
                if (f[i]==1){OCR1A = fsk;tick(tDit);}
                if (f[i]==2){OCR1A = fsk;tick(tDah);}
                blink();
                OCR1A=0;
				tick(tDit);
                i++;
                }
}

void slope(){
        char i=0;
        while (i&lt;25){
                OCR1A = 255-i;
                i++;
        }
        while (i&gt;0){
                i--;
                OCR1A = 255-i;
        }
}

int main(void)
{
        DDRA = 255;
		blink();
        pwm_init();
        t_unit=1000;fsk=10;id(); // set to fast and ID once
        //fsk=50;//t_unit = 65536; // set to slow for QRSS
		t_unit=60000;

        while(1){;
                fish();
                id();
        }

        return 1;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.SWHarden.com/blog/2010-05-22-debut-of-the-aj4vd-qrss-gator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
