0% found this document useful (0 votes)
8 views17 pages

Project Demo Presentation

Project regarding IOT
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
8 views17 pages

Project Demo Presentation

Project regarding IOT
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 17

T

t PP
ec
oj
Pr

IOT in Assistive Living

- Project Demonstration
- Overall Framework
- What is done ?
- How it is done ?
- Future Steps ?
- How they are implemented ?
Project Overview

● Objective : To create a framework (Requirements) :


○ Assistive living using IOT nodes
○ Using MQTT for Broker-Client messaging service
○ Creating Data storage for the data to forward to clients
○ Having a client Interface for Data and Statistics
○ Handling Database and Messaging Management for Reliability and
Scalability
Key Components

1. IoT Nodes:
○ Sensors to monitor various environmental parameters (e.g., temperature, motion, health data).
○ Interaction with other devices in the assistive living space.
○ Communicate data to the MQTT broker.
2. MQTT Messaging:
○ Broker: Mosquitto is used as the broker for managing message exchange between nodes and clients.
○ Client: Android devices subscribe to topics and receive messages from the IoT nodes.
3. Data Storage:
○ All sensor data and client requests are logged in a database.
○ Data forwarding to clients for visualization and statistics.
4. Client Interface:
○ A frontend interface (Android app) for monitoring data and viewing statistics from the IoT nodes.
○ Real-time visualization of key metrics (e.g., temperature, alerts).
5. Database Management:
○ Stores historical data from IoT nodes for analysis and reporting.
○ Ensures reliability and scalability to handle growing data sets.
6. Reliability and Scalability:
○ Techniques such as QoS in MQTT and load balancing for database and messaging services to ensure robust performance.
3. Technical Stack

● MQTT Broker: Mosquitto (lightweight, low power consumption)


● Platform: Android (client), IoT (nodes)
● Messaging Protocol: MQTT (Message Queuing Telemetry Transport) for lightweight, reliable communication.
● Database: MySQL/NoSQL (for scalable storage)
● Frontend: Android App with charts and data visualizations.

4. MQTT Implementation

● Broker Setup (Mosquitto):


○ Installed and configured Mosquitto as the MQTT broker.
○ Defined topics for each node and client to subscribe/publish messages.
● Android MQTT Client:
○ Implemented MQTT client on Android using the Eclipse Paho library.
○ Subscribes to specific topics (e.g., sensor data) and handles message reception.
● Message Structure:
○ Messages are published in JSON format for ease of data parsing.
○ Topics structured hierarchically (e.g., assistive/living/sensors/temperature).
Technical Stack

● MQTT Broker: Mosquitto (lightweight, low power consumption)


● Platform: Android (client), IoT (nodes)
● Messaging Protocol: MQTT (Message Queuing Telemetry Transport) for lightweight, reliable communication.
● Database: MongoDB (for scalable storage)
● Frontend: Android App with charts and data visualizations.

4. MQTT Implementation

● Broker Setup (Mosquitto):


○ Installed and configured Mosquitto as the MQTT broker.
○ Defined topics for each node and client to subscribe/publish messages.
● Android MQTT Client:
○ Implemented MQTT client on Android using the Eclipse Paho library.
○ Subscribes to specific topics (e.g., sensor data) and handles message reception.
● Message Structure:
○ Messages are published in JSON format for ease of data parsing.
○ Topics structured hierarchically (e.g.,sensors/temperature).
5. Client Interface and Frontend

● Frontend Interface:
○ A responsive Android app.
○ Displays real-time sensor data (temperature, motion, etc.) and historical statistics in a graphical format.
○ Allows users to subscribe/unsubscribe to topics.
● Features:
○ Real-time Monitoring: Live data updates on the app.
○ Alert System: Sends notifications for abnormal sensor readings (e.g., high temperature).
○ Data Visualization: Graphical representation of sensor readings over time.

6. Database and Data Management

● Storage Design:
○ Centralized database (SQL/NoSQL) for storing IoT node data.
○ Indexed for efficient retrieval and scaling.
● Data Handling:
○ Automatic logging of incoming messages from IoT nodes.
○ Data forwarded to subscribed clients in real-time.
○ Historical data available for statistics and trend analysis.
7. Reliability and Scalability

● Message Quality of Service (QoS):


○ Implemented different levels of QoS (0, 1, 2) for message delivery guarantees.
○ Ensured that critical messages (e.g., alarms) are delivered reliably.
● Scalability:
○ MQTT's lightweight protocol allows many IoT devices to communicate simultaneously.
○ Horizontal scaling for database and message handling to manage more nodes as needed.

8. Challenges and Solutions

● Latency and Performance:


○ Optimized MQTT payloads for faster transmission.
○ Deployed MQTT with QoS 2(But can be re-configured in app) for important messages to ensure delivery with a small delay
for Acknowledge packet to the broker.
● Data Integrity:
○ Implemented message retries in MQTT.
○ Database backup strategies to avoid data loss.
Documentation for Android Client Implementation

There are only few Android libraries which implements MQTT protocol, but fortunately they are well documented and work fine.

The most famous libraries are: Eclipse Paho Android Service , HiveMQ MQTT Client library
In our app , we used the Eclipse Paho library.

App is composed by two fragments:


1.Connect fragment
It allows you to insert the MQTT Broker details you want to connect to.
2.Client fragment
You can interact with the MQTT Broker by publishing and subscribing on the topics.

Connect
Subscribe Publish
Documentation for Web Client (backend)
API Documentation for Assistive Living System

1. Overview : This API is designed for managing assistive living environments using IoT nodes. Users log in with family
credentials and access houses, rooms, and nodes. The system allows for managing rooms and nodes while providing
data visualization for each node.

2. API Endpoints
1. Family: Manages family login and houses associated with a family.
2. Home: Manages homes under a family.
3. Room: Manages rooms within a home.
4. Node: Manages nodes within a room and their corresponding data.

Family Routes
Flow:After logging in, the user can retrieve all the houses linked to the family.The familyController handles
authentication and management of family-related data.

Family Login Flow

● POST : /login:

Payload:
{

"familyName": "string",

"password": "string"

Response:
{

"success": true,

"token": "jwt_token",

"homeIdsArr": ["homeId1", "homeId2"]

}
*Similarly, for all other routes too, docs will be available soon in postman docs.
Home Routes Flow:After logging in, the user selects a home from the list provided by homeController.
Houses are stored in an array in the family model (homeIdsArr).

Room Routes Flow :After selecting a home, the user can view rooms associated with that home.
Room details include its name, description, and associated nodes (nodeIdsArr).
Node Routes Flow:Once a room is selected, the user can view all nodes in that room.
Each node contains sensor data such as activity, predictions, and timestamps.
3. Database Models
The API uses MongoDB for data storage, with each main entity (Family, Home, Room, Node) represented by a schema.

3.1. Family Model

familyName: { type: String, unique: true },

_id: { type: String, required: true, unique: true, isPrimary: true },

password: { type: String },

homeIdsArr: { type: Array, default: [] },

familyUsersIdsArr: { type: Array, default: [] }

● Attributes:
○ familyName: Unique name of the family.
○ _id: Unique identifier for the family.
○ homeIdsArr: Array of associated home IDs.
○ familyUsersIdsArr: Array of family members' user IDs.
3.2. Home Model
homeName: { type: String },

_id: { type: String, required: true, unique: true, isPrimary: true },

roomIdsArr: { type: Array, default: [] }

● Attributes:
○ homeName: Name of the home.
○ _id: Unique identifier for the home.
○ roomIdsArr: Array of associated room IDs.

3.3. Room Model


roomName: { type: String },

_id: { type: String, required: true, unique: true, isPrimary: true },

roomDesc: { type: String },

nodeIdsArr: { type: Array, default: [] },

userIdsPresent: { type: Array, default: [] }

● Attributes:
○ roomName: Name of the room.
○ _id: Unique identifier for the room.
○ roomDesc: Description of the room.
○ nodeIdsArr: Array of associated node IDs.
○ userIdsPresent: Array of user IDs present in the room.
3.4. Node Model

_id: { type: String, required: true, unique: true, isPrimary: true },

activityArr: { type: Array, default: [] },

predictionArr: { type: Array, default: [][10] },

probabilityArr: { type: Array, default: [][10] },

timestampArr: { type: Array, default: [][10] }

● Attributes:
○ _id: Unique identifier for the node.
○ activityArr: Array of recorded activities.
○ predictionArr: Array of predictions.
○ probabilityArr: Array of probabilities associated with predictions.
○ timestampArr: Array of timestamps for activities.
Documentation for Web Client (Front End)

Login Select Homes

View Nodes Select Rooms


Thank you

You might also like