Professional Documents
Culture Documents
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.
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.
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
Figure 4.3 shows the image is in full sun light and giving me a reading of
138KΩ and not 500Ω.
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.
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.
Figure 4.6. No Light Condition without Motion and with Light Intensity
38
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.