by Arduino Circuit
Introduction
In this tutorial, we are going to Interfacing KY-001 Temperature Sensor with Arduino, The KY-001 Temperature Sensor Module enables measuring the atmosphere’s ambient temperature by operating the digital serial bus. It is possible to attach more than one sensor module on the same bus.
This module is compatible with popular electronic platforms like Arduino, ESP32, Raspberry Pi, and other microcontrollers. To interface with them and sense the input temperature from the atmosphere and display results on the monitor.
Hardware Required
You will require the following Hardware Components for the Interfacing KY-001 Temperature Sensor with Arduino.
Components | # | Buy From Amazon |
---|---|---|
Arduino UNO | 1 | Buy Link |
KY-001 Temperature Sensor Module | 1 | Buy Link |
Jumper Wires | 1 | Buy Link |
Breadboard | 1 | Buy Link |
Specifications
This module includes the single-bus DS18B20 digital temperature sensor, a resistor, an LED, and 3 male header pins.
Operating Voltage | 3.0V to 5.5V |
Temperature Measurement Range | -55°C to 125°C [-57°F to 257°F] |
Measurement Accuracy Range | ±0.5°C |
Board Dimensions | 18.5mm x 15mm [0.728in x 0.591in] |
Technical Data
MODEL | Temperature sensor |
---|---|
Chipset | DS18B20 |
Communication Protocol | 1-Wire |
Accuracy | 9 to 12 Bit |
Measuring range | -55 °C to +125 °C |
Measurement accuracy | ±0.5 °C from -10 °C to +85 °C |
Pinout
Pin Configuration
Pin Name | Pin Type |
---|---|
SIG | Signal Output |
+5V | Power Supply Pin |
GND | Ground Pin |
Circuit Connections
Now attach the power supply line (middle) and ground (-) of the module to the +5V pin and GND pin on the Arduino side respectively. and then connect the signal pin (S) of the module to pin 2 of the Arduino.
Arduino | KY-001 Module |
---|---|
+5v | Middle |
GND | GND |
Pin 2 | Signal |
Circuit Diagram
The following circuit shows you the connection of the KY-001 Module with Arduino Please make the connection carefully
Installing Arduino IDE Software
First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow
Installing Libraries
Now when you are Ready to upload the code, to the Arduino Board you will need first to add the Following Libraries in Arduino, If you Learn How to add the library in the Arduino step-by-step guide click on how to install the library Button given Blow
How To Add library
Code
The given below Arduino code will operate the OneWire library to communicate serial with the module and it will output the temperature read by the device.
//For more Projects: www.arduinocircuit.com#include <OneWire.h>#include <DallasTemperature.h>// Data wire is plugged into pin 2 on the Arduino#define ONE_WIRE_BUS 2// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)OneWire oneWire(ONE_WIRE_BUS);// Pass our oneWire reference to Dallas Temperature. DallasTemperature sensors(&oneWire);void setup(void){ // start serial port Serial.begin(9600); Serial.println("Dallas Temperature IC Control Library Demo"); // Start up the library sensors.begin(); // IC Default 9 bit. If you have troubles consider upping it 12. Ups the delay giving the IC more time to process the temperature measurement}void loop(void){ // call sensors.requestTemperatures() to issue a global temperature // request to all devices on the bus Serial.print("Requesting temperatures..."); sensors.requestTemperatures(); // Send the command to get temperatures Serial.println("DONE"); Serial.print("Temperature for Device 1 is: "); Serial.print(sensors.getTempCByIndex(0)); // Why "byIndex"? You can have more than one IC on the same bus. 0 refers to the first IC on the wire}
Applications
- Weather Stations and Environmental Monitoring: The KY-001 Temperature Sensor Module is an excellent choice for weather stations and environmental monitoring systems. It allows you to measure ambient temperature accurately, enabling you to track temperature variations over time and analyze climate patterns.
- Home Automation and HVAC Control: In home automation projects, the KY-001 Temperature Sensor Module plays a crucial role in regulating heating, ventilation, and air conditioning (HVAC) systems. By monitoring indoor temperature, you can create a smart HVAC control system that ensures optimal comfort while also saving energy.
- Temperature-Dependent Alarms and Alerts: With the KY-001 Temperature Sensor Module, you can design temperature-dependent alarm systems. For example, in industrial settings or server rooms, if the temperature exceeds a predefined threshold, the sensor can trigger alarms or notifications, alerting personnel to take necessary actions.
- Aquatic and Terrarium Temperature Monitoring: For aquariums and terrariums, the KY-001 Temperature Sensor Module is an invaluable tool. It allows you to monitor the water or enclosure temperature, helping you maintain the ideal environment for aquatic life or specific reptile species.
- Agriculture and Greenhouse Automation: In agriculture and greenhouse applications, the KY-001 Temperature Sensor Module can be employed to control and optimize growing conditions. By tracking temperature fluctuations, you can automate irrigation, ventilation, and heating systems, ensuring the best possible environment for crops and plants.