0% found this document useful (0 votes)
7 views

Automatic Night Lamp Using Arduino

Uploaded by

fadewe3628
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Automatic Night Lamp Using Arduino

Uploaded by

fadewe3628
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

JIIT

PHYSICS LAB -1
BTECH CSE – 1ST SEMESTER

AUTOMATIC NIGHT LAMP USING ARDUINO

SUBMITTED BY : SUBMITTED TO:


Om Agarwal -2401030204 MR.BHUBESH
Gaurang garg - 2401030213 CHANDER JOSHI
Bhrat garg -2401030221
CERTIFICATE
This is to certify that the project based
laboratory report titled ‘AUTOMATIC NIGHT
LAMP USING ARDUINO ’ is submitted by
group of OM agarwal, Gaurang garg and
Bhrat garg , studying in B.Tech CSE ,Batch B-
4.This project has been satisfactorily
completed and verified during 2024-2025
under the supervision of Mr.BHUBESH
CHANDRA JOSHI
ACKNOWLEDGEMENT
In the accomplishment of this project
successfully, many people have bestowed
upon their blessing with support, We would
like to thank all the people who have been
concerned with this project. I would like to
express my gratitude to our professor Mr.
Whose valuable guidance has been the one
that helped us finish this project. His
suggestion has served in contributing
towards the completion of the project
Automatic Night Lamp Using Arduino
INTRODUCTION :
Automation basically means to invent a method which reduces or
eliminate human efforts. In this project, we have automate a night
lamp via a simple interfacing of Arduino and Relay .
The control systems for the automation purpose can either be open
loop or closed loop meaning it can work either with a single input
parameter or in response to the output fed as the input as in case of
closed loop systems.
Automation has many pros like :
1. Increase in productivity
2. Predictable quality (Quality Improvement)
3. Increased robustness
4. Great output consistency
5. Reduction in human labour expenses
6. Highly accurate
7. Reduces human efforts in monotonous works.
In this project we have made a lamp turn on or off by itself when the
circuit detects an appreciable change in the intensity of light and for
achieving that we are going to use the two most common tools used
for automation i.e. Arduino and Rela9 interfacing along with
the would be achieved by the Proteus software.

Components Required :
1. Arduino – microcontroller
2. Relay 5 Volts
3. LDR (Light Dependent Resistor)
4. 10K Ohms
5. Transistor BC547
6. DC Supply 9volts

Software Required :
1.Arduino IDE
2.Proteus

Automatic Night Lamp Circuit Diagram:


Component Description
Arduino UNO
Arduino is basically a development board which is open source and
primarily utilizes the Microchip ATmega328P microcontroller and is
manufactured by Arduino.cc. The board comes with a set of
input/output pins comprising of digital and analogue which can be
interfaced to different expansion boards and external circuits.

Relay
9 is an electromagnetic switch which can be operated electrically and
made to turn on and off AC/DC appliances. It can be controlled even
with a low voltage of 5 volts like the output provided by the Arduino
pins.
LDR
LDR (Light Dependent Resistor) is a variable resistance component
that can vary its resistance value with the change in intensity of light
and it works on the photoconductivity principle. The value of
resistance decreases with increase in the intensity of light. It is used
in light-sensitive detector circuits and light activated switching
circuits.
Transistor
A transistor is basically a semiconductor device which is employed to
amplify or switch electronic signals and power. It is made up of
semiconductor material and has 3 terminals to connect with an
external circuit.
A small value of current at its base terminal controls a large value of
current at its emitter and collector terminals. A fixed dc voltage is
required at transistor terminals to operate in the desired region of its
characteristic curves. Transistor, when used for amplification
purpose, is kept biased so that it is partly on for all inputs and the
amplified output signal is taken at the emitter. For switching
applications, the transistor is biased so that it remains fully ON if
signal at base terminal is present and it gets completely OFF in the
absence of base signal.

Software Description
Proteus
Proteus design suite comes under the category of proprietary
software which is employed to perform electronic design
automation. This software is very handy for the electronic design
engineers and respective technicians for the purpose of creating
schematics and the prints in electronic form termed as PCB layout.
The software was developed in Yorkshire, England by Labcenter
Electronics Ltd. and comes with multi-language support which are
English, French, Spanish and Mandarin.
Arduino IDE
Arduino IDE is a software that can be used on various platforms.
Hence, it’s a cross-platform application and was developed using the
programming language java. It has a soul purpose of writing the
sketch and uploading it on Arduino compatible boards. The
supported languages are C and C++ which are a bit modified and
depends upon the library being used.
Code in Arduino :
void setup()
{
Serial.begin(9600);
}
void loop()
{
//only change value of the sesitivty "nothing else"....
int sensitivity = 80;

int sensorValue = analogRead(A0);


if(sensorValue<sensitivity)
{
digitalWrite(13,HIGH);
}
else
{
digitalWrite(13,LOW);
}
delay(100);
Serial.println(sensorValue); }

Code explanation :
In void setup , it talks about basic structure setup.
Serial.begin(9600)-sets the baud rate for serial data communication.
In void loop
Sensitivity- we set sensitivity of the photo resistor to detect the
change in luminous conditions
Here we apply “if else” conditions for comparison. Initially it is set to
a analog value of 80.
Then if the value is more than 80 means the light is on and if the
value is less then the room is dark
Sensor value = analogRead(A0)
It tells the jumper wire of the photo resistor is connected to analog
pin “A0”
DigitalWrite is just a kind of function which has High value for just
turn on and low for turn off and 13 tells the pin no. Of Arduino which
supplies signals for it.
Delay (100 mili second) tells there will be a delay after a continuous
on situation to off conditions
Serial.println(sensorValue) prints the analog signal on the serial
monitor
Nigh Lamp Circuit Working
The working of the circuit, here we have used a 9V DC supply
(Arduino’s 9V) and connected a 10k ohm resistor and an LDR. The
voltage which can be taken across the resistor or the LDR and fed
into the analog pin of the Arduino, pin A3 in this case.
With the help of the code mentioned above, the board will be able to
detect the analog input provided to it. This value read is in
accordance with the intensity of the light which is detected by the
LDR.
While we can check the coming value on the serial monitor to
calibrate the circuit according to the intensity of the light. Hence we
can change the condition in the conditional statement provided in
the code to turn the lamp “ON” & “OFF” at a desired intensity of
light, hence making it dynamic.
Now when the conditional statement is satisfied i.e. the light
intensity falls down below the value provided by you (in ADC
equivalent form) the board will generate a” HIGH” output at the pin
12 By “HIGH” it is meant that it produces 9V output as pin 12.
In this case a sufficient voltage is developed at the base of the
transistor and the transistor starts conducting. As a result, the
current starts flowing in the coils of the relay and it switches on
which means the NO terminal is switched to an active state to which
the lamp circuit has been connected to and upon the completion of
the circuit the lamp turns “ON”.
The lamp turns “OFF” when the else condition in the code becomes
true i.e. the intensity of light increases from the threshold value
provided given by us. Hence, output at pin 12 becomes “LOW” and
subsequently relay is turned OFF which turn the Lamp OFF.

You might also like