Arduino KY-018 Photo resistor module

photoresistor module

Buy the 37 in 1 kit at Amazon

Contents

Overview

Photo resistors, also known as light dependent resistors (LDR), are light sensitive devices most often used to indicate the presence or absence of light, or to measure the light intensity. In the dark, their resistance is very high, sometimes up to 1MΩ, but when the LDR sensor is exposed to light, the resistance drops dramatically, even down to a few ohms, depending on the light intensity. LDRs have a sensitivity that varies with the wavelength of the light applied and are nonlinear devices. They are used in many applications but are sometimes made obsolete by other devices such as photodiodes and phototransistors. Some countries have banned LDRs made of lead or cadmium over environmental safety concerns.

Widely used in cameras, solar garden lights, lawn, detectors, clock, music, cups, gift boxes, miniNight light, light voice switches, lights automatically switch toys and a variety of light control, light control lighting, lamps and other light automatic opening OFF control field

Specifications

  1. according to the spectral characteristics of the photoresistor has three photoresistor: Ultraviolet photosensitive resistance, infrared light-sensitive resistors, Visible photosensitive resistance;
  2. the main parameters are as follows:
    1. dark current, dark resistance: photosensitive resistance at a certain applied voltage, when the light is not irradiated when the flowing Current is called dark current. Applied voltage and dark current ratio as the dark resistance;
    2. Sensitivity: Sensitivity is irradiated by light sensitive resistor, the resistance value (dark resistance) when irradiated with light Resistance value (light resistance) the relative change in values.
    3. volt-ampere characteristic curve. Voltage characteristic curves are used to describe the resistance of the applied voltage and the photosensitive photocurrent relationship, On the photosensitive devices, the light current with applied voltage increases.
    4. temperature coefficient. Photoelectric effect photoresistor affected by temperature, at a low temperature portion photoresistor photoelectric Sensitive high sensitivity at high temperatures is low.
    5. rated power. Photosensitive resistor rated power is allowed for certain lines in the power consumed when the temperature rise High, its power consumption is reduced.

Schematic

  • Arduino A5 –> Module Signal (S)
  • Arduino 5V –> Module +5V (Pin2)
  • Arduino GND –> Module GND (-)

Example code

//KY018 Photo resistor module
 
int sensorPin = A5; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int sensorValue = 0; // variable to store the value coming from the sensor
void setup() {
  pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
}
void loop() {
  sensorValue = analogRead(sensorPin);
  digitalWrite(ledPin, HIGH);
  delay(sensorValue);
  digitalWrite(ledPin, LOW);
  delay(sensorValue);
  Serial.println(sensorValue, DEC);
}