Turtle hibernation with Perl

December 12th, 2010 robin Posted in Ironman, Just for Fun, Perl Comments Off on Turtle hibernation with Perl

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 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…), my girlfriends parents cellar was too warm, and in the end our neighbours cellar had about the right temperature… but a lot of bother.

So this year I thought I’d find a technical solution.

  • styrofoam and spray foam around a storage box to make a really well insulated box for the turtles.
  • Two CPU water cooling blocks sandwiching a Peltier element (thermoelectric heat pump).
  • From the cold side of the heat pump a water cycle through a copper pipe in the turtle box to cool the box
  • From the hot side of the heat pump a water cycle through a radiator to cool the water
  • 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.
  • A Perl script to control it!

When I’ve got the logic and parameters worked out, I’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… I just don’t really like C as much.

And as a by-product of monitoring and controlling the system with Perl, I was able to easily store the data in an SQLite database, and use GD::Graph to create pretty graphs to see how healthy the system (and of course the turtles) is:

This is what it looks like:

Google Directions to GPS

June 16th, 2010 robin Posted in Internet, Just for Fun Comments Off on Google Directions to GPS

I have a Garmin Legend HCx and have recently mounted it on my bicycle again.  I’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…  While Google Maps 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?

Here’s how:

  • In Google Maps, get the directions you want.  Drag the path, click till you’re happy.
  • In the top-right of the screen you’ll see the “Link” link – click on that, and copy the URL to your address bar

  • Now add the string “&output=kml” to the end of the url, and hit enter

  • A download dialogue should now pop up asking you where you want to save the file maps.kml – save it
  • Now use gpsbabel to transfer the track to your GPS.  For my Garmin it works like this:
gpsbabel -i kml -t -f maps.kml -o garmin -F usb:0

And that’s it… 🙂

Fridge alarm

December 23rd, 2009 robin Posted in Just for Fun 2 Comments »

Getting into PIC programming, I thought I’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 – but gentle ones!

So – a little bit of C code, a little bit of soldering, and hey presto: a fridge alarm.

How it works

When the door is opened, the magnet moves away from the reed switch, it opens, and the door_open flag is set.  As time goes by, the LED first blinks slowly, then more frequently… after 30 seconds it is accompanied by an intermittent chirp from the buzzer, and if the door hasn’t closed after a minute, the buzzing and flashing gets really intense.  I don’t think I’ll be able to forget the door open any more!

Want one for yourself?  Get the code and schematics here.