You are on page 1of 8

CHAPTER 4

TEST AND RESULT OF THE SYSTEM

4.1. Introduction
As the whole system is divided into two parts which is light with LDR and
another one is with PIR motion sensor. For these two sensors are controlled by
Arduino Uno MCU. PIR sensor gives the motion of the body as input to MCU and
MCU gives output to the LEDs as light. LDR detect the light intensity. When the light
intensity is from the surrounding is less than the light value given by the program,
Light will be ON automatically.

4.2. Hardware Testing of PIR Sensor

Figure 4.1. PIR Sensor Testing


34

Hardware testing of PIR sensor is shown in figure 4.1. For our PIR’s the cable
is +voltage power, black cable is –ground power and yellow is the signal out. Just
make sure you plug the cable in as shown above. If you get it backwards you won’t
damage the PIR but it won’t work.
Now when the PIR detects motion, the output pin will go “high” to 3.3 V and
light up the LED.
Once you have the breadboard wired up, insert batteries and wait 30-60
seconds for the PIR to stabilize. During that time the LED may blink a little. Wait
until the LED is off and then move around in front of it, waving a hand, etc. to see the
LED light up.

4.3. Software Testing of PIR Sensor

Figure 4.2. Serial Result of PIR Sensor Testing

Figure 4.2 shows the serial output of PIR motion sensor. In program, the
motion of the body is given as input. While detecting of the motion, the result shows
“Motion is detected”. If there is no motion, in serial output monitor shows the result
as “ No Motion is detected”.
35

4.4. Hardware Testing of LDR

Figure 4.3. Testing of LDR

Figure 4.3 shows the image is in full sun light and giving me a reading of
138KΩ and not 500Ω.

4.5. Arduino LDR Sensor Connections


First, need to connect the LDR to the analog input pin 0 on the Arduino. You
have to use a voltage divider configuration to do this. The connection diagram for the
Arduino is given in figure 4.4.

Figure 4.4. Testing of LDR with Arduino Uno Board


36

One leg of the LDR is connected to VCC (5 V) on the Arduino, and the other
to the analog pin 0 on the Arduino. A 100 K resistor is also connected to the same leg
and grounded.

4.6. Testing the Code for the Arduino LDR Sensor


After connecting the LDR to Arduino, we can check for the values coming
from the LDR via the Arduino. To do this, connect the Arduino via USB to PC and
open up the Arduino IDE or software. Next, paste this code and upload it to Arduino:
Int sensorPin=A0;//select the input pin for LDR
Int sensorValue=0;//variable to store the value coming from the sensor
Void setup(){
Serial.begin(9600);//sets serial port for communication
}
Void loop(){
SensorValue=
analogRead(sensorPin);//read the value from the sensor
Serial.println(sensorValue);//prints the values coming from the sensor on the screen
Delay(100);
}

Figure 4.5 Arduino LDR Sensor Serial Monitor


37

After uploading the code, click the button on the Arduino IDE called “Serial
monitor”. This will open a new window, which prints different values on the screen.
Now, test out the sensor by blocking its surface from light and see what values you
get on the serial monitor, This is how the serial monitor looks.

4.7. Result of Room Light with PIR Sensor


The figure 4.6 is the ones which are taken on field at which point of distance
and distance, the sensors detected the motion and then the light is ON. After sensing
the detection of the motion, sensor sense the motion and then there is no motion, light
will be off automatically.
Human detection part of the project entirely depended on the program
responsible for the subtraction of any background noises. The PIR sensor responsible
for the detection of motion adjusts itself to the infrared signature of its surroundings
and keeps watching for any changes.
In the absence of motion, the LED indicator will remain dim, and the program
will continue updating the surroundings. If the sensor detects movement, the frame for
motion detected will be the input frame to the process of human detection, and
consequently, the motion detection indicator will light up.

Figure 4.6. No Light Condition without Motion and with Light Intensity
38

Figure 4.7. Lighting with Motion

Figure 4.8. Lighting after Detecting the Motion (behind view)


39

Figure 4.9. Lighting after Detecting the Motion (Left view)

4.8. Result of walkway light with LDR


The figure shows the light at the condition when LDR sense the light intensity.
When the light intensity of the surrounding is less than the value of light given by the
program, light will be OFF.

Figure 4.10. Lighting with LDR Sense Light Intensity (Behind View)
40

Figure 4.11. Lighting with LDR Sense Light Intensity (Left View)

In contract when the real dark is greater than the dark, light will be ON. All
these systems are automatically by the LDR sensing the light intensity without having
manmade.
This system works 95% well, the light will be ON when required and
gradually goes to OFF position when it is not necessary.

You might also like