1. i
Design & Modeling of Self Configuring Automatic
Light Control System
Authors
Talha Khan (11-ME-135)
Hassan Abbas (11-ME-159)
Shehryar Ali (11-ME-180)
Waseem Arshad (11-ME-185)
Thesis Supervisor
Assistant Professor Zahid Suleman Butt
DEPARTMENT OF MECHANICAL ENGINEERING
FACULTY OF MECHANICAL AND AERONAUTICAL ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY
TAXILA
JUNE 2015
2. i
Automatic Indoor Power Saving and Security System
Authors
Talha Khan (11-ME-135)
Hassan Abbas (11-ME-159)
Shehryar Ali (11-ME-180)
Waseem Arshad (11-ME-185)
A thesis submitted in partial fulfillment of the requirements for the degree of
B.Sc. Mechanical Engineering
Thesis Supervisor:
Engr. Zahid Suleman Butt
Assistant Professor
External Examiner Signature: _____________________________
Thesis Supervisor Signature:______________________________
DEPARTMENT OF MECHANICAL ENGINEERING
FACULTY OF MECHANICAL AND AERONAUTICAL ENGINEERING
UNIVERSITY OF ENGINEERING AND TECHNOLOGY
TAXILA
JUNE 2015
3. ii
ABSTRACT
Design & Modeling of Self Configuring Automatic
Light Control System
The project works under an automatic operation, the system senses luminosity
inside and outside a closed space, controls the angle of the blinds and dims the lamps to
maintain a prescribed level of illumination inside the room. The system can also provide
the user with multiple pre-programmed ambience settings that can set the tone of the
room with just a button press. The materials required will be an occupancy detector,
blinds control, dimmer, light sensors, pushbutton, power supply, temperature sensor,
automatic operation and an LCD. Occupancy detector will detect either a person is
present in the room or not. Light sensors will be used to check the intensity of light inside
and outside of the room. The automatic operation takes full control over the blinds and
the light dimmer. The controller adjusts the blinds and the dimmer in order to maintain a
constant amount of light in the room. The LCD will be used to display the intensity of
light inside the room. The blinds are controlled mechanically using servo motor. All of
the circuit is being controlled using programmed micro-controller.
4. iii
UNDERTAKING
We certify that research work titled “Design & Modeling of Self Configuring Automatic
Light Control System” is our own work. The work has not been presented elsewhere for
assessment. Where material has been used from other sources it has been properly
acknowledged / referred.
Talha Khan (11-ME-135)
Hassan Abbas (11-ME-159)
Shehryar Ali (11-ME-180)
Waseem Arshad (11-ME-185)
5. iv
ACKNOWLEDGEMENTS
Firstly, we thank Allah Almighty for His blessings in completion of our “Design &
Modeling of Self Configuring Automatic Light Control System” project.
We want to say a big thanks to everyone who helped us and especially our very sincere
supervisor Engr. Zahid Suleman Butt, who overviewed our work at every step and guided
us at every stage of the project. His efforts led us towards the successful completion of
our project indeed.
We also want to say a big thanks to our beloved parents and siblings for always mentally
and financially supporting us while we were doing this project. Completion of this final
year project would have been impossible without their prayers.
6. v
TABLE OF CONTENTS
Abstract ………………………………………………………………………………………………….…….……………...iii
Undertaking…………………………………………………………………………………………………………………..iv
Acknowledgement……………………………….……………………………………………..…………………………v
List of Figures……………………………………………………………………….……………………………………….vii
Chapter 1: Introduction………………………………………….…………………………………………………….1
1.1 Overview………………………………………………………………………………………………..….………...…1
1.2 Problem statement…………………………………………………………………………………..……….…….2
1.3 Legal issues…………………………………………………………………………………..…………………….……2
1.3.1 Dimmer…………………………………..………..…………………………………….....................3
1.3.2 Occupancy sensors……………………………………………..………………………………….….3
1.4 Project significance………………………………………………………………………………..…………….….4
Chapter 2: Hardware components………………………………………………..……………………………..5
2.1 Occupancy detector……………………..………………………………………………………………………….5
2.1.1 Working of circuit…………………………………………..…………………………………………7
2.2 Windows control…………………………………………………………………..…………………………………8
2.2.1 Stepper motor…………………………………..……………………………………………………..9
2.3 Dimmer………………………………………………………..………………………………………………………..10
2.4 Light sensors…………………………………………………………………………………………………………..14
2.4.1 Electronic circuit…………………………………….....................................................15
2.5 Relays……………………………………………………………………………………………………………………..15
2.5.1 Protective relay…………………………………………………………………………….………...15
2.5.2 Working…………………………………………………………………………………...……………..16
2.6 Transformer………………………………….…………………………………………………………………………18
9. 1
CHAPTER 1
INTRODUCTION
1.1 Overview
It is a state-of-the-art, self-configuring lighting control system solution for bedrooms,
offices and perimeter areas. Under automatic operation, the system senses luminosity
inside and outside a room, controls the angle of the blinds and dims the lamps to maintain
a prescribed level of illumination inside the room. It is an environmentally friendly
system that saves energy by keeping unoccupied rooms unlit and maximizing the use of
available natural light. In the long-run, It provides control solutions that reduce energy
costs and extend lamp life. Fig 1.1 gives the overview of the project.
Fig 1.1 Project Overview
10. 2
1.2 Problem Statement
Objective was to control the window, the lights and the heater with optimum freedom of
range and minimum delay. It is a system that automatically controls the light in a room
based on room occupancy, lighting conditions and user objectives by controlling the
intensity of lighting inside and the amount of external light coming into the room. When
sunlight outside decreases, the blinds will be further opened and only until they can't be
opened will the system turn on lights inside the room.
1.3 Legal Issues
Considering that lighting control systems are "the next big thing" for energy saving, there
are many companies that actually manufacture similar products. We tried to make
product as competitive as possible by trying to comply as much as possible with
California's new energy code that significantly impacts lighting in new and remodeled
homes. Just to provide some info, all new and remodeled homes must incorporate energy
efficient lighting and controls. Depending on the room, these include:
Dimmers
Occupancy Sensors
Must be manual-on/automatic-off (can also be turned off manually)
Must turn off automatically in 30 minutes
Cannot be locked in a permanent "on" state
11. 3
High efficacy lights - fluorescent, compact fluorescent (CFL) or high-intensity
discharge (HID) lamps.
Fluorescent, CFL, and HID lights must not have a medium screw base socket.
Lamps rated 13 watts or greater must have an electronic ballast.
Though we did not have time or money to work on the ballast, we think that all other
points were covered.
Furthermore, latest microcontroller was implemented for communicating between the
sensors and the human beings. Other than those, after a reasonable search for such items,
we really didn't find infringement of any existing patents, trademarks or copyrights.
1.3.1 Dimmers
Part of setting the right ambience in a room is controlling the intensity of the lights. Very
bright lights have a much different effect on people than low lights. It controls the
intensity of the light by dimming an incandescent light bulb. Dimming can be achieved in
different ways, the most straightforward being a variable resistance that varies the voltage
coming in to the lamp. However, variable resistance dimming is very inefficient in terms
of energy, as the resistance is turning energy into heat that is not used.[1]
1.3.2 Occupancy sensors
An occupancy detector circuit was built using a pair of infrared transceivers (Receiver:
LTR-4206E; Transmitter: LTE-4208). When an opaque object is put in between the
aligned transceiver current flows through the receiver. Putting one transceiver on a door
12. 4
could be used to determine whether someone crossed the door, however, two are needed
to determine the direction of the person crossing the door.
1.4 Project significance
This project has many applications such as :
Automatic control of lights
o The lights in the room or in any other controlled space will be controlled
automatically.
Automatic control of window
o Windows of the room will be controlled automatically.
This concept can be used to create a security system
o The concept of occupancy detector can be used to create a security alarm
system.
Power saving
o With the maximum use of sunlight for the lighting of a room and
minimum use of electricity the power can be saved efficiently.
Environment friendly
o It is a smart system that saves energy by controlling the illumination of a
space. By operating on a feedback loop where the system senses light and
the presence of people, the system makes smart decisions on how to best
illuminate the space given the user's preference.
13. 5
CHAPTER 2
HARDWARE COMPONENTS
2.1 Occupancy detection
An occupancy detector circuit was built using a pair of infrared transceivers (Receiver:
LTR-4206E; Transmitter: LTE-4208). When an opaque object is put in between the
aligned transceiver current flows through the receiver. Putting one transceiver on a door
could be used to determine whether someone crossed the door, however, two are needed
to determine the direction of the person crossing the door.
The voltage that develops across the receiver is dependent on the opaqueness of the
object and the distance between the transmitter and receiver. To deal with this, two
inverting Triggers were designed using an Operational Amplifier. Each Trigger was
designed to have a low threshold of 1.55 V and high threshold of 2.08 V. This design
permits easy interfacing with the microcontroller as it provides an active-low signal to
indicate a specific sensor has toggled.
The transmitter/receiver pair has an active range of detection of about 10° and were tested
for acceptable operation of 2m. The actual circuits were mounted on the frame for
demonstration purposes, as the figure 2.1 shows the occupancy detector.
14. 6
Fig 2.1 Occupancy Detector
The figure 2.2 below illustrates the Occupancy Detector Circuit, shows a receiver and a
transmitter circuit (which do not communicate with each other).
Fig 2.2 Occupancy Detector Circuit Diagram
15. 7
2.1.1 Working of the circuit
The circuit feeds information to the microcontroller, so an appropriate algorithm needed
to be developed. Conceptually, when a person walks into the room through a door with
the sensors, Sensor A is toggled first followed by Sensor B. Similarly, when a person
leaves the room, Sensor B is toggled before Sensor A. In order to account for cases when
a person walks half-way through the door (toggling only Sensor A) and decides to reverse
direction and leave never entering the room, the following algorithm was implemented:
The number of people in the room will only be increased if the sensors are toggled in the
following specific order:
1 Sensor A
2 Sensor A and Sensor B
3 Sensor B
In an analogous manner, the number of people will only be decreased if the following
sensors are toggled in order:
1. Sensor B
2. Sensor B and Sensor A
3. Sensor A
All other combinations are ignored
16. 8
2.2 Windows control
To control the window we made use of unipolar stepper motor functionally equivalent
one as described in the Dimmer section. The rationale for using stepper motors (as
opposed to other types of motors) are their high precision movement and better control
due to its rotation in fixed discrete steps. To provide sufficient power and torque to these
motors, we used 9V as power supply along with the ULN2003AN (High-voltage, high-
current arrays) which provide the current necessary to drive the motors and that the
microcontroller cannot supply. A CD ROM was used as a window in the project, shown
in figure 2.3 below.
Fig 2.3 CD ROM
17. 9
2.2.1 Stepper motor
The stepper motor’s electrical input consists of six wires; four for control and two for
power supply. In order to drive the motor, a particular sequence of high/low voltages is
required to be applied to the four control wires. [2]
The documentation we found online claimed a two-hot assignment of codes which we
later found out was not the only way to control the motor. Using two-hot assignment
results in an increase of about 1.4 times in torque at the expense of twice the amount of
current. The motor can also be controlled by four one-hot assignment codes. The blinds
control required the torque that is created by using two-hot codes, while the dimmer only
needs the torque generated by the one-hot codes. The motor set-up for the blinds is shown
below in figure 2.4.
Fig 2.4 Stepper Motor
18. 10
2.3 Dimmer
Part of setting the right ambience in a room is controlling the intensity of the lights. Very
bright lights have a much different effect on people than low lights. It controls the
intensity of the light by dimming an incandescent light bulb. Dimming can be achieved in
different ways, the most straightforward being a variable resistance that varies the voltage
coming in to the lamp. However, variable resistance dimming is very inefficient in terms
of energy, as the resistance is turning energy into heat that is not used. An efficient way
to dim an incandescent light bulb on AC power is to periodically turn off the AC sinusoid
and thus provide only a fraction of the full wave to the light. At first this might sound
counterintuitive as it would create flicker, but if the phase of the AC power and the
periodic switching of the light are locked, the flickering is not perceivable by the human
eye. The concept is illustrated by the figure 2.5.
Two circuits are needed to achieve the dimming: a pulse-controlled switch and a zero-
crossing detector. The latter is used to keep the switching in phase with the power source.
Safety precautions had to be implemented in order to deal with the 120 V AC source. The
circuitry had to be electrically and mechanically isolated from the outside through
optoisolators and a metal box, respectively. The pulse-controlled switch consists of a triac
and a diac. If input a periodic pulse, the circuit 'blocks' the AC line with the pulse. The
zero crossing detector is essentially a full-wave rectifier with high-power resistors to
diminish the voltage. Unfortunately we encountered problems with the diodes in the full
wave rectifier more than once, twice creating short circuits that burned our circuits. In the
19. 11
interest of safety this approach was left out of the project and a mechanical approach was
designed.
Fig 2.5 Pulse Control using Dimmer
Due to the problems described above, we decided to seek a mechanical alternative to
dimming the lights. Using another stepper motor as the one described in the Blinds
section we tied the motor to the dimmer with fishing line. To provide the movement back
to the original position when the motor is no longer holding the dimmer in position we
mounted an elastic band attached to a fixed position that provided the necessary force to
bring the dimmer slider back to position. The figures 2.6 below show the final assembly
of the dimmer and motor.
20. 12
Fig 2.6 Final Assembly of Dimmer and Motor
However, this solution required holding the motor in position when the desired dimming
level was achieved. This means that the motor must be sourced current constantly to keep
it on hold. Not only is this energy inefficient, but also it required high amounts of current
(in the order of 800 mA per motor) that the power supplies availabe can't source properly,
thus creating a serious heating problem. We only discovered this late in the development
process and had to completely redesign the mechanical solution and control code for both
the dimmer and the blinds.
21. 13
Fig 2.7 Redesigning of Dimmer Assembly
We required a mechanical design that would allow for the motor to be off during the
times that it was not moving the dimmer. We scrounged a scanner for the track and belt
that is used to move the scanning head and reassembled the parts. This new solution
means that the motor only draws bursts of current when it is needed for adjusting either
the dimmer or the blinds. This helped reduce the usage of power and allowed us to
uphold our project’s dictum. The figure 2.8 below shows the new mechanical solution as
implemented.
22. 14
. Fig 2.8 The New Mechanical solution for Dimmer and Motor Assembly
2.4 Light sensors
To measure the intensity of light inside and outside the “house”, we acquired a pair of
photoresistors. This light dependent resistor is an electronic component whose resistance
decreases with increasing incident light intensity and vice-versa. This module was
connected with another resistor is series in the form of a voltage divider shown on the
right. The output of the voltage divider was connected with the Analog-to-Digital
Converter input of the microcontroller to acquire the various voltage levels. The figure
2.9 below shows the final assembly of the photoresistor pointing to the inside of the
room.
Since the resolution of the microcontroller is 8-bits, the ‘digitized’ output of the voltage
divider ranges from 0 to 255 units. This range span was divided by 2 (i.e. have it range
from 0 to 127 units) in order to reduce the sensitivity of the light sensor. An upper limit
was set at 100 units which makes it convenient to define the step sizes of luminosity
23. 15
inside the room. Hence, steps sizes of 10 were decided upon which results in 10 different
intensity levels for the users to choose from.
Fig 2.9 Light Sensor
2.4.1 Electronic circuit
Fig 2.10 Electronic Circuit of Light Sensor
2.5 Relay
Figure 2.11 shows relay , an electrically operated switch. Relays use an electromagnet to
mechanically operate a switch, but other operating principles are also used, such as solid-
24. 16
state relays. Relays are used where it is necessary to control a circuit by a low-power
signal (with complete electrical isolation between control and controlled circuits), or
where several circuits must be controlled by one signal. The first relays were used in long
distance telegraph circuits as amplifiers: they repeated the signal coming in from one
circuit and re-transmitted it on another circuit. Relays were used extensively in telephone
exchanges and early computers to perform logical operations.
2.5.1 Protective relays
A type of relay that can handle the high power required to directly control an electric
motor or other loads is called a contactor. Solid-state relays control power circuits with
no moving parts, instead using a semiconductor device to perform switching. Relays with
calibrated operating characteristics and sometimes multiple operating coils are used to
protect electrical circuits from overload or faults; in modern electric power systems these
functions are performed by digital instruments still called "protective relays". [3]
2.5.2 Working
A simple electromagnetic relay consists of a coil of wire wrapped around a soft iron core,
an iron yoke which provides a low reluctance path for magnetic flux, a movable
iron armature, and one or more sets of contacts. The armature is hinged to the yoke and
mechanically linked to one or more sets of moving contacts. It is held in place by
a spring so that when the relay is de-energized there is an air gap in the magnetic circuit.
In this condition, one of the two sets of contacts in the relay pictured is closed, and the
25. 17
other set is open. Other relays may have more or fewer sets of contacts depending on
their function. The relay in the picture also has a wire connecting the armature to the
yoke. This ensures continuity of the circuit between the moving contacts on the armature,
and the circuit track on the printed circuit board (PCB) via the yoke, which is soldered to
the PCB.
When an electric current is passed through the coil it generates a magnetic field that
activates the armature and the consequent movement of the movable contact either makes
or breaks (depending upon construction) a connection with a fixed contact. If the set of
contacts was closed when the relay was de-energized, then the movement opens the
contacts and breaks the connection, and vice versa if the contacts were open. When the
current to the coil is switched off, the armature is returned by a force, approximately half
as strong as the magnetic force, to its relaxed position. Usually this force is provided by a
spring, but gravity is also used commonly in industrial motor starters. Most relays are
manufactured to operate quickly. In a low-voltage application this reduces noise; in a
high voltage or current application it reduces arcing.
When the coil is energized with direct current, a diode is often placed across the coil to
dissipate the energy from the collapsing magnetic field at deactivation, which would
otherwise generate a voltages pike dangerous to semiconductor circuit components. Some
automotive relays include a diode inside the relay case. Alternatively, a contact protection
network consisting of a capacitor and resistor in series may absorb the surge. If the coil is
designed to be energized with alternating current (AC), some method is used to split the
flux into two out-of-phase components which add together, increasing the minimum pull
on the armature during the AC cycle. Typically this is done with a small copper "shading
26. 18
ring" crimped around a portion of the core that creates the delayed, out-of-phase
component.
Fig 2.11 Relay
2.6 Transformer
A transformer is an electrical device that transfers energy between two or more circuits
through electromagnetic induction. Commonly, transformers are used to increase or
decrease the voltages of alternating current in electric power applications.
A varying current in the transformer's primary winding creates a varying magnetic flux in
the transformer core and a varying magnetic field impinging on the transformer's
secondary winding. This varying magnetic field at the secondary winding induces a
varying electromotive force (EMF) or voltage in the secondary winding. Making use
27. 19
of Faraday's Law in conjunction with high magnetic permeability core properties,
transformers can thus be designed to efficiently change AC voltages from one voltage
level to another within power networks.
Transformers have become essential for the AC transmission, distribution, and utilization
of electrical energy. A wide range of transformer designs is encountered in electronic and
electric applications. Transformers range in size from RF transformers less than a cubic
centimeter in volume to units interconnecting the power grid weighing hundreds of tons.
For simplification or approximation purposes, it is very common to analyze the
transformer as an ideal transformer model as presented in the two images. An ideal
transformer is a theoretical, linear transformer that is lossless and perfectly coupled; that
is, there are no energy losses and flux is completely confined within the magnetic core.
Perfect coupling implies infinitely high core magnetic permeability and winding
inductances and zero net magnetomotive force. Figure 2.12 shows a transformer.
Fig 2.12 Transformer
28. 20
Transformers can be of two types
1. Step up Transformer
2. Step down Transformer
2.6.1 Step up Transformer
On a step-up transformer there are more turns on the secondary coil than the primary
coil. The induced voltage across the secondary coil is greater than the applied voltage
across the primary coil or in other words the voltage has been “stepped-up”. Figure
2.14 shows a step up transformer.
2.6.2 Step down Transformer
A step down transformer has less turns on the secondary coil that the primary coil. The
induced voltage across the secondary coil is less the applied voltage across the primary
coil or in other words the voltage is “stepped-down”.
Transformers are very efficient. If it is assumed that a transformer is 100% efficient (and
this is a safe assumption as transformers may be up to 99% efficient) then the power in
the primary coil has to be equal to the power in the secondary coil, as per the law of
conservation of energy. Figure 2.13 shows a step down transformer.
29. 21
Fig 2.13 A step down transformer
Fig 2.14 A step up transformer
2.7 Light-emitting Diode
A light-emitting diode (LED) is a two-lead semiconductor light source. It is a p–n
junction diode, which emits light when activated. When a suitable voltage is applied to
the leads, electrons are able to recombine with electron holes within the device, releasing
energy in the form of photons. This effect is called electroluminescence, and the color of
30. 22
the light (corresponding to the energy of the photon) is determined by the energy band
gap of the semiconductor.
An LED is often small in area (less than 1 mm2
) and integrated optical components may
be used to shape its radiation pattern. Figure 2.15 shows LEDs of different colors.
Appearing as practical electronic components in 1962. The earliest LEDs emitted low-
intensity infrared light. Infrared LEDs are still frequently used as transmitting elements in
remote-control circuits, such as those in remote controls for a wide variety of consumer
electronics. The first visible-light LEDs were also of low intensity, and limited to red.
Modern LEDs are available across the visible, ultraviolet, and infrared wavelengths, with
very high brightness.
Early LEDs were often used as indicator lamps for electronic devices, replacing small
incandescent bulbs. They were soon packaged into numeric readouts in the form
of seven-segment displays, and were commonly seen in digital clocks.
Recent developments in LEDs permit them to be used in environmental and task lighting.
LEDs have many advantages over incandescent light sources including lower energy
consumption, longer lifetime, improved physical robustness, smaller size, and faster
switching. Light-emitting diodes are now used in applications as diverse as aviation
lighting, automotive headlamps, advertising, general lighting, traffic signals, and camera
flashes. However, LEDs powerful enough for room lighting are still relatively expensive,
and require more precise current and heat management than compact fluorescent
lamp sources of comparable output.
31. 23
LEDs have allowed new text, video displays, and sensors to be developed, while their
high switching rates are also useful in advanced communications technology.
2.7.1 Early developments
Electroluminescence as a phenomenon was discovered in 1907 by the British
experimenter H. J. Round of Marconi Labs, using a crystal of silicon carbide and a cat's-
whisker detector. Soviet inventor Oleg Losev reported creation of the first LED in
1927.His research was distributed in Soviet, German and British scientific journals, but
no practical use was made of the discovery for several decades. Kurt Lehovec, Carl
Accardo and Edward Jamgochian, explained these first light-emitting diodes in 1951
using an apparatus employing SiC crystals with a current source of battery or pulse
generator and with a comparison to a variant, pure, crystal in 1953.
Rubin Braunstein of the Radio Corporation of America reported on infrared emission
from gallium arsenide (GaAs) and other semiconductor alloys in 1955. Braunstein
observed infrared emission generated by simple diode structures using gallium
antimonide (GaSb), GaAs, indium phosphide (InP), and silicon-germanium (SiGe) alloys
at room temperature and at 77 kelvins.
In 1957, Braunstein further demonstrated that the rudimentary devices could be used for
non-radio communication across a short distance. As noted by Kroemer Braunstein" had
set up a simple optical communications link: Music emerging from a record player was
used via suitable electronics to modulate the forward current of a GaAs diode. The
emitted light was detected by a PbS diode some distance away. This signal was fed into
32. 24
an audio amplifier, and played back by a loudspeaker. Intercepting the beam stopped the
music. We had a great deal of fun playing with this setup." This setup presaged the use of
LEDs for optical communication applications.
Fig 2.15 blue green and red LEDs
2.8 LCD
A liquid-crystal display (LCD) is a flat panel display, electronic visual display, or video
display that uses the light modulating properties of liquid crystals. Liquid crystals do not
emit light directly.
LCDs are available to display arbitrary images (as in a general-purpose computer display)
or fixed images which can be displayed or hidden, such as preset words, digits, and 7-
segment displays as in a digital clock. They use the same basic technology, except that
arbitrary images are made up of a large number of small pixels, while other displays have
larger elements.
33. 25
LCDs are used in a wide range of applications including computer monitors,
televisions, instrument panels, aircraft cockpit displays, and signage. They are common
in consumer devices such as DVD players, gaming devices, clocks, watches, calculators,
and telephones, and have replaced cathode ray tube (CRT) displays in most applications.
They are available in a wider range of screen sizes than CRT and plasma displays, and
since they do not use phosphors, they do not suffer image burn-in. LCDs are, however,
susceptible to image persistence. [4]
The LCD screen is more energy efficient and can be disposed of more safely than a CRT.
Its low electrical power consumption enables it to be used in battery-
powered electronic equipment. It is an electronically modulated optical device made up
of any number of segments filled with liquid crystals and arrayed in front of a light
source (backlight) or reflector to produce images in color or monochrome. Liquid crystals
were first discovered in 1888. Figure 2.16 shows an LCD.
Fig 2.16 Liquid crystal display (LCD)
34. 26
2.9 Temperature sensor
A thermistor is a type of resistor whose resistance is dependent on temperature, more so
than in standard resistors. Figure 2.17 below shows a thermistor. Thermistors are widely
used as inrush current limiter, temperature sensors, self-resetting over current protectors,
and self-regulating heating elements.
Thermistors differ from resistance temperature detectors (RTDs) in that the material used
in a thermistor is generally a ceramic or polymer, while RTDs use pure metals. The
temperature response is also different; RTDs are useful over larger temperature ranges,
while thermistors typically achieve a greater precision within a limited temperature range,
typically −90 °C to 130 °C.
Fig 2.17 A Thermistor
2.10 Microcontroller
Figure 2.18 shows a microcontroller, it is a small computer on a single integrated
circuit containing a processor core, memory, and programmable input/output peripherals.
35. 27
Program memory in the form of Ferroelectric RAM, NOR flash or OTP ROM is also
often included on chip, as well as a typically small amount of RAM.
Microcontrollers are used in automatically controlled products and devices, such as
automobile engine control systems, implantable medical devices, remote controls, office
machines, appliances, power tools, toys and other embedded systems. By reducing the
size and cost compared to a design that uses a separate microprocessor, memory, and
input/output devices, microcontrollers make it economical to digitally control even more
devices and processes. Mixed signal microcontrollers are common, integrating analog
components needed to control non-digital electronic systems.
Some microcontrollers may use four-bit words and operate at clock rate frequencies as
low as 4 kHz, for low power consumption. They will generally have the ability to retain
functionality while waiting for an event such as a button press or other interrupt; power
consumption while sleeping may be just nanowatts, making many of them well suited for
long lasting battery applications. Other microcontrollers may serve performance-critical
roles, where they may need to act more like a digital signal processor (DSP), with higher
clock speeds and power consumption. [5]
Fig 2.18 Microcontroller
36. 28
2.10.1 Microcontroller (8-Bit PIC 16f877a)
The name PIC initially referred to Peripheral Interface Controller. Early models of PIC
had read-only memory (ROM) or field-programmable EPROM for program storage,
some with provision for erasing memory. All current models use Flash memory for
program storage, and newer models allow the PIC to reprogram itself. Program memory
and data memory are separated. Data memory is 8-bit, 16-bit and in latest models, 32-bit
wide. Program instructions vary in bit-count by family of PIC, and may be 12, 14, 16, or
24 bits long. The instruction set also varies by model, with more powerful chips adding
instructions for digital signal processing functions.
The hardware capabilities of PIC devices range from 8-pin DIP chips up to 100-
pin SMD chips, with discrete I/O pins, ADC and DAC modules, and communications
ports such as UART, I2C, CAN, and even USB. Low-power and high-speed variations
exist for many types.
The manufacturer supplies computer software for development known as MPLAB,
assemblers and C/C++ compilers, and programmer/debugger hardware under
the MPLAB and PICKit series. Third party and some open-source tools are also
available. Some parts have in-circuit programming capability; low-cost development
programmers are available as well has high-production programmers.
PIC devices are popular with both industrial developers and hobbyists due to their low
cost, wide availability, large user base, extensive collection of application notes,
availability of low cost or free development tools, serial programming, and re-
programmable Flash-memory capability. Figure 2.19 is a PIC microcontroller.
37. 29
Fig 2.19 PIC Microchip
2.11 Capacitor
A capacitor is defined as a passive two-terminal electrical component being used to
store energy electrostatically in an electric field. The forms of practical capacitors vary
widely, but all contain at least two electrical conductors (plates) separated by
a dielectric (i.e. insulator). The conductors can be thin films, foils or sintered beads of
metal or conductive electrolyte, etc. The non conducting dielectric acts to increase the
capacitor's charge capacity. A dielectric can be glass, ceramic, plastic film, air, vacuum,
paper, mica, oxide layer etc. Capacitors are widely used as parts of electrical circuits in
many common electrical devices. Unlike a resistor, an ideal capacitor does not dissipate
energy. Instead, a capacitor stores energy in the form of an electrostatic field between its
plates. Figure 2.20 shows a capacitor.
When there is a potential difference across the conductors (e.g., when a capacitor is
attached across a battery), an electric field develops across the dielectric, causing
positive charge +Q to collect on one plate and negative charge −Q to collect on the other
plate. If a battery has been attached to a capacitor for a sufficient amount of time, no
38. 30
current can flow through the capacitor. However, if a time-varying voltage is applied
across the leads of the capacitor, a displacement current can flow.
Capacitors are widely used in electronic circuits for blocking direct current while
allowing alternating current to pass. In analog filter networks, they smooth the output
of power supplies. In resonant circuits they tune radios to particular frequencies.
In electric power transmission systems, they stabilize voltage and power flow.
Fig 2.20 A Capacitor
2.12 Block diagram
Fig 2.21 Block diagram
39. 31
CHAPTER 3
WORKING MECHANISM
3.1 Automatic actuation
As soon as a person enters the room, the system is activated automatically and keeping
in view of the present light conditions, it turns on the lights if necessary. Also the
windows are opened if outside light is bright at that time of day. It also checks the
temperature and decides whether to turn on the fan or not, or heater in case we have
programmed the microcontroller in such a way.
When set to the automatic operation mode, the sensor takes full control over the blinds
and the light dimmer. The controller adjusts the blinds and the dimmer in order to
maintain a constant amount of light in the room, which is pre-determined by the user.
This pre-determined light amount, called "floating value" can be increased or decreased
at any time by pressing the "plus" or "minus" buttons on the controller. The coordination
of the movements of the blinds and the dimming of the lamp is done prioritizing energy
savings i.e.: When it is brighter outside, the controller opens up the blinds before turning
the lights up. Similarly, when the inside is brighter than the set value, the lamp is dimmed
first before the blinds start closing.
The automatic operation also enters the privacy mode closing the blinds when it sees that
the light indoors is greater than outside and the light outside does not contribute to the
40. 32
illumination of the room. This procedure prevents the room from being exposed during
night times increasing the security of the facility.
3.2 Number of occupants
Relays are used to keep the count of the occupants entering the room. The systems
remains active as long as the last person is out of the room. Whenever there is no one in
the room, the system automatically shuts down everything in control in order to conserve
energy. The microcontroller is in charge of the whole operation and it receives electrical
signals from the temperature sensor and the LTR senor and accordingly activates or
deactivates the system.
3.3 Temperature control
Temperature control can be achieved using thermistors. They can be used for both air-
conditioning and heating purposes. When the temperature of the room rises to a certain
level the system shuts the heater and if the temperature further rises it starts the fan or AC
system. This mechanism can be used for research purposes and in the fields where some
machines are operated in a certain temperature range.
3.4 Light control
Light sensors sense the light inside and outside of the room. When the intensity of outside
light is greater than the intensity of inside light the system opens the window and
maximum sunlight is utilized. In this way maximum power is saved prioritizing the
sunlight over the tube lights or bulbs for illuminating the room.
41. 33
CHAPTER 4
PRACTICAL APPLICATIONS
4.1 Energy saving overview
Energy saving light controls provide a comfortable and productive visual environment.
Enhancing the comfort levels of a space leads to increases in productivity. Better lighting
not only can reduce the energy consumption of a room, it can improve the quality of
work from its occupants.
Every dimmer automatically saves 4-9% in electricity, even at the highest lighting levels,
over a standard on-off switch. When users choose to dim their lights, even more
electricity is saved. Quite simply, the more you dim, the more you save. A standard light
switch only saves electricity in the “off” position.
Automatic lighting controls are becoming more popular in lighting retrofits. Respondents
reported lighting controls were considered in over 50 percent and installed in over 30
percent of their projects in 2012. Forty percent of respondents said the percentage of their
projects in which controls were installed was higher than the previous year, while about
half reported it as the same.
Estimating energy savings resulting from installation of more-efficient light fixtures and
lighting systems is fairly straightforward, being based on the difference in wattage.
Estimating energy savings for lighting controls, however, can be challenging, as actual
savings will depend on application characteristics such as occupant behavior, building
42. 34
design, site orientation, availability of daylight, device settings and level of
commissioning. This variability presents risk, which can make owners balk at investment.
The average respondent to the Lighting Controls Association survey reported that
intelligent (programmable scheduling) control was installed in about 30 percent of their
lighting retrofit projects in 2012. Similarly, the economic value of institutional task
tuning, in which the light level needs in different areas of a space can be satisfied via
dimming for associated energy savings, can be fairly straightforward to predict.
4.2 Environment friendly system
It is a smart system that saves energy by controlling the illumination of a space. By
operating on a feedback loop where the system senses light and the presence of people,
the system makes smart decisions on how to best illuminate the space given the user's
preference. Given that the system already has control over the lighting and the shading of
the space, ambiences can be saved and recalled with ease. It is very expandable and
versatile. There are areas in which it can become a better product, which are further
discussed later in this section. The heart of the system is a microcontroller. The sensors
on the system are made from easily obtained components and the control algorithms are
extensive and robust. In the future, the work done for this system can be used as a basis
for another project, making improvements on the areas in which this project could be
better. Student projects such as the Solar Decathlon could make use of principles
explored in this project to implement environmentally-friendly systems.
43. 35
It is a simplified version of systems and equipments sold for thousands of dollars in the
high-income housing segment as well as high-visibility public buildings. With
improvements, It could also be used in architecture projects to enhance prototypes and
models of buildings.
44. 36
CHAPTER 5
FUTURE WORK
5.1 Push buttons mechanism
Since the system can be designed to work under a specific range of data, the following
figure 5.1 shows the circuit which can be implemented in order to connect pushbuttons:
Fig 5.1 Pushbuttons circuit
5.2 Working
When the button is not pressed (open switch), the port on the MCU is connected to Vcc
through a 1KΩ resistor. Assuming infinite input impedance, the MCU will also going to
45. 37
be tied to Vcc. When the pushbutton is depressed (short circuit), the MCU will be
connected to ground, toggling the port.
The controller can be fully programmed with only eight pushbuttons. The first four
buttons S1-S4 are pre-set ambiances that can be recovered by pressing the buttons once.
One pressing of the Float button makes the controller enter the automatic operation mode,
which is explained in more detailed in the automatic operation section.
When in Float mode, the buttons Plus/Minus can be used to increase or decrease the
floating value.
Fig 5.2 Pushbutton
The button operations are summarized in the table 5.1 :
46. 38
Table 5.1 Pushbutton operations
Button
Number
Single Press
(default)
Press and Hold for 2
seconds
Hold "manual"
button and...
1
Setting 1
(Bright day)
Save current
conditions as Setting
1
Open (one step)
blinds
2
Setting 2
(Privacy)
Save current
conditions as Setting
2
Close (one step)
blinds
3
Setting 3
(Intimacy)
Save current
conditions as Setting
3
Brighten (one step)
lights
4
Setting 4
(Sleep)
Save current
conditions as Setting
4
Dim (one step)
lights
5
Enter Float
Mode
- -
6
Increase
Illumination
- -
7
Decrease
Illumination
- -
8 -
(Hold to use with
other buttons)
-
47. 39
CONCLUSION
The final prototype yielded exceptional performance:
The code is lightweight and does not crash the microcontroller, which suggests a smaller
microcontroller could be used in an upgraded version of the system, or more features can
be easily added to the system.
Drastic changes in lighting are very uncomfortable, as the physiology of the eye adjusts
slowly. Because of this, speed of execution is not a concern and motors are deliberately
set to be slower than their maximum speed.
A very stable and strong frame and assembly of parts gave the prototype the mechanical
stability necessary for the parts not to move when the motors are off and not holding the
dimmer or the blinds in place. Because of illumination auto control, changes will not
occur inside the room unless the bulbs burn out, or there is no electricity to power the
system.
The user interface is incredibly simple and friendly in future. With a simple table as the
one shown in the Pushbuttons section, anyone can make full use of the circuit and all its
features. All the necessary configurations can be stored and edited afterwards.
48. 40
References
[1] Bellman, Wilard F. (2001). LIGHTING THE STAGE: Art and Practice, Third
Edition, Chapter 4 –The Control Console, Broadway Press, Inc., Louisville
Kentucky, ISBN 0-911747-40-0
[2] Liptak, Bela G. (2005). Instrument Engineers' Handbook: Process Control and
Optimization. CRC Press. p. 2464. ISBN 978-0-8493-1081-2
[3] https://www.digikey.com/product-search/en/relays
[4] http://www.businesskorea.co.kr/article/8579/cut-and-run-taiwan-controlled-lcd-
panel-maker-danger-shutdown-without-further
[5] Heath, Steve (2003). Embedded systems design. EDN series for design engineers (2
ed.). Newnes. pp. 11–12. ISBN 9780750655460.
49. 41
Abbreviations
CFL: Compact Fluorescent Lights
HID: High Intensity Discharge
PCB: Printed Circuit Board
LED: Light Emitting Diode
LCD: Liquid Crystal Display
PIC: Peripheral Interface Controller
SMD: Surface Mounted Diode
ADC: Analog to Digital Convertor
DAC: Digital to Analog Convertor
UART: Universal Asynchronous Receiver/Transmitter
USB: Universal Serial Bus
MCU: Micro Controller Unit
OTP: One time Programmable
RTD: Resistance Temperature Diode
CRT: Cathode Ray Tube