View
4
Download
0
Category
Preview:
Citation preview
Design of a Sensor-Based Adaptive Smart Home System
Using NXP ARM Cortex-M3
M. I. U. Haque1, D. Valles1 1Ingram School of Engineering, Texas State University, San Marcos, Texas, USA
Abstract - This paper discusses a project of designing a
smart system which is user-defined and adaptable for
different environments such as home, offices, and
classrooms. By using the values received from temperature
sensor and motion sensor some electrical appliances such as
fan and light may turn on or off. Moreover, the user can
define fan speed, brightness of lighting, as well as, time to
gradually increase the brightness of a light to its full
capacity. Also, other electrical appliances chosen by the user
may turn on automatically. All current statuses of appliances
will be shown on an LCD. Same scenario can be applied to a
bedroom, kitchen, toilet, office, etc. configurations. In short,
this project aims to build a smart system which is user defined
and adaptable to every possible indoor environment.
Keywords: Embedded, LPC1768, Sensors, Adaptive, Smart
1 Introduction
Smart systems have proven to facilitate automation for
different applications for home and office environments. The
impact and presence of embedded systems is felt directly in
our daily walk of life [1]. The applications of an embedded
system vary from cellular phones, digital cameras,
biomedical and home appliances up to ubiquitous and sensor
networking [2]. For this paper, we introduce an embedded
solution that can provide a form to automate room
environments.
Embedded solutions provide many forms of facilitating
many aspects of living and are being applied for smart-living
concepts. Figure 1 is the basic input/output system diagram
of the proposed project. This project uses NXP Cortex-M3
LPC1768 microprocessor as the main processing unit along
with a temperature sensor and motion sensor. The
temperature sensor will measure the temperature of the room
and there will be a predefined temperature value in the
processor. If the measured temperature is equal or larger than
this predefined value, then the fan will automatically turn on.
Additionally, the user can control the speed of the fan by the
‘Fan mode selection’ input and this will be done using PWM
technique and DIP (Dual In-line Package) switch. The fan
can also be turned off if the user wants. Similarly, the motion
detector will detect any human presence in different
environment selections. When detected, the light will
automatically turn on to pre-defined configurations.
Now, it is surely not convenient and not pleasant for the
eyes when someone enters a dark room and suddenly a light
is on with its full brightness. Also, the brightness of light
depends on different environment and configured by the user.
For this project, there is an additional option for the user to
select the right light mode by the ‘Light selector’ input in
other words how bright the user wants the light as well as how
much time the user needs to gradually increase the brightness
to the selected level. This will also be done using the DIP
(Dual In-line Package) switch and PWM technique.
Fig.1. Basic Input-Output design of the project
Depending on the environment, a user can define which
light or fan to be turned on. Each personalized setting
mentioned here may vary by different users and they can be
changed accordingly which shows the flexibility of this
system. As the whole project will be demonstrated using
breadboard and microcontroller, LEDs will be used as the
light and small cooling fan as the fan. The project will be
completed using NXP LPC1768 microcontroller, TMP36
temperature sensor, passive infrared motion sensor, LCD,
DIP switch, LEDs, cooling fan, n-channel MOSFET, diode,
jumper wires and resistors.
22 Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 |
ISBN: 1-60132-475-8, CSREA Press ©
The following sections are organized as: Section 2
discusses background and motivation of this project. Section
3 gives whole procedure. Section 4 discusses outcomes of the
project. Conclusions and scope for future work are included
in Section 5.
2 Background and Motivation
Different mini sensor-based projects have been done
using LPC1768 such as temperature measurement, humidity
measurement, angular/linear velocity measurement etc. [1].
Also, previously temperature controller system for LED
lighting has been designed where according to the ambient
temperature obtained by sensors, the designed system can
adjust the glow color automatically to provide a pleasant
lighting environment [3]. Another project done is about
weather monitoring and controlling system [4]. The proposed
project in this paper combines all the ideas above and an
additional feature to the system.
It is well known that smart systems are typically made
possible by network-enabled sensors/actuators and intelligent
computational algorithms. Most smart systems are designed
to be used directly by general consumers which we refer to
as human-centered smart systems. Smart technologies,
including smart-healthcare, smart-home, smart-grid, as well
as smart vehicles and intelligent transportation system are
transforming our society and have enormous economic
impact [5]. This proposed project is in the area of smart-home
and will surely be impactful upon successful completion.
3 Procedures
In this project, the smart system will be demonstrated
for five different environments. Those five different
environments include an office and different rooms of a
house: bedroom, living room, kitchen, office, and toilet. For
the bedroom, the light will glow gradually to its full capacity
in 5/10/15/20 seconds depending on the user whereas for
living room, the brightness of the light will be half of its full
capacity. For the kitchen and toilet, the light will glow to its
full glow instantaneously. In the office, the light will be the
desk lamp and the time and brightness can be adjusted as
well. The fan speed and status for all the environments can
also be varied by the user. These settings can be selected via
the keypad used for input ‘fan mode selection’ and ‘light
selector’ and the environment can also be selected via the
DIP switches. So, there will be enough options for different
inputs. All of the statuses will be shown on the LCD screen.
Figure 2 shows these features and adaptability of the
proposed design.
For temperature measurement, the TMP36 sensor is
used. It is a low voltage, precision centigrade temperature
sensor. It provides a voltage output that is linearly
proportional to the Celsius temperature. It also doesn’t
require any external calibration to provide typical accuracies
of ±1°C at +25°C and ±2°C over the −40°C to +125°C
temperature range. The design decision to utilize this sensor
is due to the ease of utilization and implementation: provides
the device a ground and 2.7 to 5.5 VDC in providing the
required power source. The output voltage can be converted
to temperature easily using the scale factor of 10 mV/°C [6].
Fig. 2. Environment adaptability(Home)
For motion sensing, PIR Motion Sensor (SEN-08630)
is used. The PIR Motion sensor (SEN-08630) is a small, low
cost proximity sensor user to detect motion. The specified
operation voltage is 12V, but the sensor works just fine off of
the 5V from the bed. A pull up resistor is needed since the
output pin is open collector. This can be done with an
external resistor or in software with internal pull-ups [7].
The main and only microcontroller unit used for this
project is NXP Cortex-M3 LPC 1768. It includes 512KB
FLASH, 32KB RAM and lots of interfaces including built-in
Ethernet, USB Host and Device, CAN, SPI, I2C, ADC, DAC,
PWM and other I/O interfaces. The pinout above shows the
commonly used interfaces and their locations. One of the
main advantages of this board is its’ low power consumption.
It consumes power in the range of 0.2885 - 1.103 Watts [8].
The maximum power consumption occurs when all of its’
peripherals are turned on. For this useful feature this board is
really a good choice to use in an embedded system project.
The NXP LPC1768 board is shown in Figure 3.
Fig. 3. NXP LPC1768 board [9]
The main working principal flow diagram is shown in
Figure 4. The whole algorithm for this program will be
decoded and compiled using Mbed online compiler.
Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 | 23
ISBN: 1-60132-475-8, CSREA Press ©
Fig. 4. Flow chart of working principal
The algorithm will look first for an environment to be
selected. When one is selected, the two sensors will supply
data to the board. When temperature data is equal to or
greater than a predefined value for that specific environment,
the fan will turn on. Similarly, when motion is detected by
the motion sensor the light will turn on. Both light and fan
can be turned off by the two-selector named as fan mode
selection and light selector. Also, these two selectors have
some more functionalities which have been discussed earlier.
All of the selections including environment selection will be
executed using the keypad. All of the statuses of on/off, fan
mode, light brightness will be shown on the LCD. A 16×2
LCD panel will be used. Finally, the outcome is a sensor-
based smart system adaptable for every possible
environment. For this project the outcomes will be shown
through LCD, LEDs and cooling fan. In other words, this
project is a small size of implementation to high level
comfortable environment.
4 Outcomes
This section discusses different outcomes from
different environments. The Outcomes are based on small
scale demonstration of the project using a project board and
different components discussed earlier.
Figure 5 shows the outcome of toilet environment.
When the motion is detected by the motion sensor,
LED(Yellow) turns on with its full brightness. Environment,
temperature and light status is shown on the LCD. For kitchen
environment, the exact same thing happens and this time a
red LED turns on when motion is detected. Figure 6 shows
the outcome for kitchen environment. Again, all statuses are
shown on the LCD.
Fig. 5. Outcome for toilet environment
Fig. 6. Outcome for kitchen environment
For office environment, a desk lamp automatically turns
on whenever user enters the office room. And to display the
lamp, a red LED is used and a variable resistor to control the
brightness of the LED. PWM technique is used here to
control the brightness of the LED. Outcome for office
environment is shown in Figure 7. Here, on LCD ‘Lamp’ can
be seen instead of ‘Light ON’.
As written in the procedures section, the LED
brightness for the living room will be half of its full capacity.
After motion is detected by motion sensor, whenever the
temperature in the room measured by temperature sensor
exceeds a predefined value of 20°C., the fan turns on. Also,
TV turns on when motion is detected. This is shown on LCD
with ‘TV’. Here, a small 5V DC brushless fan is used to
demonstrate the fan output. Figure 8 shows the activation of
the fan.
The last environment is bedroom. For bedroom, three
different settings are implemented. For first setting, the LED
increases its brightness to full capacity in 5 seconds and Fan
speed will be 100 percent. PWM technique is used here to
drive the fan and LED. For second setting, time to reach the
full brightness is 10 seconds and fan speed is 75 percent. For
third setting, time to reach the full brightness is 15 seconds
and fan speed is 60 percent. Fan and light statuses along with
temperature reading are shown in Figure 9.
24 Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 |
ISBN: 1-60132-475-8, CSREA Press ©
Fig. 7. Outcome for Office environment
Fig. 8. Outcome for Living Room environment
Fig. 9. Outcome for Bedroom environment
5 Conclusion and future scope
This paper proposes an embedded solution that
provides an automation and configuration for smart-living
environments. This sensor-based project will be useful for
learning embedded systems deeply and preparing for
industrial work. The main work is to measure analog data
provided by the temperature sensor and motion sensor and
then use those data for driving some outputs. There are also
some other inputs, controlled and defined by the user to make
the system more useful and user-friendly. The whole project
is adaptable to every possible environment such as home,
classroom, office, etc.
As this is an adaptable project for every environment, it can be extended to other extended functionalities that can adapt to different environments. For example, if someone wants the Xbox, speakers, video game consoles, Bluetooth speaker, etc. to be on as soon as user enters the room, it can be done by extending this project. Similarly, for each environment different outputs can be added as per user choice. The goal is to design an embedded system that doesn’t require switch interaction and utilizes wireless communication through smartphone devices. To implement the project in real life, each output should have a WI-FI module and then all of them will be connected to a main server through LAN (local area network). So, wireless communication part will play the vital role to implement it in real life. This embedded design is scalable and adaptable for every possible environment.
6 References
[1] A. Kommu, N. K. Uttarkar, and R. R. Kanchi, “Design
and development of sensor-based mini projects for
embedded system laboratory using ARM Cortex-
M3(LPC1768),” in International Conference on
Information Communication and Embedded Systems
(ICICES2014), 2014, pp. 1–6.
[2] “Human-Centered Smart Systems and Technologies,”
IEEE Access, 01-Jun-2017.
[3] L. Xin, S. Ling, S. Quan, C. Changzhu, and C.
Xiaoqiang, “Temperature controlling system for LED
lighting based on ARM,” in 2013 3rd International
Conference on Consumer Electronics, Communications
and Networks, 2013, pp. 649–652.
[4] P. Susmitha, Design and Implementation of Weather
Monitoring and Controlling System.
[5] H. Mitsui, H. Kambe, and H. Koizumi, “Use of Student
Experiments for Teaching Embedded Software
Development Including HW/SW Co-Design,” IEEE
Trans. Educ., vol. 52, no. 3, pp. 436–443, Aug. 2009.
[6] “Temperature Sensor - TMP36 - SEN-10988 - SparkFun
Electronics.” [Online]. Available:
https://www.sparkfun.com/products/10988. [Accessed:
19-Mar-2018].
[7] “PIR Motion Sensor (SEN-08630) | Mbed.” [Online].
Available: https://os.mbed.com/components/PIR-
Motion-Sensor/. [Accessed: 19-Mar-2018].
[8] “mbed Power Control/Consumption | Mbed.” [Online].
Available:
https://os.mbed.com/users/no2chem/notebook/mbed-
power-controlconsumption/. [Accessed: 19-Mar-2018].
[9] https://www.switch-science.com
Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 | 25
ISBN: 1-60132-475-8, CSREA Press ©
Recommended