LDR & Buzzer with Arduino :

What is LDR?

LDR stands for Light “Dependent Resistor”.  LDR is a special type resistor that works on the photoconductivity principle. It means that resistance will change according to the intensity of light. The resistance decreases with an increase in the intensity of light. We can make different cool projects with LDR such as Light meter, automatic street light. It is also called “Light sensor”.

LDR

What is Buzzer?

Buzzer is like alarm. It is very easy to use. It operates just like simple led. It is use to make alarms etc.

Buzzer

Components :

  • Arduino Uno
  • Jumper wires
  • LDR
  • Buzzer
  • Bread Board
  • 1K ohm resistor

Circuit Diagram :

Code :

void setup() {
  // initialize serial communication at 9600 bits per second
  Serial.begin(9600);
  pinMode(13, OUTPUT);
}

void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
  if(sensorValue<50){
    digitalWrite(13, HIGH);
  }
  else
  digitalWrite(13, HIGH);
  delay(1);     // delay in between reads for stability

}

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Facebook
YouTube
× Contact us