Group 7 Final Project Report - Automatic Night Light
Group 7 Final Project Report - Automatic Night Light
ME153P/E01
CONTROL SYSTEMS ENGINEERING
FINAL REPORT
SUBMITTED BY:
BERNAL, CHRIS DANE B.
2013103212
JAVIER, LAWRENCE
2013105533
LIBAO, CLARENCE V.
201304630
PAPIO, ROBERTO
2013150730
SUBMITTED TO:
ENGR. PAULO RAFAEL MERIS
1
ABSTRACT
This project is all about creating an automatic control system that senses the light intensity
of its surroundings, and will turn its own light on or off depending on the status of the area, whether
it is dark or bright. The system is programmed using Arduino UNO board and Arduino software
and other supporting materials that helps the whole system work.
2
TABLE OF CONTENTS
ABSTRACT .................................................................................................................................... 2
I. OVERVIEW ............................................................................................................................ 4
II. STATEMENT OF THE PROBLEM ................................................................................... 4
III. OBJECTIVE ........................................................................................................................ 4
IV. RELATED LITERATURE .................................................................................................. 4
a. AUTOMATIC ROOM LIGHT INTENSITY DETECTION AND CONTROL USING A
MICROPROCESSOR AND LIGHT SENSORS (Ying-Wen Bai, 2008) .................................. 4
b. LIGHT SENSORS FOR OBJECTIVE LIGHT MEASUREMENT IN AMBULATORY
POLYSOMNOGRAPHY (Rachel Schmebri, 2017) .................................................................. 4
c. INTEGRATED HIGH RESOLUTION DIGITAL COLOR LIGHT SENSOR IN 130 nm
CMOS TECHNOLOGY (Vincent Chi Zhang, 2015)................................................................. 5
d. THE WORKING PRINCIPLE OF ARDUINO (Badamasi, 2014) ..................................... 6
e. MICROCONTROLLER-BASED CONTROL SYSTEM IN ELECTRICAL
ENGINEERING TECHNOLOGY (Lozano-Nieto, 2014) ......................................................... 6
f. SIGNAL ............................................................................................................................... 7
V. THEORETICAL CONSIDERATIONS .............................................................................. 8
VI. SOLUTION.......................................................................................................................... 8
VII. DISCUSSION .................................................................................................................... 10
VIII. CONCLUSION .............................................................................................................. 11
IX. RECOMMENDATION ..................................................................................................... 11
X. REFERENCES .................................................................................................................. 11
XI. APPENDICES ................................................................................................................... 12
Appendix A: Specification of Project ....................................................................................... 12
Appendix B: List of Components and Cost .............................................................................. 12
Appendix C: Fabrication Process.............................................................................................. 13
Appendix D: Work Distribution ............................................................................................... 15
3
I. OVERVIEW
Our group wanted to apply this project in real life scenarios and products such as
automatic night light and emergency light system.
III. OBJECTIVE
Our group aimed to create a simple prototype of an automatic night light that turns on
whenever it can’t detect any light within the sensor’s range.
4
examined the light measurement characteristics of the LS when used with a portable PSG
device, specifically recording trace range, linearity, sensitivity, and stability. This involved
the LS being exposed to varying incandescent and fluorescent light levels in a light
controlled room. Secondly, the LS was trialed in 24 home and 12 hospital ambulatory PSGs
to investigate whether light levels in home and hospital settings were within the recording
range of the LS, and to quantify the typical light intensity reduction at the time of Loff. A
preliminary exploration of clinical utility was also conducted. Linearity between LS
voltage and lux was demonstrated, and the LS trace was stable over 14 hours of recording.
The observed maximum voltage output of the LS/PSG device was 250 mV, corresponding
to a maximum recording range of 350 lux and 523 lux for incandescent and fluorescent
light respectively. At the time of Loff, light levels were within the recording range of the
LS, and on average dropped by 72 lux (9±245) in the home and 76 lux (4±348) in the
hospital setting. Results suggest that clinical utility was greatest in hospital settings where
patients are less mobile. The LS was a simple and effective objective marker of light level
in portable PSG, which can be used to identify Loff in ambulatory PSG. This allows
measurement of additional sleep indices and support with clinical decisions.
5
d. THE WORKING PRINCIPLE OF ARDUINO (Badamasi, 2014)
Arduino Uno is a microcontroller board based on the ATmega328P (datasheet). It
has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog
inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and
a reset button. It contains everything needed to support the microcontroller; simply
connect it to a computer with a USB cable or power it with a AC-to-DC adapter or
battery to get started.You can tinker with your UNO without worring too much about
doing something wrong, worst case scenario you can replace the chip for a few dollars
and start over again.Uno" means one in Italian and was chosen to mark the release of
Arduino Software (IDE) 1.0. The Uno board and version 1.0 of Arduino Software
(IDE) were the reference versions of Arduino, now evolved to newer releases. The Uno
board is the first in a series of USB Arduino boards, and the reference model for the
Arduino platform; for an extensive list of current, past or outdated boards see the
Arduino index of boards.
The UNO is the best board to get started with electronics and coding. If this is your
first experience tinkering with the platform, the UNO is the most robust board you can
start playing with. The UNO is the most used and documented board of the whole
Arduino family.
6
f. SIGNAL
Signals are one of the most important thing in Arduino programing. Signals gives
a big help on the operation of the device. For example for every sensor that we will be
applying on the device the proper signal for that specific sensor should be used in order
for it to function properly. This also applies to the other components that requires to be
on or off in the device. According to Jimbo, signal is defined to be a quantity that is
varying from time in which contains information. Signals are important and travels
from one device to another with the means of wires or air via radio frequency waves.
The signals are used to send and receive certain information. For Arduino there are two
kinds of signals that are used and here are they:
ANALOG SIGNAL – Analog signals are one of the kinds of signals that is
being used in the Arduino. According to Yarlagadda, most of the signals that
are being used are analog signal (2010). According to Kuphaldt, analog signals
is defined to be a signal in which it is continuous. In order to easily determine
if the signal that will be used is an analog signal, we should know if there will
be a specific range of action that will be done. Analog signal are used in
temperature sensor. This is because in order to determine the temperature of the
environment, there should be a range of the voltage difference. Another thing
that transmits an analog signal is the speed of the motor, the speed of the rotating
shaft can be varied by using an analog signal. This gives an ability to the user
to change the motor’s speed.
DIGITAL SIGNAL – Digital signal is also one of the kinds of signals that is
being used in an Arduino. According to Jimbo, digital signals commonly have
two values, one is a low number and the other one is high number that is not
infinity. Digital signals are said to have finite values. Commonly the most used
digital signal value is 0V and 5V. One of the component that uses a digital
signal is the light emitting diode or the LED. This is because there is only two
possibilities that may happen to a light emitting diode. This is to light up or be
turned off. When it is lighted up it uses a 5V signal on the other hand if it is
light off, it makes use of a 0V signal. The on value of a digital signal is referred
to be high and on the other hand the off value of a digital signal is referred to
be low.
7
V. THEORETICAL CONSIDERATIONS
The whole idea of this group’s project is to have a control system involving automatic
switching on/off of the LED based on the area’s light intensity using Arduino UNO board
and a photocell. In this system, when the room is bright, the LED of the system remains
off, and when the light in the room goes out, the LED will automatically turn on. This
principle will be applied on automatic night lights, like the ones in some people’s
bedrooms. This is possible because the Arduino UNO board was programmed to do so,
basing on the light intensity’s value.
VI. SOLUTION
In this project, we made a very simple automatic night light, a combination of Arduino
board and LED that is initially turned off the whole time, but turns itself on whenever the
light within the room is out. Here is the code used for the project.
int sensor=A1;
int LED= 7;
int Light=0;
int timer=0;
unsigned long prevmil=0;
const long interval = 500;
//Automatic Night Light
//Description: This project lights up when it senses that the room
//is dark and turns off if the room has light
void setup() {
Serial.begin(9600);
pinMode(LED,OUTPUT);
8
void loop() {
9
As for the circuit itself, here’s the connection diagram of our project using the Fritzing
software.
VII. DISCUSSION
In this project, we used Arduino UNO microcontroller. The goal of this project is to
create a simple control system involving an automatic light that turns off when the
surrounding is bright and turns on when the surroundings turn dark. We injected a code
that programs the board to turn on/off the light emitting diode depending on the light
intensity of the surroundings. The program code involves interval, and an if-else command
that if the light intensity of the area is greater than a value of 870, the LED will turn off,
else if it is lower than 870 units, it will turn on. Other materials include the light sensor
or photocell itself which sends signal to the Arduino board, and converts light energy into
electrical energy. When no light is present, they have a very high resistance that may be
millions of ohms. In contrast, when light is present, their resistance lowers greatly to a few
hundred ohms. This allows more current to flow inside the circuit, resistors for
miscellaneous stuff, and the light emitting diode as a signal receiver.
10
infrared light. Examples of the light sources may include sunlight, moonlight, fire, lasers,
neon, fluorescent, and other similar ones. This allows the photocells to function in two
ways: digitally, to indicate whether a source of light is present, or in analog fashion, to
indicate the light source’s intensity. Despite being made up with semiconductors,
photocells doesn’t have a PN junction. A PN junction is formed by combining positive and
negative type semiconductors, and is the basis of components, such as diodes and
transistors. In photocells, a photon or light particle forces electrons from their positions in
the material's atoms, leaving holes with positive charges. An applied voltage through the
photocell forces the holes and the electrons flow, thereby creating a current. Their symbol
is that of a resistor with two arrows pointing towards one side. Like ordinary resistors, they
lack polarity, which and so they may be placed in either direction inside a circuit.
VIII. CONCLUSION
Same concept can be applied to create autonomous control systems that can function
on its own depending on the status of its surroundings. This paper successfully integrated
the microcontroller system and light sensor technology. It gives the user a convenience of
having a light source in the dark.
IX. RECOMMENDATION
The main thing to improve this project is by using a PCB instead of a breadboard, and
soldered components for more stability. Also, it can be improved by scaling the project up
to a larger one, like using an actual light build and a larger photocell instead of LED.
X. REFERENCES
G. Batistell (2015), “Integrated High resolution Digital Color Light Sensor”
De Graaf, G., & Wolffenbuttel, R. F. (1998). Smart optical sensor systems in
CMOS for measuring light intensity and colour. Sensors and Actuators A: Physical,
67(1-3), 115–119. doi:10.1016/s0924-4247(97)01774-3
Schembri, R., Spong, J., Peters, A., Rochford, P., Wilksch, P., O’Donoghue, F. J.,
… Berlowitz, D. J. (2017). Light sensors for objective light measurement in
ambulatory polysomnography. PLOS ONE, 12(11), e0188124.
doi:10.1371/journal.pone.0188124
http://arduino.cc/en/Main/arduinoBoardUno
11
XI. APPENDICES
12
Appendix C: Fabrication Process
Completing the circuit by connecting the components based on the schematic diagram
Creating the code in Arduino software that will be used for the automatic night light
13
How the circuit and LED looks like when there is light in the room
14
Appendix D: Work Distribution
15