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”.
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.
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
}
Good day! I just want to offer you a big thumbs up for your excellent information you have got here on this post. Ill be coming back to your blog for more soon.