Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use KY-005: Examples, Pinouts, and Specs

Image of KY-005Design with KY-005 in Cirkit Designer

Introduction

The KY-005 is a digital temperature and humidity sensor module that integrates the DHT11 sensor. Manufactured by ESP-32 with the part ID CINCO, this module is designed to provide accurate and reliable measurements of temperature and humidity. It is widely used in environmental monitoring, home automation, weather stations, and other applications requiring real-time climate data.

The KY-005 is compact, easy to use, and compatible with microcontrollers such as Arduino, Raspberry Pi, and ESP32. Its digital output simplifies integration into various projects, making it an excellent choice for both beginners and experienced developers.

Explore Projects Built with KY-005

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Arduino Nano-Based Wireless Joystick and Motion Controller: A project utilizing KY-005 in a practical application
Arduino Nano-Based Wireless Joystick and Motion Controller

This circuit features an Arduino Nano microcontroller interfaced with an HC-05 Bluetooth module, an MPU-6050 accelerometer/gyroscope, and a KY-023 Dual Axis Joystick Module. The Arduino Nano is powered by a 9V battery through a rocker switch and communicates with the HC-05 for Bluetooth connectivity, reads joystick positions from the KY-023 module via analog inputs, and communicates with the MPU-6050 over I2C to capture motion data. The circuit is likely designed for wireless control and motion sensing applications, such as a remote-controlled robot or a game controller.

Open Project in Cirkit Designer

Technical Specifications

The KY-005 module is built around the DHT11 sensor, which offers the following key specifications:

Parameter Value
Operating Voltage 3.3V to 5.5V
Operating Current 0.3mA (measuring), 60µA (standby)
Temperature Range 0°C to 50°C
Temperature Accuracy ±2°C
Humidity Range 20% to 90% RH
Humidity Accuracy ±5% RH
Communication Protocol Single-wire digital signal
Sampling Period ≥1 second

Pin Configuration

The KY-005 module has three pins, as described in the table below:

Pin Name Description
1 VCC Power supply pin (3.3V to 5.5V)
2 DATA Digital signal output for temperature and humidity
3 GND Ground connection

Usage Instructions

How to Use the KY-005 in a Circuit

  1. Power the Module: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to the ground.
  2. Connect the Data Pin: Attach the DATA pin to a digital input pin on your microcontroller. Use a 10kΩ pull-up resistor between the DATA pin and VCC to ensure stable communication.
  3. Read Data: Use a compatible library (e.g., DHT library for Arduino) to read temperature and humidity values from the module.

Important Considerations and Best Practices

Example Code for Arduino UNO

Below is an example of how to use the KY-005 with an Arduino UNO:

#include <DHT.h>

// Define the pin connected to the KY-005 DATA pin
#define DHTPIN 2

// Define the type of DHT sensor (DHT11 for KY-005)
#define DHTTYPE DHT11

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

void setup() {
  Serial.begin(9600); // Start serial communication at 9600 baud
  dht.begin();        // Initialize the DHT sensor
  Serial.println("KY-005 Temperature and Humidity Sensor");
}

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

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

  // Check if readings are valid
  if (isnan(humidity) || isnan(temperature)) {
    Serial.println("Failed to read from KY-005 sensor!");
    return;
  }

  // Print the results to the Serial Monitor
  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.print(" %\t");
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Data Output:

    • Ensure the VCC and GND pins are correctly connected.
    • Verify the pull-up resistor is properly installed on the DATA pin.
    • Check the wiring and ensure the DATA pin is connected to the correct digital pin on the microcontroller.
  2. Incorrect Readings:

    • Ensure the sensor is not exposed to extreme environmental conditions (e.g., condensation or high humidity).
    • Verify the sampling interval is at least 1 second.
    • Check for loose or damaged connections.
  3. Sensor Not Detected:

    • Confirm the DHT library is installed and correctly configured in your code.
    • Ensure the correct pin number is defined in the code.

FAQs

Q: Can the KY-005 measure negative temperatures?
A: No, the KY-005 (DHT11) has a temperature range of 0°C to 50°C and cannot measure negative temperatures.

Q: What is the maximum cable length for the KY-005?
A: The recommended maximum cable length is 20 meters, but shorter lengths are preferred to maintain signal quality.

Q: Can the KY-005 be powered with 3.3V?
A: Yes, the KY-005 operates within a voltage range of 3.3V to 5.5V.