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.
These module price typically ranged from $0.5 to $6, depending on the supplier and quantity purchased. It's always a good idea to compare prices from different suppliers to find the best deal.
This article will provide detailed information about the temperature sensor module KY-001, including specifications, pinout, circuit diagram, how to interface with Arduino, code, and more. Let's get started!
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 -
- Pin (-): GND
- Pin (Middle): +5V
- 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:
- Open the Arduino IDE
- Go to Sketch > Include Library > Manage Libraries
- In the Library Manager, search for each library by typing "OneWire" and "DallasTemperature".
- Click on the Library, select the latest version, and then click on the "Install" button.
- Wait for the Library to be installed, then close the Library Manager.
- 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.begin(9600);
Serial.println("KY-001 temperature sensor measurement");
// Sensor is initialized
sensors.begin();
}
// Start the main program loop
void loop(void)
{
// Send the request command to get temperatures
sensors.requestTemperatures();
// 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.
Serial.print(sensors.getTempCByIndex(0));
// Temperature in Celsius
Serial.println(" °C");
// 1s pause until next temperature measurement
delay(1000);
}
0 Comments
If you have any doubts or questions, please let me know. Don't add links as it goes to spam. Share your valuable feedback. Thanks