Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Manufacturing Technology >> Manufacturing process

Hysteresis-Based Arduino Temperature Control System

Components and supplies

Hysteresis-Based Arduino Temperature Control System
Arduino 101
×1
Hysteresis-Based Arduino Temperature Control System
DHT22 Temperature Sensor
×1
Hysteresis-Based Arduino Temperature Control System
Jumper wires (generic)
×1
Hysteresis-Based Arduino Temperature Control System
LED (generic)
×2
Hysteresis-Based Arduino Temperature Control System
Resistor 10k ohm
×1
Hysteresis-Based Arduino Temperature Control System
Resistor 330 ohm
×2
DFRobot LCD button Shield
×1
Hysteresis-Based Arduino Temperature Control System
Breadboard (generic)
×1

Apps and online services

Hysteresis-Based Arduino Temperature Control System
Arduino IDE

About this project

The Project

We want to show the operation of a temperature control system using hysteresis.

Hysteresis-Based Arduino Temperature Control System

Components

The components we used were the following:

Hysteresis-Based Arduino Temperature Control System

Temperature Control

The project does a temperature control, we model the following situation:

The system starts and shows the temperature, if the temperature reaches 25 degrees, then the green led is activated and the room starts to cool until the temperature drops to 23 degrees, the air conditioner turns off (red led) until the temperature rises again.

Hysteresis-Based Arduino Temperature Control System

And finally we have a video where you can see the operation:

Code

  • Temperature control
Temperature controlArduino
/*By Alexis Santiago Allende */
/*Last update: 12/03/2017*/
#include "DHT.h"//DHT sensor Library
#include <LiquidCrystal.h>//LCD Library 
#define DHTPIN 12 //Define sensor pin(pin 12)
#define DHTTYPE DHT22 //What sensor use

DHT dht(DHTPIN, DHTTYPE);//Create sensor object
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);//Create lcd object using this pins 8,9,4,6,7

boolean a=LOW,b=HIGH;
float h=0,t=0;
const int ledPin = 3; //LED pins for temperature control 
const int ledPin2 = 2;
long previousMillis = 0;
long interval = 2000; //Read sensor each 2 seconds

void setup() {
lcd.begin(16, 2);              //Start lcd 
lcd.setCursor(0,0);            //Set in position 0,0
// set the digital pin as output:
pinMode(ledPin, OUTPUT);//Change to output my pins
pinMode(ledPin2, OUTPUT);
dht.begin();//Start DHT22 sensor
digitalWrite(ledPin2,LOW);//Turn off LED
digitalWrite(ledPin,LOW);//Turn off LED
lcd.print("Tempera:");// print in lcd this word 
lcd.setCursor(0,1);//Change cursor position
lcd.print("Humedad:");// print in lcd this word 
}

void loop()
{
  unsigned long currentMillis = millis();//time elapsed
  if(currentMillis - previousMillis > interval) //Comparison between the elapsed time and the time in which the action is to be executed
  {
    previousMillis = currentMillis; //"Last time is now"

     h = dht.readHumidity();//humidity value
     t = dht.readTemperature();//temperature value centigrades if you want farenheit change to
     //t = dht.readTemperature(true);
     //Below is for print data sensors in lcd 
     lcd.setCursor(10,0);
     lcd.print(t);
     lcd.setCursor(10,1);
     lcd.print(h);
    
    if(t>=25 && a==LOW)//if temperature above of 25 degrees
    {
      digitalWrite(ledPin,HIGH);//Active air conditioner
      digitalWrite(ledPin2,LOW);
      a=HIGH;
      b=LOW;
     
    }
    else if(t<=23&&b==LOW)//if temperature is under 23 degrees
    {
      digitalWrite(ledPin2,HIGH);
      digitalWrite(ledPin,LOW);//Turn off air conditioner
      a=LOW;
      b=HIGH;
    }
    
  }
}

Schematics

Hysteresis-Based Arduino Temperature Control System

Manufacturing process

  1. Arduino Temperature & Humidity Logger Using DHT11 and Ethernet Shield
  2. Build a Simple Obstacle Sensor with Arduino – Easy IR LED & Photodiode Tutorial
  3. Find Me: Smart Item Locator with Arduino and Bluetooth
  4. DIY Arduino Humidifier Controller with Relay – Safe High‑Voltage Setup
  5. Contactless Temperature Monitoring Gate for Rapid, Accurate Screening
  6. Build a Custom Arduino Joystick Steering Wheel for Gaming
  7. Precision Temperature‑Controlled Charcoal Smoker Kit – Build Your Own BBQ Masterpiece
  8. Build a Reliable LCD Stopwatch with Arduino Nano – No Potentiometer Needed
  9. PhoneLocator: Securely Locate Your Phone Anywhere
  10. Ultrasonic Eyes: Interactive 8x8 LED Matrix Distance Sensor