Tuesday 27 January 2015

Eclipse Open IoT Challenge - project inception

This is a description of my proposal for home automation IoT solution.

Case

There are water meters with impulse transmitting in apartments of a typical apartment building.
Meters are already built into the apartments’ water system (two meters per flat - one for hot water and one for cold water), but their impulse transmitting outputs are not in use at the moment. Owners of apartments have to take readings of water consumption from meters and manually submit them through the website or mobile app to form utility bills on a per month basis.

Project objectives

The goal of my project is to implement distributed system to automatic measure the flow of water used by household needs.

The resulting raw measurement data will be published periodically into the Cloud infrastructure, through IoT gateway using MQTT protocol. The Cloud infrastructure includes MQTT message broker, stream processing engine, NoSQL datastore, UI component for data visualization and HTTP bot for monthly automatic data sending to the utilities website on behalf of the user (apartments owner).


Component view of the system



  1. Standalone battery powered component (remote sensor), includes microcontroller and wireless serial Bluetooth RF Transceiver Module. Impulse transmitting outputs of both water meters are connected to the component, which counts the number of impulses and stores its current values in EEPROM of the microcontroller. The component will utilize USART of the microcontroller to communicate with Transceiver Module.
  2. Raspberry Pi component, running Raspbian OS. RPI has two wireless USB dongles connected: WiFi dongle and Bluetooth dongle. Eclipse Kura is installed on the device and will be used as IoT gateway. OSGi bundles will be developed:
  • for wireless serial communication via RFCOMM protocol with remote sensor in polling mode for data requests, since the sensor’s Bluetooth RF Transceiver Module runs in slave mode;
  • for data preprocessing (adds timestamps to received data, water meter uid, etc.) and message publishing via MQTT protocol into the Cloud infrastructure.
     Bundles will be implemented as configurable components.

The following components will be deployed on two RHEL-7.0 t2.micro type Amazon EC2 instances: first instance will run components 3, 4 and second instance - components 5, 6.


3. Broker component, based on Mosquitto MQTT Broker. This component has at least two preconfigured topics for data messages from both water meters.

4. Stream processing component, based on Apache Storm framework. The component will run topology, which subscribes to the Broker component topics, consumes data messages from the broker, processes and sends measurement data to the Datastore component using exactly-once delivery semantics.
In addition, the Stream processing component will provide real time data analysis. Concretely, and Outlier detection functionality will be implemented (most likely based on Extreme Value Analysis). This functionality will be used as an water leakage detection and alerting system. IM alerts will be sent to the user using XMPP protocol and stored in the Datastore component.

5. Datastore component, based on MongoDB database. The component persists time series measurement data, notifications and alerts event data and current state of the Stream processing component if necessary.

6.  UI & Scheduling component. Will be implemented as Spring Boot standalone application. The component will deliver real-time and historical data to the user, providing online visualization, reporting and notification functionality through the Server Sent Events, HTML5 and d3.js framework. Additionally, the component will contain HTTP bot. A task will be executed on a monthly basis to run the HTTP bot for automatic submitting of total flow rate values for both meters to the utilities web portal on behalf of the user.

I'll try to set up a kind of incremental development process while working on the project. So the first iteration objective: install hardware parts and start to receive meter data in Kura.