KY-001 Temperature Sensor Module


The KY-001 Module is a DS18B20 Digital Temperature Sensor for Arduino, Raspberry Pi, and ESP32. It provides 9-bit to 12-bit Celsius temperature measurements and communicates via a one-wire bus with a central microprocessor. The module can be powered by an external DC power supply, or it can derive power from its data line, eliminating the need for an external DC power supply. The temperature sensor module comes with an alarm function with non-volatile, user-programmable high and low trigger points.

In this guide, I will cover everything you need to know about ky-001 temperature sensor module circuit board, including specifications, pinout, circuit & connection diagram, and how to interface with Arduino.

    KY-001 Module Specifications

    The quick specifications of the KY-001 temperature sensor module is given below:

    • Chipset: DS18B20
    • Operating Voltage: 3.0V to 5.5V
    • Communication: One-Wire Bus
    • Temprature Measurement Range: -55°C to 125°C [-57°F to 257°F]
    • Measurement Accuracy Range: ±0.5C (between the range -10°C to 85°C)
    • Board Dimantions: 18.5mm x 15mm

    KY-001 Module Pinout

    The module has 3 male header pins those are -

    1. Pin (-): GND
    2. Pin (Middle): +5V
    3. Pin (S): Signal

    KY-001 Module Circuit Diagram

    Schematic of the ky-001 temperature sensor module circuit is shown below.

    KY-001 Module Interfacing with Arduino

    Connection diagram of the KY-001 temperature sensor module with an Arduino is shown below.

    Connect the power pin (middle) and ground pin (-) of the ky-001 module to +5V and GND on the Arduino, respectively. The module signal pin (s) connect to pin 2 on the Arduino.

    Arduino Source Code

    The following Arduino sketch will use two additional libraries to communicate serially with the ky-001 module, it'll output the temperature read by the device.

    OneWire Library by Paul Stoffregen. It helps to access 1-wire temperature sensors, memory and other chips.

    DallasTemperature Library by Miles Burton. Arduino Library for Dallas Temperature ICs (Supports DS18B20, BS18S20, DS1820, DS1822)

    To install the libraries in your Arduino IDE, follow these steps:

    1. Open the Arduino IDE
    2. Go to Sketch > Include Library > Manage Libraries
    3. In the Library Manager, search for each library by typing "OneWire" and "DallasTemperature".
    4. Click on the Library, select the latest version, and then click on the "Install" button.
    5. Wait for the Library to be installed, then close the Library Manager.
    6. You can now use the library in the sketch for the ky-001 module.
    // Both Libraries will be imported
    #include <OneWire.h>
    #include <DallasTemperature.h>
    // KY-001 Module signal pin is plugged into pin 2 on the Arduino board
    #define KY001_ONE_WIRE_BUS 2 //
    // Libraries are configured to communicate with the Module
    OneWire oneWire(KY001_ONE_WIRE_BUS);
    DallasTemperature sensors(&oneWire);
    void setup(void)
      // Initialize serial output
      Serial.println("KY-001 temperature sensor measurement");
      // Sensor is initialized
    // Start the main program loop
    void loop(void)
      // Send the request command to get temperatures
      // Output measured temperature
      Serial.print("Temperature: ");
      // You can have multiple ICs on the same bus, where 0 refers to the first IC on the wire.
      // Temperature in Celsius
      Serial.println(" °C");
      // 1s pause until next temperature measurement

    No comments