Window Automation Project based upon Temperature and Wind Sensor by Using DC Motor with Encoder and Arduino UNO R4 Wi-Fi Board and Mobile App

In the age of smart homes and automated systems, the concept of controlling home environments has extended to include even the smallest details, such as window operation. Automatic window control systems are an excellent way to optimize indoor conditions based on external environmental factors, such as temperature and wind speed. This project outlines the creation of a window automation system using an Arduino UNO R4 Wi-Fi board, temperature and wind sensors, and a DC motor with an encoder. Additionally, by integrating the Blynk IoT platform, users can monitor and control the system remotely through their smartphones, providing both convenience and peace of mind.

The system is designed to automatically open or close a window optimize indoor comfort depending on the surrounding environmental conditions. For instance, the window will open when the indoor temperature exceeds a certain threshold, allowing for natural ventilation. Conversely, if high wind speeds are detected, the system will close the window to prevent damage or maintain indoor comfort. This project is ideal for enhancing home comfort, improving energy efficiency, and protecting property.

Project Overview:

Components used in the Project:

  1. Arduino UNO R4 Wi-Fi:
    • The Arduino UNO R4 Wi-Fi serves as the main controller for the system. It reads data from the sensors, controls the DC motor, and connects to the Blynk IoT platform via Wi-Fi. The built-in Wi-Fi capabilities of the UNO R4 make it ideal for IoT applications.
  2. Temperature and Humidity Sensor:
    • A temperature sensor (e.g., DHT22) measures the ambient temperature and Humidity. The data is used to determine when to open or close the window to maintain a comfortable indoor environment.
  3. Wind Speed Sensor (Anemometer):
    • A wind speed sensor (anemometer) measures the speed of the wind. This data ensures the window is closed during strong winds to protect the interior from damage or discomfort.
  4. DC Motor with Encoder:
    • The DC motor, equipped with an encoder, controls the movement of the window. The encoder provides feedback on the motor’s position, allowing for precise control over how much the window is opened or closed.
  5. Motor Driver (BTS7960):
    • The high ampere motor driver interfaces between the Arduino and the DC motor, allowing the Arduino to control the motor’s speed and direction.
  6. Blynk IoT Mobile App:
    • Blynk is a popular IoT platform that allows users to create a custom interface on their smartphones to monitor and control IoT devices. In this project, Blynk is used to remotely control the window and monitor sensor data. In this project, Blynk is used to remotely control the window and monitor sensor data. User can select the Auto Mode or Manual Mode with respect to requirements and can set temperature, humidity and wind speed limits for both modes. Moreover, we will do the calibration of encoder motor to find the maximum and minimum distance covered by window.
  7. Optional Components: Some other components can also be used like solar panel, batteries, charge controller, air quality sensor and many more. But it depends upon the requirements and budget of end user weheter to add more components or not.

Project Working:

The window automation system operates by continuously monitoring temperature and wind speed. Based on predefined thresholds, the Arduino UNO R4 Wi-Fi controls the DC motor to adjust the window’s position. The Blynk app provides real-time monitoring and manual control, offering a user-friendly interface for managing the system remotely. User can select the Auto Mode or Manual Mode with respect to requirements and can set temperature, humidity and wind speed limits for both modes.

1. Sensor Integration and Data Acquisition:

  • Temperature and Humidity Sensor: The DHT22 sensor is connected to the Arduino, providing real-time temperature and humidity data. SHT20 sensor can also be used instead of DHT22 for better accuracy.
  • Wind Speed Sensor: The wind speed sensor, typically an anemometer, is connected to the Arduino to measure wind velocity.

2. Decision-Making Algorithm (in Auto Mode):

  • The Arduino processes sensor data and makes decisions based on predefined conditions:
    • High Temperature: If the temperature exceeds a certain threshold (e.g., 25°C), the Arduino will command the motor to open the window.
    • High Wind Speed: If the wind speed exceeds a safe limit (e.g., 20 km/h), the Arduino will close the window to protect the interior.

3. Motor Control with Encoder Feedback:

  • The DC motor with an encoder provides feedback on the window’s position. This ensures precise control, allowing the window to be partially or fully opened or closed based on the current conditions.

5. Wi-Fi Connectivity and Blynk Integration:

The Arduino UNO R4 Wi-Fi connects to the Blynk cloud server, enabling remote control and monitoring. The Blynk app on a smartphone provides a user interface with buttons, sliders, and displays for controlling the window and viewing sensor data in real-time.

Code:

#include <DHT.h>
#include <BlynkSimpleEsp32.h>
#include <Encoder.h>

// Define pins
#define DHTPIN 2 // Temperature sensor pin
#define DHTTYPE DHT22 // DHT22 sensor
DHT dht(DHTPIN, DHTTYPE);

#define WIND_SENSOR_PIN A0 // Wind speed sensor pin

#define MOTOR_DIR_PIN1 3
#define MOTOR_DIR_PIN2 4
#define MOTOR_PWM_PIN 5

#define ENCODER_PIN1 6
#define ENCODER_PIN2 7
Encoder motorEncoder(ENCODER_PIN1, ENCODER_PIN2);

#define LIMIT_SWITCH_OPEN 8
#define LIMIT_SWITCH_CLOSED 9

// Blynk credentials
char auth[] = "YourBlynkAuthToken";
char ssid[] = "YourSSID";
char pass[] = "YourPassword";

void setup() {
  Serial.begin(9600);
  Blynk.begin(auth, ssid, pass);

  dht.begin();
  
  pinMode(MOTOR_DIR_PIN1, OUTPUT);
  pinMode(MOTOR_DIR_PIN2, OUTPUT);
  pinMode(MOTOR_PWM_PIN, OUTPUT);

  pinMode(LIMIT_SWITCH_OPEN, INPUT_PULLUP);
  pinMode(LIMIT_SWITCH_CLOSED, INPUT_PULLUP);
}

Calibration of DC Motor with Encoder:

Calibration is needed in order to calculate maximum and minimum revolutions of dc motor for complete window opening and closing. the calibration process will be just one time and it will be done with the help Blynk IoT App.

Applications of Smart Window:

The window automation project, which utilizes temperature and wind sensors, a DC motor with an encoder, an Arduino UNO R4 Wi-Fi board, and the Blynk IoT mobile app, offers numerous practical applications across different environments. Its ability to automatically control window positions based on environmental conditions can be leveraged to improve comfort, energy efficiency, and safety in various settings. Below are detailed applications of this project:

1. Smart Homes

  • Climate Control and Comfort: In smart homes, maintaining an optimal indoor environment is essential for comfort and energy efficiency. This automated window system can regulate indoor temperature by opening windows when it’s too warm inside and closing them when it’s too cold or windy. By integrating with other smart home devices, such as thermostats and HVAC systems, this project can contribute to a fully automated climate control system, enhancing comfort and reducing energy costs.
  • Energy Efficiency: By optimizing natural ventilation, this system reduces reliance on air conditioning and heating systems, leading to lower energy consumption and cost savings. For example, during cooler evenings, the windows can be automatically opened to cool the house naturally, reducing the need for air conditioning.
  • Remote Monitoring and Control: Through the Blynk IoT mobile app, homeowners can monitor and control their windows remotely. This feature is particularly useful when homeowners are away and want to ensure their home remains comfortable or to secure the property by closing all windows in case of unexpected weather changes.

2. Greenhouses

  • Automated Ventilation: Greenhouses require precise control over temperature and humidity to ensure optimal plant growth. This window automation system can open and close greenhouse windows based on real-time temperature data, ensuring the environment remains within the desired range. For instance, the system can open windows to reduce excess heat or close them during cold or windy conditions.
  • Protection Against Extreme Weather: The wind sensor in the system can protect the greenhouse from strong winds that could potentially damage plants or the structure itself by closing the windows automatically when high wind speeds are detected.
  • Remote Farming Management: Farmers or greenhouse operators can monitor and adjust the window positions remotely using the Blynk app, allowing them to respond quickly to changing weather conditions even when they are not physically present at the site.

3. Commercial Buildings

  • Office Climate Control: In commercial buildings, maintaining a comfortable working environment is crucial for employee productivity. This automated window system can be used in office spaces to regulate temperature and ventilation based on real-time data. For instance, during work hours, the system can open windows for natural ventilation and close them in response to adverse weather conditions.
  • Energy Savings: Like in smart homes, this system can help commercial buildings reduce energy consumption by minimizing the use of HVAC systems. By utilizing natural ventilation during suitable weather conditions, buildings can achieve significant energy savings, contributing to overall operational efficiency.
  • Integration with Building Management Systems: This project can be integrated with existing building management systems (BMS) for centralized control and monitoring. Facility managers can remotely manage window positions across multiple floors or sections of the building using the Blynk app or other BMS interfaces.

4. Schools and Educational Institutions

  • Healthy Learning Environments: Ensuring proper ventilation in classrooms is essential for maintaining a healthy learning environment. This system can automate the opening and closing of windows based on indoor temperature and outdoor wind conditions, ensuring classrooms are well-ventilated and comfortable for students and staff.
  • Safety During Adverse Weather: The system can automatically close windows in response to high wind speeds or sudden weather changes, enhancing the safety of the school environment. This is particularly important in regions prone to extreme weather events.
  • Energy Conservation in Schools: Schools can benefit from reduced energy costs by using this system to optimize natural ventilation, reducing the need for artificial cooling or heating.

5. Hotels and Hospitality Industry

  • Enhanced Guest Comfort: Hotels can use this automated window system to provide guests with a comfortable room environment. The system can automatically adjust window positions based on room temperature and external weather conditions, ensuring a pleasant stay for guests.
  • Energy Management: The hospitality industry is highly focused on energy efficiency. By integrating this system, hotels can reduce energy consumption by utilizing natural ventilation, especially during mild weather conditions, reducing the need for HVAC systems.
  • Remote Monitoring for Maintenance: Hotel staff can monitor and control windows remotely using the Blynk app, allowing for efficient room management and quick response to any issues related to window operations.

6. Healthcare Facilities

  • Optimizing Indoor Air Quality: In healthcare facilities, maintaining high indoor air quality is crucial for patient health. This system can automate the ventilation process by adjusting windows based on real-time temperature and air quality data, ensuring a healthy environment for patients and staff.
  • Energy Efficiency in Hospitals: Hospitals and clinics can benefit from reduced energy consumption by integrating this system into their building management. Automated window control can complement HVAC systems, optimizing natural airflow and reducing energy usage.
  • Remote Control for Facility Managers: Facility managers can use the Blynk app to monitor and control window positions across the healthcare facility, ensuring that patient rooms, operating theaters, and other critical areas maintain optimal conditions.

7. Industrial and Warehouse Settings

  • Temperature Regulation: In industrial and warehouse settings, temperature regulation is vital for maintaining the quality of stored goods or ensuring a comfortable working environment. This system can automatically adjust windows to maintain appropriate temperatures within the facility.
  • Protection of Goods: The wind sensor can prevent damage to goods or warehouse structures by closing windows during high wind conditions, thus protecting inventory from environmental damage.
  • Energy Savings: Industrial facilities can also reduce energy costs by utilizing natural ventilation to regulate temperature, reducing the reliance on expensive industrial cooling systems.

8. Residential Buildings in High Wind Areas

  • Protection Against Wind Damage: In areas prone to high winds, this system can provide essential protection for residential buildings by automatically closing windows when wind speeds exceed safe levels. This helps prevent structural damage and protects the interior from debris and rain.
  • Energy Efficiency: In regions with varying weather conditions, the system can optimize natural cooling and heating by adjusting windows based on real-time temperature data, reducing energy consumption.
  • Remote Access for Homeowners: Homeowners in these regions can use the Blynk app to monitor and control their windows remotely, providing peace of mind when they are away from home during unpredictable weather conditions.

9. Historical Buildings

  • Preserving Building Integrity: In historical buildings, maintaining structural integrity and protecting interior elements is crucial. This system can help by automatically closing windows during adverse weather conditions, preserving both the structure and its contents.
  • Energy Conservation in Old Buildings: Many historical buildings lack modern insulation and climate control systems. This automated window control system can help improve energy efficiency by optimizing natural ventilation, reducing the need for modern HVAC systems that might not be appropriate for such buildings.
  • Remote Monitoring for Conservationists: Conservationists and building managers can use the Blynk app to remotely monitor and control the windows, ensuring the building’s environment is maintained according to conservation standards.

Leave a Reply

Your email address will not be published. Required fields are marked *

Facebook
YouTube
× Contact us