ARID ZONE JOURNAL OF ENGINEERING, TECHNOLOGY & ENVIRONMENT AZOJETE, June, 2019. Vol. 15(2):259-267 Published by the Faculty of Engineering, University of Maiduguri, Maiduguri, Nigeria. Print ISSN: 1596-2490, Electronic ISSN: 2545-5818 www.azojete.com.ng 259 ORIGINAL RESEARCH ARTICLE DESIGN AND IMPLEMENTATION OF AN ARDUINO BASED LIGHT DEPENDENT ALARM SYSTEM H. Ibrahim*, A. A. Mohammed and I. A. Aliyu (Department of Computer Engineering, Kaduna Polytechnic, Kaduna, Nigeria) *Corresponding author’s e-mail address: harunaebrahim@gmail.com ARTICLE INFORMATION Submitted 10 November, 2018 Revised 4 February, 2019 Accepted 10 February, 2019 Keywords: Alarm Arduino Uno LDR Microcontroller Potentiometer ABSTRACT This paper is based on design and implementation of an Arduino based alarm system which is capable of monitoring the illumination of the surrounding automatically. Once the presence or absence of light is detected accordingly, a control device is activated which sends a sound alarm to a buzzer connected to the output of the system. Waking up early from sleep has always become a challenge most especially after a very hectic and busy engagement during the previous day time, this makes waking up early the next morning to meet up with the activities of the day a challenge. The components used for carrying out this study include Light Dependent Resistor, a control unit and an output buzzer unit. The LDR works on the principle of change of resistance based on the amount of luminous energy in its environment at that moment of time, once an illumination is detected, an Arduino Uno board was used to send a signal to the buzzer that generates sound when the intensity of light increases. The test conducted showed that the LDR resistance decreased as illuminance on the LDR increased; the illuminance ranges at which the buzzer was triggered was between 100-1000lux. © 2019 Faculty of Engineering, University of Maiduguri, Nigeria. All rights reserve 1.0 Introduction Advancement in technology has made all aspects of life simpler and easier thereby making automated systems more preferred to manual systems (Nikhil, 2016). Automatic alarm systems are designed to alert an individual or group of individuals at specified times. The alarm system in this study uses sound and light devices. Researchers have worked on techniques for light detection and sensing and had developed devices that offer excellent performance (Busari et al., 2015). Light is an electromagnetic radiation within a certain portion of the electromagnetic spectrum which is visible to the human eye and is responsible for the sense of sight (Effend et al., 2014). The Light sensor is a passive device that converts light energy into electrical signal that generates an output signal that is proportional to the intensity of the light (Mavrya et al., 2012). The commonly used photo resistor is called Cadmium Sulphide Light Dependent Resistor (LDR). mailto:harunaebrahim@gmail.com http://www.azojete.com.ng Ibrahim et al.: Design and Implementation of an Arduino Based Light Dependent Alarm System. AZOJETE, Vol. 15(2):259-267 Print ISSN: 1596-2490, Electronic ISSN: 2545-5818, www.azojete.com.ng Corresponding author’s e-mail address: harunaebrahim@gmail.com 260 Manual control of light is prone to errors and stressful. The introduction of automation and remote management solution for detecting light illuminations is vital and can be achieved by the used of programmed microcontroller. The alarm system in this article is designed to automatically detect the presence and absence of light. A buzzer is triggered once light, with illuminance between 100-1000lux, is detected. Much effort and work have been done in this area of research but improvement on the drawbacks of past works is necessary in order to have maximum performance of their applications in domestic use which include: detection of the presence or absence of light, street light switching, security systems and as a triggered alarm system. Some related works are therefore discussed. Isah et al. (2015) designed an automatic street light Control System. The work is based on UA741 operational amplifier which is configured as a Schmitt trigger and a light dependent resistor. During the day, the LDR senses enough illumination and the street light goes off and comes ON when there is darkness. A transistor is used as switch to provide the switching mechanism that activates the street lights. The transistor was not fully saturated and only switched on DC loads. This design overcame the challenge of streetlight system using a timer controller, and human intervention was completely removed. The drawback of this work is that discrete components were used in its implementation: this requires using many circuit components and thus not cost effective. Similarly, an automatic street light control system was designed by Sakshee (2013). This work exploits the working of a transistor, in saturation and cut-off region, to switch ON and OFF the lights at the appropriate time with the help of an electromagnetically operated switch. It operates on a 12V DC supply and a photoconductive device whose resistance changes in proportion to light intensity. The work helped to reduce energy consumption, easy to operate and has low cost. The major drawback of this work is that the ON and OFF timer controller circuit is easily affected during sunny or rainy days. Mustafa et al, (2013) proposed an automatic street light control system using PIC16F877A microcontroller. In the work, two sensors were used which are an LDR and a photoelectric sensor. The LDR is used to detect day/night time while the photoelectric sensor detects the movements on the street. The microcontroller is used as a brain, to control the street light system. The PIC16F877A microcontroller used is not as flexible as Arduino. Arduino hardware components are cheaper in relation with the PIC microcontroller, and the programming language is easy. Arduino needs no separate compiler and programmer, and it also has greater academic applications because it is simple to learn. The objective of the study is to enable waking up from sleep early easier so as to meet up with responsibilities such as dropping of children in school and arriving in office on time a reality. With this study it makes meeting up with such responsibilities a reality. http://www.azojete.com.ng Arid Zone Journal of Engineering, Technology and Environment, June, 2019; Vol. 15(2):259-267 Print ISSN: 1596-2490, Electronic ISSN: 2545-5818, www.azojete.com.ng Corresponding author’s e-mail address: harunaebrahim@gmail.com 261 2. Materials and Methods 2.1 Design of the Arduino-Based Alarm System The Arduino based alarm system using light sensor is designed in four working units which are the power supply unit, the LDR, the controller and the buzzer. The units are connected together to form a functional hardware system. The power supply unit powers the complete system. The second unit is the Photo-sensor known as the Light Dependent Resistor (LDR). The LDR resistance changes with the intensity of light. The LDR gives out an analog voltage when connected to VCC (5v), which varies in magnitude and is directly proportional to the intensity of the input light on it. The third unit is the Arduino UNO which serves as the Control Unit. The Arduino, with its inbuilt ADC (Analog to Digital converter) converts the analog voltage (from 0- 5V) into digital voltage. Thus, when there is sufficient light in its environment or on the surface of the LDR, the converted digital values are read from the LDR through the Arduino. The buzzer is the last unit: it is connected to the Arduino pin and produces sound as it is programmed. When the LDR detects a light beyond a certain threshold, the Arduino triggers the buzzer and a sound is produced, but turned off when the intensity of light decreases. Figure 1 shows the block diagram of the system and its component units. Figure 1: Block Diagram of an Arduino Based Alarm System. http://www.azojete.com.ng Ibrahim et al.: Design and Implementation of an Arduino Based Light Dependent Alarm System. AZOJETE, Vol. 15(2):259-267 Print ISSN: 1596-2490, Electronic ISSN: 2545-5818, www.azojete.com.ng Corresponding author’s e-mail address: harunaebrahim@gmail.com 262 2.2 The Software System In order to enable that the controller function appropriately, software that models the system operation is designed and implemented using C language. The flowchart is shown in Figure 2. Figure 2: The System flowchart. http://www.azojete.com.ng Arid Zone Journal of Engineering, Technology and Environment, June, 2019; Vol. 15(2):259-267 Print ISSN: 1596-2490, Electronic ISSN: 2545-5818, www.azojete.com.ng Corresponding author’s e-mail address: harunaebrahim@gmail.com 263 2.3 The Hardware Design The system hardware is implemented as shown in the Figure 3: Figure 3: Circuit Diagram of an Arduino Based Alarm System The voltage out across the LDR and the variable resistor is implemented as shown in figure 4. Figure 4: Voltage Divider between LDR and Potentiometer. http://www.azojete.com.ng Ibrahim et al.: Design and Implementation of an Arduino Based Light Dependent Alarm System. AZOJETE, Vol. 15(2):259-267 Print ISSN: 1596-2490, Electronic ISSN: 2545-5818, www.azojete.com.ng Corresponding author’s e-mail address: harunaebrahim@gmail.com 264 Vout when light is detected; Where: RLDR is the resistance of the LDR, measured in ohm; Vout is the output voltage from the voltage divider combination, measure in volt. Vcc is the supply voltage , measure in volt. Vout when light is not detected; Vout = 4.95V It was deduced that, when light is detected, the resistance of the LDR decreases with a corresponding increase in voltage across the LDR as well as the variable resistor, and vice versa. Figure 5 shows the light emitting resistor circuit. Figure 5: The Series connection between The Miniature Indicator Light Emitting Resistor and a Ballast Resistor. The value of the current limiting resistor can be calculated from Figure 5. The formula is shown below: ��im ���im � �⢈Оᗐ⢈ 벨 ���� �⢈�� ⢈Оᗐ⢈� (1) ��ૡ � 4.99 벨 �t��V R D R ⢈ � ��� � ��� � (2) http://www.azojete.com.ng Arid Zone Journal of Engineering, Technology and Environment, June, 2019; Vol. 15(2):259-267 Print ISSN: 1596-2490, Electronic ISSN: 2545-5818, www.azojete.com.ng Corresponding author’s e-mail address: harunaebrahim@gmail.com 265 Where; Vs � Power Supply Voltage Vf � LEDforward voltage /Voltage drop across LED I � Desired Current of LED R � Current Limiting or Ballast ResistorDesired Current of LED Note: Miniature Indicator LED (red LED) from the manufacturer datasheet has the following parameters: I � 2tmA LED voltage � �.8V � 2V Therefore, from equation (2), R is calculated as R � �5 � 2�V 2tmA R � �5tΩ The value of the current resistor needed to be connected in series to the Red LED is 150Ώ. 2.3 Construction of Arduino based light dependant alarm system The construction of the hardware and packaging was carried out as shown in Figure 6 and 7 respectively. 3. Results and Discussions Table 1 shows the testing of Arduino based alarm system. When the system was subjected to darkness with the LDR having resistance of about 100KΩ, the light intensity is around 0lux and the alarm is in off-state. With decrease in the resistance of the LDR, at about 1269Ω, the light intensity begins to increase gradually to about 100lux and the alarm comes “ON”. The test conducted shows the LDR resistance decreases as light intensity increases. The light illuminance ranges at which the buzzer was triggered “ON” is between 100-1000lux. The result obtained is as shown in a graph of resistance against light illuminance plot in Figure 8. Figure 6: Construction of the System Figure 7: Packaging of the System http://www.azojete.com.ng Ibrahim et al.: Design and Implementation of an Arduino Based Light Dependent Alarm System. AZOJETE, Vol. 15(2):259-267 Print ISSN: 1596-2490, Electronic ISSN: 2545-5818, www.azojete.com.ng Corresponding author’s e-mail address: harunaebrahim@gmail.com 266 Table 1: Testing of the Arduino Based Alarm System. S/N Light Illuminance (Lux) Resistance (Ώ) Buzzer 1 0 11 900.90 OFF 2 100 1269.18 ON 3 200 630.04 ON 4 300 547.10 ON 5 400 411.87 ON 6 500 342.09 ON 7 600 292.52 ON 8 700 264.66 ON 9 800 230.77 ON 10 900 212.04 ON 11 1000 190.30 ON Figure 8: Result of plot for Resistance against Illuminance. 4. Conclusion The Arduino based alarm system was built, tested and found to be working in conformity to the design. It was found to be a versatile system capable of detecting the presence of light and triggering the buzzer. The LDR resistance decreases (to about100Ώ) as incident of light falls on it and increases (to about 10MΏ) in the dark. The range of illuminance at which the buzzer was triggered was between 100-1000 lux. The alarm is triggered at about 6.45 a.m., which is in http://www.azojete.com.ng Arid Zone Journal of Engineering, Technology and Environment, June, 2019; Vol. 15(2):259-267 Print ISSN: 1596-2490, Electronic ISSN: 2545-5818, www.azojete.com.ng Corresponding author’s e-mail address: harunaebrahim@gmail.com 267 conformity with the mean time of getting out of bed. Such system can be produced locally with a minimum circuit complexity, resulting in a technological tool of utility and economy suited to the need of modern activities. The implementation (construction) is built around an open-source electronics platform which is based on an easy to use hardware and software. No need of a separate hardware programmer/burner for loading/burning of program on to the microcontroller. The Arduino software is easy to use for beginners and very flexible for advance users. It is recommended that any other person working on this kind of design should make use of photodiode or phototransistor so as to improve on the response time of the system and increase the resistance needed to trigger the buzzer. A passive infrared (PIR) sensor can also be used to detect motion when there is a variation of weather or light intensity. References Busari, A., Adebisi, O. and Akanji, O. 2015. Design and Implementation of a Microcontroller Based Alarm Enabled Dark Activated Switch. International Journal of Engineering and Innovation Technology, Ibadan, Nigeria, 4(12): 38-41 Effendi, M., Shayfull, Z. and Saad, M. 2014. Design and Implementation of an Alarm Reminder. Locking Security System. International Journal of Electronics and Computer Science Engineering, 6(5): 465-472. Isah, A., Oshoma, A. and Alexander, O. 2015, Design and Implementation of an automatic street light Control System. International Journal of Emerging Technology and Advanced Engineering, 4(3): 318-329. Mavrya, K., Singh, M. and Jain, N. 2012. Implementation of a Real Time Vehicle Tracking Using GPS Technology. International Journal of Electronic and Computer Science Engineering, 4(4): 277-289. Mustafa, E., Farij, A. and Abdalroof, A. 2013. Automatic street light control system using microcontroller. Mathematical Methods and optimization Techniques in Engineering ISBN; 978- 960-474-339-1 pp 92 -96 Nikhil, K. 2016. Design and Construction of an IOT based Intelligent Home using Smart Devices. International Journal of Innovative Research in Electrical Electronics and Instrumentation Engineering, 4(6): 12090-12097 http://www.azojete.com.ng