A DIY cloud centered, iOS controlled, Arduino based Home Automation System – Part 1

Wireless Node Prototype

There is a lot of buzz around things like “Internet of Things”, “Home Automation”, and “Smart Homes”. One reason for buying into commercial home automation systems is energy savings. At least that is often the main marketing message for commercial products. That is not true, as recent studies found out, and it is not my main motivation to build such a system.

A lot of commercial systems use Bluetooth (Low Energy) Systems zu drive their home automation solutions. You have a device, and an App that is connected to this device to control it. Sometimes, you have an array of devices, that are connected to a hub often with Zigbee based Mesh networks (so your Smartphones App only needs one connection). One example for that is Philips Hue Light System. Apple realized this is a problem as no one wants 10 Apps to control different aspects of their home and introduced HomeKit. While this really sounds interesting on iOS-Controller side, it remains to be seen how this works out on devices and compatibility (and price of course).

When I first got my Philips Hue System I have been impressed and loved it from day one and do so till today. But we have not installed it in every room. And controlling it with your phone is great, but it’s also tedious to pick up your phone to turn on light in a room you are just entering and turning it of when leaving the room. We often end up using the light switches on the wall, which kills that whole Home Automation thing as lights switched off on the wall cannot be turned on again wirelessly.

IFTTT  and Philips Hue: just magic

Things got really interesting when I tested IFTTT.com. What a great service. With “If This Then That” it’s possible to interconnect different web services and trigger actions based on data or triggers of other services. I created a very small receipt turning on my Philips Hue lights at sundown and turns them off at 1 o’clock in the night as a fallback if I just forget to turn lights off when I go to bed.

And it really works well most of the time. And that is really magic. If you have Philips Hue installed. Give it a try. It’s magic. Yesterday I have cooked and thought that it’s about time to turn the lights on, a few seconds later they turned on. Without pressing a key. Without picking my phone. On cloudy days, you sometimes have to turn lights on before sundown, because it’s just kind of dark. This is where large scaled systems like IFTTT have not enough details.

That’s been the moment where I decided to make my own DIY cloud centered, iOS controlled, Arduino based wireless Home Automation System.

(more…)

Read More

Running Node.js on Arduino Yun

Arduino Yun is a great device once you learn how to use it correctly. Microcontrollers like the Atmel-ICs used in all nearly all Arduino compatible devices haven’t a lot of power or memory to Internet-Traffic. Of course they can, there are libraries and modules out there that will transform your little Arduino in a full-fledged Internet of Things device, but you will not have a lot of fun running it.

I.e. a typically RESTFul Web service will deliver so much JSON-Code that even a slightly more complex response will blow the memory of your Arduino.

Arduino Yun, and a few others like DigiX (sold in Germany for example by cboden) or Udoo solve this problem by merging the best of both worlds onto one device. Imaging a Raspberry Pi with an Arduino. If you want to know more about the difference between those two I have a small introduction on both devices.

Arduino Yun packs a full-fledged rather powerful Linux-machine onto an Arduino Leonardo. A so-called bridge allows the Linux part to talk to the sketch, and the sketch is allowed to run the Linux shell. This way you can use everything that has ever been build for Linux, the whole Internet-Stack, and the Arduino Sketch controls all that.

The previous example of running a rather complex RESTFul-Webservice, the sketch would run a Python, PHP, Node.js-Script on the Linux side that will request the data, process them, and delivers back only the really useful things to the micro controller. This way memory is now blown.

Since the latest software-update for Yun (see here on how to update your Yun) you are allowed to run Node.js on the Linux side of your Yun. That way you have a very powerful combination as Node.js is basically exactly build for that: Handling events in a very easy and transparent way. I have never really loved to work in Python, so I have been very pleased to know that I can write my Arduino Internet of Things Code in JavaScript using Node.js.

(more…)

Read More

Arduino vs Raspberry PI

It all started with Chumby One

Being a programmer my whole live, I have never really touched the hardware. I have developed all sorts of Applications, Platforms, web pages, etc. Being fascinated in small and mini computers I found myself buying a Chumby One a few years ago. This rather useless device (for me) launched my interest in small computers and programming them.

The Raspberry PI came into my home

A few month later I bought a Raspberry Pi (Model B) and started developing an interface for my ADF-Scanner. I loved the scanner, but I hated to mount it to my laptop and spending an evening scanning papers coming in the last months. I wanted a solution that runs the scanner and uploads the generated PDF-Documents to my Home Server (QNAP NAS) so I could scan a paper every evening without hooking up USB cables. As a simple user interface I ordered a simple LCD-Screen, hooking it up to the Raspberry PI. I got results, but I really did not like it and it was very unreliable. The Raspi lost WLAN connectivity, crashed or stopped. I think it has been powering issues perhaps now fixed in B+. But even besides that programming the Raspberry PI did not made me happy. Why? Because I had to use the Linux Shell, because all just felt like programming ordinary Computers without learning anything new but being restricted to odd C++ Frameworks, etc… And I did miss my Cocoa Frameworks. When developing rather large scale applications I really miss the clean, fast and reliable Cocoa-APIs  for Mac OS X or iOS Programming. I ended up implementing a small App on my rather old Mac Mini running fine till today.

Anyone else out there who is waiting for a small, cheap ARM-based Apple Device with GPIOs that can be programmed with Cocoa?

Arduino got my heart

A few months ago I discovered Arduino for me. I have heard of it a few times before. But I never really got behind the idea until I took the time to read a few articles about it. For anyone who does not know what Arduino is, I try to sum it up in a few sentences:

Arduino is a convention and a product. The Arduino products are small mini computers based around rather slow Atmel Microprocessors, ranging from 8 MHz around 70 MHz and memory measured in KB and not GB! But it’s also a convention in that everything around Arduino is Open Source and there are a lot of rules all Arduino devices follow – if a device follows there rules it is Arduino compatible and should run everything that has been developed for Arduino before by other groups or person that followed these rules. What makes Arduino even more great is that every schematic is open, so you can build your own Arduino compatible device from scratch if you follow the basic principles defined by Arduino.

(more…)

Read More