Hackster will be offline on Monday, June 15 from 5pm to 7pm PDT to perform some scheduled maintenance.
SURYATEJA
Published © Apache-2.0

Arduino Light Senser Using LDR

This project uses LDR for a light sensor.

BeginnerFull instructions provided1.5 hours2,582
Arduino Light Senser Using LDR

Things used in this project

Story

Read more

Custom parts and enclosures

CONNECTIONS

Schematics

CONNECTIONS

Code

CODE FOR LDR

Arduino
void setup() {
  Serial.begin(9600); // Start Serial.
  pinMode(13, OUTPUT);
}

void loop() {
  int A = analogRead(A0);
  Serial.println(A);// Display serial results in serial monitor.
  if (A < 100 ) {   // Change 100 to the number depending on the light in your area.
    digitalWrite(13, HIGH);
  }

  else {
    digitalWrite(13, LOW);
  }


}

Credits

SURYATEJA
18 projects • 59 followers

Comments