Project tutorial
Sensing the Comfort Level of Atmosphere using HUMIDEX

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).

  • 1,816 views
  • 1 comment
  • 3 respects

Components and supplies

Apps and online services

About this project

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
    hum = dht.readHumidity();
    temp= dht.readTemperature();
    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

Schematic of the complete circuit diagram
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.
Schematic blixx1avr3
schematic_T5LwejFyF9.jpg
Schematic t5lwejfyf9

Comments

Similar projects you might like

Liquid Level Sensing Using a Laser ToF Sensor

Project tutorial by Team ProtoCentral

  • 22,161 views
  • 16 comments
  • 42 respects

Using DHT11

by Arca_Ege

  • 2,413 views
  • 1 comment
  • 13 respects

Refrigerator Checker

Project tutorial by Hipo Shun

  • 1,671 views
  • 0 comments
  • 4 respects

Health Kit: Humidity and Temperature Control

Project tutorial by Diana Khalipina

  • 3,484 views
  • 2 comments
  • 33 respects

Factory/Warehouse/Control Shed/ Environment Monitoring

Project tutorial by Muhammad Afzal

  • 1,678 views
  • 0 comments
  • 7 respects
Add projectSign up / Login