0% found this document useful (0 votes)
17 views

Developing a Low-cost Smart Terrarium in the Context of Home Automation Applications

Uploaded by

hyoukiinc
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)
17 views

Developing a Low-cost Smart Terrarium in the Context of Home Automation Applications

Uploaded by

hyoukiinc
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/ 5

10th International Conference on Applied Information and Internet Technologies - AIIT 2020

October 16th, 2020, Zrenjanin, Serbia


________________________________________________________________________________________________

Developing a low-cost Smart Terrarium in the


Context of Home Automation Applications

Traian Stanciu, Răzvan Bogdan and Marius Marcu*


*
Politehnica University of Timișoara
Computers and Information Technology Department, Timișoara, Romania
[email protected], [email protected], [email protected]

Abstract – The concept of Internet-of-Things (IoT) requires industry is rapidly expanding with the market size
the connection of heterogeneous devices with the goal of projected to be around $114 billion by 2025 [3].
offering improved services for the users. One of the main Nowadays there are different home automation systems
directions in this domain is the development of Home already implemented. These systems help people to
Automation (HA) applications. This implies monitoring and control their houses easily and to secure them. Basically
controlling of different home appliances by taking into the user can control the lights, climate and the home
consideration IoT-specific communication technologies. Our security system by an application on mobile or tablet.
paper presents the development of a Smart Terrarium in Such kind of systems can be expensive. First, we should
the context of HA user-centric applications.
buy necessary equipment for manage the lights in the
house, for example the Philips Hue starter pack costs
I. INTRODUCTION about $200 and additional bulbs are $60 each. When we
are talking about the climate control the most used and
The “Smart City – Smart Home” paradigm is one of popular device is the Nest Learning Thermostat, its price
the central technological developments in the present being around $250 and a smart air conditioner is about
society. This trend is based on the concept of Internet-of- $280, the most popular is Aros Smart Air Conditioner. At
Things (IoT) in which different classical objects (called the security system the market offers Dropcam Pro
things) are communicating between themselves in order to Security Camera, which is one of the best-selling products
transmit data coming from a large number of sensors. The in the smart home security category, its price being about
computing power is partially realized onto all these $200. The total amount for such a system would be around
devices, therefore the edge computing approach coming 1000$. Therefore our aim is to build a low-cost solution
into place. for the ST.
The IoT-based smart home implementations have The rest of the paper is structured as follows: section II
become a noticeable area of research [1]. The state-of-the- will present previous work. Section III will discuss the
art scientific literature, but also industrial approaches proposed architecture and obtained results, while section
focus on two main directions: smart home applications IV will highlight conclusions and future work.
development and solving issues into the standards,
communication protocols, but also human-
communication interfaces [2]. II. PREVIOUS WORK

This paper is proposing a low-cost architecture in The problem of low-cost solutions for smart home
order to implement a Smart Terrarium (ST). Our project applications has been previously addressed into the
lies in the category of Home Automation (HA) scientific literature. In [4] is presented an architecture
applications, being part of the smart home paradigm. The based on STM32F407 microcontroller which is reducing
problems we are trying to address are as follow: the energy from a smart home with 40%. The core board
of this project is a Mikromedia 7 Board and this has been
· How can a user grow plants in an environment implemented in Timisoara, Romania. In [5], the user
that is not well suited for them because of bad interface of a home automation solution is offered via a
lighting or humidity? mobile applications. This project is using Google
assistance for voice command. The home appliance
· How can the user monitor the health of the plants devices are commanded by a Node MCU V3 ESP8266
with real time sensor data such as temperature, air board. Different types of testing techniques have been
humidity, soil humidity, soil Ph and so on? used in order to demonstrate the correct functioning of this
· How could a ST system ensure that the user’s solution. The low-cost scenario in home automation has
plants get the required amount of water? been addressed in [6] based on power line communication,
by using Cypress CY8CPLC10. This is an integrated
· How could a ST system ensure that the plants power line communication chip which embeds both a
remain healthy? PHY modem and a network protocol stack. A detailed
Home automation is a largely fragmented industry implementation of a smart home is presented in [6] by
with standards being under development. Even so, the presenting a scale model that represents a smart home. In

19
10th International Conference on Applied Information and Internet Technologies - AIIT 2020
October 16th, 2020, Zrenjanin, Serbia
________________________________________________________________________________________________

Figure 1. Hardware architecture of the Smart Terrarium


[7] we can find a home automation application for people receive power whenever there is power in the
in developing countries, while in [8] the problem of circuit. This functioning mode is ideal for
mobile user interface has been addressed in the context of supplying power back to our Raspberry Pi, as it
a smart task scheduling technique. does not require input signal to function.
· Normally Open (NO) - The normally open
III. PROPOSED SOLUTION functioning mode requires a high input signal in
order to close the circuit and thus provide power.
A. Hardware Implementation We will be using this functioning mode to supply
The hardware implementation of the Smart Terrarium power to the LEDs, water pump and cooling
solution is based on RaspberryPi 3 model B version 1.2, system.
being presented in Figure 1. The 4 channel relay module is
fundamental to our application as it will allow us to Taking advantage of the NC, NO functioning modes
programmatically control four different high current we will design our circuit in order to have one supply for
appliances. The module’s 4 inputs will be connected to the the microcontroller and 3 other for the equipment we will
Raspberry Pi’s GPIO pins thus allowing us to control be controlling.
whether the relays are turned on or off depending on the For the terrarium’s watering system we will be using a
signal value that we send from the Raspberry Pi’s 3-6V DC powered submersible micro water pump. The
connected pins. The module offers two different pump in question features: DC Voltage: 2.5-6V;
functioning modes for the relay outputs: Maximum lift: 40-110cm; Outside diameter of water
outlet: 7.5mm; Inside diameter of water outlet: 4.7mm;
· Normally Closed (NC) - The normally closed
Diameter: approx. 24mm; Length: approx. 45mm; Height:
functioning mode does not require an input signal
approx. 33mm. We will require a 220V AC to 5V DC to
in order to close the circuit, thus anything
power our pump from our 4 channel relay, as we are
connected to the NC port will automatically
running 220V AC. We will also require an irrigation

20
10th International Conference on Applied Information and Internet Technologies - AIIT 2020
October 16th, 2020, Zrenjanin, Serbia
________________________________________________________________________________________________

system in order to distribute water properly through our B. Software Architecture


terrarium and we will be using a dripping micro irrigation The client-server application over LAN of our project
system. The pump will reside in a water filled container is presented in Figure 3.
and when powered on push water through to our irrigation
system.
In order to provide the required light for growing
plants we will need a full spectrum lamp that can provide
the appropriate Red / Blue colors as well as UV and IR
colors. For our projects we will be using a LED lamp that
features: 67 pieces red (620-630nm, 655-660nm); 15
pieces blue (440-450nm, 450-460nm); 8 pieces Warm
White (3500k - 4000k); 8 pieces White (6000k); 1 pieces
IR (730nm); 1 pieces UV (380-410nm). The lamp will
also require a 220V AC to 50-60V DC converter in order
to be powered.
For our temperature and air humidity sensor we will be Figure 3. Client - Server application over LAN
using an AM2302 sensor from Adafruit. The AM2302 is a In this project we will be using Node.js to turn our
wired version of the DHT22, in a large plastic body. It is a Raspberry Pi into a simple but powerful Web Server that
basic, low-cost digital temperature and humidity sensor. It will be accessible to any of the devices connected to the
uses a capacitive humidity sensor and a thermistor to same network as the Raspberry Pi. The intent is to
measure the surrounding air, and spits out a digital signal implement a simple RESTful API that will allow a client
on the data pin (no analog input pins needed). It’s fairly device to interact with the Raspberry Pi’s inputs and
simple to use, but requires careful timing to grab data. The outputs. To power up our Node server we will also be
only real downside of this sensor is the fact that the user using the Express framework for NodeJS, which will add
can only get new data from it once every 2 seconds, so a thin layer of fundamental web application features and
sensor readings can be up to 2 seconds old. provide us with all the needed tools to create a robust API.
An example flow that we are trying to achieve would look
like this:
· Raspberry Pi is connected to the network with an
IP address such as 192.168.1.131
· NodeJS is installed on the Raspberry and
listening on port 3000
· A request is received on port 3000: POST
http://192.168.1.131:3000/set/lights/on
· NodeJS will request the execution of a Python
script that turns on the input connected to one of
the relays where the lights power source is
connected
· Lights are turned on.
For our client application we require a cross platform
solution that will be able to interact with our RaspberryPi
Figure 2. Terrarium Components Box
web server and perform simple HTTP requests. For this
reason we have chosen to work with React Native. React
Our environment will require a (mostly) enclosed Native is a framework for cross-platform mobile app
container that will be able to hold all our electronics development for iOS and Android, developed by
components in a compartment separate from the one Facebook and first released in 2015. To help us quickly
which will hold our soil and plants. A custom made get started and have a cross platform compatible mobile
acrylic sheet terrarium will be used for this project, application we will specifically be using the Expo
although a glass terrarium could work as well. The main framework. The mobile application use cases diagram are
body of the terrarium is built from 5 transparent acrylic presented in Figure 4. As we can see in the diagram there
sheets made out of 5mm thick acrylic sheets with a size of are 6 main activities that the user can perform while
W:800mm x L:450mm and H:450mm. Additionally we interacting with our application.
will have a custom made box that will act as our cover for
the terrarium, which will hold all of our electrical and · Configure WiFi activity: This activity can only
electronics components, as well as having proper airways happen when the Smart Terrarium is first
for cooling. configured, or when the WiFi network has
changed. In this activity the user is required to
connect to the WiFi access point created by the
Smart Terrarium and then provide it with a SSID

21
10th International Conference on Applied Information and Internet Technologies - AIIT 2020
October 16th, 2020, Zrenjanin, Serbia
________________________________________________________________________________________________

and passkey, so that the Smart Terrarium can in background process that will continuously check any
turn connect to the local area network. scheduled tasks against the current time and run them
when appropriate.

Figure 5. Executing Scheduled Tasks Diagram


Figure 4. Application Use Cases Diagram

· Toggle Lights/Water On/Off: The toggle activity In order to execute the scheduled automated tasks, we
is the most basic activity that the application will be using the javascript setInterval() method which is
provides and it offers the user the ability to turn also supported by NodeJS. This function will accept a
delay and a callback as parameters and will execute the
either the lights or the water on or off by simply
callback every delay milliseconds. Thus we will create a
touching a button from within their mobile
function that will check the current time, compare it to any
application. In other words the mobile device
scheduled tasks time stored in Redis and execute the task
becomes a power switch for the terrarium lights or
at the appropriate time.
water.
· Schedule Lights/Water: The Schedule activity IV. OBTAINED RESULTS
provides full automation of the lights & water
systems of the terrarium. This setting will enable One of the main directions of this solution is to obtain
the setting of (daily) time ranges in which the a low-cost Smart Terrarium. This has been obtained by the
lights/water of the terrarium will turn on, and of price of the used components, which is approximately a
course turn themselves back off when the time total of 100$. The mobile application developed for the
range has finished. project is presented in Figure 6.

· View temperature & humidity: The user wants to


see the temperature & humidity data of the Smart
Terrarium so the use only needs to open the
application. The latest data is shown and
automatically refreshed every 60s with new data.
Additionally the user can force an update of data
by pressing the “sync now” button.
A very important feature of the application is that of
the automation process in the entire project. We could, for
example, want to schedule a daily watering task, or tell
our Smart Terrarium how much light a day the plants
should receive. A client could make a request to turn the
lights on every day starting at 8:00PM for a duration of 12
hours. Or we could have a daily watering task that tells Figure 6. Mobile application interface
our terrarium to start the watering pump each day at
2:00PM for a total of 10 minutes. The test cases which were developed for the system,
shows that the project has achieved the following
In order to do that we will need a data store to be able statistics, which indicates a very high coverage:
to memorize our scheduled tasks and ensure they are not
lost on a power outage, and additionally we will need a · 87,5% code coverage for all statements

22
10th International Conference on Applied Information and Internet Technologies - AIIT 2020
October 16th, 2020, Zrenjanin, Serbia
________________________________________________________________________________________________

· 92.31% code coverage for all branches circuit and 2 contacts. COB LEDs are far more energy
efficient and provide a far better lumen per watt ratio, and
· 100% code coverage for all functions additionally the driverless versions allow us to connect the
· 100% code coverage for all lines. LED directly to 220AC power, without the need of an
intermediate transformer.
The goal of the unit test developed is to cover as much
of the code as possible - this way we can be certain when
deploying new features that all our present features are
still functioning correctly. We are aiming for an above REFERENCES
80% coverage of all our code. [1] K. Agarwal, A. Agarwal and G. Misra, “Review and Performance
Analysis on Wireless Smart Home and Home Automation using
IoT,” Proc. of The IEEE Third International conference on I-
V. CONCLUSION AND FUTURE WORK SMAC (IoT in Social, Mobile, Analytics and Cloud) (I-SMAC),
The present article underlines a Smart Terrarium Palladam, India, 2019.
solution in the context of Home Automation applications. [2] S. Mehrotra, R. Dhande, “Smart cities and smart homes:
The Smart Terrarium project is an ongoing project, being From realization to reality,” Proc. of The International
Conference on Green Computing and Internet of Things
highly scalable as well as flexible, and can be turned into a (ICGCIoT), 2015.
smart grow box or expanded to a larger scale growing [3] Fortune Business Insights, Report ID: FBI100074, Home
environment. Automation Market Size Predictions and Regional Forecast 2018-
2025, [online], https://www.fortunebusinessinsights.com/industry-
The project is scalable and allows for a large number reports/home-automation-market-100074, accessed on
of expansions and optimizations from a hardware and 28/06/2020.
software point of view. A number of additional sensors [4] S. Matlak, R. Bogdan, Reducing Energy Consumption in Home
and components could be added to the terrarium in order Automation based on STM32F407 Microcontroller, 4th
to increase its versatility such as: Telecommunications Forum TELFOR, Belgrade, Serbia, 2016.
[5] Poonphon Suesaowaluk, Home Automation System Based Mobile
· A sensor for measuring soil humidity Application, Proc. of The IEEE 2nd World Symposium on
Artificial Intelligence (WSAI), Guangzhou, China, 2020.
· A sensor to measure soil acidity [6] M. Muttillo, V. Muttillo, L. Pomante, L. Pantoli, A Low Cost and
Flexible Power Line Communication Sensory System for Home
· A sensor to measure the quality of light received Automation, Proc. of IEEE International Workshop on Metrology
(lumen) for Industry 4.0 & IoT, Rome, Italy, 2020.
· A sensor to measure the amount of UV light [7] D.-I. Gota, A. Puscasiu, A. Fanca, L. Miclea, H. Valean, Smart
home automation system using Arduino microcontrollers, Proc. of
received The IEEE International Conference on Automation, Quality and
Testing, Robotics (AQTR), Cluj-Napoca, Romania, 2020.
· A video camera with which we could stream the
[8] Anand Vignesh, V. Vel, D. Purusothaman, V.
contents of our terrarium and have constant Vijayaraghavan, “Low-Cost Non-Intrusive Residential Energy
supervision. Monitoring System”, Proc. of The IEEE Conference on
Technologies for Sustainability (SusTech), 2014.
Additionally as far as the LED lighting goes a new
[9] K. Baraka, M. Ghobril, S. Malek, R. Kanj, A. Kayssi, “Low
type of LED has recently been developed that could have cost Arduino/Android-based Energy-Efficient Home Automation
a very positive impact on the project: the driverless COB System with Smart Task Scheduling”, Proc. of The Fifth
LED. COB, which stands for chip on board, is a circuit International Conference on Computational Intelligence,
which contains multiple diodes (9 or more) with only 1 Communication Systems and Networks (CICSyN), 2013.

23

You might also like