Smart Home Environmental Monitoring System

Motivation Project

The project seeks to address major issues in contemporary living spaces for increased efficiency, comfort, and safety. Conventional approaches to safety and environmental monitoring are either manual or do not have real-time reaction capabilities. For example, delayed fire alarms or undiscovered gas leaks can result in disastrous situations. The suggested system makes homes safer and more energy-efficient by automating environmental monitoring and reaction processes with sensors and actuators.

Moreover, the incorporation of cloud-based platforms such as ThingSpeak and oneM2M facilitates structured resource management and real-time data visualization. The project shows how technology may be easily incorporated into daily life to enhance general well-being by utilizing automation and the Internet of Things.


List of Required Components

System Architecture:

System Architecture

Indoor Node

The indoor node's purpose is to keep an eye on the home's environmental conditions and send out safety alerts, especially in the event of a gas leak or fire. It operates independently, gathering information, processing it, and sending out real-time alarms.

By keeping an eye on important variables including light intensity, temperature, humidity, gas levels, sound, flame, and motion, the goal is to create a secure and cozy indoor environment. The node guarantees quick hazard detection and promptly alerts the user. Circuit diagram is shown below.

Indoor node

Components:

Click to see Code used in Indoor Node

Outdoor Node:

With an emphasis on weather and noise levels, the outdoor node collects environmental data from the surrounding area. It offers information about environmental factors that may have an impact on safety and comfort.

The goal is to help with weather forecasting and noise pollution studies by keeping an eye on external environmental characteristics such as temperature, humidity, rainfall, light intensity, and sound levels. Circuit Diagram is shown below.

outdoor node

Components:

Click to see Code used in Outdoor Node

Actuation Node:

As the system's command center, the actuation node responds to notifications and controls appliance automation in response to user input.

The goal is to regulate appliances like lights, fans, and ventilation systems for safety and energy efficiency, as well as to coordinate responses to alerts (such as gas leaks or fires).Circuit diagram is shown below.

master node

Components:

Click to see Code used in Actuation Node

Possible Methods for Verifying the Implementation

  1. Real-Time alerting: To ensure prompt alerting, simulate situations like gas leaks or loud noises.
  2. Actuation Testing: Verify that sprinklers, fans, and alarms react precisely to threshold violations.
  3. Dashboard Updates: Confirm that Grafana consistently shows both historical and real-time data.
  4. Integration: Verify that cloud platforms can communicate with both interior and outdoor nodes.
Python Code for sending data from OM2M to PostgreSQL OM2M resource tree

Webpage: The Central Monitoring Hub

The webpage is designed as the primary user interface for interacting with the Smart home environmental monitoring system. Its primary purpose is to offer centralized real-time data visualization and enable appliance control from a web platform.

Purpose

Key Features:

Click to see code for webpage
Web page

Mobile App: Extending the System on the Go

The mobile app complements the webpage by offering a portable solution for monitoring and controlling the system remotely.

Purpose:

Key Features:


Image 1
Image 2

Grafana DashBoard:

Click to import json code for Dashboard Image 1

Integration and Data Flow

Data Collection:

Indoor and outdoor sensor nodes continuously collect environmental data, including temperature, humidity, light levels, and hazards like gas or flame presence. Immediate detection of hazards ensures rapid response.

Data Communication:

The collected data is sent to the ThingSpeak and oneM2M platforms for storage and processing. Alerts, including hazard warnings, are transmitted via MQTT and Telegram for user awareness.

Data Visualization:

Grafana, integrated with ThingSpeak, provides interactive and clear graphical representations of the sensor data, helping users understand environmental conditions at a glance.

System Control:

Control of appliances is facilitated through:

gas alerts flame alerts

Data Analysis:

Temperature Comparison For indoor and outdoor node :

The outdoor node shows a peak temperature around 11:00 AM as there is presence of direct sunlight and the lowest temperature around 6:00 AM. The highest recorded temperature is 43°C, and the lowest is 19°C.

For the indoor node, temperature variations are smaller, staying between 25°C and 27°C.

In out Temperature

Humidity Comparison for Indoor and Outdoor Node

The humidity trends for indoor and outdoor nodes are similar but with a slight offset. Around 11:00 AM, humidity is at its lowest due to higher temperatures.

In out Humidity All temperature and Humidity

Rain sensor analysis:

The rain sensor detects some readings even without rain, likely due to morning dew between 10:00 and 11:00 AM.

Rain

Prediction on Temperature and Humidity Data

Here we are using LSTM model for Prediction

Image 1 Image 2 Image 3 Image 4

The RMSE values indicate the performance of the LSTM model in predicting temperature and humidity. The indoor temperature RMSE (0.0535) is significantly lower than outdoor temperature RMSE (0.1705), suggesting better accuracy for indoor predictions. Similarly, the model performs slightly better for outdoor humidity (0.8909) compared to indoor humidity (1.1630), highlighting room for improvement in humidity predictions.

Conclusion

IoT technologies integrated into the Smart Home Environmental Monitoring System ensure that modern homes are safer, more efficient, and more comfortable. The selection of sensors is a crucial component, directly influencing data accuracy, reliability, and ease of integration with the ESP32 microcontroller.

Accordingly, based on observations and identified areas for improvement, the project emphasizes shifting to digital sensors where applicable. Digital options, such as I2C-based sensors, outperform their analog counterparts by reducing noise interference and ensuring precise, consistent readings. Specifically:

While the analog pins on the ESP32 occasionally exhibit inconsistent trends due to noise, these challenges have been largely mitigated through the use of digital communication protocols like I2C. The current DHT sensors for temperature and humidity have demonstrated reliable data collection and are recommended for continued use.

This transition to digital sensors enhances the system's accuracy, efficiency, and responsiveness to real-time environmental changes. Additionally, the system demonstrates cutting-edge smart living capabilities with its robust architecture of indoor, outdoor, and actuation nodes, seamlessly integrating with platforms like MQTT, ThingSpeak, oneM2M, and Grafana.

In conclusion, the Smart Home Environmental Monitoring System is a scalable, adaptable, and innovative solution for real-time monitoring and automation. The integration of digital sensors solidifies its position as a high-performance and reliable system, paving the way for safer, smarter, and more sustainable living environments.

Drive link: Drive link
Google Colab link: Colab link