The quest for a Home Monitoring System : Part 1
For a long , long time I wanted to have a system to monitor, and perform data collection, on my home.
A modular system where I could gather data from indoor and outdoor temperatures to local power consumption.
The system is meant to be designed in such manner that the server side is fully abstracted from the sensor module side, more sensors modules may be implemented on different hardware platforms. There can be as many sensor modules as required, connected on a single Ethernet network.
Sensor Module Hardware (Prototype)
An Arduino is being used as base, in order to allow for the construction of a fast prototype. Data is sent to the server via TCP/IP, by a HTTP GET request.
The Ethernet shield used is based on the MIcrochip’s ENC 28J60 Ethernet controller. The UIPEthernet library was used, as it is a drop-in replacement for the standard Arduino Ethernet library, with support for DHCP, and DNS, which is a huge plus, in order to integrate the sensor modules into my home network.
The current prototype is connected to a 1-wire temperature sensor (a DS18B20).
The server should be able to run in any hardware capable of running a lamp stack.
Sensor Module to data base interface
In order to exchange information between the sensor modules and the server over tcp/ip one of the following approaches were considered:
- Write an application running on the server that is capable of accepting and managing several simultaneous connections from several sensor modules. Its a more lengthy and harder approach.
- Use an already established method that can already do that is described above, but without having to write a native application from scratch.
The method for implementing a communication method that satisfied the above criteria was to use a php script. It solves the concurrency issue, as well as its far more simple to implement.
Data Base Design
The initial diagram described above does not take into account that one sensor module may have more than one sensor attached (some of my requirements changed mid development).
The monitoring system must also have a catalog of the sensor modules and sensor types.
Front end and back end
As of 25th of February, I’m still undecided about the implementation, but both the back end and front end will be probably built with bootstrap and php.
As of today, the sensor module is already capable of sending data via Ethernet via HTTP GET method described above, into a lamp stack installed on the development machine.
To be continued…..