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

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

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

Introduction

The KY-028 is a temperature sensor module that utilizes the LM35 temperature sensor to measure ambient temperature. It provides both analog and digital outputs, making it versatile for a wide range of applications. The analog output corresponds to the temperature in a linear fashion, while the digital output can be used for threshold-based temperature detection. This module is commonly used in temperature monitoring systems, home automation, weather stations, and educational projects.

Explore Projects Built with KY-028

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based Security System with RFID and Laser Tripwire
Image of CPE doorlock system: A project utilizing KY-028 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
ESP32-Based Security System with RFID and Laser Intrusion Detection
Image of CPE doorlock system upgrade: A project utilizing KY-028 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
Arduino Mega 2560 Bluetooth-Controlled Flame Detection System with Servo Actuation
Image of apv circuit 1: A project utilizing KY-028 in a practical application
This circuit uses an Arduino Mega 2560 to monitor four KY-026 flame sensors and control four micro servo motors. The HC-05 Bluetooth module allows for wireless communication, enabling remote monitoring and control of the system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Nano Joystick-Controlled Bluetooth Module with Battery Power
Image of padelpro transmitter: A project utilizing KY-028 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

Explore Projects Built with KY-028

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 CPE doorlock system: A project utilizing KY-028 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 CPE doorlock system upgrade: A project utilizing KY-028 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
Image of apv circuit 1: A project utilizing KY-028 in a practical application
Arduino Mega 2560 Bluetooth-Controlled Flame Detection System with Servo Actuation
This circuit uses an Arduino Mega 2560 to monitor four KY-026 flame sensors and control four micro servo motors. The HC-05 Bluetooth module allows for wireless communication, enabling remote monitoring and control of the system.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of padelpro transmitter: A project utilizing KY-028 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

Technical Specifications

  • Sensor Type: LM35 Temperature Sensor
  • Operating Voltage: 3.3V to 5V DC
  • Output Types:
    • Analog Output (proportional to temperature)
    • Digital Output (based on adjustable threshold)
  • Temperature Range: -55°C to +150°C
  • Accuracy: ±0.5°C (at 25°C)
  • Dimensions: 32mm x 14mm x 8mm (approx.)
  • Adjustable Threshold: Via onboard potentiometer

Pin Configuration and Descriptions

The KY-028 module has 4 pins. The table below describes each pin:

Pin Name Description
VCC Power supply pin (3.3V to 5V DC)
GND Ground connection
DO Digital output pin (HIGH or LOW based on the threshold set by the potentiometer)
AO Analog output pin (provides a voltage proportional to the measured temperature)

Usage Instructions

Connecting the KY-028 to a Circuit

  1. Power the Module: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to ground.
  2. Read Analog Output: Connect the AO pin to an analog input pin of your microcontroller to measure the temperature.
  3. Use Digital Output: Connect the DO pin to a digital input pin of your microcontroller to detect when the temperature crosses the threshold set by the potentiometer.
  4. Adjust Threshold: Use the onboard potentiometer to set the desired temperature threshold for the digital output.

Important Considerations

  • Ensure the module is powered within its operating voltage range (3.3V to 5V).
  • The analog output voltage is directly proportional to the temperature in °C. For the LM35, the output is typically 10mV per °C.
  • Avoid exposing the sensor to extreme conditions (e.g., high humidity or corrosive environments) to maintain accuracy and longevity.

Example: Using KY-028 with Arduino UNO

Below is an example of how to use the KY-028 module with an Arduino UNO to read both analog and digital outputs:

// KY-028 Temperature Sensor Example with Arduino UNO

// Define pin connections
const int analogPin = A0; // Connect AO pin to A0 on Arduino
const int digitalPin = 2; // Connect DO pin to digital pin 2 on Arduino
const int ledPin = 13;    // Built-in LED for threshold indication

void setup() {
  Serial.begin(9600);          // Initialize serial communication
  pinMode(digitalPin, INPUT);  // Set digital pin as input
  pinMode(ledPin, OUTPUT);     // Set LED pin as output
}

void loop() {
  // Read analog value from AO pin
  int analogValue = analogRead(analogPin);
  float temperature = (analogValue * 5.0 / 1023.0) * 100.0; 
  // Convert analog value to temperature in °C
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" °C");

  // Read digital value from DO pin
  int digitalValue = digitalRead(digitalPin);
  if (digitalValue == HIGH) {
    digitalWrite(ledPin, HIGH); // Turn on LED if threshold is crossed
    Serial.println("Threshold exceeded!");
  } else {
    digitalWrite(ledPin, LOW);  // Turn off LED if below threshold
  }

  delay(1000); // Wait 1 second before next reading
}

Notes:

  • The analog value is converted to temperature using the formula:
    Temperature (°C) = (Analog Value * Vcc / 1023) * 100
    where Vcc is the operating voltage (typically 5V for Arduino UNO).
  • The onboard LED on the KY-028 module will also light up when the temperature exceeds the threshold.

Troubleshooting and FAQs

Common Issues

  1. No Output from the Module:

    • Ensure the module is powered correctly (3.3V to 5V).
    • Check all connections for loose wires or incorrect pin assignments.
  2. Incorrect Temperature Readings:

    • Verify the formula used to convert the analog value to temperature.
    • Ensure the sensor is not exposed to external heat sources or airflow that could affect readings.
  3. Digital Output Not Triggering:

    • Adjust the potentiometer to set the correct threshold.
    • Verify the digital pin connection and ensure it is configured as an input.

FAQs

Q: Can the KY-028 measure negative temperatures?
A: Yes, the LM35 sensor can measure temperatures as low as -55°C. However, the analog output may require additional processing to interpret negative values correctly.

Q: How do I calibrate the sensor?
A: The LM35 is factory-calibrated, so no additional calibration is required. However, you can adjust the threshold for the digital output using the onboard potentiometer.

Q: Can I use the KY-028 with a 3.3V microcontroller?
A: Yes, the KY-028 operates within a voltage range of 3.3V to 5V, making it compatible with 3.3V microcontrollers like the ESP32 or Raspberry Pi Pico.

Q: What is the purpose of the onboard LED?
A: The onboard LED lights up when the temperature exceeds the threshold set by the potentiometer, providing a visual indication of the digital output state.