<?xml version="1.0" encoding="UTF-8"?>
<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>Robin Clarke - Perl and Life &#187; Just for Fun</title>
	<atom:link href="http://www.robinclarke.net/archives/category/fun/feed" rel="self" type="application/rss+xml" />
	<link>http://www.robinclarke.net</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 01 Feb 2012 20:07:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Turtle hibernation with Perl</title>
		<link>http://www.robinclarke.net/archives/turtle-hibernation-with-perl</link>
		<comments>http://www.robinclarke.net/archives/turtle-hibernation-with-perl#comments</comments>
		<pubDate>Sun, 12 Dec 2010 15:40:32 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[Ironman]]></category>
		<category><![CDATA[Just for Fun]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[perl ironman turtles atmega hibernation]]></category>

		<guid isPermaLink="false">http://www.robinclarke.net/?p=444</guid>
		<description><![CDATA[We have two red-eared slider turtles.  For most of the year they live in our living room in a big aquarium, but for the winter they have to go into hibernation.  As the winter approaches, the light and temperature in the aquarium has to be reduced, and then around the beginning of December they have [...]]]></description>
			<content:encoded><![CDATA[<p>We have two <a title="Red-eared slider turtle" href="http://en.wikipedia.org/wiki/Red-eared_slider" target="_blank">red-eared slider turtles</a>.  For most of the year they live in our living room in a big aquarium, but for the winter they have to go into hibernation.  As the winter approaches, the light and temperature in the aquarium has to be reduced, and then around the beginning of December they have to go into complete darkness, at about 10C.  Last year we tried putting them into the cellar: our cellar was too cold (went down to just +1C, could have frozen&#8230;), my girlfriends parents cellar was too warm, and in the end our neighbours cellar had about the right temperature&#8230; but a lot of bother.</p>
<p>So this year I thought I&#8217;d find a technical solution.</p>
<ul>
<li>styrofoam and spray foam around a storage box to make a really well insulated box for the turtles.</li>
<li>Two CPU water cooling blocks sandwiching a <a title="Peltier element" href="http://en.wikipedia.org/wiki/Thermoelectric_cooling" target="_blank">Peltier element</a> (thermoelectric heat pump).</li>
<li>From the cold side of the heat pump a water cycle through a copper pipe in the turtle box to cool the box</li>
<li>From the hot side of the heat pump a water cycle through a radiator to cool the water</li>
<li>A networked atmega processor to read the values from two thermometers (one in the cool water cycle, one in the turtle box), and turn the pumps and peltier element on and off.</li>
<li>A Perl script to control it!</li>
</ul>
<p>When I&#8217;ve got the logic and parameters worked out, I&#8217;m going to translate the logic of the Perl script to C and load it onto the atmega processor, but for starters Perl is a great helper because I can quickly prototype, try out and refine without having to recompile, and to be honest&#8230; I just don&#8217;t really like C as much.</p>
<p>And as a by-product of monitoring and controlling the system with Perl, I was able to easily store the data in an <a title="SQLite" href="http://www.sqlite.org/" target="_blank">SQLite</a> database, and use <a title="GD::Grap" href="http://search.cpan.org/~bwarfield/GDGraph-1.44/Graph.pm" target="_blank">GD::Graph</a> to create pretty graphs to see how healthy the system (and of course the turtles) is:</p>
<p><a href="http://htmlco.de/nocache/turtlecooler.jpg"><img class="alignnone" title="Turtle graph" src="http://htmlco.de/nocache/turtlecooler.jpg" alt="" width="400" height="200" /></a></p>
<p>This is what it looks like:</p>
<p><a href="http://www.robinclarke.net/wp-content/uploads/2010/12/20101212_turtle_cooler.jpg"><img class="alignnone size-medium wp-image-449" title="Turtle cooler" src="http://www.robinclarke.net/wp-content/uploads/2010/12/20101212_turtle_cooler-243x300.jpg" alt="" width="243" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robinclarke.net/archives/turtle-hibernation-with-perl/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Directions to GPS</title>
		<link>http://www.robinclarke.net/archives/google-directions-to-gps</link>
		<comments>http://www.robinclarke.net/archives/google-directions-to-gps#comments</comments>
		<pubDate>Wed, 16 Jun 2010 15:33:13 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Just for Fun]]></category>
		<category><![CDATA[garmin]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[gps]]></category>
		<category><![CDATA[gpx]]></category>
		<category><![CDATA[maps]]></category>

		<guid isPermaLink="false">http://www.robinclarke.net/?p=403</guid>
		<description><![CDATA[I have a Garmin Legend HCx and have recently mounted it on my bicycle again.  I&#8217;ve even got local maps on it, so it can even do navigation by following the road, but the options for route planning on the Garmin are somewhat limited&#8230;  While Google Maps still has some shortcomings with its directions for [...]]]></description>
			<content:encoded><![CDATA[<p>I have a Garmin Legend HCx and have recently mounted it on my bicycle again.  I&#8217;ve even got local maps on it, so it can even do navigation by following the road, but the options for route planning on the Garmin are somewhat limited&#8230;  While <a title="Google Maps" href="http://maps.google.com/?q=germany" target="_blank">Google Maps</a> still has some shortcomings with its directions for walking or cyclists, it has one great advantage: you can grab and drag the route as you please to quickly make a path just the way you like it.  But how can you get that route to your GPS?</p>
<p>Here&#8217;s how:</p>
<ul>
<li>In Google Maps, get the directions you want.  Drag the path, click till you&#8217;re happy.</li>
<li>In the top-right of the screen you&#8217;ll see the &#8220;Link&#8221; link &#8211; click on that, and copy the URL to your address bar</li>
</ul>
<p><a href="http://www.robinclarke.net/wp-content/uploads/2010/06/google_link.png"><img class="alignnone size-full wp-image-405" title="Google maps link" src="http://www.robinclarke.net/wp-content/uploads/2010/06/google_link.png" alt="" width="448" height="176" /></a></p>
<ul>
<li>Now add the string &#8220;&amp;output=kml&#8221; to the end of the url, and hit enter</li>
</ul>
<p><a href="http://www.robinclarke.net/wp-content/uploads/2010/06/google_output.png"><img class="alignnone size-full wp-image-408" title="Google maps output kml" src="http://www.robinclarke.net/wp-content/uploads/2010/06/google_output.png" alt="" width="296" height="76" /></a></p>
<ul>
<li>A download dialogue should now pop up asking you where you want to save the file maps.kml &#8211; save it</li>
<li>Now use <a title="GPSBabel" href="http://www.gpsbabel.org/" target="_blank">gpsbabel</a> to transfer the track to your GPS.  For my Garmin it works like this:</li>
</ul>
<pre>gpsbabel -i kml -t -f maps.kml -o garmin -F usb:0
</pre>
<p>And that&#8217;s it&#8230; <img src='http://www.robinclarke.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.robinclarke.net/archives/google-directions-to-gps/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fridge alarm</title>
		<link>http://www.robinclarke.net/archives/fridge-alarm</link>
		<comments>http://www.robinclarke.net/archives/fridge-alarm#comments</comments>
		<pubDate>Wed, 23 Dec 2009 19:16:51 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[Just for Fun]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[fridge]]></category>
		<category><![CDATA[pic]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.robinclarke.net/?p=332</guid>
		<description><![CDATA[Getting into PIC programming, I thought I&#8217;d start small: our fridge sometimes jams open leaking cold air out, and heating up the compressor in the back, burning electricity without end.  I could just be really careful when putting milk in, and always push the door shut, but being lazy, I like reminders &#8211; but gentle [...]]]></description>
			<content:encoded><![CDATA[<p>Getting into PIC programming, I thought I&#8217;d start small: our fridge sometimes jams open leaking cold air out, and heating up the compressor in the back, burning electricity without end.  I could just be really careful when putting milk in, and always push the door shut, but being lazy, I like reminders &#8211; but gentle ones!</p>
<p>So &#8211; a little bit of C code, a little bit of soldering, and hey presto: a fridge alarm.</p>
<p><a href="http://www.robinclarke.net/wp-content/uploads/2009/12/fridge_alarm_1.jpg"><img class="size-thumbnail wp-image-335 alignnone" title="Fridge alarm" src="http://www.robinclarke.net/wp-content/uploads/2009/12/fridge_alarm_1-150x150.jpg" alt="" width="150" height="150" /></a></p>
<h2>How it works</h2>
<p>When the door is opened, the magnet moves away from the reed switch, it opens, and the <em>door_open</em> flag is set.  As time goes by, the LED first blinks slowly, then more frequently&#8230; after 30 seconds it is accompanied by an intermittent chirp from the buzzer, and if the door hasn&#8217;t closed after a minute, the buzzing and flashing gets really intense.  I don&#8217;t think I&#8217;ll be able to forget the door open any more!</p>
<p>Want one for yourself?  Get the code and schematics <a href="http://www.robinclarke.net/wp-content/uploads/2009/12/fridgealarm-0.1.zip">here</a>.</p>
<p><a href="http://www.robinclarke.net/wp-content/uploads/2009/12/fridgealarm.png"><img class="size-medium wp-image-334 alignnone" title="Schematic" src="http://www.robinclarke.net/wp-content/uploads/2009/12/fridgealarm-300x211.png" alt="" width="300" height="211" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robinclarke.net/archives/fridge-alarm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Network thermometer</title>
		<link>http://www.robinclarke.net/archives/network-thermometer</link>
		<comments>http://www.robinclarke.net/archives/network-thermometer#comments</comments>
		<pubDate>Fri, 18 Dec 2009 16:17:35 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[Just for Fun]]></category>
		<category><![CDATA[atmega]]></category>
		<category><![CDATA[avr]]></category>
		<category><![CDATA[ENC28J60]]></category>
		<category><![CDATA[ethernet]]></category>
		<category><![CDATA[micro controller]]></category>
		<category><![CDATA[temperature]]></category>
		<category><![CDATA[thermometer]]></category>

		<guid isPermaLink="false">http://www.robinclarke.net/?p=314</guid>
		<description><![CDATA[Recently I ordered an AVR microcontroller based ethernet device and some sensors from Tuxgraphics*.  It&#8217;s a controller board with an atmega328p processor and ENC28J60 ethernet controller onboard.  You can connect any number of sensors and switches to the processor, so I ordered some to get started: two temperature sensors (IC2 protocol), one air pressure, one [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I ordered an <a title="AVR microcontroller based ethernet device / web server, SMD" href="http://shop.tuxgraphics.org/electronic/detail_avrwebserver4.html" target="_blank">AVR microcontroller based ethernet device</a> and some sensors from Tuxgraphics*.  It&#8217;s a controller board with an atmega328p processor and ENC28J60 ethernet controller onboard.  You can connect any number of sensors and switches to the processor, so I ordered some to get started: two temperature sensors (IC2 protocol), one air pressure, one humidity and temperature.   That&#8217;s just about enough to make a weather station!</p>
<p>Today I got around to soldering it together and trying it out.</p>
<p><a href="http://www.robinclarke.net/wp-content/uploads/2009/12/img-1.jpg"><img class="size-medium wp-image-315 alignnone" title="Finished controller" src="http://www.robinclarke.net/wp-content/uploads/2009/12/img-1-199x300.jpg" alt="Finished controller" width="199" height="300" /></a><a href="http://www.robinclarke.net/wp-content/uploads/2009/12/img-2.jpg"><img class="alignnone size-medium wp-image-316" title="Outdoor thermometer" src="http://www.robinclarke.net/wp-content/uploads/2009/12/img-2-300x199.jpg" alt="Outdoor thermometer" width="300" height="199" /></a></p>
<p>The big surprise: it worked first try: no soldering errors, and the programming worked too: a network enabled thermometer!  A little bit more hacking and I got a second thermometer mounted (in a broken pen body filled with silicon to waterproof it) outside my window.</p>
<p>And now the best part &#8211; a few quick scripts, and voila: here you have the current (updated every 5 minutes) temperature data for my house!  Please note &#8211; the indoor temperature shown is about 2-3 degrees warmer than it really is in the room because the sensor is near my computer&#8230;</p>
<pre><strong>Sat Oct  2 16:00:01 2010
DS18S20 Sensor Indoors            = 15.0C
DS18S20 Sensor Outdors            = 12.8C
STH11 Sensor Indoors temperature  = 20.4C
STH11 Sensor Indoors dew point    = 14.2C
STH11 Sensor Indoors humidity     = 71.0%

</strong></pre>
<p>(or click <a title="Temperature file" href="http://www.robinclarke.net/wp-content/uploads/temperature.txt" target="_self">here</a> for the text file &#8211; F5 to update)</p>
<p>Pretty neat eh?  Now I just have to get all the other sensors working, and build something to measure wind and rainfall&#8230;</p>
<h2>Related links</h2>
<ul>
<li><a title="Tuxgraphics" href="http://shop.tuxgraphics.org/">Tuxgraphics.org</a></li>
<li><a title="Mikrocontroller.net" href="http://www.mikrocontroller.net/">Mikrocontroller.net</a> (German site about programming micro controllers)</li>
</ul>
<p>* If you order from Tuxgraphics, beware that they send from Canada, meaning that you may have to go to the customs to clear it.  In Munich, going to the Customs takes an hour each way, and is a big hassle&#8230; The alternative is to have it sent by TNT (they will handle the customs for you), but that costs a lot extra&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robinclarke.net/archives/network-thermometer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RFID field visualisation</title>
		<link>http://www.robinclarke.net/archives/rfid-field-visualisation</link>
		<comments>http://www.robinclarke.net/archives/rfid-field-visualisation#comments</comments>
		<pubDate>Tue, 13 Oct 2009 07:16:03 +0000</pubDate>
		<dc:creator>robin</dc:creator>
				<category><![CDATA[Just for Fun]]></category>
		<category><![CDATA[rfid]]></category>
		<category><![CDATA[visualisation]]></category>

		<guid isPermaLink="false">http://www.robinclarke.net/?p=266</guid>
		<description><![CDATA[These guys have done a really cool job visualising the readable volume around RFID readers.  Watch the video!]]></description>
			<content:encoded><![CDATA[<p><a title="RFID field visualisation" href="http://www.warrenellis.com/?p=7831" target="_blank">These guys</a> have done a really cool job visualising the readable volume around RFID readers.  Watch the video!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robinclarke.net/archives/rfid-field-visualisation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

