

The KY-028 is a temperature sensor module designed for accurate temperature measurement. It features the LM35 temperature sensor, which outputs an analog voltage directly proportional to the temperature in degrees Celsius. This module is widely used in temperature monitoring systems, home automation, weather stations, and other projects requiring precise temperature readings.
The KY-028 is manufactured by ESP32 with the part ID 15. Its compact design and ease of use make it a popular choice for hobbyists and professionals alike.








The KY-028 module is built around the LM35 temperature sensor and includes additional circuitry for signal conditioning. Below are the key technical details:
The KY-028 module has four pins, as described in the table below:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (3.3V to 5V DC) |
| 2 | GND | Ground connection |
| 3 | A0 (Analog Out) | Analog output voltage proportional to the temperature (10mV/°C) |
| 4 | D0 (Digital Out) | Digital output (high/low signal based on a user-defined temperature threshold) |
The KY-028 module is simple to use and can be integrated into a variety of circuits. Below are the steps and best practices for using the module:
The following code demonstrates how to read the analog output of the KY-028 and display the temperature in Celsius on the serial monitor.
// KY-028 Temperature Sensor Example
// Reads the analog output and calculates the temperature in Celsius
const int analogPin = A0; // KY-028 analog output connected to Arduino A0
float voltage; // Variable to store the sensor's output voltage
float temperature; // Variable to store the calculated temperature
void setup() {
Serial.begin(9600); // Initialize serial communication at 9600 baud
}
void loop() {
int sensorValue = analogRead(analogPin); // Read the analog value (0-1023)
// Convert the analog value to voltage (assuming 5V reference)
voltage = sensorValue * (5.0 / 1023.0);
// Calculate temperature in Celsius (10mV per degree Celsius)
temperature = voltage * 100.0;
// Print the temperature to the serial monitor
Serial.print("Temperature: ");
Serial.print(temperature);
Serial.println(" °C");
delay(1000); // Wait for 1 second before the next reading
}
No Output or Incorrect Readings:
Temperature Readings Are Inaccurate:
Digital Output Not Triggering:
Q: Can the KY-028 be used with a 3.3V microcontroller?
A: Yes, the KY-028 can operate at 3.3V. However, ensure that the analog output voltage is within the input range of your microcontroller's ADC.
Q: How do I calibrate the KY-028 for better accuracy?
A: You can calibrate the sensor by comparing its readings with a known accurate thermometer and applying a correction factor in your code.
Q: Is the KY-028 suitable for outdoor use?
A: The KY-028 is not weatherproof. If used outdoors, it should be enclosed in a protective housing to prevent damage from moisture and dust.
Q: Can I use the KY-028 with a Raspberry Pi?
A: Yes, the KY-028 can be used with a Raspberry Pi. However, since the Raspberry Pi does not have an onboard ADC, you will need an external ADC module to read the analog output.