0% found this document useful (0 votes)
37 views6 pages

Smart Home and Yocto

Uploaded by

22119171
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views6 pages

Smart Home and Yocto

Uploaded by

22119171
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Smart Home Equipment Control System with

Raspberry Pi and Yocto


Arghya Biswas1, Dwaipayan Biswas2, Sudakar Singh Chauhan3, Antara Borwankar4
1
School of VLSI and Embedded System Design, National Institute of Technology, Kurukshetra
2
Government College of Engineering and Textile Technology, Berhampore
3
ECE Department, National Institute of Technology, Kurukshetra
4 Intel Technology India Private Limited
1
[email protected], [email protected], 3 [email protected],
2

4
[email protected]

Abstract: Yocto is a customizable lightweight Linux turn-off the GPIO pin of their test board. They add
distribution for embedded devices with any kind of that python script with a service file in a custom layer
hardware architecture. With the Yocto, it is possible to in the Yocto and build their image. After flashing the
compile an operating system with the same feature for
image, the service file automatically calls the python
the different types of hardware in a very short period of
file and test the GPIO pins. With this implementation
time. This paper proposed to use the Yocto with the
Raspberry Pi to form a high-speed Internet of Things they were able to reduce the time that need to do
(IoT) hardware cum software solution with the only manually testing for different 300 boards.
specific features that we need. The very common Linux Author D. Muthuswamy and A. P. Navik proposed
distribution for the Raspberry Pi has a number of extra
Dual Band WLAN Gateway Solutions in Yocto Linux
features that are not necessary for some dedicated
applications like IoT application, which needs to run
for IoT Platforms [4]. They took the Yocto as a base
only some specific set of tasks. Here in this project, we operating system and work on the dual-band Wi-Fi.
designed a prototype of a smart home equipment control Wi-Fi 2.4 GHz & 5 GHz ISM bands are a very good
system with the two different models of Raspberry Pi option for IoT platforms. They enable the feature of
and this embedded Linux operating system called Yocto. dual-band in the access point.
This system is able to control all the home equipment
from the control interface display or from the specific $XWKRU 5 ùHUEDQ DQG , &XOLF >@ SURSRVHG D YHU\
website world wise. useful way to convert the Cisco IR829GW router to
an IoT device. They install Yocto in that router and
Keywords: Home Automation, Home equipment control, also install the Node.js, Avahi, Node-RED, Redis and
Raspberry Pi, Yocto, Linux, Internet of Things, Operating Wyliodrin Server on top of the Yocto. As a result,
System, Attiny88 Microcontroller. they were able to convert the router to an IoT device
I. INTRODUCTION with dual-band transceiver facility. They also
proposed to add a microphone and distance sensor
Home equipment control is a very popular domain for
with the system and then it can take the human voice
the Internet of Things (IoT) [1] [2] applications. This
as input and may perform some easy tasks.
paper is also proposing a prototype of a lightweight
software solution for the home equipment control Author A. S. [6] Haron configure and install the
system based on the customizable embedded embedded operating system Yocto on a hard CPU in
operating system called Yocto [3]. On top of the basic an FPGA. They choose Altera DE1-SoC with onboard
layer of the operating system we add a new layer for hard ARM CPU for their experiment. They configure
our application which will do the all necessary action the hard processor system (HPS), Parallel I/O ports,
needed for the equipment control system and it also Peripheral pins, SDRAM to make the Yocto
has an interactive Graphical User Interface (GUI) that compatible with the specific hardware. After that they
can help the user to control the equipment. also implement the HDL code to program the FPGA.
With this all changes they were able to run the Yocto
II. LITERATURE SURVEY on that FPAG board.
H. Khandelwal, P. Mankodi proposed an enhanced
Author Z. Liu, F. Jing [7] proposed an FPGA and
system for automated test-bed using Yocto [3]. They
ARM-SoC based canny edge detection system. They
created an automated python file that can turn-on and
use the embedded operating system Yocto for ARM

c
978-1-7281-6823-4/20/$31.00 2020 IEEE 553

Authorized licensed use limited to: Fondren Library Rice University. Downloaded on October 26,2020 at 06:34:02 UTC from IEEE Xplore. Restrictions apply.
SoC and FPGA to process the image to show on a speed is very low. On the other hand, the general-
VGA display. They also conclude that the ARM-SoC purpose operating system has a number of features
with embedded OS and FPGA based canny edge that are not used ever that is one kind of a waste of
detection system has a high portability aspect. And resources. So, we are proposing a prototype with a
the high-speed and low power consumption is also a custom operating system that can have only the
plus point in their system. features that are needed for the entire system. So, the
custom OS will have fewer loads with high
Author V. Patchava, H. B. Kandala [8] proposed a
throughput.
technique for smart home automation with Raspberry
Pi and camera and motion sensor. The motion sensor V. SYSTEM OVERVIEW
and computer vision were used to control the home
This entire project has three main components as the
equipment and monitored from a web interface. For
software perspective and from the hardware prospect
security and the surveillance, they used the camera.
there are two main components. The software
The live feed from the camera directly can be
components are web interface for the application, a
observed form the web interface. Whenever any
custom operating system based on the Yocto and the
unspecified motion has been detected, the Raspberry
GUI application itself. For the hardware we use the
Pi will be triggered and the camera starts the
very popular Raspberry Pi and attiny88 micro-
recording, the alert alarm will be triggered and an
controller for IO extension.
SMS will be sent to the user mobile.
A. Web Interface
E. Rohadi et al. [9] proposed a Raspberry Pi based
home security system. They added a webcam with the To control the home equipment, we designed
USB interface of the Raspberry Pi and set up an deployed a web interface that has the all button with
apache2 server on the Raspberry Pi. As the Raspberry the equipment name and status. A signal will be sent
Pi was connected to the local network, the web-server to the Raspberry Pi when any switch is being pressed.
could be accessed from any other device on that home And the Raspberry Pi will take the responsibility of
network. The made some changes to that web-server further processing.
and able to transmit the webcam feed to the local
network. They set up a special URL with the local
network IP address. If any device browses that URL
form that home network then it can observe the feed
of the webcam. They were able to transmit different
resolution video, but it added some extra delay to get
the feed.

III. MOTIVATION
Most of the IoT project based on Raspberry Pi uses
the Raspbian [10] operating system. This operating
system has a lot of features for general purpose use.
Fig 1: Web interface for the application
But if we use a custom operating system that has only
those features that are needed for the IoT application Here figure 1 is the screen short if the web interface.
then we may reduce the power consumption as well as We added some switches and the equipment name.
the processing load, as a result, a high-speed The color of the switch is intentionally used to
lightweight device. These things motivated us to work recognize the state of the equipment.
with custom embedded operating system Yocto and
B. Yocto
C++ language with the Qt framework for the GUI.
Yocto is an open-source project that helps us to create
IV. RESEARCH GAPS the custom Linux architecture-based operating system
In most of the home equipment control system with the custom features for different kinds of
projects, the software is mainly classified into major computers. For this project, we need only some basic
two types. The first one some kind of firmware and features. We added the Qt framework base package,
another one is some custom application that is running i2c library package, Wi-Fi and DHCP-server.
on top of the general-purpose operating system. So,
for the firmware [11] [12] the processing power and

554 2020 Fourth World Conference on Smart Trends in Systems, Security and Sustainability (WorldS4)

Authorized licensed use limited to: Fondren Library Rice University. Downloaded on October 26,2020 at 06:34:02 UTC from IEEE Xplore. Restrictions apply.
Figure 2 is the architectural diagram of Yocto. Make- custom application layer that can help to lunch our
like build tool bitbake [3] is used to build the Yocto application just after the boot process.
image. The source code has been downloaded from
C. The Main Application
the upstream repository or copied from the local
directory as mentioned in the recipe files. The bitbake The main application that will going to be executed
tool follows multiple numbers of steps to complete the on the Yocto image is a GUI based application written
image build process. Figure 3 is showing all the steps in the C++ language using the Qt framework [13]
that are needed to execute by the bitbake tool. [14]. This application has three main windows. The
first one is to register a user.
Figure 4 shows the registration window. It needs the
very basic information about the user. We added the
user account verification via sending a one-time
password (OTP) on the user email id. The second
window in figure 5 is used to login to the user
account.

Fig 2: architectural diagram of Yocto

Fig 4: Registration window of the main application

Fig 5: Login window of the main application

Fig 3: Workflow of Yocto

We build the Yocto for the Raspberry Pi. So, we


import the official Raspberry Pi layer for the Yocto on
top of the basic layers. The Qt layout is also imported
after the Raspberry Pi layer. We made a custom layer
for our application. And then add the layer on the top.
We enable features like i2c, DHCP-server, Wi-Fi and
the required dependency packages from the local.conf Fig 6: Dashboard window of the main application
configuration file. We added some services in our

2020 Fourth World Conference on Smart Trends in Systems, Security and Sustainability (WorldS4) 555

Authorized licensed use limited to: Fondren Library Rice University. Downloaded on October 26,2020 at 06:34:02 UTC from IEEE Xplore. Restrictions apply.
The dashboard window in figure 6 has the all switch the communication so there is scope of connecting
buttons that are needed to control the equipment. To 112 modules like this. But for the project prototype
ensure the better user experience we grouped the purpose we added only two modules with the
switches room wise. Raspberry Pi.
This application will be synchronized with the web Here the push switches are representing the physical
application. In Figure 1 and 6 is also showing the switches and the LEDs are representing the home
synchronized status for the equipment. When a button equipment.
in the application is pressed then the application will
generate two signals. One signal comes to the i2c bus
of the Raspberry Pi to update the equipment state and
the other one come to the web interface and update
the web database as well as the web GUI. When a
button is pressed in the web GUI the same thing
happens and it updates the equipment status as well as
the GUI in both web and local application.
Some extra GUI based features are added in this
application because the operating system doesn't have
any other GUI for the OS related features. So, this
application provides the GUI solution for features like Fig 7: Attiny88 microcontroller with LEDs and switches, connected
selection of the Wi-Fi, reboot, power-off, virtual with an Arduino to flash the program
keyboard, font style change, font size change, screen
resolution, brightness control, system update etc. VI. WORKFLOW
Figures 4, 5 and 6 showing five buttons on the top
The workflow of the entire project is divided into
portion of the application for those features.
mainly three parts. All the home equipment can be
D. Raspberry Pi controlled by the physical switches, from both the
Raspberry Pi is a very compact single-board computer application that is installed on the Raspberry Pi and
having a decent processing speed and the memory from the web interface. Those three modes of control
available which is perfect for our project. The Yocto are heavily synchronized. If the equipment is updated
OS and the main application are running on this from any of those interfaces, then other interfaces will
Raspberry Pi. The application uses the dedicated i2c automatically update it.
pins of the Raspberry Pi and sends the data to the
attiny88 micro-controller.
We are mainly developing the project for the
Raspberry Pi version 4. But it has the backward
compatibility with the previous versions of Raspberry
Pi. As the processor is different in those boards so we
need to compile the OS separately for all those
boards.
E. Attiny88 microcontroller
Attiny88 is an 8-bit AVR micro-controller. We use
the Dual Input Package (DIP) version of the micro-
controller. It has 20 General Purpose Input Output
(GPIO) pins.
Figure 7 is a complete module with an attiny88 micro-
controller and 8 LEDs and 8 push switches with it.
We made multiple PCBs of this module. Here we use
an Arduino pro mini board with SPI to flash the code
to the micro-controller. The attiny88 micro-controller
module will be connected with the Raspberry Pi via
i2c connection. As we are using the i2c protocol for Fig 8: block diagram of the entire project

556 2020 Fourth World Conference on Smart Trends in Systems, Security and Sustainability (WorldS4)

Authorized licensed use limited to: Fondren Library Rice University. Downloaded on October 26,2020 at 06:34:02 UTC from IEEE Xplore. Restrictions apply.
The Yocto OS helps the application to communicate of the attiny88 micro-controller with a unique address
with the attiny88 micro-controller through the i2c which is needed to communicate over i2c bus.
communication bus of the Raspberry Pi. Here the
Raspberry Pi is working as the master in the i2c
communication and the attiny88 micro-controllers are
working as the slaves. Raspberry Pi can send some
data to write on the output port of the micro-controller
and also able to send the request to read the input port
of the micro-controller.
In figure 8 it is clearly visible that the web interface
and the Yocto are talking via HTTP connection. The
main GUI application reads the web database and then Fig 9: Available i2c device on the bus
updates itself and finally sends the command to the
micro-controller module to update the equipment Here in figure 9 clearly visible that there are two
status. The Yocto helps the application to send the devices are available on the bus with unique address
data to the i2c port of the Raspberry Pi and read the 0x04 and 0x06.
data from the i2c port. On the other hand, multiple
attiny88 micro-controllers are connected in that i2c
bus. The application can access those micro-
controllers via their unique address. We are using the
7-bit addressing mode so total possible micro-
controllers that can be attached to this bus is 112.
Each micro-controller can drive 8 LEDs and 8
switches. So, it is very clear that a huge number of
equipment can be controlled by a single Raspberry Pi.
Fig 10: Full hardware setup
VII. IMPLEMENTATION DETAILS
We created a dedicated operating system for this The original hardware setup is shown in figure 10.
project. The application is built in a pre-installed Two attiny88 micro-controller modules are connected
fashion with the operating system. We also added a via an i2c bus with the Raspberry Pi. The PCB of the
service file to run the application just after the booting attiny88 micro-controller module is designed in such
completion. As the GUI application is built with the a way that every module has two same i2c ports. So,
Yocto OS so it is a bit difficult to update some part of one port can be used to connect with the previous
the application. So, we introduce an update manager module and another port can be used to connect with
concept in the application. We can simply add the the next module. So, it makes the entire setup clean.
updated binary and dependency files in a zip folder The GUI application continuously fetches the web
and just upload it to a web repository from any other database and the push switch status from the attiny88
computer. And from the old GUI application user can micro-controller. So, if any state change is noticed by
download and install the new binary just pressing the application then it updates the other one. As it is
update and restart button. working as a bridge between the web and the physical
As we are using the Yocto as the base of the project system, but it also has the controlling interface as
so the other required features (like Wi-Fi driver, shown in figure 6. So, all the equipment can be
Ethernet driver, Display driver etc.  GRHVQ¶W QHHG VR controlled by the physical switches, local UI interface
much attention. Just add a single line for in the or web interface.
configuration file in the Yocto and Yocto will take Here in this prototype we are using LEDs to
care of all those things. representing the equipment. But in real life it needs
We are mainly using the Raspberry Pi 4 as base some solid-state relay to drive AC mainline
hardware. So, we first build the image for the equipment. The relays can be attached to the micro-
Raspberry Pi 4. And later we also test the entire controller and the micro-controller drive the relay to
project in the Raspberry Pi 3 model. We flashed each control the equipment.

2020 Fourth World Conference on Smart Trends in Systems, Security and Sustainability (WorldS4) 557

Authorized licensed use limited to: Fondren Library Rice University. Downloaded on October 26,2020 at 06:34:02 UTC from IEEE Xplore. Restrictions apply.
VIII. CONCLUSION & FUTURE WORK RoEduNet Conference: Networking in Education and
Research. doi: 10.1109/roedunet.2016.7753219.
This prototype can be implemented at home, school,
[6] Haron A, Talip M, Khairuddin A, Izam T (2017)
college, or in some industry to observe and control the
Internet of Things Platform on ARM/FPGA Using
electrical equipment. Beside the GUI interface, this
Embedded Linux. 2017 International Conference on
prototype re-uses the switches that are already Advanced Computing and Applications (ACOMP).
installed with the old equipment. So, it will make the doi: 10.1109/acomp.2017.26.
user experience better than ever. It is also possible to [7] Liu Z, Jing F, Fan J, Wang Z (2019) Implementation of
add a touch screen with Raspberry Pi, and then it will a FPGA-ARM-based Canny Edge Detection System.
be easier to use the interface. 2019 Chinese Control Conference (CCC). doi:
10.23919/chicc.2019.8865695.
This project is the only prototype. So, there are a few
[8] Patchava V, Kandala H, Babu P (2015) A Smart Home
things that need some more research work. Some up-
Automation technique with Raspberry Pi using IoT.
gradation can be done in the software part some in the
2015 International Conference on Smart Sensors and
hardware part. We are using the Raspberry Pi as the Systems (IC-SSS). doi:
heart of the project. This has a huge number of 10.1109/smartsens.2015.7873584.
features like the Camera Serial Interface (CSI), [9] Rohadi E, Suwignjo S, Pradana M et al. (2018) Internet
Display Serial Interface (DSI), Bluetooth those we are of Things: CCTV Monitoring by Using Raspberry Pi.
not using. So, it is a waste of resources. But if we can 2018 International Conference on Applied Science and
customize the hardware platform and keep only those Technology (iCAST). doi:
part that is needed for our project, then it will be more 10.1109/icast1.2018.8751612.
efficient in respect of power consumption. [10] Balon B, Simic M (2019) Using Raspberry Pi
Computers in Education. 2019 42nd International
Between the GUI interface and the web database we Convention on Information and Communication
are using HTTP connection as a communication Technology, Electronics and Microelectronics
medium. Due to this HTTP connection there is a (MIPRO). doi: 10.23919/mipro.2019.8756967.
certain delay between the button presses in the web [11] Yohan A, Lo N, Santoso L (2019) Secure and
interface and reflects the response in the hardware. Lightweight Firmware Update Framework for IoT
So, if we replace the Http connection by the TCP Environment. 2019 IEEE 8th Global Conference on
connection then this delay can be avoided. Consumer Electronics (GCCE). doi:
10.1109/gcce46687.2019.9015316.
REFERENCE [12] Son M, Kim H (2019) Blockchain-based secure
[1] Agarwal K, Agarwal A, Misra G (2019) Review and firmware management system in IoT environment.
Performance Analysis on Wireless Smart Home and 2019 21st International Conference on Advanced
Home Automation using IoT. 2019 Third International Communication Technology (ICACT). doi:
conference on I-SMAC (IoT in Social, Mobile, 10.23919/icact.2019.8701959.
Analytics and Cloud) (I-SMAC). doi: 10.1109/i- [13] Jinhui Q, Hui L, Junchao Y (2012) The Application of
smac47947.2019.9032629. Qt/Embedded on Embedded Linux. 2012 International
[2] Vishwakarma S, Upadhyaya P, Kumari B, Mishra A Conference on Industrial Control and Electronics
(2019) Smart Energy Efficient Home Automation Engineering. doi: 10.1109/icicee.2012.346.
System Using IoT. 2019 4th International Conference [14] Xibo W, Jianan Y (2009) Add Touch Screen Support
on Internet of Things: Smart Innovation and Usages for QT/Embedded. 2009 International Forum on
(IoT-SIU). doi: 10.1109/iot-siu.2019.8777607. Computer Science-Technology and Applications. doi:
[3] Khandelwal H, Mankodi P, Prajapati R (2017) 10.1109/ifcsta.2009.314.
Enhancement of automation testing system using Yocto
project. 2017 International conference of Electronics,
Communication and Aerospace Technology (ICECA).
doi: 10.1109/iceca.2017.8203630.
[4] Navik A, Muthuswamy D (2017) Dual band WLAN
gateway solutions in Yocto Linux for IoT platforms.
2017 International Conference on Internet of Things for
the Global Community (IoTGC). doi:
10.1109/iotgc.2017.8008968.
[5] Serban R, Culic I (2016) Configuring a cisco
IR829GW as an internet of things device. 2016 15th

558 2020 Fourth World Conference on Smart Trends in Systems, Security and Sustainability (WorldS4)

Authorized licensed use limited to: Fondren Library Rice University. Downloaded on October 26,2020 at 06:34:02 UTC from IEEE Xplore. Restrictions apply.

You might also like