Automatic night lamp is such type of lamp,which glow only on night time automatically and remain off during day time.
Today we are going to make automatic night lamp in Proteus with Arduino Library for this ,we need Proteus simulation software & Arduino programming software.
You have to follow the following steps to make the automatic night lamp project.
step. 1. Write a program in Arduino programming software.
code:-
int led =13;
int ldr = A0;
void setup()
{ pinMode(led,OUTPUT);
pinMode(ldr,INPUT);
Serial.begin(9600);
} // to establish the serial communation between arduino and computer.
void loop () {
int value = analogRead (ldr); // to read the analog value of the sensor
Serial.println(value); // to print the serial value in serial monitor
if (value>500)
digitalWrite(led,HIGH);
else
digitalWrite(led,LOW);
}
Today we are going to make automatic night lamp in Proteus with Arduino Library for this ,we need Proteus simulation software & Arduino programming software.
You have to follow the following steps to make the automatic night lamp project.
step. 1. Write a program in Arduino programming software.
code:-
int led =13;
int ldr = A0;
void setup()
{ pinMode(led,OUTPUT);
pinMode(ldr,INPUT);
Serial.begin(9600);
} // to establish the serial communation between arduino and computer.
void loop () {
int value = analogRead (ldr); // to read the analog value of the sensor
Serial.println(value); // to print the serial value in serial monitor
if (value>500)
digitalWrite(led,HIGH);
else
digitalWrite(led,LOW);
}
then go to file -> preference & tick mark on compilation.
step ii
Verify the program by click on ta tick botton on arduino software as shown in figure
copy the hex file after verifying the program
link here is inside the red color rectangular box and have an extension .hex
step iii
Open the Proteus and add the necessary component
here for automatic night lamp we need following component
i. Arduino
ii.LDR
iii. LED
iv. Resistor
we can pick this component from Proteus library by pressing "p" on keyboard.A dialog box will appear then we write the necessary component then we take those component.for details figure are shown below.
take all the necessary components and arrange the ckt as shown in figure below
double click on the arduino kit and paste the link copied before
Now when the ckt is played then during the day time the value of sensor is low during the day time and high during the night time.
During day time
During the night time
during the night time the led is glow because the led is only glow when LDR value is greater than 500,