KY-018 Photoresistor Module

Description

Arduino KY-018 Photoresistor module, used to measure light intensity. It can determine the presence or absence of light.

Specifications

This module consists of a photoresistor and a 10  in-line resistor. The photoresistor's resistance will decrease in the presence of light and increase in the absence of it. The output is analog and determines the intensity of light.

Operating Voltage3.3V to 5V
Output typeAnalog

KY-018 Connection Diagram

Connect the Power line (middle) and ground (-) to +5 and GND respectively. Connect signal (S) to pin A2 on the Arduino.

KY-018Arduino
SPin A2
middle+5V
-GND
Arduino KY-018 Keyes photo resistor connection diagramclick to enlarge

KY-018 Example Code

The following Arduino sketch will output readings from the photoresistor, cover the module with your hand to prevent light on it and the output values will be low, point a light to the sensor and the values will be high.

int sensorPin = 2; //define analog pin 2
int value = 0; 

void setup() {
	Serial.begin(9600); 
} 

void loop() {
	value = analogRead(sensorPin); 
	Serial.println(value, DEC); // light intensity
								// high values for bright environment
								// low values for dark environment
	delay(100); 
}

2
Leave a Reply

avatar
1 Comment threads
1 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
2 Comment authors
ArduinoModulesVladimir Recent comment authors
Vladimir
Vladimir

Great site!
Unfortunately CAPTCHA on this page https://arduinomodules.info/download/ky-018-photoresistor-module-zip-file/ is not visible and i cann’t download fzpz file.