Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

How to Use KY-018 LDR Photo Resistor: Examples, Pinouts, and Specs

Image of KY-018 LDR Photo ResistorDesign with KY-018 LDR Photo Resistor in Cirkit Designer

Introduction

The KY-018 LDR Photo Resistor, manufactured by AZ-Delivery (Part ID: KY-018), is a light-dependent resistor (LDR) that changes its resistance based on the intensity of light falling on it. This component is widely used in light sensing applications, such as automatic lighting systems, light meters, and DIY electronics projects. Its simplicity and reliability make it an excellent choice for both beginners and experienced users.

Explore Projects Built with KY-018 LDR Photo Resistor

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 Raspberry Pi 3B Light Sensor Interface: A project utilizing KY-018 LDR Photo Resistor in a practical application
Raspberry Pi 3B Light Sensor Interface

This circuit connects a KY-018 LDR Photo Resistor to a Raspberry Pi 3B for light sensing applications. The LDR's signal pin is connected to GPIO 11 on the Raspberry Pi, allowing the microcontroller to read the light levels detected by the sensor. The LDR is powered by the Raspberry Pi's 5V and ground pins.

Open Project in Cirkit Designer

Common Applications

Technical Specifications

The KY-018 module consists of an LDR and a fixed resistor, forming a voltage divider circuit. Below are the key technical details:

Key Specifications

Parameter Value
Manufacturer AZ-Delivery
Part ID KY-018
Operating Voltage 3.3V to 5V
Resistance Range ~10 kΩ (bright light) to ~1 MΩ (dark)
Power Consumption Low
Operating Temperature -30°C to +70°C
Dimensions 18mm x 10mm x 2mm

Pin Configuration

The KY-018 module has three pins. The table below describes each pin:

Pin Name Description
Signal Outputs an analog voltage proportional to light intensity
VCC Power supply pin (3.3V to 5V)
GND Ground pin

Usage Instructions

The KY-018 LDR Photo Resistor is straightforward to use in a circuit. It outputs an analog voltage that varies with the intensity of light falling on the LDR. This voltage can be read by an analog input pin on a microcontroller, such as an Arduino UNO.

Connecting the KY-018 to an Arduino UNO

  1. Connect the Signal pin of the KY-018 to an analog input pin on the Arduino (e.g., A0).
  2. Connect the VCC pin to the 5V pin on the Arduino.
  3. Connect the GND pin to the GND pin on the Arduino.

Sample Arduino Code

The following code demonstrates how to read the light intensity from the KY-018 and display the value on the Serial Monitor:

// KY-018 LDR Photo Resistor Example Code
// Reads the analog value from the KY-018 and displays it in the Serial Monitor.

const int ldrPin = A0; // KY-018 Signal pin connected to Arduino A0

void setup() {
  Serial.begin(9600); // Initialize Serial Monitor at 9600 baud rate
  pinMode(ldrPin, INPUT); // Set the LDR pin as input
}

void loop() {
  int ldrValue = analogRead(ldrPin); // Read the analog value from the LDR
  Serial.print("Light Intensity (Analog Value): ");
  Serial.println(ldrValue); // Print the value to the Serial Monitor
  delay(500); // Wait for 500ms before the next reading
}

Important Considerations

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Output or Incorrect Readings

    • Cause: Loose or incorrect wiring.
    • Solution: Double-check all connections, ensuring the Signal pin is connected to an analog input pin, and VCC and GND are properly connected.
  2. Unstable or Fluctuating Readings

    • Cause: Electrical noise or interference.
    • Solution: Add a capacitor (e.g., 0.1 µF) across the Signal pin and GND to filter out noise.
  3. Low Sensitivity to Light Changes

    • Cause: Insufficient light intensity or incorrect placement of the LDR.
    • Solution: Ensure the LDR is exposed to sufficient light and is not obstructed.
  4. Arduino Serial Monitor Not Displaying Values

    • Cause: Serial Monitor not set to the correct baud rate.
    • Solution: Set the Serial Monitor to 9600 baud to match the code.

FAQs

Q: Can the KY-018 be used with a 3.3V microcontroller?
A: Yes, the KY-018 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: How can I increase the sensitivity of the KY-018?
A: You can adjust the fixed resistor on the module or use an external resistor to modify the voltage divider circuit, but this requires careful consideration of the LDR's resistance range.

Q: Can the KY-018 detect complete darkness?
A: The KY-018 can detect very low light levels, but in complete darkness, the resistance of the LDR becomes extremely high, and the output voltage may approach 0V.

Q: Is the KY-018 suitable for outdoor use?
A: The KY-018 is not weatherproof. If used outdoors, it must be enclosed in a protective, transparent casing to shield it from moisture and dust.

By following this documentation, you can effectively integrate the KY-018 LDR Photo Resistor into your projects and troubleshoot any issues that arise.