Automatic street light using ldr, Assignments of Computer Science

Beee and Focp Automatic Street LIght

Typology: Assignments

2021/2022

Available from 01/30/2022

yuvraj-1
yuvraj-1 🇮🇳

1 document

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Experiment No. 4
Aim: To design an automatic night lamp using LDR.
Apparatus: ARDUINO, LDR, Resistance 10k ohm, wires, Breadboard
Theory: IT senses the light intensity from surroundings and find whether its day or
night.
Programming:
void setup()
{
Serial.begin (9600);
pinMode(7,OUTPUT);
}
void loop()
{
int c = analogRead(A0);
Serial.println(c);
If (c<850)
{
digitalWrite(7,LOW);
}
else
{
digitalWrite(7,HIGH);
}
}
CIRCUIT ON TINKERCAD
pf2

Partial preview of the text

Download Automatic street light using ldr and more Assignments Computer Science in PDF only on Docsity!

Experiment No. 4 Aim: To design an automatic night lamp using LDR. Apparatus: ARDUINO, LDR, Resistance 10k ohm, wires, Breadboard Theory: IT senses the light intensity from surroundings and find whether its day or night. Programming: void setup() { Serial.begin (9600); pinMode(7,OUTPUT); } void loop() { int c = analogRead(A0); Serial.println(c); If (c<850) { digitalWrite(7,LOW); } else { digitalWrite(7,HIGH); } } CIRCUIT ON TINKERCAD

PROGRAM:

void setup() { Serial.begin (9600); pinMode(7,OUTPUT); } void loop() { int c = analogRead(A0); Serial.println(c); if (c<=800) { digitalWrite(7,LOW); } else { digitalWrite(7,HIGH); } } Result Designing of automatic night lamp was verified after uploading the program.