{"id":1005,"date":"2013-03-21T21:35:02","date_gmt":"2013-03-21T21:35:02","guid":{"rendered":"http:\/\/www.daveakerman.com\/?p=1005"},"modified":"2013-03-21T23:12:40","modified_gmt":"2013-03-21T23:12:40","slug":"the-cambridge-diet","status":"publish","type":"post","link":"http:\/\/www.daveakerman.com\/?p=1005","title":{"rendered":"The Cambridge Diet"},"content":{"rendered":"<p>Since I started using the Raspberry Pi as a radio tracker, I&#8217;ve been wanting to try two things both in the interest of reducing payload weight.  As a simple telemetry tracker the Pi just cannot compete on weight with say an Arduino Mini Pro, which weighs almost nothing and has low power requirements, but as a photographic tracker it starts to come into its own.<\/p>\n<p>This two things were the model A Pi, which has been available for a few weeks, and the new Pi camera which a few lucky souls (including me) have been sent pre-production models of.  The model A has about 1\/4 of the power consumption of the model B, thus potentially (hah!) using smaller batteries.  The camera is a lot lighter than a webcam whilst using about the same power, and doesn&#8217;t connect by USB meaning that I can dispense with the 5V rail altogether (saving the weight of a 5V regulator and allowing the use of fewer batteries.  A lighter payload means less gas which in turn means a greater peak altitude before the balloon bursts, meaning a good chance of beating the &#8220;live&#8221; picture altitude record and perhaps the &#8220;highest pictures&#8221; record too.<\/p>\n<p>The Pi camera also offers much higher resolution than the webcam I was using, though the limited radio bandwidth means that such images would need to be stored only and not transmitted.  However I still wanted to take advantage of the increased picture quality over a webcam, and that means increasing the radio bandwidth.  First option is to increase the baud rate, so for my <a href=\"http:\/\/www.daveakerman.com\/?p=873\">TARDIS flight<\/a> I tested that by doubling the rate from the 300 baud of my earlier Pi flights to 600.  Practically, that&#8217;s practically as high as I can go with the existing rtty system since 1200 baud uses almost the entire audio bandwidth of the decoding software, thus making it very difficult for receivers to remain tuned in.  Then <a href=\"http:\/\/ava.upuaut.net\/\">Anthony Stirk<\/a> came up with the idea of using 2 radio transmitters on the same tracker, to either interleave a picture between 2 radio frequencies or to send separate pictures on each.  Either way the end result is double the amount of image data being sent, and I thought it was a brilliant idea.  After a quick chat with <a href=\"http:\/\/www.sanslogic.co.uk\">Philip Heron<\/a> (who wrote the SSDV imaging software I use to encode\/decode the images for transmission) to confirm that his system would work using either method, I set about making it happen.<\/p>\n<p>Now, my method for transmitting rtty from the Pi is to connect the serial (UART) port more-or-less directly to a Radiometrix NTX2 radio transmitter, thus avoiding the need for application software to maintain accurate timing.  Although the Pi has 2 such ports, only one can be mapped to the GPIO connector at a time, so I needed some other technique to get both radios running.  My solution was to add an Arduino Mini Pro as a de-multiplexer so, essentially, telemetry gets sent at double speed to the Arduino which then sends packets to the correct NTX2.  The coding was a bit more complex than that, with the Arduino maintaining 2 buffers (1 for incoming and one for outgoing) per radio channel, and handling a simple protocol with handshaking, the result of which is no gaps between transmitted packets thus making full use of the available bandwidth.  Here&#8217;s the Arduino wired up:<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/?attachment_id=1008\" rel=\"attachment wp-att-1008\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070620-1024x682.jpg\" alt=\"P1070620\" width=\"640\" height=\"426\" class=\"aligncenter size-large wp-image-1008\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070620-1024x682.jpg 1024w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070620-300x200.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>to two of these NTX2 radio transmitters<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/?attachment_id=1009\" rel=\"attachment wp-att-1009\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070621-1024x682.jpg\" alt=\"P1070621\" width=\"640\" height=\"426\" class=\"aligncenter size-large wp-image-1009\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070621-1024x682.jpg 1024w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070621-300x200.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Here&#8217;s the model A Pi.  Note that most of the connectors are missing (save more weight!):<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/?attachment_id=1010\" rel=\"attachment wp-att-1010\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070623-1024x682.jpg\" alt=\"P1070623\" width=\"640\" height=\"426\" class=\"aligncenter size-large wp-image-1010\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070623-1024x682.jpg 1024w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070623-300x200.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>and the pre-production Pi camera in action:<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/?attachment_id=1011\" rel=\"attachment wp-att-1011\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070624-e1363901151380-682x1024.jpg\" alt=\"P1070624\" width=\"640\" height=\"960\" class=\"aligncenter size-large wp-image-1011\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070624-e1363901151380-682x1024.jpg 682w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070624-e1363901151380-200x300.jpg 200w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>For GPS, I used a minature UBlox breakout board from <a href=\"http:\/\/ava.upuaut.net\/store\/\">HAB Supplies<\/a>, hacked to connect via i2c instead of async serial:<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/?attachment_id=1012\" rel=\"attachment wp-att-1012\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070627-1024x682.jpg\" alt=\"P1070627\" width=\"640\" height=\"426\" class=\"aligncenter size-large wp-image-1012\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070627-1024x682.jpg 1024w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070627-300x200.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>and the lot is going into this themed payload container:<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/?attachment_id=1015\" rel=\"attachment wp-att-1015\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/pie5-778x1024.jpg\" alt=\"pie5\" width=\"640\" height=\"842\" class=\"aligncenter size-large wp-image-1015\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/pie5-778x1024.jpg 778w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/pie5-227x300.jpg 227w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>like so:<\/p>\n<p><a href=\"http:\/\/www.daveakerman.com\/?attachment_id=1022\" rel=\"attachment wp-att-1022\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070588-1024x768.jpg\" alt=\"P1070588\" width=\"640\" height=\"480\" class=\"aligncenter size-large wp-image-1022\" srcset=\"http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070588-1024x768.jpg 1024w, http:\/\/www.daveakerman.com\/wp-content\/uploads\/2013\/03\/P1070588-300x225.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since I started using the Raspberry Pi as a radio tracker, I&#8217;ve been wanting to try two things both in the interest of reducing payload weight. As a simple telemetry tracker the Pi just cannot compete on weight with say an Arduino Mini Pro, which weighs almost nothing and has [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1005"}],"collection":[{"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1005"}],"version-history":[{"count":15,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1005\/revisions"}],"predecessor-version":[{"id":1027,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1005\/revisions\/1027"}],"wp:attachment":[{"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1005"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1005"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.daveakerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1005"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}