

The KY-012 is a temperature sensor module that utilizes the LM35 temperature sensor. It provides an analog output that is directly proportional to the temperature in degrees Celsius. This module is widely used in temperature monitoring and control applications due to its simplicity, accuracy, and ease of integration into electronic circuits.








The KY-012 module is based on the LM35 temperature sensor, which offers high accuracy and linear output. Below are the key technical details:
| Parameter | Value |
|---|---|
| Operating Voltage | 4V to 30V |
| Output Voltage Range | 0V to 1.5V (for -55°C to 150°C) |
| Temperature Range | -55°C to 150°C |
| Accuracy | ±0.5°C (at 25°C) |
| Output Scale Factor | 10mV/°C |
| Power Consumption | Low (60 µA typical) |
The KY-012 module has three pins for easy connection:
| Pin | Name | Description |
|---|---|---|
| 1 | VCC | Power supply input (4V to 30V) |
| 2 | GND | Ground connection |
| 3 | OUT | Analog output voltage proportional to temperature |
VCC pin to a power source (4V to 30V) and the GND pin to the ground.OUT pin to an analog input pin of a microcontroller (e.g., Arduino) or an analog-to-digital converter (ADC) to measure the output voltage.Below is an example of how to connect and read data from the KY-012 module using an Arduino UNO:
VCC pin of the KY-012 to the 5V pin of the Arduino.GND pin of the KY-012 to the GND pin of the Arduino.OUT pin of the KY-012 to the A0 analog input pin of the Arduino.// KY-012 Temperature Sensor Example Code
// Reads the analog output from the KY-012 and calculates the temperature in °C.
const int sensorPin = A0; // KY-012 OUT pin connected to Arduino A0
float voltage; // Variable to store the sensor 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(sensorPin); // Read the analog value (0-1023)
// Convert the analog value to voltage (assuming 5V reference voltage)
voltage = sensorValue * (5.0 / 1023.0);
// Calculate temperature in °C (10mV per °C)
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
Fluctuating Output
Output Voltage Does Not Match Expected Temperature
Sensor Overheating
Q1: Can the KY-012 measure negative temperatures?
Yes, the LM35 sensor used in the KY-012 can measure temperatures as low as -55°C. However, the output voltage will be negative for temperatures below 0°C, which may require additional circuitry to read.
Q2: Can I use the KY-012 with a 3.3V microcontroller?
Yes, the KY-012 can operate with a supply voltage as low as 4V. However, ensure the output voltage does not exceed the ADC input range of your microcontroller.
Q3: How accurate is the KY-012?
The LM35 sensor provides an accuracy of ±0.5°C at 25°C. For higher accuracy, consider calibrating the sensor in your specific application.
Q4: Can I extend the wires of the KY-012?
Yes, but long wires may introduce noise. Use shielded cables or add filtering capacitors to minimize interference.
Q5: Is the KY-012 waterproof?
No, the KY-012 is not waterproof. For outdoor or wet environments, consider using a waterproof enclosure or a different sensor designed for such conditions.