Interface LDR with Arduino Leave a comment

About LDR:

A photoresistor or LDR is a light-dependent variable resistor. The resistance of a photoresistor is dependent on the light intensity, as the intensity increases resistance decreases and vice-versa.

Pinout of LDR

Components Needed

  • Arduino Uno/nano/mega
  • LDR
  • 10km resistor
  • Jumper wires

Circuit Diagram

Arduino IDE Code

const int ldr=A0;
void setup() {

void loop() {
  int LDR_Data=analogRead(ldr);
  Serial.print("LDR DATA IN BITS:");
  int LDR_Volt=map(LDR_Data,0,1023,0,5000);
  Serial.print("LDR DATA IN milliVolts:");

Leave a Reply