Project tutorial

Sensing the Comfort Level of Atmosphere using HUMIDEX © TAPR-OHL

The comfort level was symbolized by blinking 5 different colored LED using HUMIDEX (a combined parameter of temperature and humidity).

• 3,369 views
• 4 respects

Components and supplies

 Arduino UNO
×1
 Resistor 100 ohm
×1
 LED (generic) 5 LED of different colors. I used white, blue, green, yellow and red.
×5
 DHT22 Temperature Sensor
×1
 Jumper wires (generic)
×15

Apps and online services

 Arduino IDE

The human comfort level not only determined by temperature but also with humidity. For example, at 20 °C and 80 % relative humidity is much more suffocating than 20 °C and 25 % relative humidity.

The humidex (short for humidity index) is an index number used to describe how hot the weather feels to the average person, by combining the effect of heat and humidity. The ranges are as follows:

• 20 to 29: Little to no discomfort
• 30 to 39: Some discomfort
• 40 to 45: Great discomfort; avoid exertion
• Above 45: Dangerous; heat stroke quite possible

But the calculation of the humidex is a little complicated. The formula is as follows:

Where,

• Tair is the air temperature in °C
• Tdew is the dew point in °C

Briefly, we can define dew point as follows: "The atmospheric temperature below which water droplets begin to condense and dew can form".

But our DHT22 temperature and humidity sensor can sense the atmospheric temperature and humidity, not the dew point which is needed to execute the formula of humidex.

Thus, another formula was used for calculation of dew point from temperature and humidity:

In the code, first the temperature and humidity value was captured from the sensor, further dew point is calculated and finally the value of humidex has been determined.

Afterwards, the LEDs' are blinked according to the calculated values of humidex for the users' easiness. Here are the outputs:

Green LED blinks (5 sec): No discomfort (Humidex is less than 20).

White LED blinks (5 sec): Little discomfort (Humidex is between 20 to 29).

Yellow LED blinks (5 sec): Some extent discomfort (Humidex is between 30 to 39)

Blue LED blinks (5 sec): High extent discomfort (Humidex is between 40 to 45)

Red LED blinks (5 sec): Very dangerous; sun stroke may possible (Humidex is higher than 45)

Green, White, Yellow LEDs' blinks for 1 sec sequentially: Sensor is not working.

This in a nutshell, this project is developped using DHT22 Sensor and arduino aiming to sense the discomfort/comfort level by blinking LED.

---------------------- ( ) ----------------------

Code

The CODEArduino
```//* Representing the comfort level by blinking of LED using HUMIDEX by DHT22 sensor and arduino Uno.

//Libraries
#include <DHT.h>;
#include <math.h>

//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

double hum;  //Stores humidity value
double temp; //Stores temperature value
double B; // Stores the value of intermediate parameter.
double dew; // Stores the value of Dew temperature
long humidex; // Stores the value of HUMIDEX
const int LED1 = 02; // White LED connected to digital pin 2
const int LED2 = 04; // Blue LED connected to digital pin 4
const int LED3 = 06; // Green LED connected to digital pin 6
const int LED4 = 10; // Yellow LED connected to digital pin 8
const int LED5 = 12; // Red LED connected to digital pin 10

void setup()
{

dht.begin();
pinMode(LED1, OUTPUT); // sets the digital pin as output
pinMode(LED2, OUTPUT); // sets the digital pin as output
pinMode(LED3, OUTPUT); // sets the digital pin as output
pinMode(LED4, OUTPUT); // sets the digital pin as output
pinMode(LED5, OUTPUT); // sets the digital pin as output
}

void loop()
{
delay(2000);
//Read data and store it to variables hum and temp
B=(log(hum/100)+((17.27*temp)/(237.3+temp)))/17.27; // value of "B", the intermediate dimentionless parameter has been calculated.
dew=(237.3*B)/(1-B); // The value of dew point has been calculated
humidex=temp+0.5555*(6.11*exp(5417.753*(1/273.16-1/(273.15+dew)))-10); // the value of HUMIDEX has been claculated.

if (humidex<0){ // the situation when sensor is not working ! i.e NaN is coming out of the humidity and temperature value.
digitalWrite(LED1, HIGH); // turns the Green LED (numbered as 1) on
delay(1000); // wait for 1 sec
digitalWrite(LED1, LOW); // turns the Green LED (numbered as 1) off
digitalWrite(LED2, HIGH); // turns the white LED (numbered as 1) on
delay(1000); // wait for 1 sec
digitalWrite(LED2, LOW); // turns the White LED (numbered as 1) off
digitalWrite(LED3, HIGH); // turns the yellow LED (numbered as 1) on
delay(1000); // wait for 1 sec
digitalWrite(LED3, LOW); // turns the yellow LED (numbered as 1) off
}

else if (humidex>=0 && humidex <20){
digitalWrite(LED1, HIGH); // turns the green LED (numbered as 1) on
delay(5000); // wait for 5 sec
digitalWrite(LED1, LOW); // turns the green LED (numbered as 1) off
}
else if (humidex>=20 && humidex <30){
digitalWrite(LED2, HIGH); // turns the White LED (numbered as 2) on
delay(5000); // wait for 5 sec
digitalWrite(LED2, LOW); // turns the white LED (numbered as 2) off
}
else if (humidex>=30 && humidex <40){
digitalWrite(LED3, HIGH); // turns the Yellow LED (numbered as 3) on
delay(5000); // wait for 5 sec
digitalWrite(LED3, LOW); // turns the Yellow LED (numbered as 3) off
}
else if (humidex>=40 && humidex <45){
digitalWrite(LED4, HIGH); // turns the blue LED (numbered as 4) on
delay(5000); // wait for 5 sec
digitalWrite(LED4, LOW); // turns the blue LED (numbered as 4) off
}

else {
digitalWrite(LED5, HIGH); // turns the red LED (numbered as 5) on
delay(5000); // wait for 5 sec
digitalWrite(LED5, LOW); // turns the red LED (numbered as 5) off
}
}
```

Schematics

The diagram is self explanatory. 3 difference connections (power, data and ground from the left to right) were made from the DHT22 sensor. The 3rd pin from left is 'null'. 5 different colored LED has been connected with digital pin 2, 4, 6, 10 and 12 of arduino.

• 2 projects
• 0 followers

April 2, 2018

Members who respect this project

and 2 others

See similar projects
you might like

Health Kit: Humidity and Temperature Control

Project tutorial by Diana Khalipina

• 9,164 views
• 50 respects

Room Comfort Live Display (and Log with MATLAB)

Project tutorial by dancili

• 5,061 views
• 1 comment
• 18 respects

by Arca_Ege

• 33,252 views
• 28 respects

Liquid Level Sensing Using a Laser ToF Sensor

Project tutorial by Team ProtoCentral

• 30,105 views
• 45 respects

Refrigerator Checker

Project tutorial by Hipo Shun

• 2,341 views