You are on page 1of 4

22 Int'l Conf.

Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 |

Design of a Sensor-Based Adaptive Smart Home System


Using NXP ARM Cortex-M3

M. I. U. Haque1, D. Valles1
1
Ingram School of Engineering, Texas State University, San Marcos, Texas, USA

Abstract - This paper discusses a project of designing a environment selections. When detected, the light will
smart system which is user-defined and adaptable for automatically turn on to pre-defined configurations.
different environments such as home, offices, and
Now, it is surely not convenient and not pleasant for the
classrooms. By using the values received from temperature
eyes when someone enters a dark room and suddenly a light
sensor and motion sensor some electrical appliances such as
is on with its full brightness. Also, the brightness of light
fan and light may turn on or off. Moreover, the user can
depends on different environment and configured by the user.
define fan speed, brightness of lighting, as well as, time to
For this project, there is an additional option for the user to
gradually increase the brightness of a light to its full
select the right light mode by the ‘Light selector’ input in
capacity. Also, other electrical appliances chosen by the user
other words how bright the user wants the light as well as how
may turn on automatically. All current statuses of appliances
much time the user needs to gradually increase the brightness
will be shown on an LCD. Same scenario can be applied to a
to the selected level. This will also be done using the DIP
bedroom, kitchen, toilet, office, etc. configurations. In short,
(Dual In-line Package) switch and PWM technique.
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
Fig.1. Basic Input-Output design of the project
of the proposed project. This project uses NXP Cortex-M3
LPC1768 microprocessor as the main processing unit along Depending on the environment, a user can define which
with a temperature sensor and motion sensor. The light or fan to be turned on. Each personalized setting
temperature sensor will measure the temperature of the room mentioned here may vary by different users and they can be
and there will be a predefined temperature value in the changed accordingly which shows the flexibility of this
processor. If the measured temperature is equal or larger than system. As the whole project will be demonstrated using
this predefined value, then the fan will automatically turn on. breadboard and microcontroller, LEDs will be used as the
Additionally, the user can control the speed of the fan by the light and small cooling fan as the fan. The project will be
‘Fan mode selection’ input and this will be done using PWM completed using NXP LPC1768 microcontroller, TMP36
technique and DIP (Dual In-line Package) switch. The fan temperature sensor, passive infrared motion sensor, LCD,
can also be turned off if the user wants. Similarly, the motion DIP switch, LEDs, cooling fan, n-channel MOSFET, diode,
detector will detect any human presence in different jumper wires and resistors.

ISBN: 1-60132-475-8, CSREA Press ©


Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 | 23

The following sections are organized as: Section 2 the device a ground and 2.7 to 5.5 VDC in providing the
discusses background and motivation of this project. Section required power source. The output voltage can be converted
3 gives whole procedure. Section 4 discusses outcomes of the to temperature easily using the scale factor of 10 mV/°C [6].
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, Fig. 2. Environment adaptability(Home)
including smart-healthcare, smart-home, smart-grid, as well
as smart vehicles and intelligent transportation system are For motion sensing, PIR Motion Sensor (SEN-08630)
transforming our society and have enormous economic is used. The PIR Motion sensor (SEN-08630) is a small, low
impact [5]. This proposed project is in the area of smart-home cost proximity sensor user to detect motion. The specified
and will surely be impactful upon successful completion. 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
3 Procedures external resistor or in software with internal pull-ups [7].
In this project, the smart system will be demonstrated
The main and only microcontroller unit used for this
for five different environments. Those five different
project is NXP Cortex-M3 LPC 1768. It includes 512KB
environments include an office and different rooms of a
FLASH, 32KB RAM and lots of interfaces including built-in
house: bedroom, living room, kitchen, office, and toilet. For
Ethernet, USB Host and Device, CAN, SPI, I2C, ADC, DAC,
the bedroom, the light will glow gradually to its full capacity
PWM and other I/O interfaces. The pinout above shows the
in 5/10/15/20 seconds depending on the user whereas for
commonly used interfaces and their locations. One of the
living room, the brightness of the light will be half of its full
main advantages of this board is its’ low power consumption.
capacity. For the kitchen and toilet, the light will glow to its
It consumes power in the range of 0.2885 - 1.103 Watts [8].
full glow instantaneously. In the office, the light will be the
The maximum power consumption occurs when all of its’
desk lamp and the time and brightness can be adjusted as
peripherals are turned on. For this useful feature this board is
well. The fan speed and status for all the environments can
really a good choice to use in an embedded system project.
also be varied by the user. These settings can be selected via
The NXP LPC1768 board is shown in Figure 3.
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 Fig. 3. NXP LPC1768 board [9]
of ±1°C at +25°C and ±2°C over the −40°C to +125°C The main working principal flow diagram is shown in
temperature range. The design decision to utilize this sensor Figure 4. The whole algorithm for this program will be
is due to the ease of utilization and implementation: provides decoded and compiled using Mbed online compiler.

ISBN: 1-60132-475-8, CSREA Press ©


24 Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 |

Fig. 5. Outcome for toilet environment

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 Fig. 6. Outcome for kitchen environment
selection and light selector. Also, these two selectors have
some more functionalities which have been discussed earlier. For office environment, a desk lamp automatically turns
All of the selections including environment selection will be on whenever user enters the office room. And to display the
executed using the keypad. All of the statuses of on/off, fan lamp, a red LED is used and a variable resistor to control the
mode, light brightness will be shown on the LCD. A 16×2 brightness of the LED. PWM technique is used here to
LCD panel will be used. Finally, the outcome is a sensor- control the brightness of the LED. Outcome for office
based smart system adaptable for every possible environment is shown in Figure 7. Here, on LCD ‘Lamp’ can
environment. For this project the outcomes will be shown be seen instead of ‘Light ON’.
through LCD, LEDs and cooling fan. In other words, this As written in the procedures section, the LED
project is a small size of implementation to high level brightness for the living room will be half of its full capacity.
comfortable environment. After motion is detected by motion sensor, whenever the
temperature in the room measured by temperature sensor
4 Outcomes exceeds a predefined value of 20°C., the fan turns on. Also,
This section discusses different outcomes from TV turns on when motion is detected. This is shown on LCD
different environments. The Outcomes are based on small with ‘TV’. Here, a small 5V DC brushless fan is used to
scale demonstration of the project using a project board and demonstrate the fan output. Figure 8 shows the activation of
different components discussed earlier. the fan.

Figure 5 shows the outcome of toilet environment. The last environment is bedroom. For bedroom, three
When the motion is detected by the motion sensor, different settings are implemented. For first setting, the LED
LED(Yellow) turns on with its full brightness. Environment, increases its brightness to full capacity in 5 seconds and Fan
temperature and light status is shown on the LCD. For kitchen speed will be 100 percent. PWM technique is used here to
environment, the exact same thing happens and this time a drive the fan and LED. For second setting, time to reach the
red LED turns on when motion is detected. Figure 6 shows full brightness is 10 seconds and fan speed is 75 percent. For
the outcome for kitchen environment. Again, all statuses are third setting, time to reach the full brightness is 15 seconds
shown on the LCD. and fan speed is 60 percent. Fan and light statuses along with
temperature reading are shown in Figure 9.

ISBN: 1-60132-475-8, CSREA Press ©


Int'l Conf. Embedded Systems, Cyber-physical Systems, & Applications | ESCS'18 | 25

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
Fig. 7. Outcome for Office environment 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.
Fig. 8. Outcome for Living Room environment
[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].
Fig. 9. Outcome for Bedroom environment [7] “PIR Motion Sensor (SEN-08630) | Mbed.” [Online].
Available: https://os.mbed.com/components/PIR-
5 Conclusion and future scope Motion-Sensor/. [Accessed: 19-Mar-2018].
[8] “mbed Power Control/Consumption | Mbed.” [Online].
This paper proposes an embedded solution that
Available:
provides an automation and configuration for smart-living
https://os.mbed.com/users/no2chem/notebook/mbed-
environments. This sensor-based project will be useful for
power-controlconsumption/. [Accessed: 19-Mar-2018].
learning embedded systems deeply and preparing for
industrial work. The main work is to measure analog data [9] https://www.switch-science.com

ISBN: 1-60132-475-8, CSREA Press ©

You might also like