Introduction: Control RGB Led Using Dht11

Control RGB led using DHT11 on the basis of humidity value being received.

This project has an application in making interactive installations in which you want to replicate the outside weather conditions.

Materials Required :

  • Arduino
  • DHT11
  • Wires
  • RGB LED

Step 1: Understanding DHT11 Sensor

DHT11 Humidity and Temperature Sensor

DHT11 sensor is very basic. It has two parts, a capacitive humidity sensor and a thermistor. It can measure relative humidity ranging from 20-90% with an accuracy of ±0.5% and temperature ranging from 0-50 degree Celsius with an accuracy of ±2֯ C.

The capacitive humidity sensor measures the electrical resistance between the two electrodes to give the relative humidity. It contains moisture holding substrate between the two electrodes. When water vapor is absorbed by the substrate, ions are released, which increase the conductivity between the electrodes.

Thus, resistance varies with relative humidity. Relative Humidity = (D/Ds) *100 D: Density of water vapour Ds: Density of water vapour at saturation At saturation, water vapours start condensing.

DHT11 contains a thermistor, which has a negative temperature coefficient, i.e. the resistance increases with a decrease in temperature.

Two types of DHT11 sensor DHT11 operates at 3.3V to 5V power supply.

DHT11 are of two types: · One which is mounted on a small PCB and has three pins · One which has four pins The one with four pins require a 10K ohm pull up resistor, whereas, the pull up resistor is already mounted on the PCB of the second type. There is a single signal wire for transmitting data (both relative humidity and temperature).

The sensor sends out 40 bits (5 bytes) of data continuously in the data line. The 40-bit data from the sensor has the following structure: Data (40-bit) = Integer Byte of RH + Decimal Byte of RH + Integer Byte of Temp. + Decimal Byte of Temp. + Checksum Byte The checksum byte detects successful transmission of data.

If all data is transferred successfully, the checksum byte is equal to the last eight bits of the sum of the first four bytes: Checksum = Last 8 bits of (Integer Byte of RH + Decimal Byte of RH + Integer Byte of Temp. + Decimal Byte of Temp.)

Step 2: Assemble the Circuit

Assemble the circuit as shown in the diagram above.

Step 3: Upload the Code

Upload the code using arduino IDE.

As the humdity changes, the RGB color changes.

Attachments