Posts mit dem Label ethersex werden angezeigt. Alle Posts anzeigen
Posts mit dem Label ethersex werden angezeigt. Alle Posts anzeigen

Mittwoch, 14. Dezember 2011

Energy monitor redesign

Yesterday i did a complete redesign of my energy monitor system. It is based on an Atmega32 running on a Pollin RF-Evaluation Board connected to three current clamps for measuring the current in the three phases of my house wiring. The current clamps are place just before the RCD in our home.


The software on the Mega32 Energy-Node was based on the ethersex-framework. It worked pretty well, until i added more wireless node to the 433 MHz network. After a Jeenode running ethersex went online, i experienced frequent hangups of the energy node.
So i had the choice between either fixing the hangups or port the Arduino-compatible JeeLib software to my controllers. As the ethersex framework  has grown to a really big project i found it hard to surf through all the source to check whats going on in the software. So i decided to go for the arduino stuff. This code basically consists of small hardware drivers and the main application loop. Clean, simple, easy to understand, and until now - stable.
Especially the JeeLib-Code is designed for low-power devices, and it will be easier to build a battery based application with this codebase.
So first i set up an Eclipse environment for development. I ported the arduino stuff to work inside a C++ Eclipse project and integrated support for automatic programming with avrdude. The arduino Mac application is fine for an easy start, but i like my used eclipse environment for development. This was all pretty straight forward due to the work auf the AVR-Eclipse-Plugin, the Crosspack AVR Crosscompiling-Toolchain for Mac OS X and theAVR-Netino project.

After the Basestation and Energymonitor-Node were able to run basic demo "sketches" (Arduino slang for 'main application loop'), is continued added more functionality. More on this later.

Mittwoch, 16. November 2011

Internet of Things

Last winter i had the idea to add our flat some automation functions. I looked for solutions that were comercially available, but what i found would not thrill me. As i didnt want to put cables into every edge of our flat, i was basically limited to wireless solutions. I found two that seems ok to me: The FS20 system and its successor, called "Homematic". While FS20 has a wide range of different actors and sensors, and is pretty cheap, it has some basic limitations: communication takes place in only one direction, there is no acknowledgment of commands send to an actor. I think this is a bad thing in general, as it may lead to malfunctions. Home automation, including lightning and heating is not where i want to debug communication issues. This stuff simply has to work.
The other limitation is security: FS20 communication is completely unsecured, there is only a "house id" to prevent unwanted interaction with your neighbors devices..

The FS20 successor improves both limitations: It has bidirectional communication and encryption. What detained me from getting the homematic system then was the quite high price tag, the need to buy a special master station and some the design of the thermostats/radiator valve actors. Each rooms needs its own thermostat which then controlls the radiator actors. Adding the cost of the master station i would need to buy, i eventually ended up at a price of several hundred euros just for basics functionality. To much money for just playing around a little bit.

So last winter i decided to build some stuff on my own and did research on what would be a good point to start with. There are a lot of ressources on the net dealing with home automation stuff, but i had some preferences. As i already did a lot of projects using the AVR 8/32bit family of microcontroller from Atmel, i wanted to use one of these controllers. I also searched for solutions that provide many software components (drivers, servers, communications stacks, etc..) ready to use and tested. I know what effort it takes to get software from a quick-and-dirty hack to something useable for a reliable solution.

During my research i stumbled upon many interesting projects. I wont list them all, but some i kept following for some time, e.g. http://jeelabs.net/ building small wireless microcontroller notes or the Open Energy Monitor http://openenergymonitor.org/emon/

Eventually i got a pack of evaluation board available from http://www.pollin.de and startet with a software package named (badly) "Ethersex" http://www.ethersex.de

In the folloing i will describe some of the things i learned when playing aroung with this stuff.