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.

AddThis Social Bookmark Button

Network thermometer

December 18th, 2009 robin Posted in Just for Fun | No Comments »

Recently I ordered an AVR microcontroller based ethernet device and some sensors from Tuxgraphics*.  It’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’s just about enough to make a weather station!

Today I got around to soldering it together and trying it out.

Finished controllerOutdoor thermometer

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.

And now the best part – a few quick scripts, and voila: here you have the current (updated every 5 minutes) temperature data for my house!  Please note – the indoor temperature shown is about 2-3 degrees warmer than it really is in the room because the sensor is near my computer…

Thu Mar 11 02:35:01 2010
Indoors  =  21.2C
Outdoors =  -1.1C

(or click here for the text file – F5 to update)

Pretty neat eh?  Now I just have to get all the other sensors working, and build something to measure wind and rainfall…

Related links

* 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… The alternative is to have it sent by TNT (they will handle the customs for you), but that costs a lot extra…

AddThis Social Bookmark Button

Amazon RDS

October 30th, 2009 robin Posted in MySQL, Reviews | 1 Comment »

A couple of days ago, Amazon released their RDS service.  Being a MySQL fan, I had to have a try!

The cool stuff:

  • It is well documented, and pretty easy to set up an instance.
  • You can dynamically change the class (CPU power and Memory) of a database instance – this means you can give it more power without shutting it down, and easily scale it without having to do complex MySQL proxy configuration and synchronisation.

What’s still missing:

  • Not available in EU yet (it should be soon) – I set up a few instances in the US, but can’t really test what the performance is in the EU between EC2 instances and RDS instances, and that’s what I’m really interested in…
  • I takes a long time for the instance to become available!  I was waiting between 5 and 30 minutes.  I guess that’s not such an issue if you are just creating it once and leaving it running as the data hub for an application, but it’s annoyingly slow for testing/playing.  At least they don’t seem to start billing for time until it is online.

Other interesting notes

  • If you start the instance without any parameters, it will have a typical configuration for the machine used (memory allocation spread between InnoDB and MyISAM).  It is however possible to specify parameters when the instance is started, or even during run time – this gives a lot of room for optimisation: it’s not just a dumb service, you can tune it to your requirements.
  • Just for kicks and giggles, I tried scaling a small instance to a large instance, without any custom parameters: the only change was allocating all the additional memory to innodb_buffer_pool_size.  I guess that’s what most people want…
AddThis Social Bookmark Button