Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use KY-012: Examples, Pinouts, and Specs

Image of KY-012
Cirkit Designer LogoDesign with KY-012 in Cirkit Designer

Introduction

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.

Explore Projects Built with KY-012

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino Nano Joystick-Controlled Bluetooth Module with Battery Power
Image of padelpro transmitter: A project utilizing KY-012 in a practical application
This circuit is a wireless joystick controller that uses an Arduino Nano to read analog signals from a KY-023 Dual Axis Joystick Module and transmits the data via an HC-05 Bluetooth Module. The system is powered by a 18650 Li-Ion battery with a rocker switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Security System with RFID and Laser Tripwire
Image of CPE doorlock system: A project utilizing KY-012 in a practical application
This circuit is designed for a comprehensive security and access control system with motion detection, access via RFID, and a break-beam sensor. It includes a solenoid lock controlled by a relay, visual and audible alerts, and a robust power management system with solar and battery backup to ensure uninterrupted operation.
Cirkit Designer LogoOpen Project in Cirkit Designer
Wireless Joystick-Controlled Interface with Arduino Nano and NRF24L01
Image of Transmitter 11: A project utilizing KY-012 in a practical application
This circuit features an Arduino Nano interfaced with a KY-023 Dual Axis Joystick Module for analog input, and an NRF24L01 module for wireless communication. The joystick provides x and y-axis control signals to the Arduino's analog inputs and a switch signal to a digital input, while the NRF24L01 enables the Arduino to communicate with other devices wirelessly. The 2x 18650 batteries supply power to the Arduino, which in turn powers the joystick and the NRF24L01 module.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Security System with RFID and Laser Intrusion Detection
Image of CPE doorlock system upgrade: A project utilizing KY-012 in a practical application
This circuit is a security and access control system featuring motion detection, laser beam-break sensing, and RFID scanning, interfaced with a keypad and visual/audible indicators, powered by a solar-charged battery, and capable of controlling an electric lock via a relay.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with KY-012

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of padelpro transmitter: A project utilizing KY-012 in a practical application
Arduino Nano Joystick-Controlled Bluetooth Module with Battery Power
This circuit is a wireless joystick controller that uses an Arduino Nano to read analog signals from a KY-023 Dual Axis Joystick Module and transmits the data via an HC-05 Bluetooth Module. The system is powered by a 18650 Li-Ion battery with a rocker switch for power control.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of CPE doorlock system: A project utilizing KY-012 in a practical application
ESP32-Based Security System with RFID and Laser Tripwire
This circuit is designed for a comprehensive security and access control system with motion detection, access via RFID, and a break-beam sensor. It includes a solenoid lock controlled by a relay, visual and audible alerts, and a robust power management system with solar and battery backup to ensure uninterrupted operation.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Transmitter 11: A project utilizing KY-012 in a practical application
Wireless Joystick-Controlled Interface with Arduino Nano and NRF24L01
This circuit features an Arduino Nano interfaced with a KY-023 Dual Axis Joystick Module for analog input, and an NRF24L01 module for wireless communication. The joystick provides x and y-axis control signals to the Arduino's analog inputs and a switch signal to a digital input, while the NRF24L01 enables the Arduino to communicate with other devices wirelessly. The 2x 18650 batteries supply power to the Arduino, which in turn powers the joystick and the NRF24L01 module.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of CPE doorlock system upgrade: A project utilizing KY-012 in a practical application
ESP32-Based Security System with RFID and Laser Intrusion Detection
This circuit is a security and access control system featuring motion detection, laser beam-break sensing, and RFID scanning, interfaced with a keypad and visual/audible indicators, powered by a solar-charged battery, and capable of controlling an electric lock via a relay.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Environmental temperature monitoring
  • HVAC systems
  • Industrial temperature control
  • Weather stations
  • Home automation projects
  • Educational and prototyping purposes

Technical Specifications

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)

Pin Configuration

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

Usage Instructions

How to Use the KY-012 in a Circuit

  1. Power the Module: Connect the VCC pin to a power source (4V to 30V) and the GND pin to the ground.
  2. Read the Output: Connect the 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.
  3. Calculate Temperature: The output voltage is proportional to the temperature, with a scale factor of 10mV/°C. For example:
    • At 25°C, the output voltage will be 250mV.
    • At 100°C, the output voltage will be 1V.

Important Considerations

  • Ensure the power supply voltage is within the specified range (4V to 30V).
  • Avoid placing the sensor in environments with excessive humidity or corrosive substances, as this may affect accuracy.
  • Use proper decoupling capacitors near the power supply pins to reduce noise.
  • For best accuracy, avoid exposing the sensor to rapid temperature changes.

Example: Connecting KY-012 to Arduino UNO

Below is an example of how to connect and read data from the KY-012 module using an Arduino UNO:

Circuit Connections

  • Connect the VCC pin of the KY-012 to the 5V pin of the Arduino.
  • Connect the GND pin of the KY-012 to the GND pin of the Arduino.
  • Connect the OUT pin of the KY-012 to the A0 analog input pin of the Arduino.

Arduino Code

// 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
}

Best Practices

  • Use a stable power supply to minimize noise in the output signal.
  • If the sensor is used in noisy environments, consider adding a low-pass filter to the output.
  • Calibrate the sensor if precise measurements are required.

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output or Incorrect Readings

    • Cause: Incorrect wiring or loose connections.
    • Solution: Double-check the connections and ensure the pins are properly connected.
  2. Fluctuating Output

    • Cause: Electrical noise or unstable power supply.
    • Solution: Use decoupling capacitors (e.g., 0.1µF) near the power supply pins to reduce noise.
  3. Output Voltage Does Not Match Expected Temperature

    • Cause: Incorrect calculation or reference voltage mismatch.
    • Solution: Verify the reference voltage used in calculations matches the actual supply voltage.
  4. Sensor Overheating

    • Cause: Excessive current or exposure to high temperatures.
    • Solution: Ensure the power supply voltage is within the specified range and avoid exposing the sensor to extreme conditions.

FAQs

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.