Electronics

LDR KY-018 Photosensitive Sensor

AED 5.25

1

Description

The KY-018 Photoresistor module is used to estimate the brightness of a light source. In the presence of light, the resistance will be reduced, but in the absence of it, it will be increased. The output, which controls light intensity, is analog. compatible with a variety of widely used microcontrollers, including Arduino, ESP32, and others.

Package Includes:

  • LDR Ky-018 Photosensitive Sensor

Features:

  • Using a sensitive photosensitive resistance sensor
  • The Input voltage is 3.3V-5V
  • The output form: AO analog voltage output
  • Fixed bolt holes for easy installation

Description:

The KY-018 Photoresistor module is used to estimate the brightness of a light source. In the presence of light, the resistance will be reduced, but in the absence of it, it will be increased. The input voltage is between 3.3V-5V The output, which is controlled by the light intensity, is analog. it has Fixed bolt holes for easy installation, compatible with a variety of widely used microcontrollers, including Arduino, ESP32, and others.

Principle of Work:

Electrons are what causes electricity to flow through any metal, and they are classified as insulators, conductors, and semiconductors depending on how many electrons are passing through them at any given time. These are divided into groups based on the band gap, which is the energy difference between the valence band and the conduction band. Since there aren't many electrons accessible for conduction in a photoresistor, it is composed of high-resistance semiconductor material. The photoresistor's top is covered in a zigzag pattern made of the semiconductor cadmium sulfur. In order to obtain the necessary resistance and power rating, it is placed in this manner. When light strikes the photoresistor, the valence band electrons or valence electrons absorb energy sufficient for them to break their bond with the atom and move to the conduction band.

This process of transfer of electrons generates a current flow to the photoresistor and as more and more electrons transfer to the conduction band, the current flow increases and results in the decrease of resistance in the photoresistor.

Pinout of the Module:

 

KY-018 Description
S Analog Pin
+ +5V
GND

Applications:

  • brightness measurement
  • As a sensor for aligning solar cells
  • The light barrier as counterpart for the laser
  • Optocoupler as a remote station

Circuit:

The sensor pin - to ground, sensor pin + connected to VCC, and sensor pin S to ANalog pin A0.

Library: 

no library is needed.

Code:

The program measures the current voltage value at the sensor,
calculates from this and the known series resistance the current
the resistance value of the sensor and outputs the results to the serial output

int sensorPin = A5; // Declare the input pin here
// Serial output in 9600 baud
void setup()
{
 Serial.begin(9600);
}
void loop()
{
 // Current voltage value is measured...
 int rawValue = analogRead(sensorPin);
 float voltage = rawValue * (5.0/1023) * 1000;
 float resitance = 10000 * ( voltage / ( 5000.0 - voltage) );
 // ... and here output to the serial interface
 Serial.print("Voltage value:"); Serial.print(voltage); Serial.print("mV");
 Serial.print(", resistance value:"); Serial.print(resitance); Serial.println("Ohm");
 Serial.println("---------------------------------------");
 delay(500);
}

We'll start obtaining data on the serial monitor when you upload the code, start the Serial Monitor, direct the sensor to a light source then check the serial monitor for changes

Technical Details: 

  • Operating voltage 3,3 V - 5 V
  • Output voltage 3,3 V - 5 V
  • Fixed known resistance 10 kΩ
  • Dimensions 21 x 15 x 6 mm

Resources:

Comparisons:
This module is an easy way to start with a sensor with Arduino, with this module you need no external components like bare-bone LDR because you can't work directly with LDRs without a voltage divider circuit which needs a resister plus an LDR, also this module has a fixed screw hole to fix your module in any DIY project, but still, this module has only analog output with no amplification or Schmitt trigger and digital output which another module we have on this website has you can use LDR in search to see more versions of this module in our websire.