Introducing CRON, SUNRISE and SUNSET

This new feature allows you to trigger events at certain times. The syntax for crons is
[CRON:year,month,day,hour,minute,dayofweek:trigger], you can use an asterisk as wildcard and for example if you want to trigger an event every day at 13:15 you need to write [CRON:*,*,*,13,15,*:trigger] into the IF section of that event.

With SUNRISE and SUNSET you can trigger events at… well… sunrise and sunset 🙂
As sunrise and sunset times are depending on your location you need to pass your geo coordinates. For example Hamburg is located at 53.55N, 9.99E and the sunrise/sunset triggers are like [SUNRISE:53.55,9.99:trigger] and [SUNSET:53.55,9.99:trigger]


Ardumote progress

It’s been over half a year since making the first announcement of ardumote. Now I’m actually using it myself at home to open doors and switching lights 🙂

Here you can see my arduino which is mounted to the wall next to the door in the corridor. As you can see there are two servomotors stucked to the door opener with double-faced adhesive tape. They mechanically push the buttons. I know I could have connect them directly with optocouplers but since I live in a rented flat and didn’t want to mess things up this seemed to be the best solution.

Now let’s have a look in detail. There is also a 433MHz transmitter and receiver connected, which allows me to use a simple remote as input device and operate low cost RC power sockets. I use a arduino mega cause the RCSwitch didn’t run together with the ardumote arduino library due to memory limitations and unfortunately I don’t have much hope by now to get it working on a arduino uno ever. Nevertheless there is a example sketch without RCSwitch for uno/duemilanove provided in the lib. I’ve also connected a LM35 temperature sensor cause I had one to spare.

All the input, output and communication devices are straightforward added in the sketch:

    Copyright (c) 2012 Suat Özgür

    Ardumote example sketch for Mega boards

    Pin   Device
    2     433Mhz AM Receiver
    4     Servo Motor
    5     Servo Motor
    42    Status LED (Recieve)
    44    Status LED (Transmit)
    46    Status LED (IRC Connection)
    A1    433Mhz AM Transmitter
    A10   Analog temperature sensor
// ==== Basic configuration =====================================

#define ARDUMOTE_SHARED_SECRET "01234567890abcdef01234567890abcd"

#define STATUS_LED_RX  42
#define STATUS_LED_TX  44
#define STATUS_LED_IRC 46

byte mac[]     = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

// ==== General Includes ========================================
[Snipped... a lot of includes. Find them in the lib examples]
// ==============================================================

void setup() {

  // Init ethernet

  // Init ardumote itself
  ArdumoteMD5 myArdumote;

  // Init maintenance modules (Do not remove)
  SensorMaintenance s0;
  myArdumote.addSensorModule( &s0 );

  ActorMaintenance  a0;
  myArdumote.addActorModule( &a0 );

  // Init ComModules
  ComEthernetIRC c2;

  // Init sensors
  SensorRCSwitch s1;
  s1.setup("433Mhz RX", 0); // 433Mhz AM Receiver at Pin 2
  myArdumote.addSensorModule( &s1 );

  SensorAnalog s2;
  s2.setup("Temperature", A10, 60); // LM35 Sensor Pin A10
  myArdumote.addSensorModule( &s2 );

  // Init actors
  ActorRCSwitch a1;
  a1.setup("433Mhz TX", A1); // 433Mhz AM Transmitter at Pin A1
  myArdumote.addActorModule( &a1 );

  ActorServo a2;
  a2.setup("Servo 1", 5); // Servo motor at Pin 5
  myArdumote.addActorModule( &a2 );

  ActorServo a3;
  a3.setup("Servo 2", 4); // Servo motor at Pin 4
  myArdumote.addActorModule( &a3 );

  // run
  while (true) {


void loop() {

There is no business logic implemented in the arduino. It’s just about receiving and sending data to a webservice (aka „the cloud™“). There is a very simple ardumote protocol on top of IRC. I’ve chosen IRC because it’s also very simple, scalable and there are lots of ready to run stable IRC daemons around to use. XMPP would have been a cooler choice but as it deals with comparatively complex XML data, the atmega chips don’t have much resources at all and dealing with string operations in C++ is really pain in the a**… maybe somewhen in future 🙂

Of course good old HTTP would also be an alternative but as it’s stateless you need to deal with DynDNS and router configuration stuff to allow the webservice to connect back to the arduino. With IRC the arduino connects to the webservice and keeps being connected and beside that in this way the latency is shorter and the data volume without tons of headers is much smaller.

Let’s come to the ardumote webservice.

Beside your arduino with all that sensors and actors you can also add other controller types with input and output devices. For now that is a „virtual remote panel“ with „virtual button“ input devices to use as a browser or smartphone interface. There is already a android app to use these virtual remote panels in a convenient way.

A „webservices controller“ controls onlineservices like Twitter, E-Mail or else and I’m already planing a android phone type controller so it would be possible to use the smartphone inputs (accelerometer, GPS, compass) and outputs (action bar notification, vibration), too. Ninjablocks might also be interesting in future.

Based on your input devices you can define events and actions with your output devices to be executed when the event occurs.
In this example I have my arduino controller in the corridor, a virtual remote panel with a „Haustür“ (thats german for „front door“) button and a webservices controller with my Twitter account linked to it. Whenever I push the button on my phone, the front door opens, the light in the corridor is switched on and a tweet is sent to my Twitter account.

That’s all folks… well, for now. Next steps will be some bugfixing, pimping up the virtual remote panels and enhancing the android app.

Feel free to sign up, download and play around with ardumote and share your thoughts in the forum. But keep in mind it’s still alpha and not stable yet.

Ardumote: Handy als Gamecontroller und andere Spielereien

Ihr erinnert euch an Ardumote? Auch wenn das ganze noch nicht das Beta-Stadium erreicht hat geht es doch langsam voran. Zuhause nutze ich es inzwischen sogar schon produktiv zum Licht schalten und Türen öffnen. Ursprünglich wollte ich ja nur eine Fernbedienungs-App auf dem Handy haben, inzwischen kristalisiert sich aus der Grundidee die ultimative virtuelle Schaltzentrale heraus: An dem Webinterface auf kann man verschiedenste Arten von Geräten anmelden und je nach Zustand der Eingabegeräte (z.B. Temperatursensor oder Button auf der Handy-App) Befehle an andere (Ausgabe-)Geräte (z.B. Servomotor der den Knopf am Türsummer drückt) senden. Das ganze ist nicht mal an physikalische Geräte gebunden, man könnte auch genauso gut über einen virtuellen Ardumote-Controller einen Tweet auf Twitter absetzen (was übrigens auch schon geht).

Interessant wird das ganze dann auch mit einem Smartphone, welches ja schon von Haus aus mit einer Netzwerkverbindung ausgestattet und über und über mit Sensoren vollgestopft ist. Man könnte z.B. automatisch Schlaglöcher Twittern, die Tür abschließen wenn die Geokoordinaten der Schwiegermutter näher kommen, eine Highscore für einen Autobahnabschnitt implementieren oder ganz schnöde die Heizung aufdrehen wenn die Temperatur unter 18° sinkt…

Hier als Nebenprodukt und Proof of Concept eine Spielsteuerung mit den Bewegungssensoren eines Android Smartphones. Nicht hübsch und es fehlt jeglicher Feinschliff, aber vom Grundsatz her eine ziemlich coole Sache wie ich finde.


  •  Java-Sicherheitswarnung: Das Spiel selbst läuft mit JavaScript (mit bestem Dank an wo es aus dem Tutorial stammt), weshalb keine persistente Datenverbindung möglich wäre. Hierfür verwende ich ein Java Applet (mit bestem Dank an Stephen Ware) als Brücke zwischen JavaScript und dem IRC-Server, über den App und Spiel letzendlich miteinander kommunizieren. Die Sicherheitswarnung liegt daran, dass das Applet nicht signiert ist.
  • QR-Code oben rechts: Zum runterladen der notwendigen Android-App
  • QR-Code unten rechts: Muss mit der gerade installierten App eingescannt werden, um App und Spiel zu verbinden.



I’m proud to present what I’m currently working on: a Arduino home automation framework and a corresponding webservice. I call it Ardumote, because when I started working on this, all I wanted to have is a simple remote control app for my mobile phone.

the idea

The basic idea is to use a arduino only for operating actors, requesting sensor values and communicate all this stuff to another device. To make things flexible we have ActorModule-, SensorModule- and CommunicationModule classes with a common interface and thus said you simply attach actor objects, sensor objects and communication objects to your Ardumote instance which handles everything in this manner:

loop {
  if (command available from any communication module) {
    process command / operate specified actor;
  if (value available from any sensor module) {
      send value to all attached communication modules;

The communication protocol is kept human readable and very simple. You can find more details at

The „other device“ could be a application on your computer/smartphone using the (bluetooth) serial communication module, a webapplication on your home or remote webserver or – what I personally focus on – a webservice at using the ethernet IRC module.

What is ready for now:

  • The basic ardumote library using plaintext (recommended for Duemilanove/Uno) or md5 (recommended for Mega) authentification
  • A analog and a digital sensor module -> just read a analog/digital pin in a defined interval, useful for LDR or LM35 temperature sensors for example
  • A analog (PWM) and digital actor module -> just write a analog/digital pin, useful for switching LEDs for example
  • A RCSwitch actor module -> just a wrapper for the RCSwitch library to operate RC power sockets, only works on Arduino Mega
  • A serial communication module -> test & debug in serial monitor, useful for eventually processing or android apps via bluetooth
  • A ethernet IRC communication module -> connects to
  • A ugly basic web interface at giving the ability to register a Ardumote controller, operate actors and log sensor values.
    This is what it looks like:

What I want to have in near future is:

  • Refactoring to minimize the RAM consumption (hope to get the RCSwitch module running on a Duemilanove/Uno)
  • A RCSwitch sensor module -> use a simple remote control
  • Set event based actions at the webservice -> if (LDR < threshold) { switch on lights; }
  • A fancy web interface with the possibility to compose customized fancy remote control interfaces
  • A Android app to use the fancy remote control interfaces 🙂

Quickstart if you want to try the pre alpha (ethernet shield needed):

  • Get yourself the RCSwitch and Time libraries
  • Sign up at, login and add a new Ardumote controller.
  • Get the library
  • Take the example sketch which comes along with the library, change the following lines according to the Ardumote controller you’ve created in step 1 and your local network settings:
    #define ARDUMOTE_SHARED_SECRET "2d520b8f5ea2cf6113a578f57b45201c"
    byte mac[]     = {  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
    byte ip[]      = { 192,168,0,11 };

    Btw: As the arduino connects via IRC and keeps being connected, there is no need to setup anything on your router 🙂

  • Plug in a ethernet shield, a LED to pin #5 and pin #6, plug in a analog sensor to analog pin #0
  • Upload and wait until the LED at pin #13 switchs on (which indicates that the Arduino is connected to the IRC server)
  • Now you should be able to control the LEDs at the webinterface

Feel free to share your toughts in the project forum (no registration required)