Things used in this project

Hardware components:
Ardgen 101
Arduino 101 & Genuino 101
10167 01
DHT22 Temperature Sensor
11026 02
Jumper wires (generic)
09590 01
LED (generic)
Mfr 25frf52 10k sml
Resistor 10k ohm
08377 02 l
Resistor 330 ohm
DFRobot LCD button Shield
12002 04
Breadboard (generic)
Software apps and online services:
Ide web
Arduino IDE


Temperature control
Op sbrodukubj


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 
    if(t>=25 && a==LOW)//if temperature above of 25 degrees
      digitalWrite(ledPin,HIGH);//Active air conditioner
    else if(t<=23&&b==LOW)//if temperature is under 23 degrees
      digitalWrite(ledPin,LOW);//Turn off air conditioner


Soka cdsdtvc7fp
Alexis Santiago Allende

Im a person who since young feel a passion for electronics, I also like to cook pizza and travel. Now Im working on the internet of things



Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback


Similar projects you might like

Sigfox Forest Fire Detector
  • 250
  • 3

Full instructions

How to prevent forest from burning? A small Sigfox signal can prevent natural disasters. We will use an Arduino MKRFOX + a flame detector

Happy Plant Notifier
  • 21
  • 1

Full instructions

Get a text or call if your plant is getting too dry, along with a nice LCD display giving information regarding your plant's health.

How to Make a Temperature Gun With Esp32
  • 71
  • 2

Full instructions

What a hot day it is! Too hot to drive and ride and I am thinking of making a temperature measurement sensor.

Using Common Cathode and Common Anode RGB LED with Arduino
  • 709
  • 13


Common Cathode and Common Anode RGB LEDs are two different kinds of RGB LEDs whose function is same but working is different.

From BT to WiFi: creating WiFi controlled Arduino Robot Car
  • 59
  • 1


NodeMCU ESP8266 in acsess point mode: the simpliest way to make Wi-Fi controlled Robot Car from Bluetooth Arduino Robot Car + Android App.

TV Tee Shirt
  • 2,661
  • 6

One shirt, thirty-six LEDs, endless possibilities.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog