element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Summer of Green Tech Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Summer of Green Tech Design Challenge
  • More
  • Cancel
Summer of Green Tech Design Challenge
Blog #5 Upgrade Old Air Coolers to Smart Coolers to save Electricity and water to save environment | Energy Saver Cooler : Final Programming and working model
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Summer of Green Tech Design Challenge to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: sandeepdwivedi17
  • Date Created: 16 Oct 2023 5:07 PM Date Created
  • Views 570 views
  • Likes 6 likes
  • Comments 2 comments
  • seeeduino xiao
  • energy saver
  • dht11
  • relay
Related
Recommended

#5 Upgrade Old Air Coolers to Smart Coolers to save Electricity and water to save environment | Energy Saver Cooler : Final Programming and working model

sandeepdwivedi17
sandeepdwivedi17
16 Oct 2023

After connecting all components finally program the Seeeduino with following program

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <DHT.h>

#define DHTPIN    9 // connect DHT11 sensor signal output with A9
#define RELAY_PIN 10 // relay signal pin
#define DHTTYPE DHT11   // DHT 11
DHT dht(DHTPIN, DHTTYPE); // declare DHT11 sensor
 
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
 
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
  
int h; // humidity
int t; // trmperature
String motor_Status = "OFF";
int needed_room_temp = 25 ; // targate room temp
// int motor_interval_minutes = 3 * 60 * 1000; // value in minutes
// int motor_ON_interval_minutes = 2 * 60 * 1000; // value in minutes
// int motor_OFF_interval_minutes = 2 * 60 * 1000; // value in minutes

int motor_ON_interval_minutes = 2 * 60* 1000; // value in minutes
int motor_OFF_interval_minutes = 2 * 60* 1000; // value in minutes
 
void setup() {
 
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  delay(2000);
  display.clearDisplay();
  display.setTextColor(WHITE);

  pinMode(RELAY_PIN, OUTPUT);//set pin 10 to output
  Wire.begin();
  Serial.begin(115200);
  dht.begin();
 
}
 
void loop() {

  h = dht.readHumidity(); // Read humidity value
  t = dht.readTemperature(); // Read temperature value
  
  switchON();
  showOnScreen();
  showOnSerial();
  delay(motor_ON_interval_minutes);


  switchOFF();
  showOnScreen();
  showOnSerial();
  delay(motor_OFF_interval_minutes);


  // if(t < needed_room_temp){
  //   switchON();
  // }else{
  //   switchOFF();
  // }


 

}

void switchON(){
  digitalWrite(RELAY_PIN , HIGH);
  motor_Status = "ON";
  Serial.println(motor_Status);
}

void switchOFF(){
  digitalWrite(RELAY_PIN , LOW);
  motor_Status = "OFF";
  Serial.println(motor_Status);
}

void showOnSerial(){
  Serial.print("The Temperature is: ");
  Serial.print(t);
  Serial.print(" C, Humidity is: ");
  Serial.print(h);
  Serial.println("%");
}

void showOnScreen(){
  display.clearDisplay();
  display.setTextSize(2);
  // display temp , humidity , motor state(ON/OFF) and timing interval

  // Set the cursor position for the 1st line
  display.setCursor(0,0);
  display.print("Temp : ");
  display.print(t);

  // Set the cursor position for the second line
  display.setCursor(0, 16); // Move the cursor to the next row
  display.print("Humid: ");
  display.print(h);
 
  // Set the cursor position for the third line
  display.setCursor(0, 32); // Move the cursor to the third row
  display.print("Motor: ");
  display.print(motor_Status);

  // Set the cursor position for the 4th line
  display.setCursor(0, 48); // Move the cursor to the third row
  display.print("GAP: ");
  display.print(motor_ON_interval_minutes/(60*1000));
  display.print(" : ");
  display.print(motor_OFF_interval_minutes/(60*1000));
  display.print(" min");

  display.display(); 
}
 

Here we this program will turn on motor for desired interval(her we take it 2 minutes) and then switch off for 2 mins , by this switching operation we can save most of electricity and water as described earlier blogs.

image

We can set motor operation based on Room Temperature also instead of fixed Time intervals like 

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <DHT.h>

#define DHTPIN    9 // connect DHT11 sensor signal output with A9
#define RELAY_PIN 10 // relay signal pin
#define DHTTYPE DHT11   // DHT 11
DHT dht(DHTPIN, DHTTYPE); // declare DHT11 sensor
 
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
 
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
  
int h; // humidity
int t; // trmperature
String motor_Status = "OFF";
int needed_room_temp = 25 ; // targate room temp 25 Centrigate
// int motor_interval_minutes = 3 * 60 * 1000; // value in minutes
// int motor_ON_interval_minutes = 2 * 60 * 1000; // value in minutes
// int motor_OFF_interval_minutes = 2 * 60 * 1000; // value in minutes

int motor_ON_interval_minutes = 2 * 60* 1000; // value in minutes
int motor_OFF_interval_minutes = 2 * 60* 1000; // value in minutes
 
void setup() {
 
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  delay(2000);
  display.clearDisplay();
  display.setTextColor(WHITE);

  pinMode(RELAY_PIN, OUTPUT);//set pin 10 to output
  Wire.begin();
  Serial.begin(115200);
  dht.begin();
 
}
 
void loop() {

  h = dht.readHumidity(); // Read humidity value
  t = dht.readTemperature(); // Read temperature value
  
  switchON();
  showOnScreen();
  showOnSerial();
  delay(motor_ON_interval_minutes);


  switchOFF();
  showOnScreen();
  showOnSerial();
  delay(motor_OFF_interval_minutes);


	//i in case we want it to switch on based on Room Temp instead of Fixed time interval
   if(t > needed_room_temp){
     switchON();
   }else{
     switchOFF();
	 delay(motor_OFF_interval_minutes);
   }


 

}

void switchON(){
  digitalWrite(RELAY_PIN , HIGH);
  motor_Status = "ON";
  Serial.println(motor_Status);
}

void switchOFF(){
  digitalWrite(RELAY_PIN , LOW);
  motor_Status = "OFF";
  Serial.println(motor_Status);
}

void showOnSerial(){
  Serial.print("The Temperature is: ");
  Serial.print(t);
  Serial.print(" C, Humidity is: ");
  Serial.print(h);
  Serial.println("%");
}

void showOnScreen(){
  display.clearDisplay();
  display.setTextSize(2);
  // display temp , humidity , motor state(ON/OFF) and timing interval

  // Set the cursor position for the 1st line
  display.setCursor(0,0);
  display.print("Temp : ");
  display.print(t);

  // Set the cursor position for the second line
  display.setCursor(0, 16); // Move the cursor to the next row
  display.print("Humid: ");
  display.print(h);
 
  // Set the cursor position for the third line
  display.setCursor(0, 32); // Move the cursor to the third row
  display.print("Motor: ");
  display.print(motor_Status);

  // Set the cursor position for the 4th line
  display.setCursor(0, 48); // Move the cursor to the third row
  display.print("GAP: ");
  display.print(motor_ON_interval_minutes/(60*1000));
  display.print(" : ");
  display.print(motor_OFF_interval_minutes/(60*1000));
  display.print(" min");

  display.display(); 
}

working video
https://youtu.be/lmu3Odk1kZw

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

In conclusion, the "Upgrade Old Air Coolers to Smart Coolers to save Electricity and water to save environment" will provide an intelligent and efficient solution to conserve energy and water in residential cooling applications. By leveraging the capabilities of the Seeeduino xiao and the Temperature & Humidity Sensor, the system will optimize the operation of the evaporative cooler, enhance user comfort, and promote sustainable cooling practices.

#1. Energy Saver Cooler : A Quick introduction with Seeeduino XIAO - Summer of Green Tech Design Challenge

#2 Energy Saver Cooler : Project that we are going to implement (Converting Normal Room cooler into energy efficient smart cooler)

#3 Energy Saver Cooler : Setting up Seeduino with Arduino IDE

#4 Energy Saver Cooler : Circuit Assembly on Breadbord

#5 Energy Saver Cooler : Final Programming and working model

  • Sign in to reply
Parents
  • Zhar_14
    Zhar_14 over 2 years ago

    Nice update, I have suggestion for your idea, it would be better if you could set the coolant, with the PWM signal to set speed of motor, so you can save energy better!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Zhar_14
    Zhar_14 over 2 years ago

    Nice update, I have suggestion for your idea, it would be better if you could set the coolant, with the PWM signal to set speed of motor, so you can save energy better!

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
  • sandeepdwivedi17
    sandeepdwivedi17 over 2 years ago in reply to Zhar_14

    That will be a good Update i will try to do this
    Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube