by
Certifico, Ma. Dia Lauren S.
Eugenio, Francis Erik V.
Onda, Aldrin James M.
A Thesis Submitted to the Mapúa Institute of Technology
In Partial Fulfillment of the Requirements for the Degree of B.S. in
Electrical Engineering
Mapúa Institute of Technology
August 2014 i
APPROVAL SHEET
This is to certify that we have supervised the preparation of and read the thesis prepared by
Ma. Dia Lauren S. Certifico, Francis Erik Eugenio and Aldrin James M. Onda, entitled
Intelligent LED Lamp with varying light intensity according to ambient light and height with integrated motion sensor and that the said thesis has been submitted for final examination by the Oral Examination Committee.
Engr. Joseph Bryan Ibarra
Academic Adviser
As members of the Oral Examination Committee, we certify that we have examined this thesis, presented before the committee on August 2014 , and hereby recommend that it be accepted as fulfillment of the thesis requirement for the degree in Electrical Engineering
Engr. Esperanza Chua
Panel Member 1
Engr. Leonardo Valiente Jr.
Panel Member 2
Engr. Paulo Tindogan
Committee Chairman
This study hereby approved and accepted by the School of Electrical Engineering as fulfillment of the thesis requirement for the degree in Electrical Engineering .
Engr. Ronald Vincent Santiago
EE Chairperson ii
ACKNOWLEDGEMENT
Our deepest thanks to the LORD for all the gifts He has given us and for directing our path to the following persons who have been instrumental in the completion of this study.
Our adviser, Engr. Joseph Bryan Ibarra, for his guidance and patience in providing us with an excellent atmosphere for doing research.
The Institution and its faculty members, without whom this project would have been a distant reality.
Our family, whose prayers have provided us with the strength to hold on during the times that we wanted to give up.
All our friends, who in one way or another have given us support and encouragement .
Certifico, Ma. Dia Lauren S.
Eugenio, Francis Erik V.
Onda, Aldrin James M.
iii
TABLE OF CONTENTS
TITLE PAGE ………………………………………………………………………………… i
APPROVAL PAGE ………………………………………………………………………….. ii
ACKNOWLEDGEMENT ……………………………………………………………………iii
TABLE OF CONTENTS……………………………………………………………………..iv
LIST OF TABLES…………………………………………………………………………… vi
LIST OF FIGURES…………………………………………………………………………..vii
ABSTRACT…………………………………………………………………………………..ix
Chapter 1: INTRODUCTION………………………………………………………………. 1
Chapter 2: REVIEW OF LITERATURE…………………………………………………… 4
2.1 LED Lamp ………………………………………………………………...4
2.2 Passive Infrared (PIR) Sensors…………………………………………….5
2.3 Light Dependent Resistor (LDR Sensor)………………………………... 12
2.4 Pulse Width Modulation …………………………………………………17
2.5 Recommended Light Levels…………………………………………….. 19
Chapter 3: INTELLIGENT LED LAMP WITH VARYING LIGHT INTENSITY
ACCORDING TO AMBIENT LIGHT AND POLE HEIGHT WITH INTEGRATED
MOTION SENSOR ………………………………………………………………………… 25
Introduction …………………………………………………………………… 25
Methodology Process in Designing the Prototype ………………….………….28
Microcontroller Coding………………………………………………………...29
Conceptual Diagram…………………………………………………….…… 30
Objective 1: To construct a LED lamp control circuit with analog
input control…………………………………………………………………... 32
Objective 2: Calibration of LDR using lux meter………………………………34
Objective 3: To program a microcontroller that will maintain the desired
light intensity with varying parameters: ambient light and height of positioning …………………………………………………………………. 39
Varying Light Source …………………………………………………... 40
Varying Pole Height………………………………….…………………..46
Results and Discussion …………………………………………………..52
Conclusion ……………………………………………………………… 53
Objective 4: To integrate a motion sensor that controls light intensity
from normal to maximum as movement is detected …………………..…..…....54
Results and Discussion …………………………………………………..58
Conclusion ……………………………………………………………… 58
Objective 5: To test the overall functionality of the prototype .………….…... 59
Chapter 4
: CONCLUSION …………………….………………………………………… 61
Chapter 5: RECOMMENDATION ……………………………………………………… 62
REFERENCES ……………………………………………………………………………. 63
APPENDICES ........................................................................................................................64
APPENDIX A Specification of PIR Sensor ....................................................................65
APPENDIX B Program of PIC Microcontroller ............................................................66
APPENDIX C Gathered Data from the Prototype ..........................................................81 v
LIST OF TABLES
TABLE 3.1: Lux intensity of the LED Lamp in varying its duty cycle ................................... 33
TABLE 3.2: List of materials in testing the LDR .................................................................... 35
TABLE 3.3: Calibration of LDR sensor .................................................................................. 36
TABLE 3.4: Output Voltage and Current of the LED lamp at 50 Lux, 5 ft high .................... 41
TABLE 3.5: Output Voltage and Current of the LED lamp at 75 Lux, 5 ft high .................... 42
TABLE 3.6: Output Voltage and Current of the LED lamp at 100 Lux, 5 ft high .................. 42
TABLE 3.7: Varying ambient light with Maintaining lux intensity of 50 lux at 5 feet high ... 43
TABLE 3.8: Varying ambient light with Maintaining lux intensity of 75 lux at 5 feet high ... 44
TABLE 3.9: Varying ambient light with Maintaining lux intensity of 100 lux at 5 feet high . 44
TABLE 3.10: Output Current of the LED lamp at 50 Lux, 6 ft high ....................................... 48
TABLE 3.11: Output Voltage and Current of the LED lamp at 50 Lux, 7 ft high .................. 48
TABLE 3.12: Output Current of the LED lamp at 75 Lux, 6 ft high ....................................... 49
TABLE 3.13: Output Current of the LED lamp at 75 Lux, 7 ft high ....................................... 49
TABLE 3.14: Output Current of the LED lamp at 100 Lux, 6 ft high ..................................... 50
TABLE 3.15: Output Current of the LED lamp at 100 Lux, 7 ft high ..................................... 50
TABLE 3.16: Varying ambient light with Maintaining lux intensity of 50 lux at 6 feet high . 51
TABLE 3.17: Varying ambient light with Maintaining lux intensity of 50 lux at 7 feet high . 52
TABLE 3.18: Motion Detection at desired 50 lux at 5 ft high ................................................. 56
TABLE 3.19: Motion Detection at desired 50 lux at 6 ft high ................................................. 56
TABLE 3.20: Motion Detection at desired 50 lux at 7 ft high ................................................. 56
TABLE 3.21: Motion Detection at desired 75 lux at 5 ft high ................................................. 57
TABLE 3.22: Motion Detection at desired 75 lux at 6 ft high ................................................. 57
TABLE 3.23: Motion Detection at desired 75 lux at 7 ft high ................................................. 57
TABLE 3.24: 7 o'clock in the evening at a height of 5ft and maintaining at 50 lux ................ 59
TABLE 3.25: 7 o'clock in the evening at a height of 6ft and maintaining at 50 lux ................ 59
TABLE 3.26: 7 o'clock in the evening at a height of 7ft and maintaining at 50 lux ................ 60 vi
2
LIST OF FIGURES
FIGURE 2.1: Block diagram of the Zilog ZMOTION detection module. ............................... 8
FIGURE 2.2: Zilog ZMOTION detection module. .................................................................. 8
FIGURE 2.3: A Parallax PIR sensor (Courtesy of Parallax). .................................................. 9
FIGURE 2.4: Quad-type element with receptors (Courtesy of Panasonic). ............................ 11
FIGURE 2.5: Detection zone and sensor output (Courtesy of Panasonic). ............................. 11
FIGURE 2.6: The Light Dependent Resistor Cell ................................................................... 13
FIGURE 2.7 Light Level Sensing Circuit ................................................................................ 14
FIGURE 2.8: LDR Switch ....................................................................................................... 15
FIGURE 2.9: Light Level Sensing Circuit). ............................................................................ 16
FIGURE 2.10 Sampled converter amplifier ............................................................................. 18
FIGURE 2.11 The block diagram of a simple switch-mode servo amplifier .......................... 19
FIGURE 2.12: Illuminance Categories and Values – for Generic Indoor Activities ............... 20
FIGURE 2.13: Task Categories And Reference Illuminance Levels ....................................... 21
FIGURE 2.14 Illumination Levels and Limiting Glare Indices for Various Functions ........... 22
FIGURE 2.15: Different Location with Desired Illuminance level and Limiting Glare
Index ......................................................................................................................................... 24
FIGURE 3.1: Methodology Process of designing an intelligent LED street light
with varying output according to ambient light and pole height with integrated motion sensor ........................................................................................................................... 28
FIGURE 3.2: Flowchart in coding the microcontroller .......................................................... 29
FIGURE 3.3: Conceptual Diagram .......................................................................................... 30
FIGURE 3.4: Schematic Diagram ........................................................................................... 32
FIGURE 3.5: Adjusting the power of the led lamp using the program ................................... 32
FIGURE 3.6: Block diagram in calibration of LDR using Lux meter ..................................... 34
FIGURE 3.7 Adjusting the power supplied to the led lamp using the program ...................... 34
FIGURE 3.8 Setup for LDR calibration ................................................................................... 34
FIGURE 3.9 LDR circuit ........................................................................................................ 35
FIGURE 3.10 LDR resistance vs Light intensity ..................................................................... 37
FIGURE 3.11 Output voltage vs Light intensity ...................................................................... 37 vii
FIGURE 3.12 ADC reading of LDR vs Light intensity ........................................................... 37
FIGURE 3.13 Program Process in change ambient light and height of positioning of the led lamp .......................................................................................................................................... 37
TABLE 3.21: Motion Detection at desired 75 lux at 5 ft high ................................................. 39
FIGURE 3.14 Adjusting Ambient Light using dimmer switch ............................................... 40
FIGURE 3.15 Lux meter positioning at 5 ft. LED Lamp High ............................................... 40
FIGURE 3.16 Current and Voltage vs Ambient Light at 5 ft 50 lux ....................................... 41
FIGURE 3.17 Current and Voltage vs Ambient Light at 5 ft 75 lux ....................................... 42
FIGURE 3.18 Current and Voltage vs Ambient Light at 5 ft 100 lux ..................................... 42
FIGURE 3.19 Direct and Indirect lux meter reading vs Ambient Light at 5 ft 50 lux ............ 43
FIGURE 3.20 Direct and Indirect lux meter reading vs Ambient Light at 5 ft 75 lux ............ 44
FIGURE 3.21 Direct and Indirect lux meter reading vs Ambient Light at 5 ft 100 Lux ......... 44
FIGURE 3.22 Set-up for 6 ft LED lamp high .......................................................................... 46
FIGURE 3.23 Set-up for 7 ft LED lamp high .......................................................................... 46
FIGURE 3.24 Crank in adjusting the pole height .................................................................... 46
FIGURE 3.25 Output Current and Ambient light for 50 Lux at a height of 5, 6, 7 feet .......... 48
FIGURE 3.26 Output Current and Ambient light for 75 Lux at a height of 5, 6, 7 feet .......... 49
FIGURE 3.27 Output Current and Ambient light for 100 Lux at a height of 5, 6, 7 feet ........ 50
FIGURE 3.28 Direct and Indirect lux meter reading vs Ambient Light at 6 ft 50 lux ............ 51
FIGURE 3.29 Direct and Indirect lux meter reading vs Ambient Light at 7 ft 50 .................. 52
FIGURE 3.30 System flow for Integrated Motion sensor ....................................................... 54
FIGURE 3.31 Manual trigger of motion sensor ....................................................................... 55
FIGURE 3.32 Setup in testing the motion sensor .................................................................... 55
FIGURE 3.33 Normal Condition at 50 desired lux ................................................................ 56
FIGURE 3.34 Maximum Condition at 50 desired lux ............................................................. 56
FIGURE 3.35 Normal Condition at 75 desired lux .................................................................. 57
FIGURE 3.36 Maximum Condition at 75 desired ................................................................... 57 viii
ABSTRACT
Intelligent led lamp is designed to which its light intensity varies according to ambient light and height of positioning and at the same time maintains the selected desired lux in the area. PIR sensor which will serve as the motion sensor is just an add-on feature that aims to add security feature on the system by maximizing the luminance level output of the led lamp as movement is detected for a certain delay and then back to normal luminance level once there is no more activity. With the utilization of PIC18F4520 as the microcontroller, the lux meter reading is obtained when the light source is varied to verify if the desired lux intensity is maintained and the LED Lamp will turn off once the there is enough ambient light in the surrounding. The study was conducted in a dark area. After the necessary data and parameters are gathered, the researchers were able to prove that when the ambient light increases the output current obtained is decreasing, thus it can be concluded that it conserve energy. The researchers also proved that the luminance in the area is maintained though ambient light varies. When the height of the led lamp increases the current will also increase as well to maintain the selected desired light intensity in the area.
Keywords: LED Lamp, lux meter, LDR, lux, PIR sensor ix
Chapter 1
INTRODUCTION
One of the biggest expenditures nowadays is the use of lighting. According to a study in 2009, 19% of the world’s electric consumption comes from lighting. In fact, about 52 billion kWh were consumed for lighting alone in manufacturing facilities, which was equal to about 1.3% of total U.S. electricity consumption based to the study of Energy Information
Administration (EIA) in 2010. The light levels and visibility required within an area depends on a number of factors, including the task performed, the age of the workers, and whether the space is open or blocked. The more active the area the higher the light levels needed and the lesser the activity the lower the light levels needed.
The use of LED technology in general lighting is a good option because of its continuous improvements and advantages, including long lifetime, low power cost, the physiological impact to the user, low light pollution and low carbon footprints. According to the study, a LED circuit will approach 80% efficiency, which means 80% of the electrical energy is converted to light energy. The remaining 20% is lost as heat energy. Compare that with incandescent bulbs which operate at about 20% efficiency (80% of the electrical energy is lost as heat). LEDs can emit a larger amount of light intensity than any other lamps.
Gradually, other lamps experience a gradual reduction in their light output. The more it is used the more it fails to maintain its light output. LEDs do not fall to under this category of lamps thus, it will still give a good measure of light intensity.
Nowadays, maintaining the desired amount of luminance needed for a certain area and at the same time conserve electricity is very important. Sometimes for short visited areas
1
the light levels needed must be lower compared to the task performed areas. Also some lighting fixtures does not give enough amount of illumination due to the wrong estimation of the optimum height of mounting pole according to its luminosity. There is an on-going trend of creating intelligent systems for every device at home and even at work area. Developing an intelligent light controller in maintaining constant illumination levels based on ambient light and pole height is the focus of this research. Integrating motion sensor in this research is an add-on feature for security purposes.
The study aims to build an intelligent LED lamp with varying light intensity based on ambient light and height of positioning with integrated motion sensor. In order to attain the main objective, the following specific objectives are to be achieved: (1) To construct a LED lamp control circuit with analog input control; (2) To build and calibrate an LDR sensor using lux meter; (3) To program a microcontroller that will maintain the desired light intensity with varying parameters: ambient light and height of positioning; (4) To integrate a motion sensor that controls light intensity from normal to maximum as movement is detected and lastly; (5) To test the overall functionality of the prototype.
By having an intelligent LED lamp it can adjust its output based on available ambient light and its mounting position to provide a constant illumination level needed. And using this technology, the user can choose the desired luminance level in the area and at the same time helps not to waste consumption of electricity. It has also the ability to have an automatic light dimmer in all areas as well as maintaining its light intensity at the same time.
This study is limited to be built a single system as a prototype and the maximum rating of the LED lamp used is 30W that the lamp gives a light intensity of 50-100 lux. The system can provide recommended light levels for short visited areas only. The height
2
adjustment of the intelligent LED lamp is limited only to 7ft and it can be plugged in 100-
240 VAC outlet only.
3
Chapter 2
REVIEW OF RELATED LITERATURE
2.1 LED Lamp
According to the paper by WU Yue, SHI Changhong, ZHANG Xianghong and
YANG Wei entitled “Design of New Intelligent Street Light Control System”, street lamps control at most of the urban is only by manual control, a control switch set in each of the street lamps, it is the so-called first generation of the original street light control, which is inefficient and a waste of manpower, and cumbersome to operate street light opening and closing time. Or using optical-control method, set up optical control circuit, change the resistance by using of light-sensitive device to control street lamps light up automatically in the evening after dark, turn off automatically after dawn in the morning, but the low reliability of the method, vulnerable to interference, night street lighting is too bright and are a waste of energy and other issues [1]. The other is time-control method (that is, from time to time opening and closing control) [2], and time-optical-control [3] (that is, from time to time with light intensity control). This three street light control method can be attributed to the second generation of street light control. The second generation street light control method achieved automatic control of street light, thereby reducing the labor intensity and lowering labor costs and improving the efficiency of street lighting control. With the use of in-depth, but it also exposed a problem that it cannot meet the needs of the growing street lamp information and intelligent management. The time of lighting is not only lack of precision, many street lights are controlled by using the mid-night lights strategy, energy-saving effect is poor. In short, the current street lighting strategy is simple and crude, lack of humane care of the car and human, cannot achieve the sleep and wake-up call of the lamps in time, but some research for the city's festive lighting and landscaping is also rare. An urgent need to
4
develop a high degree of information, to facilitate the realization of network-based, highly intelligent automatic control system of street lighting, which is the third generation of intelligent street light control systems.
Based on the study WU Yue, SHI Changhon and YANG Wei entitled “Study Of
Acquisition Streetlights Background Signal By Multi-Sensor Array”, an intelligent street light control system are not only for street smart "sleep" and "wake up", and automatic switching lights timely, so that "people (cars) come the lights lighting, people (car) go lights turned off," but also a significant savings in electricity costs (energy-saving 90%), to extend the life of street lamps and equipment, considerable savings in maintenance labor costs and material costs. It needs to study the new type of intelligent streetlight control systems for next-generation development. Micro-magnetic, acoustic, vibration and infrared sensors group constitutes a wide variety of sensor array, to realize the detection and perception of background information, such as public roads, residents of the community, as well as tourist attractions. Through a variety of information and data fusion, thereby to identify the typical goal, the ultimate be able to achieve the best lamp control program according to the changes of environmental information.
2.2 Passive Infrared (PIR) Sensors
According to the study of Carolyn Mathas of Hearst Electronic Produncts entitled
“Sensing Motion with Passive Infrared (PIR) Sensors,” a passive infrared (PIR) sensor measures infrared light emitted from objects that generate heat, and therefore infrared radiation, in its field of view. Crystalline material at the center of a rectangle on the face of the sensor detects the infrared radiation. The sensor is actually split into two halves so as to detect not the radiation itself, but the change in condition that occurs when a target enters its field. These changes in the amount of infrared radiation on the element in turn change the
5
voltages generated, which are measured by an on-board amplifier. When motion is detected the PIR sensor outputs a high signal on its output pin, which can either be read by an MCU or drive a transistor to switch a higher current load.
What is actually detected is the broken field for a “normal” temperature. The field does not have to be broken by an object with a different temperature in order to register change, as highly sensitive sensors will activate from the movement alone. Designed for use at ambient temperatures of 15°C to 20°C, at higher temperatures the field of view narrows, and if below 15°C, the field of view widens and small or distant objects can activate the sensor. For this reason, it is not recommended that the sensors be used in drafty environments, near HVAC equipment, or facing windows where outside temperatures, or even motion, can cause false readings.
Commonly used in security lighting and alarm systems in an indoor environment, PIR sensors have a range of approximately 6 meters, depending on conditions. The sensor adjusts to slowly changing conditions that occur normally within the environment, but shows a highoutput response when a sudden change takes place.
Generally speaking, PIR sensors are small, inexpensive, low power, rugged, have a wide lens range, are easy to interface with, and are easy to use. Their best feature is that they don’t wear out. While they may be easy to use, they are also fairly complex, since many variables that can change the sensor’s input and output must be considered.
The PIR sensor typically has two slots on it, each made of material sensitive to infrared radiation. When idle, both slots detect the same amount of IR. When a person/animal comes into their environment, one half will intercept the IR, causing a positive change between the two halves. Once the entity passes through, there is a negative differential change. It is these change pulses that are detected by the PIR sensor.
6
PIR sensors are most frequently found in motion detector devices aptly called passive infrared detectors (PIDs). The PIR sensor in this case sits on a PCB that interprets signals from the pyroelectric sensor chip. Focusing the infrared energy onto the surface of the sensor is accomplished in two primary ways: (1) the window or cover of the PID has Fresnel lenses molded into it that are used to gather light from a very wide field of view and focus it onto the PIR sensor directly, or (2) the PID has segmented parabolic mirrors that focus the infrared energy inside of it.
For example, the Zilog ZMOTION Detection module solution (Figures 2.1 and 2.2) used for lighting control and other occupancy and proximity detection applications combines the Z8FS040 motion detection microcontroller with a pyroelectric sensor and a low-profile
Fresnel lens.
FIGURE 2.1
: Block diagram of the Zilog ZMOTION detection module.
7
Figure 2.2
: Zilog ZMOTION detection module.
Measuring only 25.5 x 16.7 mm, the module offers a 5 x 6 m, 60 degree detection pattern.
This solution has a simple hardware or advanced serial (asynchronous) based configuration and interface, and features adjustable sensitivity, delay, and ambient-light threshold.
Applications include unattended vending and kiosks, display systems, home appliances, lighting control, power management, HVAC, access control, and general-purpose proximity. Zilog also offers a detection module development kit designated
ZEPIR000102ZCOG.
An example of a PIR sensor used in alarm systems is the Parallax PIR sensor, a pyroelectric device that detects motion by measuring changes in the infrared levels emitted by surrounding objects (Figure 2.3). This motion can be detected by checking for a high signal on a single I/O pin.
8
Figure 2.3
: A Parallax PIR sensor (Courtesy of Parallax).
Features of the Parallax PIR sensor include single-bit output, a small size that makes it somewhat easy to conceal in security applications, compatibility with all Parallax microcontrollers, and a 3.3 and 5 V operation with <100 µA current draw.
Alarm systems, should a person be detected within an area being monitored by the
PID, infrared energy from their body produces a warmer area than the cool area that was previously experienced by the chip focusing on the space in the room being protected. The
PID is aware of the amount of infrared energy that is focused onto its surface. A small, normally closed (NC) relay controls contacts that are connected to an alarm or control panel.
When the infrared energy focused on the sensor changes within a given time frame, the relay is switched.
The internal mirrored segments, or Fresnel lenses, focus on the infrared energy emitted by whatever intrudes on the field, and the intrusion causes a hot spot to move along with the intrusion within the field. The hot spot de-energizes the relay and activates the detection mechanism on the alarm panel. Again, care is typically taken to avoid drafty
HVAC vents or windows, or placement near windows where external elements can cause a false alarm.
9
4°C.
One solution, instead of having two detection zones, offers four. The Panasonic
NaPiOn pyroelectric sensor module is ideal for small movement detection based on a quadtype (Figure 2.4) pyroelectric element with four receptors. Since the detection zone within the detection range is so precise, even small movements are detected. The lenses on this device are miniaturized because the pyroelectric element is small, enabling the use of a short focal point. This device detects small temperature differences between the detection target and its surroundings, and the lowest required temperature difference in the background is
Figure 2.4
: Quad-type element with receptors (Courtesy of Panasonic).
The detection zone has the polarity shown in Figure 2.5. When targets enter both the
+ and – zones with the same timing, the signals cancel each other, thus in this case there is a possibility that the object cannot be detected at the maximum specified detection distance.
10
Figure 2.5
: Detection zone and sensor output (Courtesy of Panasonic).
Additional applications for this device include home appliances, air conditioners, air purifiers, fan heaters, such construction equipment as lighting and automatic switches; commercial equipment including facilities in designated smoking areas, and the anti-crime device market, including crime-prevention sensors, simple anti-crime devices, and surveillance cameras. [4]
2.3 Light Dependent Resistor Sensor (LDR Sensor)
According to the study of Kannan R. and Suresh Kumar T R entitled “Efficient
Method for Controlling Electric Power by Automated Monitoring System using FPGA”, a
LDR is a component that uses a photoconductor between two contacts. A Light Dependent
Resistor (LDR) is a round semiconductor device, has a resistance which varies according to the amount of light falling on its surface. Normally the resistance of an LDR is very high, sometimes as very high as 1000000 ohms and is called the dark resistance but when they are illuminated with light, resistance drop dramatically to 50 ohms. Light dependent resistors are used to re-charge a light during different changes in the light, or they are made for switching
ON and OFF a light during certain changes in intensity of lights. The light dependent resistors (LDR) are used to sense the changes in the light intensity of the classroom. [5]
11
Light dependent resistors are a crucial part in any electric circuit which is to be turned a off and on automatically in accordance to the level of ambient light for instance in night security lighting or solar powered garden lights.
Light dependent resistors are usually used in circuits where it is necessary to detect the presence or the level of light. They are commonly used in photographic light meters and they are sensitive to light. This device is made from semiconductor materials like cadmium sulfide. Light dependent resistors are used to re-charge a light during different changes in the light or they are made to turn a light on during certain changes in lights. One of the most common uses for light dependent resistors is in traffic lights.
Figure 2.6
: The Light Dependent Resistor Cell
The most commonly used photoresistive light sensor is the ORP12 Cadmium Sulfide photoconductive cell. This light dependent resistor has a spectral response of about 610nm in the yellow to orange region of light. The resistance of the cell when unilluminated (dark resistance) is very high at about 10MΩ’s which falls to about 100Ω’s when fully illuminated
(lit resistance).
12
To increase the dark resistance and therefore reduce the dark current, the resistive path forms a zigzag pattern across the ceramic substrate. The CdS photocell is a very low cost device often used in auto dimming, darkness or twilight detection for turning the street lights “ON” and “OFF”, and for photographic exposure meter type applications.
Figure 2.7
: Used the Voltage Divider
Connecting a light dependant resistor in series with a standard resistor like this across a single DC supply voltage has one major advantage, a different voltage will appear at their junction for different levels of light.
The amount of voltage drop across series resistor, R
2 is determined by the resistive value of the light dependant resistor, R
LDR
. This ability to generate different voltages produces a very handy circuit called a “Potential Divider” or Voltage Divider Network.
As we know, the current through a series circuit is common and as the LDR changes its resistive value due to the light intensity, the voltage present at V
OUT will be determined by the voltage divider formula. An LDR’s resistance, R
LDR
can vary from about 100Ω’s in the sun light, to over 10MΩ’s in absolute darkness with this variation of resistance being converted into a voltage variation at V
OUT
as shown.
13
below.
One simple use of a Light Dependent Resistor, is as a light sensitive switch as shown
Figure 2.8
: LDR Switch
This basic light sensor circuit is of a relay output light activated switch. A potential divider circuit is formed between the photoresistor, LDR and the resistor R1. When no light is present ie in darkness, the resistance of the LDR is very high in the Megaohms (MΩ’s) range so zero base bias is applied to the transistor TR1 and the relay is de-energised or
“OFF”.
As the light level increases the resistance of the LDR starts to decrease causing the base bias voltage at V1 to rise. At some point determined by the potential divider network formed by resistor R1, the base bias voltage is high enough to turn the transistor TR1 “ON” and thus activate the relay which in turn is used to control some external circuitry. As the light level falls back to darkness again the resistance of the LDR increases causing the base voltage of the transistor to decrease, turning the transistor and relay “OFF” at a fixed light level determined again by the potential divider network.
By replacing the fixed resistor R1 with a potentiometer VR1, the point at which the relay turns “ON” or “OFF” can be pre-set to a particular light level. This type of simple
14
circuit shown above has a fairly low sensitivity and its switching point may not be consistent due to variations in either temperature or the supply voltage. A more sensitive precision light activated circuit can be easily made by incorporating the LDR into a “Wheatstone Bridge” arrangement and replacing the transistor with an Operational Amplifier as shown.
Figure 2.9
: Light Level Sensing Circuit
In this basic dark sensing circuit, the light dependent resistor LDR1 and the potentiometer VR1 form one adjustable arm of a simple resistance bridge network, also known commonly as a Wheatstone bridge, while the two fixed resistors R1 and R2 form the other arm. Both sides of the bridge form potential divider networks across the supply voltage whose outputs V1 and V2 are connected to the non-inverting and inverting voltage inputs respectively of the operational amplifier.
The operational amplifier is configured as a Differential Amplifier also known as a voltage comparator with feedback whose output voltage condition is determined by the difference between the two input signals or voltages, V1 and V2. The resistor combination R1 and R2 form a fixed voltage reference at input V2, set by the ratio of the two resistors. The LDR – VR1 combination provides a variable voltage input V1 proportional to the light level being detected by the photoresistor.
15
As with the previous circuit the output of the operational amplifier is used to control a relay, which is protected by a free wheel diode, D1. When the light level sensed by the LDR and its output voltage falls below the reference voltage set at V2 the output from the op-amp changes state activating the relay and switching the connected load.
As likewise as the light level increases the output will switch back turning “OFF” the relay. The hysteresis of the two switching points is set by the feedback resistor Rf can be chosen to give any suitable voltage gain of the amplifier.
The operation of this type of light sensor circuit can also be reversed to switch the relay “ON” when the light level exceeds the reference voltage level and vice versa by reversing the positions of the light sensor LDR and the potentiometer VR1. The potentiometer can be used to “pre-set” the switching point of the differential amplifier to any particular light level making it ideal as a simple light sensor project circuit. [6]
2.4 Pulse Width Modulation (PWM)
According to the study of G. Forrest Cook entitled “Pulse Width Modulator for 12 and 24 Volt Applications,” a pulse width modulator (PWM) is a device that may be used as an efficient light dimmer or DC motor speed controller. The circuit described here is a general purpose device that can control DC devices which draw up to a few amps. The circuit may be used in 12 or 24 volt systems with a few minor changes. This device has been used to control the brightness of an automotive tail lamp, and as a motor speed control for small DC fans of the type used in computer power supplies.
A PWM circuit works by making a pulsating DC square wave with a variable on-tooff ratio. The average on time may be varied from 0 to 100 percent. In this way, a variable
16
amount of power is transferred to the load. The main advantage of a PWM circuit over a resistive power controller is the efficiency. At a 50 percent level, the PWM will use about 50 percent of full power, almost all of which is transferred to the load. A resistive controller at
50 percent load power would consume about 71 percent of full power; 50 percent of the power goes to the load, and the other 21 percent is wasted heating the dropping resistor. The
PWM circuit will typically waste well under 1 percent of the power, depending on the load current. It takes a constant trickle of power to operate, so the efficiency improves with higher power loads. [7]
According to the study of Djuro G. Zrilic entitled “Alternative Approach to Use of
Pulse Width Modulation,” a sampled converter amplifier, controlled by PWM, is shown in
Figure 2.10. The operation of this system is identical to the operation of the system in Figure
2.11. For small robot applications transistor is supplied with on-board batteries. The output of the transistor has variable pulse width (Ton), which is rectified and then filtered to get nearly
DC voltage
Figure 2.10
: Sampled converter amplifier
17
proportional to the average value of the pulse-width wave. Should some variation in the load cause the output to try to increase, the PWM will sense this and reduce the pulse width to the switching transistor and thus, lower the output voltage to the load. Conversely, an increase in voltage at the PWM input will cause the PWM to increase a pulse width out of the switch transistor. This causes the voltage to rise to the load. Should some impulse noise appear at the output of the comparator circuit, it will be eliminated by the sampled quantizer. In addition, one of the benefits of a negative feedback is in the suppression of undesired noise components. [8]
Figure 2.11
: The block diagram of a simple switch-mode servo amplifier
2.5 Recommended Light Levels for All Areas
The light level 1 foot from a standard candle is 1 footcandle. The amount of light falling on 1 square foot of surface lit to 1 footcandle is 1 lumen. [10]
18
Figure 2.12
: Illuminance Categories and Values – for Generic Indoor Activities
Legends:
A-C for illuminances over a large area
D-F for localized tasks
G-I for extremely difficult visual tasks
19
Figure 2.13
: Task Categories And Reference Illuminance Levels
General Lighting for Room Areas
Three categories are included in various types of activities:
A Use 30 lux for public areas with dark surroundings.
B Use 75 lux for simple orientation for short temporary visits.
C Use 1 50 lux for working spaces where visual tasks are only occasionally performed.
20
Figure 2.14
Illumination Levels and Limiting Glare Indices for Various Functions
The table following lists illumination levels suitable for a range of situations: the quality of these levels could be influenced by glare and an acceptable limiting index is also shown. The glare index is calculated by considering the light source location, the luminances of the source, the effect of surroundings and the size of the source. Glare indices for artificial light range from about 10 for a shaded light fitting having low output to about 30 for an unshaded lamp.
As seen from this illustration, various basic decisions have to be made concerning lighting objectives and whether the system involves daylight, electric light or a combined system. With electric or combined systems, further decisions must be taken concerning the way light is distributed by particular fittings, and upon their positions relative to each other as well as in relation to the surface to be illuminated. As with day lighting, light - colored and
21
highly reflective room surfaces help to provide more illumination from the same amount of energy source – it preserves the luminance effect of the light source. [10]
Figure 2.15: Different Location with Desired Illuminance level and Limiting Glare Index
22
Chapter 3
INTELLIGENT LED LAMP WITH VARYING LIGHT INTENSITY ACCORDING
TO AMBIENT LIGHT AND POLE HEIGHT WITH INTEGRATED MOTION
SENSOR
INTRODUCTION
One of the biggest expenditures nowadays is the use of lighting. According to a study in 2009, 19% of the world’s electric consumption comes from lighting. In fact, about 52 billion kWh were consumed for lighting alone in manufacturing facilities, which was equal to about 1.3% of total U.S. electricity consumption based to the study of Energy Information
Administration (EIA) in 2010. The light levels and visibility required within an area depends on a number of factors, including the task performed, the age of the workers, and whether the space is open or blocked. The more active the area the higher the light levels needed and the lesser the activity the lower the light levels needed.
The use of LED technology in general lighting is a good option because of its continuous improvements and advantages, including long lifetime, low power cost, the physiological impact to the user, low light pollution and low carbon footprints. According to the study, a LED circuit will approach 80% efficiency, which means 80% of the electrical energy is converted to light energy. The remaining 20% is lost as heat energy. Compare that with incandescent bulbs which operate at about 20% efficiency (80% of the electrical energy is lost as heat). LEDs can emit a larger amount of light intensity than any other lamps.
Gradually, other lamps experience a gradual reduction in their light output. The more it is used the more it fails to maintain its light output. LEDs do not fall to under this category of lamps thus, it will still give a good measure of light intensity.
23
Nowadays, maintaining the desired amount of luminance needed for a certain area and at the same time conserve electricity is very important. Sometimes for short visited areas the light levels needed must be lower compared to the task performed areas. Also some lighting fixtures does not give enough amount of illumination due to the wrong estimation of the optimum height of mounting pole according to its luminosity. There is an on-going trend of creating intelligent systems for every device at home and even at work area. Developing an intelligent light controller in maintaining constant illumination levels based on ambient light and pole height is the focus of this research. Integrating motion sensor in this research is an add-on feature for security purposes.
The study aims to build an intelligent LED lamp with varying light intensity based on ambient light and height of positioning with integrated motion sensor. In order to attain the main objective, the following specific objectives are to be achieved: (1) To construct a LED lamp control circuit with analog input control; (2) To build and calibrate an LDR sensor using lux meter; (3) To program a microcontroller that will maintain the desired light intensity with varying parameters: ambient light and height of positioning; (4) To integrate a motion sensor that controls light intensity from normal to maximum as movement is detected and lastly; (5) To test the overall functionality of the prototype.
By having an intelligent LED lamp it can adjust its output based on available ambient light and its mounting position to provide a constant illumination level needed. And using this technology, the user can choose the desired luminance level in the area and at the same time helps not to waste consumption of electricity. It has also the ability to have an automatic light dimmer in all areas as well as maintaining its light intensity at the same time.
This study is limited to be built a single system as a prototype and the maximum rating of the LED lamp used is 30W that the lamp gives a light intensity of 50-100 lux. The
24
system can provide recommended light levels for short visited areas only. The height adjustment of the intelligent LED lamp is limited only to 7ft and it can be plugged in 100-
240 VAC outlet only.
25
Methodology Process in Designing the Prototype
Start
Research about
Ambient Light Sensors
Research about LED
Lamps
Build Intelligent Light
Controller with ambient light sensor and motion sensor
Experiments and Data
Gathering
Test the System
Microcontroller coding Stop
Figure 3.1
Methodology Process of designing an intelligent LED Lamp with varying light intensity according to ambient light and pole height with integrated motion sensor
As shown in Figure 3.1, the study will start on researching about ambient light sensors, its operation, its components and designs. After that the group will research about
LED lamps, its types, understanding its ratings and technical specifications. Programming of the microcontroller follows, motion detection system will be integrated to the input of the microcontroller and driver to the LED lamp will be connected to the output. The study will conduct experiments and data gathering that will determine the current supplied to the LED lamp and its luminance level in lux. And lastly overall system test and comparison will be performed to check the performance of the system.
26
Microcontroller Coding
Figure 3.2 Flowchart in coding the microcontroller
The researchers used assembly language of the program code then compiling it to the program compiler (ProtonIDE). All the data including duty cycle of the led lamp using
PWM, LDR adc reading and lux meter reading were tested and input it to the program.
The processor of the microcontroller used is PIC18F4520 and Pickit2 is the software used to burn the program that is compiled in the ProtonIDE.
27
Conceptual Diagram
Ambient Light
Monitoring
Set Pole
Height
Motion detection
Figure 3.3
Conceptual Diagram
Controls
LED Lamp
Driver
Circuit to control Light
Intensity
Set target lux
28
Figure 3.3 shows the conceptual diagram of an intelligent LED lamp with varying light intensity according to ambient light and its mounting height with integrated motion sensor. Based from the conceptual diagram, the system will monitor the amount of ambient light and as an add-on feature, the system also uses the signal of the motion sensor for security purposes. The task of the microcontroller is to control the amount of current for the
LED driver circuit to control its light intensity. The height of the pole and the desired luminance level will be chosen. An increase on ambient light detected means a decrease in current output correspondingly to maintain luminance level. An increase in height of the mounting pole of the LED lamp means an increase in current output correspondingly to maintain luminance in an area. The integrated motion sensor aims to add security feature on the system by maximizing the luminance level output of the led lamp as movement is detected for a certain delay and then back to normal luminance level once there is no more activity.
29
Objective 1: To construct a LED lamp control circuit with analog input control
Figure 3.4 Schematic Diagram
Figure 3.5 Adjusting the power of the led lamp using the program
Figure 3.5 shows that the researchers program the microcontroller to control the power supplied through the 30 watts LED Lamp. PWM ranges from 0-255, where 0 indicates fully off, and 255 indicates fully on pulses. With the use of PWM the researchers can
30
generate an analog average voltage using the digital pulses. Duty cycle is expressed in percent, a low duty cycle corresponds to a low power and 100% is being fully on. The researchers will use a lux meter to measure the light intensity coming from the LED Lamp, which located 2 feet above the ground.
PWM
0
13
26
38
51
64
77
89
102
115
128
140
153
166
179
191
204
217
230
242
255
Duty Cycle,
%
65
70
75
80
45
50
55
60
85
90
95
100
20
25
30
35
40
0
5
10
15
Lux Meter
Reading
Direct, Lux
0
41
94
139
183
196
276
297
314
327
337
344
351
357
359
359
359
359
359
359
359
Table 3.1 Lux intensity of the LED Lamp in varying its duty cycle.
Table 3.1 shows that when the power delivered to the led lamp is increased from 0-
75%, the light intensity of the led lamp increases as well. But when it reaches 75-100% there are minimal changes in the light intensity of the LED lamp. The researchers were able to adjust the PWM value from 0-179 only. Making the researchers focus more on a much lesser light intensity.
31
Objective 2: Calibration of LDR using lux meter
PC Microcontro ller
Output of
LED lamp
LDR equivalent
ADC reading
LCD display
Figure 3.6 Block diagram in calibration of LDR using Lux meter
Figure 3.7 Adjusting the power supplied to the led lamp using the program
Figure 3.8 Setup for LDR calibration
Calibration is done by adjusting the power supplied to the LED lamp to vary its light intensity using microcontroller PIC18F4520 as shown in Figure 3.7. The LDR and digital lux meter Model1010B are both place equidistant (2ft above the ground) from the light source.
The power that is supplied to the led lamp is varied from 0-100 percent. For each setting, the adc reading of the microcontroller is recorded.
32
The resistance of the Light Dependent Resistor (LDR) varies according to the amount of light that falls on it. The relationship between the resistance LDR and light intensity Lux for a typical LDR is
LDR = 500 / Lux Kohm
Figure 3.9 LDR circuit
With the LDR connected to 5V through a 1K resistor, the output voltage of the LDR is
Vo = Vcc*R1 / (LDR+R1)
The output voltage will be divided to 0.00488 V to get the equivalent ADC reading in the microcontroller
ADC Reading = Vo/0.00488
Below is the tabulated list of materials in conducting the testing of ldr sensor:
List of Materials
Pickit2
Pic18F4520 microcontroller
LX1010B
Typical LDR sensor
Functions
Program debugger
Controller
Digital Lux Meter
Ambient light sensor
Table 3.2
List of materials in testing the LDR
33
166
179
191
204
217
230
242
255
64
77
89
102
115
128
140
153
0
13
26
38
51
45
50
55
60
65
70
75
80
85
90
95
100
20
25
30
35
40
0
5
10
15
PWM Duty Cycle
Light intensity,
Lux
327
337
344
351
357
359
359
359
359
359
359
359
0
41
94
139
183
196
276
297
314
1.98
2.01
2.04
2.06
2.08
2.09
2.09
2.09
2.09
2.09
2.09
2.09
0
0.38
0.79
1.09
1.34
1.41
1.78
1.86
1.93
LDR, Vout
LDR
Resistance,
Kohm
1.53
1.48
1.45
1.42
1.40
1.39
1.39
1.39
12.20
5.32
3.60
2.73
2.55
1.81
1.68
1.59
1.39
1.39
1.39
1.39
Table 3.3 Calibration of LDR sensor
ADC
Reading
405
413
418
423
427
428
428
428
428
428
428
428
0
78
162
223
275
289
364
382
395
34
Figure 3.10
LDR resistance vs Light intensity
Figure 3.11
Output voltage vs Light intensity
Figure 3.12
ADC reading of LDR vs Light intensity
35
In Table 3.3 show the response of the ldr as the light changes. In Figure 3.10, the researchers observe that as the ambient light increases the ldr resistance decreases. The light intensity sensed by the LDR and its resistance is inversely proportional. The output voltage of the LDR was calculated by using the voltage divider formula. The researchers noticed that whenever the LDR detects a strong light intensity it produces more voltage. Figure 3.11 shows that output voltage of the LDR is directly proportional to the light intensity detected by the LDR. The LDR adc reading which is reflected to the microcontroller increases as well as the light intensity detected also increases.
36
Objective 3: To program a microcontroller that will maintain the desired light intensity with varying parameters: ambient light and height of positioning.
Flowchart
Start
Select desired lux and pole height
Read ambient light
Is the desired lux = to the measured lux
No
Troubleshoot/Reprogram the microcontroller to adjust the light intensity of the led lamp
Yes
Stop
Figure 3.13
Program process in change ambient light and height of positioning of the led lamp
In creating the program of the system, the researchers used two LDR’s, with same specifications, LDR2 is located below the LED lamp (2 ft above the ground), and LDR 1 is located on the top of the LED lamp, LDR2 will serve as the guide to the researchers if the desired lux will be met.
37
Varying Light Source
Figure 3.14 Adjusting Ambient Light using dimmer switch
Procedure
Figure 3.15 Lux meter positioning at 5 ft. LED Lamp High.
Figure 3.15 Lux meter positioning at 5 ft. LED Lamp High.
The prototype will be places in a dark area which the lux meter reading of the area itself is 0 lux. The researchers will use a dimmer switch to control the 150 watts halogen lamp which will serve as a varying ambient light located 2 ft above the LDR sensor and digital lux meter (Figure 3.14). The researchers decided the height of 5 ft. to be the basis on the varying light source case then the researchers will choose the maintaining lux of the area from 50, 75, or 100. The researchers will vary the light intensity of the ambient light. The
ADC reading of the program along with the percentage duty cycle of the lamp will be displayed in the LCD. The light intensity of the LED lamp will also be measured at a height
2ft above the ground in two different points, one that is directly below the lamp and the other
38
at a distance to the first point that the ambient light and LED lamp light intensity will add up.
The researchers tested that the second point is 12 inches away from the first point in the height of 5 ft. (Figure 3.15). After obtaining the lux reading, the digital multimeter will measure the output current and output voltage from the LED lamp.
Varying Light
Source
(Ambient
Light), Lux
0
16
32
48
64
80
96
112
128
144
160
176
192
208
224
240
256
272
288
304
320
Output
Voltage, V
2.44
2.4
2.15
1.93
1.91
1.84
1.84
4.6
4.41
3.17
3.09
2.6
2.47
1.87
1.85
1.76
1.76
1.05
0.98
0.3
0
Output current of the LED
Lamp, A
0.25
0.21
0.21
0.18
0.14
0.12
0.11
0.51
0.45
0.37
0.35
0.3
0.27
0.11
0.11
0.04
0.04
0.03
0.02
0.01
0
Table 3.4
Output Voltage and Current of the
LED lamp at 50 Lux, 5 ft high.
Figure 3.16
Current and Voltage vs Ambient
Light at 5 ft 50 lux
39
216
240
264
288
312
336
360
384
408
432
456
480
Varying Light
Source
(Ambient
Light), Lux
0
24
48
72
96
120
144
168
192
Varying Light
Source
(Ambient
Light), Lux
Output
Voltage, V
3.33
3.3
2.97
2.47
2.42
1.95
1.91
5.36
5.25
5.08
4.63
3.8
3.33
1.85
1.85
1.79
1.79
1.76
1.06
0.81
0
Output Voltage,
V
Output current of the LED
Lamp, A
0.35
0.31
0.27
0.22
0.18
0.17
0.17
0.7
0.63
0.53
0.5
0.44
0.35
0.12
0.12
0.08
0.08
0.04
0.02
0.01
0
Table 3.5 Output Voltage and Current of the
LED lamp at 75 Lux, 5 ft high.
Output current of the LED
Lamp, A
306
340
374
408
442
476
510
544
578
612
646
680
0
34
68
102
136
170
204
238
272
2.8
2.47
2.04
1.94
1.59
1.64
1.03
0.98
0.68
0.35
0.35
0
6.9
5.28
5.32
5.16
4.55
3.3
3.78
3.18
2.89
Table 3.6 Output Voltage and Current of the
LED lamp at 100 Lux, 5 ft high.
0.22
0.22
0.17
0.17
0.13
0.13
0.07
0.07
0.03
0.01
0.01
0
0.92
0.78
0.66
0.57
0.49
0.44
0.4
0.32
0.27
Figure 3.17
Current and Voltage vs Ambient
Light at 5 ft 75 lux
Figure 3.18
Current and Voltage vs Ambient
Light at 5 ft 100 lux
40
The data in Table 3.4 show that when the ambient light source is set to 0 lux the output current obtained was 0.51 A, increasing the ambient light source into 16 lux the output current obtained was 0.45 A, increasing it again into 32 lux the output current gives 0.37 A.
Table 3.4, Table 3.5 and Table 3.6 show that there was a decrease in output current obtained when the light source was increased. Noticed that the maximum current in every table is different, the maximum current recorded is in Table 3.6 which has a maintaining lux of 100 is 0.92 A and the minimum current recorded is in Table 3.4 which has the maintaining lux of only 50 is 0.51 A. It is because the higher the light intensity needed the more current the system must produces to give the desired light intensity in the area. Figure 3.16, Figure 3.17 and Figure 3.18 shows the graph of voltage and current at different maintaining lux at 5 ft high.
Varying Light
Source
(Ambient
Light), Lux
208
224
240
256
272
288
304
320
96
112
128
144
160
176
192
0
16
32
48
64
80
LED Lamp Lux meter reading -
Direct, Lux
Lux meter reading with ambient light -
Indirect, Lux
12
11
5
4
4
3
2
1
30
23
23
21
16
14
12
62
53
45
43
33
32
51
51
51
52
52
53
53
53
51
52
50
52
50
50
50
51
50
50
50
52
52
Table 3.7 Varying ambient light with Maintaining lux intensity of 50 lux at 5 feet high
Figure 3.19
Direct and Indirect lux meter reading vs Ambient Light at 5 ft 50 lux
41
Varying Light
Source
(Ambient
Light), Lux
0
24
48
72
96
120
144
168
192
216
240
264
288
312
336
360
384
LED Lamp
Lux meter reading -Direct,
Lux
93
84
70
57
55
45
44
38
33
15
15
12
11
28
21
20
19
Lux meter reading with ambient light -
Indirect, Lux
75
75
75
75
75
75
76
76
76
75
75
74
74
76
75
75
75
408 8 74
432 5 74 Figure 3.20
Direct and Indirect lux meter
456 5 75
480 4 75
Table 3.8 Varying ambient light with Maintaining reading vs Ambient Light at 5 ft 75 lux lux intensity of 75 lux at 5 feet high
Varying Light
Source
(Ambient
Light), Lux
LED Lamp Lux meter reading -
Direct, Lux
Lux meter reading with ambient light -
Indirect, Lux
306
340
374
408
442
476
510
544
578
612
646
680
0
34
68
102
136
170
204
238
272
28
28
20
20
17
17
11
11
8
6
6
0
123
103
88
76
62
56
48
41
34
98
98
99
99
99
99
99
99
99
100
100
100
100
99
98
98
98
98
98
98
97
Table 3.9 Varying ambient light with Maintaining lux intensity of 100 lux at 5 feet high
Figure 3.21
Direct and Indirect lux meter reading vs Ambient Light at 5 ft 100 lux
42
In Table 3.7, Table 3.8 and Table 3.9 show that the power which is supplied to the led lamp which is reflected as (direct) light intensity of the LED lamp decreases when the ambient light increases. The lux meter reading (direct) is the measure of the light intensity of the LED lamp only in lux. Noticed that as the ambient light increases the program will automatically lessen the percentage duty cycle of the led lamp to reduce its light intensity as shown in Figure 3.19, Figure 3.20 and Figure 3.21. Indirect lux meter reading is the measure of light intensity of both the led lamp and ambient light. Figure 3.19, Figure 3.20 and figure
3.21 also shows the graph of the indirect lux reading which the lux meter both reads the ambient light and the light intensity of the led lamp. The data show that luminance in the area is maintained though ambient light varies. Also noticed that in Table 3.9, the maximum direct light intensity is higher which has 123 lux compare to Table 3.7 and Table 3.8 with maximum direct light intensity of 62 and 93 lux respectively. It is because of the desired lux selected, if the user selected a higher desired lux of the area, LED lamp must produce more light intensity compare to the lower desired light intensity.
43
Varying Pole Height
Figure 3.22
Set-up for 6 ft LED lamp high.
Figure 3.24
Figure 3.23
Set-up for 7 ft LED lamp high.
Crank in adjusting the pole height
44
Procedure
The prototype will be placed in a dark area which the lux meter reading of the area itself is 0 lux. The researchers will use a dimmer switch to control the 150 watts halogen lamp which will serve as a varying ambient located 2 ft above the LDR sensor and digital lux meter. The researchers will set and adjust the pole height ranging from 5ft – 7ft with an interval of 1 ft. (Figure 3.24). The researchers will vary the pole height at different lux meter reading of the halogen light source. The adc reading will be displayed in the LCD. The light intensity of the LED lamp will also be measured at a height 2ft above the ground in two different points, one that is directly below the lamp and the other at a distance to the first point that the ambient light and LED lamp light intensity will add up. The researchers tested that the second point is 12 inches away from the first point in the height of 5 feet (Figure
3.15), 15inches in the height of 6 feet (Figure 3.22), and 18 inches in the height of 7 feet
(Figure 3.23). After obtaining the lux reading, the digital multimeter will measure the output current and output voltage from the LED lamp.
45
Varying Light
Source
(Ambient
Light), Lux
0
16
32
48
64
80
96
112
128
144
160
176
192
208
224
240
256
272
288
304
320
Output current of the LED
Lamp, A
0.43
0.36
0.32
0.3
0.25
0.25
0.18
0.81
0.74
0.62
0.59
0.5
0.46
0.14
0.14
0.11
0.11
0.07
0.03
0.02
0
Table 3.10
Output Current of the
LED lamp at 50 Lux, 6 ft high.
Figure 3.25
126
140
154
168
182
196
210
224
238
252
280
320
Varying Light
Source
(Ambient
Light), Lux
0
14
28
42
56
70
84
98
112
Output current of the LED
Lamp, A
1.23
1.04
0.91
0.8
0.68
0.63
0.56
0.5
0.44
0.44
0.31
0.31
0.31
0.23
0.22
0.15
0.11
0.11
0.11
0.04
0
Table 3.11
Output Voltage and Current of the LED lamp at 50 Lux, 7 ft high.
Output Current and Ambient light for 50 Lux at a height of 5, 6, 7 feet.
46
Figure 3.25 show that the current obtained in 7 feet is higher than in the current obtained in 6 feet and in 5 feet. It is because when the mounting height of the led lamp goes higher, to be able the led lamp to maintain the desired 50 lux, the system must produce more current to be able to meet the selected desired lux in the area.
Varying Light
Source
(Ambient
Light), Lux
Output current of the LED
Lamp, A
0
20
40
60
80
100
120
140
160
180
200
220
240
260
280
300
320
340
360
400
480
1.2
1.01
0.88
0.77
0.66
0.61
0.54
0.49
0.44
0.37
0.3
0.3
0.23
0.23
0.17
0.17
0.11
0.11
0.03
0.02
0
Table 3.12
Output Current of the
LED lamp at 75 Lux, 6 ft high.
Varying Light
Source
(Ambient
Light), Lux
0
23
46
69
92
115
138
161
184
207
230
253
276
299
322
345
368
391
414
450
480
Table 3.13
Output current of the LED
Lamp, A
0.73
0.64
0.55
0.55
0.46
0.37
0.37
0.27
2.09
1.79
1.39
1.12
1.02
0.87
0.27
0.17
0.17
0.17
0.15
0.07
0
Output Current of the LED lamp at 75 Lux, 7 ft high.
Figure 3.26
Output Current and Ambient light for 75 Lux at a height of 5, 6, 7 feet.
47
Figure 3.26 show that the current obtained in 7 ft is higher than in 6 feet and 5 feet.
The maximum current obtained when the led lamp is at 7 feet high is 2.09 A (Table 3.13), at
6 feet high is 1.2 A (Table 3.12) and at 5 ft high is 0.7 A (Table 3.5). When the height of the led lamp increases the current must be increases as well to maintain the desired light intensity of 75 lux.
Varying Light
Source
(Ambient
Light), Lux
Output current of the LED
Lamp, A
0
28
56
84
112
140
168
196
224
252
280
308
336
364
392
1.84
1.4
1.07
0.97
0.82
0.66
0.59
0.59
0.43
0.43
0.32
0.32
0.25
0.25
0.14
420
448
476
0.14
0.07
0.07
0.07
0.07
504
550
680 0
Table 3.14
Output Current of the
LED lamp at 100 Lux, 6 ft high.
Varying Light
Source
(Ambient
Light), Lux
0
29
58
87
116
145
174
203
232
261
290
319
348
377
406
435
464
493
522
580
680
Output current of the LED
Lamp, A
2.1
2.1
2.11
1.48
1.31
1.18
1.02
0.73
0.73
0.72
0.59
0.59
0.45
0.45
0.3
0.3
0.3
0.13
0.13
0.07
0
Table 3.15
Output Current of the LED lamp at
100 Lux, 7 ft high.
Figure 3.27
Output Current and Ambient light for 100 Lux at a height of 5, 6, 7 feet.
48
Figure 3.27 show that the current obtained in 7 ft is higher than in 6 feet and 5 feet.
The maximum current obtained when the led lamp is at 7 feet high is 2.10 A (Table 3.15), at
6 feet high is 1.84 A (Table 3.14) and at 5 ft high is 0.92 A (Table 3.6). When the height of the led lamp increases the current must be increases as well to maintain the desired light intensity of 100 lux.
Varying Light
Source
(Ambient
Light), Lux
91
104
117
130
143
156
169
0
13
26
39
52
65
78
182
195
208
221
234
250
320
LED Lamp Lux meter reading -
Direct, Lux
Lux meter reading with ambient light -
Indirect, Lux
27
24
20
19
19
13
10
63
58
49
47
37
33
32
3
2
1
10
8
8
6
50
50
49
49
50
50
51
51
50
50
50
50
50
50
51
51
51
51
51
52
52
Table 3.16
Varying ambient light with Maintaining lux intensity of 50 lux at 6 feet high
Figure 3.28
Direct and Indirect lux meter reading vs Ambient Light at 6 ft 50 lux
49
Varying Light
Source
(Ambient
Light), Lux
LED Lamp
Lux meter reading -
Direct, Lux
Lux meter reading with ambient light -
Indirect, Lux
196
210
224
238
252
280
320
112
126
140
154
168
182
0
14
28
42
56
70
84
98
6
3
1
12
9
6
6
22
22
15
15
15
12
61
54
50
41
35
32
29
25
50
50
51
51
51
51
51
48
49
49
50
50
50
51
51
50
50
50
49
49
48
Table 3.17
Varying ambient light with Maintaining lux intensity of 50 lux at 7 feet high
Figure 3.29
Direct and Indirect lux meter reading vs Ambient Light at 7 ft 50 lux
Results and Discussion
Figure 3.25 shows the output current obtained for the 5, 6 and 7 feet height of the led lamp with a maintain lux reading of 50. The current if the pole height is at 7 feet is greater than the current obtained in 6 feet high and 5 feet high. If the pole height is set to 6 feet, the current that passes through the led lamp is high compare if the setting of the pole height was set to 5 ft. Figure 3.19, Figure 3.28 and Figure 3.29 shows the light intensity of the led lamp when measured direct below the led lamp and ambient plus led lamp (indirect) at 50 maintaining lux..
50
Conclusion
The systems were able to adjust the current that passes through the led lamp as the pole height increases. Therefore the system can be able to maintain the selected desired lux in the area. Also the led lamp turns off when there is much ambient light.
51
Objective 4: To integrate a motion sensor that controls light intensity from normal to maximum as movement is detected.
Flowchart
FIGURE 3.30
System flow for Integrated Motion sensor
Figure 3.30 shows that as movement is detected maximum duty cycle of the led lamp will be produced and after a 10 seconds delay if there is no movement detected the system will go back to its original state (normal condition).
52
Figure 3.31 Manual trigger of motion sensor Figure 3.32 Setup in testing the motion sensor
Procedure
The prototype will be placed in a dark area which the lux meter reading of the area itself is 0 lux. The researchers will monitor the parameters after the motion sensor is triggered.
The digital multimeter will measure the output current and output voltage of the
LED lamp. The light intensity of the LED lamp will be measured at a height 2ft above the ground which is located the same position when measuring the (indirect) lux meter reading.
53
Motion
Sensor
Detection
Lux meter reading
Indirect,
Lux
Output
Voltage,
V
Output current,
A
Motion
Sensor
Detection
Lux meter reading
Indirect,
Lux
Output
Voltage,
V
Output current,
A
0 51 4.6 0.51
1 100 6.9 0.92
Table 3.18 Motion Detection at desired
50 lux at 5 ft high.
Motion
Sensor
Detection
0
1
Table 3.19
51
99
6.6
7.47
Motion Detection at desired
50 lux at 6 ft high.
Lux meter reading
Indirect,
Lux
Output
Voltage,
V
Output current,
A
0.81
1.84
0 51 7.33 1.23
1 100 9.91 2.1
Table 3.20 Motion Detection at desired 50 lux at 7 ft high.
Figure 3.33
Normal Condition at 50 desired lux
54
Figure 3.34
Maximum Condition at 50 desired lux
Motion
Sensor
Detection
Lux meter reading
Indirect,
Lux
Output
Voltage,
V
Output current,
A
0 75 5.36 0.7
1 100 6.9 0.92
Table 3.21 Motion Detection at Desired 75
lux at 5 ft high.
Motion
Sensor
Detection
Lux meter reading
Indirect,
Lux
Motion
Sensor
Detection
0
1
Table 3.22
75 lux at 6 ft high.
Output
Voltage,
V
Lux meter reading
Indirect,
Lux
75
99
Output current,
A
Output
Voltage,
V
7.28
7.47
Motion Detection at
Output current,
A
1.2
1.84
Desired
0 76 7.51 2.09
1 100 9.91 2.1
Table 3.23 Motion Detection at desired 75 lux at 7 ft high.
Note:
0 – without detection
1with detection
Figure 3.35 Normal Condition at 75 desired lux
55
Figure 3.36 Maximum Condition at 75 desired lux
Results and Discussion
Table 3.18, Table 3.19, and Table 3.20 shows the selected desired lux at 50 at a height of 5 feet. The data shows that when the motion sensor detection was 0 (without detection) the lux meter of the led lamp and output current was 51 lux and 0.51 A respectively, while in 6 feet the reading of the lux meter of the led lamp and output current was 51 lux and 0.81 A respectively, and in 7 feet the reading of the lux meter of the led lamp and output current was 51 lux and 1. 23 A respectively. Noticed that there was an increase in output current as well as the output voltage when the pole height was increased. The increase in current resulted to the increase in power of the led lamp. When the power of the led lamp increases its light intensity also increase. In figure 3.33 the data shows that the indirect lux reading was maintained to 50-51 lux at normal condition. Figure 3.33 show that when the motion is at maximum condition the output current will be set to its maximum value to give a reading of 100 lux.
Table 3.21, Table 3.22 and Table 3.23 also show that when the selected desired lux is
75, In normal condition the lux reading was maintained from 75-76 and in maximum condition the the output current will increase to provide a 100 lux light level. (Figure 3.36)
Conclusion
The researchers were able to integrate a motion sensor that controls light intensity from normal to maximum as movement is detected. The system were able to maximize the luminance level output of the led lamp as movement is detected for a certain delay (10 sec) and then back to normal luminance level once there is no more activity.
56
Objective 5 To test the overall functionality of the prototype
For the overall testing, the researchers conduct the test in one of the researcher’s house in Bacoor, Cavite. The prototype was placed in the rooftop at different time of the day.
Trials
Motion
Sensor
Detected
Lux meter reading
(Indirect)
Output current
49 0.50 without person
1
97 0.90 with person
48 0.50 without person
2
98 0.90 with person
49 0.50 without person
3
97 0.90 with person
49 0.50 without person
4
97 0.90 with person
49 0.50 without person
5
97 0.90 with person
49 0.50 without person
6
97 0.90 with person
48 0.50 without person
7
97 0.90 with person
48 0.50 without person
8
97 0.90 with person
48 0.50 without person
9
97 0.91 with person
48 0.50 without person
10
97 0.91 with person
Table 3.24
7 o'clock in the evening at a height of 5ft and maintaining at 50 lux
Trials
Motion Sensor
Detected
Lux meter reading
(Indirect)
Output current
1
2
3
4
5
6
7
8
9
10 without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person
Table 3.25
7 o'clock in the evening at a height of 6ft and maintaining at 50 lux
101
52
101
52
100
52
101
51
52
100
52
100
51
100
52
101
51
101
51
101
1.79
0.80
1.80
0.80
1.79
0.80
1.79
0.80
0.80
1.78
0.80
1.78
0.80
1.79
0.80
1.80
0.80
1.80
0.80
1.80
57
Trials Motion Sensor Detected Lux meter reading (Indirect) Output current
1
2
3
4
5
6
7
8 without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person
103
50
103
50
103
50
51
103
50
102
50
103
50
103
50
103 without person 50 1.25
9 with person without person
103
50
2.07
1.25
10 with person 102 2.07
Table 3.26
: 7 o'clock in the evening at a height of 7ft and maintaining at 50 lux
2.07
1.25
2.07
1.25
2.07
1.25
1.25
2.07
1.25
2.07
1.25
2.07
1.25
2.07
1.25
2.07
The data from Table 3.24, shows that when there is no detection or without person the lux meter reading obtained was 49 lux in trial 1at 5 ft with a maintaining desired lux at 50 while the output current obtained was 0.50, noticed that the lux meter reading and output current retain until 10 trials. Meanwhile, when there is detection or with person the lux meter reading obtained was 97 lux at its maximum condition of 100 lux and the output current was
0.90, it also noticed that the lux meter reading and output current retain until 10 trials. When the pole height varies and repeating the same procedure with the same desired lux, it can be observed that the output current increase as shown in Table 3.25 and Table 3.26, because when the pole height vary the output current increase to maintain the desired lux level. The motion sensor is add one feature for security purposes when there is a detection or with person.
58
Chapter 4
CONCLUSION
The researchers were able to create an intelligent LED Lamp with varying light intensity according to ambient light and pole height with integrated motion sensor by creating a LED Lamp control circuit with analog input control, calibrating LDR sensor using lux meter, constructing a program using PIC18F4520 as the microcontroller that will maintain the desired lux selected, integrating a PIR as a motion sensor that controls light intensity from normal to maximum when movement is detected and lastly, testing the overall functionality of the prototype. After the prototype had been completed and the necessary data and parameters are gathered, the researchers had proven that it is possible to maintain the desired lux intensity of the area as the ambient light and the pole height varies. When the ambient light increases the output current obtained is decreasing thus, it can be concluded that it conserve energy. The system has an add-on feature that also uses the signal of the motion sensor for security purposes.
59
Chapter 5
RECOMMENDATION
The researchers recommend that it can be used in an area which are more recently visited and needs a higher amount of intensity. It is furthermore recommended to consider the use of a double/multiple LED lamp instead of single LED lamp and a higher wattage of the LED lamp must be used, but it must consider the effect of varying ambient light to maintain the desired light of the area. The system must use a protection for its electric wirings and microcontroller because these components are sensitive. The area of installation must be free from wet and moist. It is recommended to extend its pole height to be more flexible in many place and integrate a height sensor in the system that will automatically detects its mounting height. Also the researchers recommend to use a numeric keypad in selecting the desired lux. If the height of the pole has reach its limit a warning indicator must be integrate to the system. It is also required that the system must be free from abrupt increase in temperature. This can cause the LED lamp to blow up. A suitable shielding must be installed in the LED lamp in able to prevent accidents.
60
REFERENCES
[1] LIU Lianhao, A new street lamp controller design (J). Computing Technology and
Automation, 1997, (4):61-63
[2] ZHANG Liqun, Single-chip single board controller from time to time in the street lamp factory control (J). Application of Energy Technologies, 1998, (4):33-34
[3] YU Xiao-xiang, HUANG Pei-wei. Intelligent Road Lamp Control System Based on
Lonworks(J).Computer Technology and Development, 2007,(2):99-102
[4] Digi-Key Corporation Site by Carolyn Mathas. Last updated 28 th
June 2014, 2012
[5] Jacob Millman Christos C. Halkias.: “Electronic Devices And Circuits”, Tata McGraw-
Hill Publishing Company Ltd. Sep, 2003.
[6] Basic Electronics Tutorials Site by Wayne Storr. Last updated 5th March 2014,1999 –
2014.
[7] G. Forrest Cook: “Pulse Width Modulator for 12 and 24 Volt Applications,” Carnegie Dr.
Boulder, 2000
[8] Djuro G. Zrilic: “Alternative Approach To Use Of Pulse Width Modulation,” World
Automation Congress (WAC) 2006, July 24-26
[9] LED Lighting Management Company Catalog. 2014.
[10] Lighting Levels Site by the University of Wolverhampton. 2014.
61
APPENDICES
62
APPENDIX A
Specification of PIR Sensor
GH-718C Specifications
Input Voltage: DC 4.5-20V
Static current: 50uA
Output signal: 0 - 3V (Output high when motion detected)
Sentry Angle: 110 degree
Sentry Distance: max 7 m
Shunt for setting override trigger: L - No (Default)
Terminals:
(+) : +4.5- 20VDC Power in
OUT : TTL Compatible Digital Output
(-) : GND
63
APPENDIX B
Program of the PIC Microcontroller
Device 18F4520
Declare XTAL 20
Declare WATCHDOG = OFF
Declare FSR_CONTEXT_SAVE = On
Declare ADIN_RES 10
Declare ADIN_TAD 32_FOSC
Declare LCD_RSPIN PORTD.0
'PORTD.0 'D5
Declare LCD_ENPIN PORTD.1
'PORTD.1 'D6
Declare LCD_LINES 2
Declare LCD_INTERFACE 4
Declare ADIN_STIME 50
'All_Digital=TRUE
REMARKS On
Symbol PBtn1=PORTB.1
Symbol PBtn2=PORTB.2
Symbol PBtn3=PORTB.3
On_Interrupt myTimerInterrupt
Symbol PBtn4=PORTD.3
Symbol PBtn5=PORTB.5
Symbol PBtn6=PORTD.2
Symbol T0IF = INTCON.2 ' TMR0
Overflow Interrupt Flag
Symbol T0IE = INTCON.5 ' TMR0
Overflow Interrupt Enable
Symbol GIE = INTCON.7 ' Global
Interrupt Enable
'Hserial_Baud = 9600
'Hserial_RCSTA = %10010000
'Hserial_TXSTA = %00100100
'Hserial_Clear = On
'OPTION_REG = $06 'Pre Scaler 'ctr=30
/secs
;PRE SCALER
T0CON=06 'Pres scaler 1:128
T0CON.7=1 'TMR0 ON
T0CON.6=1 '8 bit scaler
; --------------------------
Declare SERIAL_DATA 8 ' Set SERIN and SEROUT data bits to 8 (default)
Declare CCP1_PIN PORTC.2 ' Select
Hpwm port and bit for CCP1 module (ch
1)
'Declare CCP2_Pin PORTC.1 ' Select
Hpwm port and bit for CCP2 module (ch
2)
Declare LCD_DTPIN PORTD.4
'PORTC.0 'D4
'ANALOG Setting
ADCON1=%00001101
ADCON2.7=1
Dim TempAvg As Word
Dim ictr As Byte
Dim LdrAdc As Word
Dim LdrAdc2 As Word
Dim IRAdc As Word
Dim smin As Byte
Dim ssec As Byte
Dim shr As Byte
Dim myCtr As Byte
Dim IrFlg As Byte
Dim RefID As Word
Dim dflg As Byte
Dim myFrequency As Word
Dim DutyCycle As Word
Dim Volts As Float
Dim LuxM As Word
66
Dim Percentage As Word
Dim MaxAdc As Word
Dim MaxPwm As Word
Dim LuxID As Word
Dim LuxVal As Word
Dim sdelay As Byte
TRISA=$FF
TRISB=$2F
TRISC=$80
TRISD=$0C
TRISE=$03
PORTA=$FF
PORTB=$2F
PORTC=$80
PORTD=$0C
TRISE=$03
smin=0
ssec=0
shr=0
myCtr=0
IrFlg=0
IRAdc=0
LdrAdc=0
LdrAdc2=0
TempAvg=0
dflg=0
ictr=0
RefID=0
MaxAdc=0
LuxVal=0
sdelay=0
RefID=0
T0IE=0
GIE=0
myFrequency=2000 'hpwm frequency
DutyCycle=255 'hpwm duty cycle default
DelayMS 500 'stabilize pic
'GoTo Test_Timer 'For Timer Test
Only
67
'GoTo Test_LuxPwm 'FOR PWM AND
ADC
GoTo Main_Prog 'GOTO SWITCH
'----- ------TIMER INTERRUPT
ROUTINE-------------
myTimerInterrupt:
If T0IF=1 Then
'sdelay=sdelay + 1
If myCtr >=130 Then 'create seconds
'150= 1 seconds
myCtr=0
ssec=ssec + 1
If ssec >=5 Then 'Seconds
IrFlg=0
ssec=0
EndIf
If ssec > 59 Then 'create minute
ssec=0
smin=smin + 1
'If smin >=1 Then '1 minutes
' IrFlg=0
'End If
If smin > 59 Then
smin=0
shr=shr + 1
If shr > 23 Then
shr=0
EndIf
EndIf
EndIf
'Print At 2,1,Dec2 shr,":",Dec2 smin,":",Dec2 ssec
Else
myCtr=myCtr + 1
'Print At 2,1,Dec2 shr,":",Dec2 smin,":",Dec2 ssec
EndIf
T0IF=0
EndIf
Context Restore
';----------- END OF INTERRUPT
SERVICE ROUTINE----------
Main_Prog:
Cls
'PRINT AT 1,1,"STATE"
'WHILE 1=1
' Print At 2,1,Dec2 PBtn4
' PRINT AT 3,1,DEC2 PBtn5
' Print At 4,1,Dec2 PBtn6
' DELAYMS 500
'WEND
RefID=0
Print At 1,1,"Select Reference"
Print At 2,1,"Switch #1:7Ft"
Print At 3,1,"Switch #2:6Ft"
Print At 4,1,"Switch #3:5Ft"
68
While 1=1
'Select Feet Reference
If PBtn5=0 Then 'switch 1
DelayMS 200
While PBtn5=0
Wend
DelayMS 300
RefID=7
Break
ElseIf PBtn4=0 Then 'switch 2
DelayMS 200
While PBtn4=0
Wend
DelayMS 300
RefID=6
Break
ElseIf PBtn6=0 Then 'switch 3
DelayMS 200
While PBtn6=0
Wend
DelayMS 300
RefID=5
Break
End If
If RefID > 0 Then
'BREAK
End If
Wend
Sub_LuxRef:
LuxVal=0
DelayMS 1500
Cls
Select Case RefID 'at 7 feet
Case 7
Print At 1,1,"Select Lux at 7 Feet"
Print At 2,1,"Switch #1:50 Lux"
Print At 3,1,"Switch #2:75 Lux"
Print At 4,1,"Switch #3:100 Lux"
Case 6 'at 6 feet
Print At 1,1,"Select Lux at 6 Feet"
Print At 2,1,"Switch #1:50 Lux"
Print At 3,1,"Switch #2:75 Lux"
Print At 4,1,"Switch #3:100 Lux"
Case 5 'at 5 feet
Print At 1,1,"Select Lux at 5 Feet"
Print At 2,1,"Switch #1:50 Lux"
Print At 3,1,"Switch #2:75 Lux"
Print At 4,1,"Switch #3:100 Lux"
EndSelect
While 1=1
Select Case RefID
Case 7 'at 7 feet
'Set Lux Reference Max ADC
If PBtn5=0 Then 'switch 1
DelayMS 200
While PBtn5=0
Wend
DelayMS 200
MaxAdc=85
LuxVal=50
LuxID=1
End If
If PBtn4=0 Then 'switch 2
DelayMS 200
While PBtn4=0
Wend
DelayMS 200
MaxAdc=115
LuxVal=75
69
LuxID=2
End If
If PBtn6=0 Then 'switch 3
DelayMS 200
While PBtn6=0
Wend
DelayMS 200
MaxAdc=136
LuxVal=100
LuxID=3
End If
Case 6 'at 6 feet
'Set Lux Reference Max ADC
If PBtn5=0 Then 'switch 1
DelayMS 200
While PBtn5=0
Wend
DelayMS 200
MaxAdc=82
LuxVal=50
LuxID=1
End If
If PBtn4=0 Then 'switch 2
DelayMS 200
While PBtn4=0
Wend
DelayMS 200
MaxAdc=107
LuxVal=75
LuxID=2
End If
If PBtn6=0 Then 'switch 3
DelayMS 200
While PBtn6=0
Wend
DelayMS 200
MaxAdc=128
LuxVal=100
LuxID=3
End If
Case 5
'Set Lux Reference Max ADC
If PBtn5=0 Then 'switch 1
DelayMS 200
While PBtn5=0
Wend
DelayMS 200
MaxAdc=91
LuxVal=50
LuxID=1
End If
If PBtn4=0 Then 'switch 2
DelayMS 200
While PBtn4=0
Wend
DelayMS 200
MaxAdc=119
LuxVal=75
LuxID=2
End If
If PBtn6=0 Then 'switch 3
DelayMS 200
While PBtn6=0
Wend
DelayMS 200
MaxAdc=142
LuxVal=100
LuxID=3
End If
End Select
If MaxAdc > 0 Then
Cls
Print At 1,1,"MaxAdc:",DEC4
MaxAdc
Print At 2,1,"Ref #:",DEC2 RefID, " ft."
Print At 3,1,"at Lux:",DEC3 LuxVal
Print At 4,1,"loading wait..."
DelayMS 2000
GoTo GetADC
70
End If
Wend
GetADC:
If LuxVal < 5 Then
GoTo Main_Prog
End If
Cls
TempAvg=0
LdrAdc=0
LdrAdc2=0
IRAdc=0
IrFlg=0
dflg=0
T0IE=1
GIE=1
While 1=1
'Get IRADC
'IRAdc=ADIn 2
'If IRAdc >=675 Then
If PORTA.2=1 Then
If dflg=0 Then
dflg=1
ElseIf dflg=1 Then
IrFlg=1
smin=0
ssec=0
shr=0
myCtr=0
End If
End If
'Get LDRADC
While GIE > 0
T0IE=0
GIE=0
Wend
For ictr=1 To 200
LdrAdc=ADIn 5
TempAvg=TempAvg + LdrAdc
Next ictr
LdrAdc=TempAvg / 200
LdrAdc2= MaxAdc - LdrAdc
'FOR NEGATIVE RESULT
Select Case RefID
Case 7
Select Case LuxID
Case 1 'at lux 50
If LdrAdc2 >=85 Then
LdrAdc2=0
End If
If LdrAdc = 0 Or LdrAdc < 1
Then 'if ldr1 value 0 set to maxadc
LdrAdc2=MaxAdc
End If
Case 2 'at lux 75
If LdrAdc2 >=115 Then
LdrAdc2=0
End If
If LdrAdc = 0 Or LdrAdc < 1
Then 'if ldr1 value 0 set to maxadc
LdrAdc2=MaxAdc
End If
Case 3 'at lux 100
If LdrAdc2 >=136 Then
LdrAdc2=0
End If
If LdrAdc = 0 Or LdrAdc < 1
Then 'if ldr1 value 0 set to maxadc
LdrAdc2=MaxAdc
EndIf
71
EndSelect
GoSub RefSevenFt
GoSub SetPWM
GoSub DisplayData
Case 6
Select Case LuxID
Case 1 'at lux 50
If LdrAdc2 >=82 Then
LdrAdc2=0
End If
If LdrAdc = 0 Or LdrAdc < 1
Then 'if ldr1 value 0 set to maxadc
LdrAdc2=MaxAdc
End If
Case 2 'at lux 75
If LdrAdc2 >=107 Then
LdrAdc2=0
End If
If LdrAdc = 0 Or LdrAdc < 1
Then 'if ldr1 value 0 set to maxadc
LdrAdc2=MaxAdc
End If
Case 3 'at lux 100
If LdrAdc2 >=128 Then
LdrAdc2=0
End If
If LdrAdc = 0 Or LdrAdc < 1
Then 'if ldr1 value 0 set to maxadc
LdrAdc2=MaxAdc
EndIf
EndSelect
GoSub RefSixFt
GoSub SetPWM
GoSub DisplayData
Case 5
Select Case LuxID
Case 1 'at lux 50
If LdrAdc2 >=91 Then
LdrAdc2=0
End If
If LdrAdc = 0 Or LdrAdc < 1
Then 'if ldr1 value 0 set to maxadc
LdrAdc2=MaxAdc
End If
Case 2 'at lux 75
If LdrAdc2 >=119 Then
LdrAdc2=0
End If
If LdrAdc = 0 Or LdrAdc < 1
Then 'if ldr1 value 0 set to maxadc
LdrAdc2=MaxAdc
End If
Case 3 'at lux 100
If LdrAdc2 >=142 Then
LdrAdc2=0
End If
If LdrAdc = 0 Or LdrAdc < 1
Then 'if ldr1 value 0 set to maxadc
LdrAdc2=MaxAdc
EndIf
EndSelect
GoSub RefFiveFt
GoSub SetPWM
GoSub DisplayData
EndSelect
Wend
72
SetPWM:
'MOTION DETECTION
If IrFlg=1 Then
Select Case RefID
Case 7 'at 7 feet
If LuxID=1 Then 'at 50 lux
DutyCycle=160
Percentage=100
ElseIf LuxID=2 Then 'at 75 lux
DutyCycle=160
Percentage=100
ElseIf LuxID=3 Then 'at 100 lux
DutyCycle=160
Percentage=100
End If
Case 6 'at 6 feet
If LuxID=1 Then 'at 50 lux
DutyCycle=91
Percentage=100
ElseIf LuxID=2 Then 'at 75 lux
DutyCycle=91
Percentage=100
ElseIf LuxID=3 Then 'at 100 lux
DutyCycle=91
Percentage=100
End If
Case 5 'at 5 feet
If LuxID=1 Then 'at 50 lux
DutyCycle=51
Percentage=100
ElseIf LuxID=2 Then 'at 75 lux
DutyCycle=51
Percentage=100
ElseIf LuxID=3 Then 'at 100 lux
DutyCycle=51
Percentage=100
End If
EndSelect
End If
'Hardware Pwm
HPWM 1 ,DutyCycle,myFrequency
Return
'Display Data LCD
DisplayData:
If sdelay >=50 Then
Print At 1,1,"Ldr1:",DEC4 LdrAdc, "
PP:",DEC3 Percentage,"%"
'Print At 2,1,"Pwm:",Dec3 DutyCycle, "
Lux:",Dec3 LuxM
Print At 2,1,"Pwm:",DEC3 DutyCycle,
" Ldr2:",DEC3 LdrAdc2," "
Print At 3,1,"Ft:",DEC2 RefID , "
Lux:",DEC3 LuxVal," "
Print At 4,1,"Motion:",DEC2 IrFlg,
"Sec:",DEC2 ssec
sdelay=0
Else
sdelay=sdelay + 1
Print At 4,1,"Motion:",DEC2 IrFlg,
"Sec:",DEC2 ssec
End If
LdrAdc=0
LdrAdc2=0
TempAvg=0
While GIE =0
GIE=1
T0IE=1
Wend
Return
'-------------SEVEN FEET ---------------
RefSevenFt:
If LuxID=1 Then 'at lux 50
Select Case LdrAdc2
Case 0
DutyCycle=0
73
Percentage=0
Case 1 To 3
DutyCycle=3
Percentage=5
Case 4 To 11
DutyCycle=7
Percentage=10
Case 8 To 15
DutyCycle=10
Percentage=15
Case 16 To 21
DutyCycle=13
Percentage=20
Case 22 To 29
DutyCycle=17
Percentage=25
Case 30 To 33
DutyCycle=20
Percentage=30
Case 34 To 39
DutyCycle=23
Percentage=35
Case 40 To 44
DutyCycle=27
Percentage=40
Case 45 To 50
DutyCycle=30
Percentage=45
Case 51 To 54
DutyCycle=34
Percentage=50
Case 55 To 58
DutyCycle=37
Percentage=55
Case 59 To 62
DutyCycle=40
Percentage=60
Case 63 To 64
DutyCycle=44
Percentage=65
Case 65 To 68
DutyCycle=47
Percentage=70
Case 69 To 70
DutyCycle=50
Percentage=75
Case 71 To 74
DutyCycle=54
Percentage=80
Case 75 To 78
DutyCycle=57
Percentage=85
Case 79 To 80
DutyCycle=60
Percentage=90
Case 81 To 82
DutyCycle=64
Percentage=95
Case 83 To 85
DutyCycle=67
Percentage=100
EndSelect
ElseIf LuxID=2 Then At 'at lux 75
Select Case LdrAdc2
Case 0
DutyCycle=0
Percentage=0
Case 1 To 5
DutyCycle=5
Percentage=5
Case 6 To 15
DutyCycle=10
Percentage=10
Case 16 To 25
DutyCycle=15
Percentage=15
Case 26 To 33
DutyCycle=20
Percentage=20
Case 34 To 39
DutyCycle=25
Percentage=25
Case 40 To 50
DutyCycle=30
Percentage=30
Case 51 To 56
DutyCycle=35
Percentage=35
Case 57 To 62
DutyCycle=40
74
Percentage=40
Case 63 To 66
DutyCycle=45
Percentage=45
Case 67 To 72
DutyCycle=51
Percentage=50
Case 73 To 76
DutyCycle=56
Percentage=55
Case 77 To 82
DutyCycle=61
Percentage=60
Case 83 To 87
DutyCycle=66
Percentage=65
Case 88 To 91
DutyCycle=72
Percentage=70
Case 92 To 93
DutyCycle=76
Percentage=75
Case 94 To 99
DutyCycle=81
Percentage=80
Case 100 To 101
DutyCycle=86
Percentage=85
Case 102 To 103
DutyCycle=91
Percentage=90
Case 104 To 109
DutyCycle=96
Percentage=95
Case 110 To 115
DutyCycle=101
Percentage=100
EndSelect
ElseIf LuxID=3 Then At 'at lux 100
Select Case LdrAdc2
Case 0
DutyCycle=0
Percentage=0
Case 1 To 11
DutyCycle=8
Percentage=5
Case 12 To 25
DutyCycle=16
Percentage=10
Case 26 To 37
DutyCycle=24
Percentage=15
Case 38 To 50
DutyCycle=32
Percentage=20
Case 51 To 62
DutyCycle=40
Percentage=25
Case 63 To 68
DutyCycle=48
Percentage=30
Case 69 To 76
DutyCycle=56
Percentage=35
Case 77 To 82
DutyCycle=64
Percentage=40
Case 83 To 89
DutyCycle=72
Percentage=45
Case 90 To 97
DutyCycle=80
Percentage=50
Case 98 To 101
DutyCycle=88
Percentage=55
Case 102 To 107
DutyCycle=96
Percentage=60
Case 108 To 113
DutyCycle=104
Percentage=65
Case 114 To 119
DutyCycle=112
Percentage=70
Case 120 To 123
DutyCycle=120
Percentage=75
Case 124 To 125
DutyCycle=128
75
Percentage=80
Case 126 To 130
DutyCycle=136
Percentage=85
Case 131 To 132
DutyCycle=144
Percentage=90
Case 133 To 134
DutyCycle=152
Percentage=95
Case 135 To 136
DutyCycle=160
Percentage=100
EndSelect
End If
Return
'-------------END OF SEVEN FEET ------
---------
'-------------SIX FEET ---------------
RefSixFt:
If LuxID=1 Then 'at lux 50
Select Case LdrAdc2
Case 0
DutyCycle=0
Percentage=0
Case 1 To 3
DutyCycle=2
Percentage=5
Case 4 To 7
DutyCycle=5
Percentage=10
Case 8 To 13
DutyCycle=7
Percentage=15
Case 14 To 19
DutyCycle=9
Percentage=20
Case 20 To 23
DutyCycle=11
Percentage=25
Case 24 To 31
DutyCycle=14
Percentage=30
Case 32 To 35
DutyCycle=16
Percentage=35
Case 36 To 41
DutyCycle=18
Percentage=40
Case 42 To 44
DutyCycle=20
Percentage=45
Case 45 To 50
DutyCycle=23
Percentage=50
Case 51 To 52
DutyCycle=25
Percentage=55
Case 53 To 56
DutyCycle=27
Percentage=60
Case 57 To 60
DutyCycle=29
Percentage=65
Case 61 To 66
DutyCycle=32
Percentage=70
Case 67 To 68
DutyCycle=34
Percentage=75
Case 69 To 72
DutyCycle=36
Percentage=80
Case 73 To 74
DutyCycle=38
Percentage=85
Case 75 To 78
DutyCycle=41
Percentage=90
Case 79 To 80
DutyCycle=43
Percentage=95
Case 81 To 82
DutyCycle=45
Percentage=100
EndSelect
76
ElseIf LuxID=2 Then At 'at lux 75
Select Case LdrAdc2
Case 0
DutyCycle=0
Percentage=0
Case 1 To 3
DutyCycle=3
Percentage=5
Case 4 To 13
DutyCycle=7
Percentage=10
Case 14 To 21
DutyCycle=10
Percentage=15
Case 22 To 29
DutyCycle=13
Percentage=20
Case 30 To 35
DutyCycle=16
Percentage=25
Case 36 To 44
DutyCycle=20
Percentage=30
Case 45 To 50
DutyCycle=23
Percentage=35
Case 51 To 56
DutyCycle=26
Percentage=40
Case 57 To 62
DutyCycle=29
Percentage=45
Case 63 To 68
DutyCycle=33
Percentage=50
Case 69 To 72
DutyCycle=36
Percentage=55
Case 73 To 76
DutyCycle=39
Percentage=60
Case 77 To 80
DutyCycle=42
Percentage=65
Case 81 To 85
DutyCycle=46
Percentage=70
Case 86 To 89
DutyCycle=49
Percentage=75
Case 90 To 93
DutyCycle=52
Percentage=80
Case 94 To 97
DutyCycle=55
Percentage=85
Case 98 To 101
DutyCycle=59
Percentage=90
Case 102 To 105
DutyCycle=62
Percentage=95
Case 106 To 107
DutyCycle=65
Percentage=100
EndSelect
ElseIf LuxID=3 Then At 'at lux 100
Select Case LdrAdc2
Case 0
DutyCycle=0
Percentage=0
Case 1 To 7
DutyCycle=5
Percentage=5
Case 8 To 19
DutyCycle=9
Percentage=10
Case 20 To 31
DutyCycle=14
Percentage=15
Case 32 To 41
DutyCycle=18
Percentage=20
Case 42 To 50
DutyCycle=23
Percentage=25
Case 51 To 56
DutyCycle=27
77
Percentage=30
Case 57 To 66
DutyCycle=32
Percentage=35
Case 67 To 72
DutyCycle=36
Percentage=40
Case 73 To 78
DutyCycle=41
Percentage=45
Case 79 To 85
DutyCycle=46
Percentage=50
Case 86 To 89
DutyCycle=50
Percentage=55
Case 90 To 97
DutyCycle=55
Percentage=60
Case 98 To 101
DutyCycle=59
Percentage=65
Case 102 To 105
DutyCycle=64
Percentage=70
Case 106 To 109
DutyCycle=68
Percentage=75
Case 110 To 113
DutyCycle=73
Percentage=80
Case 114 To 117
DutyCycle=77
Percentage=85
Case 118 To 123
DutyCycle=82
Percentage=90
Case 124 To 125
DutyCycle=86
Percentage=95
Case 126 To 128
DutyCycle=91
Percentage=100
EndSelect
End If
Return
'-------------END SIX FEET ---------------
'-------------FIVE FEET ---------------
RefFiveFt:
If LuxID=1 Then 'at lux 50
Select Case LdrAdc2
Case 0
DutyCycle=0
Percentage=0
Case 1 To 3
DutyCycle=1
Percentage=5
Case 4 To 5
DutyCycle=3
Percentage=10
Case 6 To 9
DutyCycle=4
Percentage=15
Case 10 To 13
DutyCycle=5
Percentage=20
Case 14 To 23
DutyCycle=7
Percentage=25
Case 24 To 27
DutyCycle=8
Percentage=30
Case 28 To 29
DutyCycle=9
Percentage=35
Case 30 To 37
DutyCycle=11
Percentage=40
Case 38 To 44
DutyCycle=12
Percentage=45
Case 45 To 52
DutyCycle=14
Percentage=50
Case 52 To 54
DutyCycle=15
Percentage=55
Case 55 To 58
78
DutyCycle=16
Percentage=60
Case 59 To 64
DutyCycle=18
Percentage=65
Case 65 To 70
DutyCycle=19
Percentage=70
Case 71 To 76
DutyCycle=20
Percentage=75
Case 77 To 78
DutyCycle=22
Percentage=80
Case 79 To 80
DutyCycle=23
Percentage=85
Case 81 To 85
DutyCycle=24
Percentage=90
Case 86 To 89
DutyCycle=26
Percentage=95
Case 90 To 91
DutyCycle=27
Percentage=100
EndSelect
ElseIf LuxID=2 Then At 'at lux 75
Select Case LdrAdc2
Case 0
DutyCycle=0
Percentage=0
Case 1 To 3
DutyCycle=2
Percentage=5
Case 4 To 9
DutyCycle=4
Percentage=10
Case 10 To 17
DutyCycle=6
Percentage=15
Case 18 To 27
DutyCycle=8
Percentage=20
Case 28 To 35
DutyCycle=10
Percentage=25
Case 36 To 37
DutyCycle=11
Percentage=30
Case 38 To 48
DutyCycle=13
Percentage=35
Case 49 To 54
DutyCycle=15
Percentage=40
Case 55 To 60
DutyCycle=17
Percentage=45
Case 61 To 70
DutyCycle=19
Percentage=50
Case 71 To 76
DutyCycle=21
Percentage=55
Case 77 To 80
DutyCycle=23
Percentage=60
Case 81 To 82
DutyCycle=25
Percentage=65
Case 83 To 91
DutyCycle=27
Percentage=70
Case 92 To 97
DutyCycle=29
Percentage=75
Case 98 To 101
DutyCycle=30
Percentage=80
Case 102 To 105
DutyCycle=32
Percentage=85
Case 106 To 109
DutyCycle=34
Percentage=90
Case 110 To 113
DutyCycle=36
Percentage=95
Case 114 To 119
79
DutyCycle=38
Percentage=100
EndSelect
ElseIf LuxID=3 Then At 'at lux 100
Select Case LdrAdc2
Case 0
DutyCycle=0
Percentage=0
Case 1 To 5
DutyCycle=3
Percentage=5
Case 6 To 13
DutyCycle=5
Percentage=10
Case 14 To 27
DutyCycle=8
Percentage=15
Case 28 To 35
DutyCycle=10
Percentage=20
Case 36 To 48
DutyCycle=13
Percentage=25
Case 49 To 54
DutyCycle=15
Percentage=30
Case 55 To 64
DutyCycle=18
Percentage=35
Case 65 To 76
DutyCycle=20
Percentage=40
Case 77 To 80
DutyCycle=23
Percentage=45
Case 81 To 89
DutyCycle=26
Percentage=50
Case 90 To 93
DutyCycle=28
Percentage=55
Case 94 To 101
DutyCycle=31
Percentage=60
Case 102 To 107
DutyCycle=33
Percentage=65
Case 108 To 113
DutyCycle=36
Percentage=70
Case 114 To 119
DutyCycle=38
Percentage=75
Case 120 To 123
DutyCycle=41
Percentage=80
Case 124 To 125
DutyCycle=43
Percentage=85
Case 126 To 132
DutyCycle=46
Percentage=90
Case 133 To 134
DutyCycle=48
Percentage=95
Case 135 To 142
DutyCycle=51
Percentage=100
EndSelect
End If
Return
'-------------END FIVE FEET ---------------
Test_LuxPwm:
DutyCycle=8 '0
HPWM 1 ,DutyCycle,myFrequency
Cls
LdrAdc2=0
TempAvg=0
While 1=1
For ictr=1 To 200
LdrAdc2=ADIn 5
TempAvg=TempAvg + LdrAdc2
80
Next ictr
LdrAdc2=TempAvg / 200
DelayMS 500
Print At 1,1,"ADC1:",DEC4 LdrAdc2
TempAvg=0
LdrAdc2=0
Wend
Test_Timer:
Cls
myCtr=0
T0IE=1
GIE=1
While 1=1
'Print At 1,1,"Secs:",Dec2 ssec
'DelayMS 1500
Wend
End
APPENDIX C
Gathered Data from the Prototype
Scenario 1: 7 o'clock in the evening at a height of 5ft and maintaining at 50 lux
Trials
1
2
3
4
5
6
7
8
9
10
Motion Sensor
Detected without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person
Lux meter reading
(Indirect), Lux
49
97
48
98
49
97
49
97
48
97
48
97
49
97
49
97
48
97
48
97
Output current, A
0.50
0.90
0.50
0.90
0.50
0.90
0.50
0.90
0.50
0.90
0.50
0.90
0.50
0.90
0.50
0.90
0.50
0.91
0.50
0.91
Scenario 2: 7 o'clock in the evening at a height of 5ft and maintaining at 75 lux
Trials
1
2
3
4
5
Motion Sensor
Detected without person with person without person with person without person with person without person with person without person
Lux meter reading
(Indirect), Lux
74
98
73
98
74
98
74
98
74
81
Output current, A
0.69
0.90
0.69
0.91
0.69
0.91
0.69
0.91
0.69
6
7
8
9
10 with person without person with person without person with person without person with person without person with person without person with person
98
74
98
73
98
73
98
73
98
74
98
0.91
0.69
0.91
0.69
0.91
0.69
0.91
0.69
0.91
0.69
0.91
Scenario 3: 7 o'clock in the evening at a height of 5ft and maintaining at 100 lux
Trials
1
2
3
4
5
6
7
8
9
10
Motion Sensor
Detected without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person
Lux meter reading
(Indirect), Lux
98
98
98
98
98
98
98
99
98
99
98
98
98
98
98
98
98
99
98
98
Output current, A
0.91
0.91
0.91
0.91
0.91
0.91
0.92
0.92
0.92
0.92
0.91
0.91
0.91
0.91
0.91
0.91
0.91
0.91
0.91
0.91
82
Scenario 4: 7 o'clock in the evening at a height of 6ft and maintaining at 50 lux
Trials
1
2
3
4
5
6
7
8
9
10
Motion Sensor
Detected without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person
Lux meter reading
(Indirect), Lux
52
100
52
100
51
100
52
100
52
101
51
101
52
101
52
101
51
101
51
101
Output current, A
0.80
1.79
0.80
1.80
0.80
1.80
0.80
1.80
0.80
1.80
0.80
1.78
0.80
1.78
0.80
1.79
0.80
1.79
0.80
1.79
Scenario 5: 7 o'clock in the evening at a height of 6ft and maintaining at 75 lux
Trials
1
2
3
4
5
Motion Sensor
Detected without person with person without person with person without person with person without person with person without person
Lux meter reading
(Indirect), Lux
75
101
75
101
75
101
75
101
75
83
Output current, A
1.19
1.80
1.19
1.80
1.19
1.80
1.19
1.81
1.19
6
7
8
9
10 with person without person with person without person with person without person with person without person with person without person with person
101
75
101
75
101
74
101
74
101
74
101
1.81
1.19
1.81
1.19
1.81
1.19
1.81
1.19
1.81
1.2
1.81
Scenario 6: 7 o'clock in the evening at a height of 6ft and maintaining at 100 lux
Trials
1
2
3
4
5
6
7
8
9
10
Motion Sensor
Detected without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person
Lux meter reading
(Indirect), Lux
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
100
Output current, A
1.82
1.82
1.82
1.82
1.82
1.82
1.82
1.83
1.83
1.83
1.83
1.83
1.83
1.83
1.83
1.83
1.84
1.84
1.84
1.84
84
Scenario 7: 7 o'clock in the evening at a height of 7ft and maintaining at 50 lux
Trials
1
2
3
4
5
6
7
8
9
10
Motion Sensor
Detected without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person
Lux meter reading
(Indirect), Lux
51
103
50
102
50
103
50
103
50
103
50
103
50
103
50
103
50
103
50
102
Scenario 8: 7 o'clock in the evening at a height of 7ft and maintaining at 75 lux
Output current, A
1.25
2.07
1.25
2.07
1.25
2.07
1.25
2.07
1.25
2.07
1.25
2.07
1.25
2.07
1.25
2.07
1.25
2.07
1.25
2.07
Trials
1
2
3
4
5
6
7
Motion Sensor
Detected without person with person without person with person without person with person without person with person without person with person without person with person without person
Lux meter reading
(Indirect), Lux
75
103
75
103
75
102
75
102
74
102
75
102
75
85
Output current, A
2.09
2.07
2.09
2.07
2.08
2.06
2.08
2.06
2.08
2.06
2.08
2.06
2.08
8
9
10 with person without person with person without person with person without person with person
102
74
102
74
102
74
102
2.06
2.08
2.06
2.08
2.06
2.08
2.06
Scenario 9: 7 o'clock in the evening at a height of 7ft and maintaining at 100 lux
Trials
1
2
3
4
5
6
7
8
9
10
Motion Sensor
Detected without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person without person with person
Lux meter reading
(Indirect), Lux
102
102
102
102
102
102
102
103
102
102
102
102
102
102
103
102
102
102
102
102
Output current, A
2.06
2.06
2.06
2.06
2.06
2.06
2.06
2.06
2.06
2.06
2.06
2.06
2.06
2.06
2.06
2.06
2.07
2.07
2.07
2.07
86