top of page

Interfacing of LDR Sensor Module with Arduino Uno.



What is a LDR Sensor Module ?


LDR sensor module is used to detect the intensity of light. It is associated with both analog output pin and digital output pin labelled as AO and DO respectively on the board. When there is light, the resistance of LDR will become low according to the intensity of light. The greater the intensity of light, the lower the resistance of LDR. The sensor has a potentiometer knob that can be adjusted to change the sensitivity of LDR towards light.



Material Required:



Material Quantity

Arduino Uno 1

LDR Sensor Module 1

Jumper cables 4


Pinout Diagram:













Circuit Diagram:


Parameter Value

VCC 5 V DC from your Arduino

Ground GND from your Arduino

A0 Connect to Analog Pin A0





Tested Programming Code:


int sensorPin = A0; // select the input pin for LDR


int sensorValue = 0; // variable to store the value coming from the sensor

void setup() {

Serial.begin(9600); //sets serial port for communication

}

void loop() {


sensorValue = analogRead(sensorPin); // read the value from the sensor

Serial.println(sensorValue); //prints the values coming from the sensor on the screen


delay(100);


}



Precautions: 1. Double check the connections before powering on the circuit. 2. Don’t use loose jumper cables. 3. Check whether proper board is selected from Arduino IDE. 4. Ensure proper placement of LDR Sensor Module for correct working. 5. Don’t lose hope if LDR Sensor Module does not run properly for the first time, try again.

Conclusion:


Once your sketch is running, you have to open your serial monitor to check the readings.




GET IN TOUCH

We'd love to hear from you

bottom of page