Arduino Robot
Arduino Robot
AUTOMATIC
LIGHTINING
SYSTEM
B
INTRODUCTION:
• In this project, We will set up an automatic lighting system using Arduino, so the ideas came
when I tried to build automatic lighting system using Arduino and PIR motion sensor but I
confronted big issue because the light turn ON even if day time, this is why I thought to use LDR
in order to solve this issue.
PURPOSE OF THIS PROJECT:
The main purpose of this project is to prevent loss of current unnecessarily during day time and
make the system more efficient then before and conserve electicity .
IN THIS PROJECT AN AUTOMATIC LIGHTINING SYSTEM WITH AURDUINO WILL BE
REALISED.IT CONSISTS OF TURNING OF AN LED LAMP WHEN THE ROOM
BECOMES dark AND TURNING IT OFF OTHERWISE.IT MAINLY USES A KY-018 LIGHT
SENSOR .
ARDUINO:
Arduino refers to an open-source electronics platform or board and the software used to
program it. Arduino is designed to make electronics more accessible to artists, designers,
hobbyists and anyone interested in creating interactive objects or environments. An Arduino
board can be purchased pre-assembled or, because the hardware design is open source, built
by hand. Either way, users can adapt the boards to their needs, as well as update and
distribute their own versions.
PIR SENSOR:
sensor that measures infrared light radiating from objects. PIR sensors mostly
used in PIR-based motion detectors. Also, it used in security alarms and automatic
lighting applications. The below image shows a typical pin configuration of the
PIR sensor, which is quite simple to understand the pinouts. The PIR sensor
consist of 3 pins,
LDR:
An LDR or light dependent resistor is also known as photo resistor, photocell, photoconductor. It is a one type of
resistor whose resistance varies depending on the amount of light falling on its surface. When the light falls on the
resistor, then the resistance changes. These resistors are often used in many circuits where it is required to sense the
presence of light. These resistors have a variety of functions and resistance. For instance, when the LDR is in
darkness, then it can be used to turn ON a light or to turn OFF a light when it is in the light. A typical light dependent
resistor has a resistance in the darkness of 1MOhm, and in the brightness a resistance of a couple of KOhm
NECESSARY COMPONENTS:
CODE:
// C++ code
//
void setup()
{
Serial.begin(9600);
pinMode(13,OUTPUT);
pinMode(8,INPUT);
pinMode(A0,INPUT);
}
void loop()
{
int ldr=analogRead(a0);
int pir=digitalRead(13);
serial.println(ldr);
serial.println(pir);
if((300>ldr)&&(pir==1))
{
digitalWrite(13,1);
delay(5000);
}
else{
digitalWrite(13,0);
}}
SOFTWARE VISUALISATION: