Sei sulla pagina 1di 21

HANOI UNIVERSITY OF SCIENCE AND TECHNOLOGY

SCHOOL OF TELECOMMUNICATION ENGINEERING


***************

Smart Garden Project


INSTRUCTOR: PROFESSOR DR.VU VAN YEM

Name: Tran Viet Nghia


Student ID: 20123348
Class: Advanced program Telecommunication Engineering k57

CONTENTS
Introduction.............................................................................................................................................. 4
Objectives and scope .............................................................................................................................. 4
Research ................................................................................................................................................. 6
IOT ....................................................................................................................................................... 6
Cloud Services .................................................................................................................................... 7
Azure services ..................................................................................................................................... 8
Azure IOT hub .................................................................................................................................. 8
Azure Stream Analytics.................................................................................................................... 9
Azure Storage .................................................................................................................................. 9
Azure Virtual Machine ...................................................................................................................... 9
System description .................................................................................................................................. 9
Hardware ............................................................................................................................................... 12
Temperature sensor .......................................................................................................................... 12
Soil moisture sensor .......................................................................................................................... 12
light sensor ........................................................................................................................................ 14
Arduino Mega 2560 ........................................................................................................................... 14
Servo motor ....................................................................................................................................... 15
Fluorescent lamp ............................................................................................................................... 16
Electronic Water pump ...................................................................................................................... 16
Module Wifi ........................................................................................................................................ 17
Software ................................................................................................................................................ 18
CIrcuit Simulation .............................................................................................................................. 18
Cpu programming .............................................................................................................................. 18
Cloud programming ........................................................................................................................... 20
Evaluation.............................................................................................................................................. 20
Refferences ........................................................................................................................................... 21

Table of Figure
figure 2: Model(2) .................................................................................................................................... 5
figure 1: Model(1) .................................................................................................................................... 5
figure 3: Model(3) .................................................................................................................................... 6
figure 4: System Architecture ................................................................................................................ 10
figure 5: Block design ............................................................................................................................ 11
Figure 6: Model(3) ................................................................................................................................. 12
figure 7: Hardware selection ................................................................................................................. 12
figure 8: Soil moisture sensor................................................................................................................ 13
figure 9: Light sensor ............................................................................................................................. 14
figure 10: Arduino mega 2560 ............................................................................................................... 15
figure 11: Servor Motor ......................................................................................................................... 15
figure 12: Water pump........................................................................................................................... 17
figure 13: Module Wifi MKR1000 .......................................................................................................... 17
figure 14: Simulation ............................................................................................................................. 18
figure 15: Demo ..................................................................................................................................... 20
figure 16: app demo .............................................................................................................................. 21

INTRODUCTION
The need for a refreshing area indoor regardless the limit of space,
the demand for a place to grow fresh vegetables for daily usage is an
unanswered question nowadays. Although the trend of living style now
consists of the recreational area where people can get close to the
nature, people want a novel gardening model that's enjoyable and
appealing for all without the common hassles and mess. Combining with
the advanced of electronic embedded system, we come with the idea
making a smart garden. This garden will measure life sustained element
automatically and will adjust it automatically. Unsupervised gardening or
supervised remotely via internet will bring the breath of future to your
small garden
OBJECTIVES AND SCOPE
Automatic watering system
Automatic light measurement and light control
Temperature and moisture measurement
Easy to assemble and disassemble
Easy to replace and renew soil
Bluetooth control
Wifi connectable using as an IOT device
Control via android app
Compact and elegance design
IOT cloud system, analysis

figure 2: Model(1)

figure 1: Model(2)

figure 3: Model(3)

RESEARCH
IOT
The Internet of Things (IoT) is a system of interrelated computing
devices, mechanical and digital machines, objects, animals or people
that are provided with unique identifiers and the ability to transfer data
over a network without requiring human-to-human or human-tocomputer interaction.
A thing, in the Internet of Things, can be a person with a heart
monitor implant, a farm animal with a biochip transponder, an
automobile that has built-in sensors to alert the driver when tire pressure
is low -- or any other natural or man-made object that can be assigned
an IP address and provided with the ability to transfer data over a
network.

IoT has evolved from the convergence of wireless technologies,


micro-electromechanical systems (MEMS), microservices and the
internet. The convergence has helped tear down the silo walls between
operational technology (OT) and information technology (IT), allowing
unstructured machine-generated data to be analyzed for insights that will
drive improvements.
CLOUD SERVICES
A cloud service is any resource that is provided over the Internet.
The most common cloud service resources are Software as a Service
(SaaS), Platform as a Service (PaaS) and Infrastructure as a Service
(IaaS).
Cloud computing is the on-demand delivery of compute power,
database storage, applications, and other IT resources through a cloud
services platform via the internet with pay-as-you-go pricing. Cloud
computing provides a simple way to access servers, storage, databases
and a broad set of application services over the Internet.
Six Advantages and Benefits of Cloud Computing
Trade capital expense for variable expense
Instead of having to invest heavily in data centers and servers before
you know how youre going to use them, you can only pay when you
consume computing resources, and only pay for how much you
consume.
Benefit from massive economies of scale
By using cloud computing, you can achieve a lower variable cost than
you can get on your own. Because usage from hundreds of thousands of
customers are aggregated in the cloud, providers such as Amazon Web
Services can achieve higher economies of scale which translates into
lower pay as you go prices.
Stop guessing capacity
Eliminate guessing on your infrastructure capacity needs. When
you make a capacity decision prior to deploying an application, you often
either end up sitting on expensive idle resources or dealing with limited
capacity. With cloud computing, these problems go away. You can

access as much or as little as you need, and scale up and down as


required with only a few minutes notice.
Increase speed and agility
In a cloud computing environment, new IT resources are only ever
a click away, which means you reduce the time it takes to make those
resources available to your developers from weeks to just minutes. This
results in a dramatic increase in agility for the organization, since the
cost and time it takes to experiment and develop is significantly lower.
Stop spending money on running and maintaining data centers
Focus on projects that differentiate your business, not the
infrastructure. Cloud computing lets you focus on your own customers,
rather than on the heavy lifting of racking, stacking and powering
servers.
Go global in minutes
Easily deploy your application in multiple regions around the world
with just a few clicks. This means you can provide a lower latency and
better experience for your customers simply and at minimal cost.
AZURE SERVICES
Azure is the heart of the platform. Beside for ingestion device-to-cloud
telemetry data, it's also used for sending cloud-to-device messages (or
commands), and later for further analysis (hot or cold path) of ingested
data stream. Following Azure services are used:
AZURE IOT HUB
Azure IoT Hub is a fully managed service that enables reliable and
secure bidirectional communications between millions of IoT devices
and a solution back end. Azure IoT Hub:
Provides multiple device-to-cloud and cloud-to-device
communication options, including one-way messaging, file
transfer, and request-reply methods.
Provides built-in declarative message routing to other Azure
services.
Provides a queryable store for device metadata and synchronized
state information.

Enables secure communications and access control using perdevice security keys or X.509 certificates.
Provides extensive monitoring for device connectivity and device
identity management events.
Includes device libraries for the most popular languages and
platforms.

AZURE STREAM ANALYTICS


A Stream Analytics job definition includes inputs, a query, and output.
Inputs are from where the job reads the data stream, the query is used
to transform the data input stream, and the output is where the job sends
the job results to.
In this project, Azure Stream Analytics is used to process data stream
received by Azure IoT Hub in realtime. One of processing that's currently
performed is for knowing the rate of water level changes.
AZURE STORAGE
For current project, Azure Storage Account, especially table storage, is
used as the output of Azure Stream Analytics Job.
AZURE VIRTUAL MACHINE
Virtual Machine is used to host:
Node.js-based backend that consists of REST API and relay to reroute
messages from Azure IoT to client apps via web socket
MongoDB: database engine for storing device's data
Dashboard web app
SYSTEM DESCRIPTION
Sensor:
o Light sensor: Measure the amount of sun light radiated into
each plant
o Soil Moisture Sensor: Measure the moisture of the soil
o Atmostphere temperature and moisture sensor
CPU
o Send data acquired from sensor to the cloud to be analysed
in Azure Stream Analytics.
o All the data is stored in Azure Storage

o Action for actuators are guided by programmed Azure Virtual


Machine with the data taken from the Azure analytics and
Azure Storage
Actuator
o The watering system, guide water into each plant
o The window shading angle is adjustable base on the light
density and the time of the day.
o Fluorescent Lamp is used to provide light at night
o Mist creator system is used to maintain the moisture as well
as the enviroment temperature surrounding the plant.

figure 4: System Architecture

Electrical Valve

Light
sensors

CPU
Andruino

Fluorescent lamp
Plant

Earth
moisure
sensor

Servo system to open the


roof

Air
temperature,
moisure sensor

Mist maker

Module Wifi

Azure
Analytics

Azure
Virtual
Machine

App application

figure 5: Block design

Microsoft Azure IOT hub


Azure
Storage

Web application

HARDWARE

figure 7: Hardware selection

There are two functional components in this project. They are the
moisture sensors and the motor/water pump. Thus the Arduino Board is
programmed using the Arduino IDE software. The function of the
moisture sensor is to sense the level of moisture in the soil. The
motor/water pump supplies water to the plants
TEMPERATURE SENSOR

SOIL MOISTURE SENSOR


Soil moisture sensors measure the water content in soil. A soil
moisture probe is made up of multiple soil moisture sensors.
Technologies commonly used in soil moisture sensors include:
Figure 6: Model(3)

Frequency domain sensor such as a capacitance sensor.


Neutron moisture gauges, utilize the moderator properties of water
for neutrons.
Electrical resistance of the soil

figure 8: Soil moisture sensor

In this particular project, we will use the moisture sensors which can
be inserted in the soil , in order to measure the moisture content of the
soil.
Soil electrical conductivity is simply measured using two metal
conductors spaced apart in the soil except that dissolved salts greatly
alter the water conductivity and can confound the measurements. An
inexpensive fix is to embed conductors in a porous gypsum block which
releases calcium and sulphate ions to swamp the soil background level
of ions. The water absorbed by the block is correlated with soil water
potential over the range -60 to -600 kPa providing a tertiary indicator for
use in medium to heavy soils. Non-dissolving granular matrix sensors
are now available with a more exacting specification for the range 0 to 200 kPa and use internal calibration methods to offset variations due to
solutes and temperature.
Methods for exploiting soil dielectric properties actually measure
proxy variables that more or less include a component due to the soil
electrical conductivity and are thus inherently sensitive to variations in
soil salinity and temperature as well as water. Measurements are also
affected by soil bulk density and the proportion of bound and free water
determined by the soil type. Nevertheless, good accuracy and precision
can be achieved under specific conditions and some sensor types have
become widely adopted for scientific work.
In general, conversions from raw sensor readings to volumetric
moisture content or water potential using secondary or tertiary methods
tend to be sensor or soil specific, affected or precluded at high salinity
levels and dependent on temperature. Research-grade instruments

typically have laboratory measured accuracy worse than +/- 4% when


relying on factory settings or as good as +/- 1% when calibrated for the
specific soil. Sensors based on the TDR method seem to require least
calibration but may be unsuitable for soils with very high salinity or clay
content. There are no comparable laboratory specifications for granular
matrix sensors, possibly because they are technically more difficult to
calibrate, their response times are relatively slow and the output is
hysteretic for wetting and drying curves.
Soil dielectric measurement is the method of choice for most research
studies where expertise is available for calibration, installation and
interpretation, but scope for cost reduction through sensor multiplexing is
limited due to the possibility of stray capacitances. A lower
manufacturing cost is possible through development of application
specific integrated circuits (ASICS), though this requires a high level of
investment. Multiple sensors are required to provide a depth profile and
cover a representative area, but this cost can be minimized through use
of a computer model to extend the measurements in a predictive way.
Thus, by using the moisture sensors, the over-riding factor will be
reliable, costeffective sensors and electronic systems for accessing and
interpreting the data.
LIGHT SENSOR

figure 9: Light sensor

A Light Sensor is something that a robot can use to detect the


current ambient light level - i.e. how bright/dark it is. There are a range of
different types of light sensors, including 'Photoresistors', 'Photodiodes',
and 'Phototransistors'. The sensor included in the BOE Shield-Bot kit,
and the one we will be using, is called a Phototransistor.
ARDUINO MEGA 2560

figure 10: Arduino mega 2560

The Arduino Mega is a microcontroller board based on


the ATmega1280 .It has 54 digital input/output pins (of which 14 can be
used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial
ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an
ICSP header, and a reset button. It contains everything needed to
support the microcontroller; simply connect it to a computer with a USB
cable or power it with a AC-to-DC adapter or battery to get started. The
Mega is compatible with most shields designed for the Arduino
Duemilanove or Diecimila.
SERVO MOTOR
A servo is a rotary actuator that allows for precise control of
angular position, velocity and acceleration. It consists of a suitable motor
coupled to a sensor for position feedback. It also requires a relatively
sophisticated controller, often a dedicated module designed specifically
for use with servomotors.

figure 11: Servor Motor

Servomotors are not a different class of motor, on the basis of


fundamental operating principle, but use servo mechanism to achieve

closed loop control with a generic open loop motor. In other words, a
servomotor is just a regular motor with a sensor installed, typically to
measure angular position during operation. A servomotor is a specific
type of motor and rotary encoder combination that forms a
servomechanism. This assembly may in turn form part of another
servomechanism. The encoder provides position and usually speed
feedback, which by the use of a PID controller allow more precise
control of position and thus faster achievement of a stable position (for a
given motor power)
Servomotors are used for both high-end and low-end applications,
although the mid-range is generally handled by stepper motors. Most
servomotors, at least under this name, are precision industrial
components. However the very cheap radio control servo, because it
combines a free-running motor and a simple position sensor with an
embedded controller, also qualifies as a servomotor.
FLUORESCENT LAMP
Fluorescents are a large family of light sources. There are three
main types of fluorescent lamps: cold cathode, hot cathode,
and electroluminescent. They all use phosphors excited by electrons to
create light.
The standard fluorescent lamp was developed for commercial
use during the 1930's. The idea of the fluorescent lamp had been around
since the 1880's however it took steady work over the decades to finally
create a working commercially viable model. This work was done by
many, not one single inventor.
Common uses: lamps both outdoor and indoor, backlight for LCD
displays, decorative lighting and signs, both high bay and small area
general lighting. Not used for lighting from afar due to diffused nature of
the light.
ELECTRONIC WATER PUMP
The water pump is used to artificially supply water for a particular
task. It can be electronically controlled by interfacing it to a
microcontroller. It can be triggered ON/OFF by sending signals as
required. The process of artificially supplying water is known as
pumping. There are many varieties of water pumps used. This project
employs the use of a small water pump which is connected to a HBridge.

figure 12: Water pump

The pumping of water is a basic and practical technique, far more


practical than scooping it up with one's hands or lifting it in a hand-held
bucket. This is true whether the water is drawn from a fresh source,
moved to a needed location, purified, or used for irrigation, washing, or
sewage treatment, or for evacuating water from an undesirable location.
Regardless of the outcome, the energy required to pump water is an
extremely demanding component of water consumption. All other
processes depend or benefit either from water descending from a higher
elevation or some pressurized plumbing system.
MODULE WIFI

figure 13: Module Wifi MKR1000

Arduino MKR1000: the brain with built-in WiFi module to connect to


internet
Overview
Arduino MKR1000 has been designed to offer a practical and cost
effective solution for makers seeking to add WiFi connectivity to their
projects with minimal previous experience in networking. The design
includes a Li-Po charging circuit that allows the Arduino MKR1000 to run
on battery power or external 5V, charging the Li-Po battery while running

on external power. Switching from one source to the other is done


automatically.
Technology
MKR1000 has a good 32 bit computational power similar to the Zero
board, the usual rich set of I/O interfaces, low power WiFi with a
Cryptochip for secure communication, and the ease of use of the
Arduino Software (IDE) for code development and programming. All
these features make this board the preferred choice for the emerging IoT
battery-powered projects in a compact form factor.
SOFTWARE
CIRCUIT SIMULATION

figure 14: Simulation

CPU PROGRAMMING
Arduino Eclipse IDE
The open-source Arduino environment makes it easy to write code and
upload it to the i/o board. It runs on Windows, Mac OS X, and Linux. The

environment is written in Java and based on Processing, avr-gcc, and


other open source software.
Steps for using Arduino IDE:
Step 1: Get an Arduino board and USB cable
In this tutorial, we assume you're using an Arduino Mega. You also need
a standard USB cable (A plug to B plug): the kind you would connect to
a USB printer, for example
Step 2 : Download the Arduino environment
Get the latest version from the download page. When the download
finishes, unzip the downloaded file. Make sure to preserve the folder
structure. Double-click the folder to open it. There should be a few files
and sub-folders inside.
Step 3 : Connect the board
The Arduino Uno, Mega, Duemilanove and Arduino Nano automatically
draw power from either the USB connection to the computer or an
external power supply. If you're using an Arduino Diecimila, you'll need
to make sure that the board is configured to draw power from the USB
connection. The power source is selected with a jumper, a small piece of
plastic that fits onto two of the three pins between the USB and power
jacks. Check that it's on the two pins closest to the USB port. Connect
the Arduino board to your computer using the USB cable. The green
power LED (labelled PWR) should go on.
Step 4 : Install the drivers
Installing drivers for the Arduino Uno or Arduino Mega 2560 with
Windows7, Vista, or XP
Step 5: Launch the Arduino application
Double-click the Arduino application. (Note: if the Arduino software loads
in the wrong language, you can change it in the preferences dialog. See
the environment page for details.)
Step 6: Open the blink example
Open the LED blink example sketch: File > Examples > 1.Basics > Blink.
Step 7: Select your board
You'll need to select the entry in the Tools > Board menu that
corresponds to your Arduino.
Step 8: Select your serial port
Select the serial device of the Arduino board from the Tools | Serial Port
menu. This is likely to be COM3 or higher COM1and COM2 are usually

reserved for hardware serial ports). To find out, you can disconnect your
Arduino board and re-open the menu; the entry that disappears should
be the Arduino board. Reconnect the board and select that serial port.
Step 9 : Upload the program
Now, simply click the "Upload" button in the environment. Wait a few
seconds - you should see the RX and TX leds on the board flashing. If
the upload is successful, the message "Done uploading." will appear in
the status bar.
CLOUD PROGRAMMING
Microsoft Azure
EVALUATION
Due to the shortage of time we are not able to make the cloud into
fuction properly. That is why we build up the demo with Bluetooth
connection to the android app that can manually function the actuator or
the actuator can work automatically

figure 15: Demo

figure 16: app demo

REFFERENCES
Project gallon: Project "Gallon" - Smart Drinking Water Monitoring
Platform
Microsoft Azure: https://azure.microsoft.com/en-us/
https://docs.microsoft.com/en-us/azure/stream-analytics/streamanalytics-scale-jobs
https://azure.microsoft.com/en-us/services/iot-hub/

Potrebbero piacerti anche