You are on page 1of 4

Experiment 2.

Student Name: Anshu Saini Student UID: 21BCS3600


Branch: CSE Section/Group: 420-B
Semester: 1st Date of Performance: 15-12-21
Subject Code: 21ELH 101
Subject Name: BEEE

1. Aim: Design automatic street light using LDR.

2. Apparatus:

S. Apparatus Name Specification and Quantities in No.


No. rating
1 Resistance 10 kohm 1

2 LED light 0–2V 1

3 LDR -------------------------- 1

4 Breadboard ---------------------------- 1

5 Jumping Wires As per requirements

3. Circuit Diagram:
During Night

During Day
4.Code

5.Program

// C++ code

//

int LDR = 0;

void setup()

pinMode(A0, INPUT);

pinMode(10, OUTPUT);

void loop()

LDR = analogRead(A0);

analogWrite(10, map(LDR, 0, 1023, 180, 0));

delay(10); // Delay a little bit to improve simulation performance

}
6.Observation:

During day time the light is switched off while during night time it glows up

7.Result:

Designing of automatic night lamp was verified after uploading the program.

Evaluation Grid:

Sr. Parameters Marks Obtained Maximum Marks


No.
1. Worksheet completion including 10
writing learning objectives/Outcomes.
(To be
submitted at the end of the day).
2. Post Lab Quiz Result. 5
3. Student Engagement in 5
Simulation/Demonstration/Performance
and Controls/Pre-Lab Questions.
Signature of Faculty (with Date): Total Marks Obtained:

You might also like