HomeDigital Temperature and Humidity Sensor Module DHT11
Digital Temperature and Humidity Sensor Module DHT11
Digital Temperature and Humidity Sensor Module DHT11Digital Temperature and Humidity Sensor Module DHT11
Standard shipping in 3 working days

Digital Temperature and Humidity Sensor Module DHT11

₹110
₹75
Saving ₹35
32% off
Product Description

The DHT11 is a popular and inexpensive temperature and humidity sensor widely used in basic environmental monitoring applications. It is simpler and less accurate than the DHT22, but still offers decent performance for many projects where high precision is not critical. The DHT11 can be used with Arduino, Raspberry Pi, and other microcontroller platforms to measure temperature and humidity in environments like homes, gardens, or simple weather stations.

Key Features of the DHT11 Sensor:

  • Temperature Range: 0°C to 50°C (±2°C accuracy)
  • Humidity Range: 20% to 80% RH (±5% RH accuracy)
  • Output: Digital signal (single-wire communication)
  • Power Supply: 3.3V to 5V DC (ideal for 5V systems)
  • Sampling Rate: Once every 1-2 seconds (typically)
  • Response Time: Around 1 second (time for the sensor to update)
  • Pinout: 3 or 4 pins (depending on the module version)
  • Precision: Lower than the DHT22 (good for less demanding applications)

Pinout of the DHT11 Module:

The DHT11 module typically has 3 or 4 pins depending on the version, with the following pin configuration:

PinNameDescription1VCCPower supply (3.3V to 5V)2DataData output (connected to the microcontroller)3NCNot Connected (some modules have this pin)4GNDGround (0V)

How DHT11 Works:

The DHT11 sensor uses a thermistor to measure temperature and a capacitive humidity sensor to measure humidity. It generates a digital signal containing the temperature and humidity data, which is transmitted to a microcontroller (such as an Arduino or Raspberry Pi) over a single-wire interface.

  • The sensor uses one-wire communication to send data in the form of a 40-bit serial data stream.
  • It sends humidity data (16 bits), followed by temperature data (16 bits), and a checksum (8 bits) to ensure the data is correct.

Each time you read the sensor, it sends a new set of data for the temperature and humidity.

Wiring the DHT11 to an Arduino:

To connect the DHT11 sensor to an Arduino, follow these simple steps:

  1. VCC pin of the DHT11 to 5V (or 3.3V if you're using a low-power system).
  2. GND pin of the DHT11 to GND of the Arduino.
  3. Data pin of the DHT11 to a digital input pin of the Arduino (e.g., pin 2).
  4. Optionally, add a 10kΩ pull-up resistor between the Data pin and the VCC pin. This resistor stabilizes the signal and ensures proper data transmission.

Here’s a basic connection diagram:


DHT11 Pin   ->   Arduino Pin
------------------------------
VCC         ->   5V (or 3.3V)
GND         ->   GND
DATA        ->   Pin 2 (or any other digital pin)

Using DHT11 with Arduino:

To read the temperature and humidity from the DHT11 sensor, you can use the DHT sensor library for Arduino. This library simplifies the communication between the Arduino and the sensor.

  1. Install the DHT Sensor Library:
  • Open the Arduino IDE.
  • Go to SketchInclude LibraryManage Libraries.
  • Search for DHT sensor library and install the one by Adafruit.
  1. Example Code: Here’s an example code to read the temperature and humidity from the DHT11 sensor and print it to the serial monitor:
#include <DHT.h>

// Define the pin where the DHT11 data line is connected
#define DHTPIN 2

// Define the type of sensor (DHT11)
#define DHTTYPE DHT11

// Initialize the DHT sensor
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  // Start the serial communication
  Serial.begin(9600);
  // Initialize the DHT sensor
  dht.begin();
}

void loop() {
  // Wait a few seconds between readings
  delay(2000);

  // Read temperature as Celsius
  float temperature = dht.readTemperature();
  // Read humidity
  float humidity = dht.readHumidity();

  // Check if readings failed, if so, display error message
  if (isnan(temperature) || isnan(humidity)) {
    Serial.println("Failed to read from DHT sensor!");
    return;
  }

  // Print temperature and humidity values to the serial monitor
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.print(" °C");

  Serial.print("  Humidity: ");
  Serial.print(humidity);
  Serial.println(" %");
}

Explanation of the Code:

  • DHT dht(DHTPIN, DHTTYPE): Initializes the DHT11 sensor on the specified pin and sensor type.
  • dht.readTemperature(): Reads the temperature in Celsius.
  • dht.readHumidity(): Reads the humidity level as a percentage.
  • The values are printed to the Serial Monitor every 2 seconds (delay(2000)).

Reading Data from DHT11:

  • The DHT11 sensor requires a delay between readings (usually around 2 seconds). This is to give the sensor enough time to refresh and calculate new values for temperature and humidity.
  • If you try to read the sensor too frequently, it may fail to provide accurate readings or return NaN (Not a Number) values.

Things to Keep in Mind:

  • Pull-up Resistor: The DHT11 sensor often requires a pull-up resistor (typically 10kΩ) between the Data pin and VCC pin to stabilize the communication signal. In many sensor modules, this resistor is already built in.
  • Accuracy: The DHT11 has lower accuracy and a narrower range compared to other sensors like the DHT22. The temperature accuracy is ±2°C, and the humidity accuracy is ±5% RH. It’s suitable for basic applications where high precision is not required.
  • Power Supply: Ensure that the sensor is powered within its specified voltage range (usually 5V). A lower voltage might cause unreliable readings.

Alternative: DHT11 with Raspberry Pi:

If you're using a Raspberry Pi, you can read the data from the DHT11 sensor using the GPIO pins. You’ll need to install the Adafruit Python DHT library to interact with the sensor.

To install the necessary libraries on Raspberry Pi:

sudo apt-get update
sudo apt-get install build-essential python-dev python-openssl
sudo pip3 install Adafruit-DHT

Once installed, you can use the following Python code to read the DHT11 sensor:

import Adafruit_DHT

# Set sensor type and pin
sensor = Adafruit_DHT.DHT11
pin = 4  # GPIO pin (e.g., GPIO4)

# Read temperature and humidity
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)

if humidity is not None and temperature is not None:
    print('Temp: {0:0.1f} C  Humidity: {1:0.1f}%'.format(temperature, humidity))
else:
    print('Failed to get reading. Try again!')

This code will print the temperature and humidity values to the terminal.

Applications of DHT11 Sensor:

  • Basic Weather Stations: Measure the temperature and humidity in a controlled environment.
  • Home Automation: Use the sensor to monitor and control heating, ventilation, and air conditioning (HVAC) systems based on temperature and humidity levels.
  • Greenhouses: Monitor the temperature and humidity to optimize growing conditions for plants.
  • Data Logging: Record temperature and humidity over time for analysis or research.
  • Environmental Monitoring: Use in projects where basic environmental conditions are needed, such as in rooms, basements, and outdoor settings.


Origin:- China

Brand:- Generic

Share
Customer Reviews

Secure Payments

Shipping in India

Cash on Delivery

Great Value & Quality