WiFi based Smart Home system
The system described in this project aims two simple goal:
- Gather various information from the smart-nodes in the house, and let the user access this data from a smartphone
- Control some smart devices in the house
Architecture
The current solution implements a mixed LAN / WAN architecture, with the following functions and restrictions:
- The devices can only be controlled by the mobile clients connected to the local WiFi network.
- The local client gets the aggregated data from the cloud server
- If the cloud server in not accessible, the local client can access the devices directly (reading data, sending commands)
Technical details
IoT devices
ESP8266 based devices implementing HTTP client for sending data to the cloud server, and also HTTP server for handling the direct connections.
Cloud server
Custom central server running on node.js + express 4, implementing the following functions:
- Collecting, aggregating data
- Serving the mobile clients
- Authenticating the users (google)
Mobile Client
JavaScript WEB application, capable to run offline (when the cloud server is unreachable) using the state-of-the-art application cache HTML5 function.
The Smart Nodes
Humidity control
Background
Bathrooms can be wet places... usually because of showering or having a bath, which create a lot of humid air. This vapor should be extracted from the room, and usually extractor fans are used for this purpose.
The ordinary fan control in a bathroom is usually connected to the main light switch. However people use the bathroom for reasons other than showering, and in these cases the operation of this fan is unnecessary, and results in avoidable energy consumption and noise production.
Solution
The device simply measures the room humidity, continuously calculating the average level over a predefined time period (over the past hours). It then turns on the fan if the level is 5% higher than the average, and turns it off when the humidity has dropped below the average level plus 2%.
Fancy IoT Functionality
The device can connect to the home automation server to provide the following extra functions:
- The device continuously reports the values to the IoT server as a data log
- The user can check the charts of the measurements on the server's web page
- The user can deliberately override the fan control. One can set a timed and forced operating period regardless of the humidity measurements. It can also be disabled in the same way for a user selected time period.
Door / lock status report
This type of smart node reports the garage door open / closed status, and the lock's locked / unlocked status as well.
Universal Smart Nodes
The smart nodes should support various data acquisition or control functions. They can be powered from AC mains, or some sort of batteries. To achieve flexibility the ESP8266 based MCU board has 2 identical standard peripheral connector. This way different input or output modules can be connected.
The peripheral modules can either communicate on I2C or SPI protocol with the MCU.
The existing modules for the extractor fan control: