I needed to check the exact temperature of a aircon room to display my fact that an ac room is not what it says on the remote. so I decided to make this.
you will need x1 breadboard (optional)
x1 set of wires
x1 dhtxx
x1 Arduino uno
so connect (left to right)
Pin 1 to 5v
pin 2 to digital pin 7
pin 3 (just leave it)
Pin 4 to GND
it will DISPLAY in C, F, K and humidity
Here the code
Thanks
//Libraries
#include <DHT.h>;
//#include<iostream>:
//Constants
#define DHTPIN 7 // what pin we're connected to
#define DHTTYPE DHT22 // DHT 22 (AM2302)
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz Arduino
//Variables
int chk;
float hum; //Stores humidity value
float temp; //Stores temperature value
float faran;
float kel;
void setup()
{
Serial.begin(9600);
dht.begin();
}
void loop()
{
delay(2000);
//Read data and store it to variables hum and temp
hum = dht.readHumidity();
temp= dht.readTemperature();
//Print temp and humidity values to serial monitor
Serial.print("Humidity : ");
Serial.print(hum);
Serial.println(" %");
Serial.print("Temp :");
Serial.print(temp);
Serial.println(" Celsius");
faran = (temp * 9.0) / 5.0 + 32;
Serial.print("Faranheit: ");
Serial.print(faran);
Serial.println(" F");
kel = temp + 273.15;
Serial.print("Kelvin: ");
Serial.print(kel);
Serial.println(" K");
Serial.println("");
Serial.println("");
delay(5000); //Delay 5 sec
// This is free and unencumbered software released into the public domain Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OROTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.
//For more information, please refer to <http://unlicense.org>
}





_ztBMuBhMHo.jpg?auto=compress%2Cformat&w=48&h=48&fit=fill&bg=ffffff)






Comments