The initial sensor module was done with an Arduino + DS18B20 sensor and a ENC28J60 ethernet chip. It was pretty fast to build a prototype that would send data via ethernet to a server running a LAMP stack.
However, since I want to have sensors trough out the house (including the exterior), it became a problem since I’m unable to pass an Ethernet cable everywhere I might need a sensor module installed.
The cheapest to add wifi capabilities to an arduino based system would be to add an ESP8622 wifi module :
They are low priced – around 1,7€ a piece on ebay.
Answer to AT commands via serial communication (thus an arduino board could simply send AT commands to the module with the data).
But upon more reading, it was also noted that the ESP8266 could be used as a stand alone module, without the arduino hardware. This helps drive the cost and assembly complexity of each module down further. A major plus was the fact that the arduino IDE can be used with the ESP8266, work with most libraries already included, without changes to software development workflow.
And since the ESP8266 supports I2C and 1 wire data buses, any sensor supporting those protocols can be added to a ESP8266 module.
Sensor module variants
A total of 3 variants of the ESP8266 based sensor module, as of 17th February, were built:
A module only using a temperature sensor (the DS18B20), with no RTC on board. Exists in breadboard form only and it is currently in use.
A module using both a DHT22 humidity and temperature sensor, and also a DS18B20 sensor. Also without RTC support. Module was disassembled and parts used on the PCB version 1.0.
A module using a DHT22 humidity and temperature sensor, with a DS1337 RTC, as used on my Nixie Clock. This version was built on a PCB designed in KICAD, and it is currently in use.
Changes to the Home Monitoring System Architecture
Almost a year later, and a working prototype, the development of the monitoring system had reached a standstill, mostly due to the lack of time :
On the sensor side , the Arduino + ENC28J60 + DS18B20 combo works, although it is dependent on the availability of a network cable. But the hardware is functional.
On the server side , the development of a backend and frontend with the flexibility required (multiple sensor support, dashboard with user selected time intervals, etc) was starting to take too much time.
So I was faced with a decision regarding the server side of the system:
Fully development of a frontend and backend , using a LAMP stack and bootstrap templates. This would take time that I simply don’t have, and the project would probably still be stalled.
On the hardware side, I had some ESP8622 (ESP-12) modules to try out.
Server Side changes
The server side of the Monitoring system was the one that was the most time consuming.
One of the major changes was the replacement of the LAMP stack for elasticsearch and kibana for data storage and visualization respectively. This removed the need to write a backend and a frontend from scratch. The time that would be spent on writing the back and front ends was spent on the sensor module development (both hardware and software).
Elasticsearch, according to the authors:
” Elasticsearch is an open source distributed, RESTful search and analytics engine capable of solving a growing number of use cases.”
With elasticsearch, the sensor modules sends data in json , instead of sending the data via http get to a php script with the previous Monit System architecture.
And a dashboard with visualizations of the data can be done in minutes.
Although the arduino + enc28J60 sensor module was not entirely abandoned, hardware development focus was oriented on the ESP8622 based modules.
The ESP8622 have some interesting advantages over the arduino + ENC28J60 combination :
The ESP8622 can be sourced from around 1,7 € a piece (ESP-12) (and it replaces the arduino board and the ENC28J60 in one package)
It can be used with the Arduino IDE , and use most of its libraries (no need to learn a new SDK and new tools).
No additional network hardware required, since the ESP module is a wifi module first and foremost (DHCP, WPA2 supported out of the box), and thus I could place the sensor module anywhere as long as there is wifi coverage, including the exterior of the house.
Less parts per module, since the ESP8622 has an ARM CPU besides the WiFi capabilities : besides the module itself, only the sensor, a RTC (if needed) and some passive components are needed.
However the usage of the bare modules are not as “plug and play” as with arduino boards – additional hardware and wiring required . This is not an issue since the final goal is to have a custom made PCB for the sensor module.