You are on page 1of 197

MINISTRY OF EDUCATION AND

TRAINING

FPT UNIVERSITY

Capstone Project Document


Design and Implement
The model of Smart Garden
Group 1
Phan Thnh Sang Sangptse61252
Group
Phm Hong Chinh Chinhph60147
L Vn Php - Phaplvse60608
members
Hunh Hu Ngh - Nghihhse61055 (Drop out)
Supervisor Nguyn c Li - Loind
Ext. N/A
Supervisor
Capstone DIMOSG
Project code

-Ho Chi Minh City, 10th May 2016 -

Capstone Project 2016: Design and Implement The Model of Smart Garden

Acknowledgment
We would like to give a special shout-out to our beloved teacher
and our mentor, Mr Nguyen Duc Loi, for his professional guidance,
his conscientious teachings and his contributive advices during entire
time of this capstone project.

SUMMER 2016

PAGE 1 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Table of Contents
Acknowledgment ............................................................................................... 1
Table of Contents ............................................................................................... 2
List of Tables ...................................................................................................... 6
List of Figures ..................................................................................................... 9
A. Report No. 1 Introduction........................................................................ 14
1. Project Information ................................................................................. 14
2. Introduction ............................................................................................. 14
3. Current Situation ..................................................................................... 14
4. Problem Definition .................................................................................. 16
5. Proposed Solution ................................................................................... 17
5.1. Feature functions .............................................................................. 18
5.2. Advantage and Disadvantage ........................................................... 18
6. Functional Requirements ........................................................................ 19
7. Role and Responsibility .......................................................................... 19
B. Report No. 2 Software Project Management Plant ............................... 20
1. Problem Definition .................................................................................. 20
1.1. Name of this Capstone Project ......................................................... 20
1.2. Problem Abstract.............................................................................. 20
1.3. Project Overview.............................................................................. 20
2. Project organization ................................................................................ 29
2.1. Software Process Model................................................................... 29
2.2. Roles and responsibilities................................................................. 30
2.3. Tools and Techniques ...................................................................... 31
3. Project Management Plan ....................................................................... 32
3.1. Software development life cycle ...................................................... 32
3.2. Increment Detail ............................................................................... 34
3.3. Task sheet ......................................................................................... 38
3.4. All Meeting Minutes ........................................................................ 38
4. Coding Convention ................................................................................. 38
C. Report No. 3 Software Requirement Specification................................ 39
SUMMER 2016

PAGE 2 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
1. User Requirement Specification ............................................................. 39
1.1. Model requirements ......................................................................... 39
1.2. Monitoring the status of garden ....................................................... 39
1.3. Response with expected problems ................................................... 39
1.4. Manage the model ............................................................................ 39
1.5. Schedule ........................................................................................... 39
1.6. Consumption and durability ............................................................. 39
1.7. Security ............................................................................................ 39
1.8. Interoperability ................................................................................. 39
2. System Requirement Specification ......................................................... 40
2.1. External Interface Requirement ....................................................... 40
2.2. System Overview Use Case ............................................................. 51
2.3. List of Use Case ............................................................................... 52
3. Software System Attribute ...................................................................... 88
3.1. Usability ........................................................................................... 88
3.2. Reliability ......................................................................................... 88
3.3. Availability....................................................................................... 88
3.4. Security ............................................................................................ 88
3.5. Maintainability ................................................................................. 88
3.6. Portability ......................................................................................... 88
3.7. Performance ..................................................................................... 88
4. Conceptual Diagram ............................................................................... 89
D. Report No. 4 Software Design Description ............................................ 90
1. Design Overview..................................................................................... 90
2. System Architecture Design.................................................................... 91
2.1. Software Architecture Description .................................................. 92
2.2. Hardware Architecture Description ................................................. 93
2.3. Software Hardware Connection Architecture Description ......... 111
3. Component Diagram ............................................................................. 112
3.1. Physical Component Diagram ....................................................... 112
3.2. Logical Component Diagram ......................................................... 113
4. Detailed Description ............................................................................. 114
SUMMER 2016

PAGE 3 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.1. Class Diagram ................................................................................ 114
4.2. Class Diagram Explanation............................................................ 114
4.3. Interaction Diagram ....................................................................... 117
5. Interface................................................................................................. 129
5.1. Component Interface ...................................................................... 129
5.2. User Interface Design..................................................................... 130
6. Database Design .................................................................................... 141
6.1. Entity Relationship Diagram (ERD) .............................................. 141
6.2. Data Dictionary .............................................................................. 142
7. Flowchart............................................................................................... 145
7.1. Add index of sensors to database ................................................... 145
7.2. Control Water Pump through Algorithm ....................................... 146
7.3. Control Light through Algorithm................................................... 147
E. Report No. 5 System Implementation & Test ...................................... 148
1. Introduction ........................................................................................... 148
1.1. Overview ........................................................................................ 148
1.2. Test Approach ................................................................................ 148
2. Database Relationship Diagram ............................................................ 148
2.1. Physiscal Diagram.......................................................................... 148
2.2. Data Dictionary .............................................................................. 149
3. Performance Measures .......................................................................... 152
4. Test plan ................................................................................................ 152
4.1. Features to be tested ....................................................................... 152
4.2. Features not to be tested:................................................................ 154
4.3. Test environment............................................................................ 154
5. System Testing Test Case ..................................................................... 155
5.1. Component Testing ........................................................................ 155
5.2. Integration Test .............................................................................. 172
F. Report No. 6 Software Users Manual .................................................. 177
1. Installation Guide .................................................................................. 177
1.1. Setting up environment .................................................................. 177
1.2. Setting up the environment at server side ...................................... 177
SUMMER 2016

PAGE 4 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
1.3. Setting up the environment at client side ....................................... 183
2. Users Guide.......................................................................................... 186
2.1. Login .............................................................................................. 186
2.2. Show zone ...................................................................................... 187
2.3. Add zone ........................................................................................ 188
2.4. Library info .................................................................................... 189
2.5. Add new plant ................................................................................ 190
2.6. Show plant info .............................................................................. 191
2.7. Update Zone ................................................................................... 192
2.8. Show sensor info ............................................................................ 193
2.9. History sensor ................................................................................ 194
2.10. Show actuator .............................................................................. 195

SUMMER 2016

PAGE 5 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

List of Tables
Table A-1: Role and Responsibility ................................................................ 19
Table B-1: Hardware Requirements - Sub Controller .................................... 26
Table B-2: Hardware Requirement - Main Controller .................................... 26
Table B-3: Hardware Requirements - Mobile Device .................................... 26
Table B-4: Hardware Requirement - Webserver ............................................ 27
Table B-5: Software Requirements of Project Management .......................... 27
Table B-6: Software Requirements of Embedded Development.................... 27
Table B-7: Software Requirement of Software Development ........................ 28
Table B-8: Roles and Responsibilities ............................................................ 30
Table B-9: Tools and Techniques ................................................................... 31
Table B-10: Software development life cycle ................................................ 32
Table B-11: Increment 0: Analysis and Research........................................... 34
Table B-12: Increment 1: Research - Planning - Design ................................ 35
Table B-13: Increment 2: Implementation ...................................................... 36
Table B-14: Increment 3: Merge Implementation - Testing ........................... 36
Table B-15: Increment 4: Deployment ........................................................... 37
Table C-1: Raspberry Pi 3 Hardware Specification ........................................ 41
Table C-2: Comparison of Standard Wireless Network Protocol................... 43
Table C-3: CC1310 Launchpad Specification ................................................ 45
Table C-4: Description of Light Sensor .......................................................... 46
Table C-5: Description of Temperature & Humidity Sensor ......................... 47
Table C-6: Description of Soil Moisture Sensor............................................. 48
Table C-7: Description of Analog pH Meter Module Kit............................... 49
Table C-8: <Guest>Login use case ................................................................. 52
Table C-9: <User> View Zone Use Case ....................................................... 54
Table C-10: <User> Add Zone Use Case ....................................................... 55
Table C-11: <User> Update Zone Use Case................................................... 57
Table C-12: <User> Delete Zone Use Case .................................................... 58
Table C-13: <User> View Library Use Case .................................................. 60
Table C-14: <User> Add Library Use Case ................................................... 61
Table C-15: <User> View Temperature Specification ................................... 63
Table C-16: <User> Get Humidity Specification ........................................... 64
Table C-17: <User> Get Light Index Specification........................................ 65
Table C-18: <User> Get pH Degree Specification ......................................... 66
Table C-19: <User> Get Soil Moisture Specification .................................... 67
Table C-20: <User> Switch On/Off Light Specification ................................ 68
Table C-21: <User> Change Control Mode Specification ............................. 70
Table C-22: <User> Switch On/Off Roof in Automatic Specification .......... 72
Table C-23: <User> Switch On/Off Water in Automatic Specification......... 73
Table C-24: <User> Switch On/Off Misting in Manual Use Case ................. 74
Table C-25: <User> Switch On/Off Roof in Manual Specification ............... 75
SUMMER 2016

PAGE 6 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Table C-26: <User> Switch On/Off Water in Manual Specification ............. 76
Table C-27: <User> Switch On/Off Misting in Manual Specification........... 77
Table C-28: <Main Controller> Switch On/Off Light Specification ............. 79
Table C-29: <Main Controller> Switch On/Off Water Specification ............ 80
Table C-30: <Main Controller> Switch On/Off Misting Specification.......... 81
Table C-31: <Main Controller> Switch On/Off Roof Specification .............. 82
Table C-32: <Main Controller> Tracking Ambient Light Specification........ 83
Table C-33: <Main Controller> Tracking Temperature Specification ........... 84
Table C-34: <Main Controller> Tracking Humidity Specification ................ 85
Table C-35: <Main Controller> Tracking pH Degree Specification .............. 86
Table C-36: <Main Controller> Tracking Soil Moisture Specification ......... 87
Table D-1: Detail Description of Raspberry Pi 3............................................ 94
Table D-2: Detail Description of CC1310 LaunchPad in Main Controller .... 96
Table D-3: BH1750 Ouput Pins ...................................................................... 99
Table D-4: HDC1008 Output Pins ................................................................ 101
Table D-5: Soil Moisture Sensor Output Pins .............................................. 103
Table D-6: Module pH Meter Kit Output Pins ............................................. 104
Table D-7: LM2576-ADJ Description .......................................................... 104
Table D-8: Switch Description...................................................................... 106
Table D-9: Tantalum Capacitors Description ............................................... 106
Table D-10: CAP 10F 50V CERM CHIP 0805 SMD Description ............ 107
Table D-11: CAP 100nF 50V CERM CHIP 0805 SMD Description .......... 107
Table D-12: CAP 100nF 50V CERM CHIP 0805 SMD Description .......... 108
Table D-13: USB Female Description .......................................................... 108
Table D-14: RH127 100uH 3A ..................................................................... 109
Table D-15: PC817X2NIP0F ........................................................................ 109
Table D-16: ULN2003A Description ........................................................... 110
Table D-17: SMD 0805 5% Resistor ........................................................... 110
Table D-18: Relay YL303H-S-5VDC Description....................................... 111
Table D-19: Component Dictionary ............................................................. 113
Table D-20: Library Info Explanation .......................................................... 114
Table D-21: Account Explanation ................................................................ 115
Table D-22: User Library Explanation ......................................................... 115
Table D-23: Zone Explanation ...................................................................... 115
Table D-24: Sensor Info Explanation ........................................................... 116
Table D-25: End Devices Explanation.......................................................... 116
Table D-26: Component Interface ................................................................ 129
Table E-1: Hardware Test Plan ..................................................................... 152
Table E-2: Software Test Plan ...................................................................... 154
Table E-3: Test case of ambient light ........................................................... 155
Table E-4: Test case of Temperature and Humidity ..................................... 156
Table E-5: Test case of Soil Moisture Sensor ............................................... 157
Table E-6: Test Case of pH Meter Kit .......................................................... 158
SUMMER 2016

PAGE 7 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Table E-7: Test Case of DIO Control End Devices ...................................... 158
Table E-8: Test Case of CC1310 LaunchPad ............................................... 159
Table E-9: Test Case of Raspberry Pi 3 ........................................................ 163
Table E-10: Test Case of Mobile App .......................................................... 164
Table E-11: Test Case of Webserver ............................................................ 166
Table E-12: Test Case Integration Test......................................................... 172

SUMMER 2016

PAGE 8 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

List of Figures
Figure A-1: Overview of Edyn System........................................................... 15
Figure A-2: Overview of Parrot device........................................................... 15
Figure A-3: Wireless Sensor Network in Agriculture .................................... 16
Figure A-4: System Introduction Overview.................................................... 17
Figure B-1: Network Topology Overview ...................................................... 21
Figure B-2: Proposed Solution System Overview .......................................... 22
Figure B-3: Peripheral Block in System ......................................................... 23
Figure B-4: Main Controller in System .......................................................... 23
Figure B-5: Webserver in System ................................................................... 24
Figure B-6: Mobile User in System ................................................................ 24
Figure B-7: 6LoWPAN Mesh Network .......................................................... 25
Figure B-8: Scrum Model ............................................................................... 29
Figure C-1: Raspberry Pi 3 Overview............................................................. 40
Figure C-2: CC1310 LaunchPad Description ................................................. 42
Figure C-3: Ambient Light Sensor.................................................................. 46
Figure C-4: Temperature and Humidity Sensor.............................................. 47
Figure C-5: Soil Moisture Sensor ................................................................... 48
Figure C-6: Platforms of mobile devices ........................................................ 50
Figure C-7: System Overview Use Case......................................................... 51
Figure C-8: <Guest> Login use case............................................................... 52
Figure C-9: <User> Manage Zone Overview Use Case ................................. 53
Figure C-10: <User> View Zone Use Case .................................................... 54
Figure C-11: <User> Add Zone Use Case ...................................................... 55
Figure C-12: <User> Update Zone Use Case ................................................. 57
Figure C-13: <User> Delete Zone Use Case .................................................. 58
Figure C-14: <User> Manage Library Overview Use Case ........................... 59
Figure C-15: <User> View Library Use Case ................................................ 59
Figure C-16: <User> Add Library Use Case .................................................. 61
Figure C-17: <User> View Sensor Status Use Case....................................... 63
Figure C-18: <User> Get Light Use Case....................................................... 63
Figure C-19: <User> Get Humidity Use Case ................................................ 64
Figure C-20: <User> Get Light Index Use Case ............................................ 65
Figure C-21: <User> Get pH Degree Use Case .............................................. 66
Figure C-22: <User> Get Soil Moisture Use Case ......................................... 67
Figure C-23: <User> Control End Devices Overview Use Case ................... 68
Figure C-24: <User> Switch On/Off Light ..................................................... 68
Figure C-25: Change Control Mode Use Case ............................................... 69
Figure C-26: Control Manual Use Case .......................................................... 70
Figure C-27: <User> Change Control Mode Use Case .................................. 70
Figure C-28: <User> Switch On/Off Devices in Automatic Overview Use
Case ................................................................................................................. 71
SUMMER 2016

PAGE 9 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Figure C-29: <User> Switch On/Off Roof in Automatic Use Case ............... 72
Figure C-30: <User> Switch On/Off Water in Automatic Use Case ............. 73
Figure C-31: <User> Switch On/Off Misting in Automatic Use Case ........... 74
Figure C-32: <User> Switch On/Off Devices in Manual Overview Use Case
......................................................................................................................... 75
Figure C-33: <User> Switch On/Off Roof in Manual Use Case .................... 75
Figure C-34: <User> Switch On/Off Water in Manual Use Case .................. 76
Figure C-35: <User> Switch On/Off Misting in Manual Use Case ............... 77
Figure C-36: <Main Controller> Switch On/Off Devices Overview Use Case
......................................................................................................................... 78
Figure C-37: <Main Controller> Switch On/Off Light .................................. 79
Figure C-38: <Main Controller> Switch On/Off Water ................................. 80
Figure C-39: <Main Controller> Switch On/Off Misting .............................. 81
Figure C-40: <Main Controller> Switch On/Off Roof ................................... 82
Figure C-41: <Main Controller> Tracking Sensors Overview Use Case ....... 83
Figure C-42: <Main Controller> Tracking Ambient Light ............................ 83
Figure C-43: <Main Controller> Tracking Temperature ................................ 84
Figure C-44: <Main Controller> Tracking Humidity Use Case ..................... 85
Figure C-45: <Main Controller> Tracking pH Degree Use Case................... 86
Figure C-46: <Main Controller> Tracking Soil Moisture Use Case .............. 87
Figure C-47: Conceptual Diagram .................................................................. 89
Figure D-1: System Architecture Design ........................................................ 91
Figure D-2: Software Architecture Description .............................................. 92
Figure D-3: Hardware Architecture Description ............................................ 93
Figure D-4: Main Controller Detail Design Description ................................ 93
Figure D-5: Raspberry Pi 3 Overview ............................................................ 94
Figure D-6: CC1310 LaunchPad Overview .................................................... 95
Figure D-7: Module BH1750-FVI .................................................................. 99
Figure D-8: BH1750-FVI Block Diagram ...................................................... 99
Figure D-9: BH1750 Flow Chart .................................................................. 100
Figure D-10: Module HDC1008 ................................................................... 100
Figure D-11: HDC1008 Block Diagram ....................................................... 101
Figure D-12: Module Soil Moisture Sensor using LM393 ........................... 102
Figure D-13: Module Soil Moisture Sensor Schematic ................................ 102
Figure D-14: Module DFRobot pH Meter .................................................... 103
Figure D-15: LM2576-ADJ chip .................................................................. 104
Figure D-16: LM2576-ADJ pinout ............................................................... 104
Figure D-17: Diodes Schottky SS34 ............................................................. 105
Figure D-18: Jack DC 002 ............................................................................ 105
Figure D-19: Switch on Shield ...................................................................... 106
Figure D-20: Tantalum Capacitors ............................................................... 106
Figure D-21: CAP 10F 50V CERM CHIP 0805 SMD............................... 107
Figure D-22: CAP 100nF 50V CERM CHIP 0805 SMD ............................. 107
SUMMER 2016

PAGE 10 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Figure D-23: Red Side LED 0805................................................................. 108
Figure D-24: AF180 Female USB-A connector ........................................... 108
Figure D-25: RH127 100uH 3A.................................................................... 109
Figure D-26: PC817X2NIP0F ...................................................................... 109
Figure D-27: ULN2003A .............................................................................. 109
Figure D-28: 220 Ohm 0805 5%................................................................... 110
Figure D-29: 1K Ohm 0805 5% .................................................................... 110
Figure D-30: 3-Pin 128V-5.0 Terminal ........................................................ 110
Figure D-31: 3-Pin 128V-5.0 Terminal ........................................................ 111
Figure D-32: Relay YL303H-S-5VDC ......................................................... 111
Figure D-33: Hardware - Software Connection Architecture Description ... 111
Figure D-34: Physical Component Diagram ................................................. 112
Figure D-35: Logical Component Diagram .................................................. 113
Figure D-36: Class Diagram ......................................................................... 114
Figure D-37: Login Sequence Diagram ........................................................ 117
Figure D-38: Show Zone Sequence Diagram ............................................... 118
Figure D-39: Update Zone Sequence Diagram ............................................. 119
Figure D-40: Add Zone Sequence Diagram ................................................. 120
Figure D-41: Delete Zone Sequence Diagram .............................................. 121
Figure D-42: Show Sensor Sequence Diagram ............................................ 122
Figure D-43: Show History Sensors Sequence Diagram .............................. 123
Figure D-44: Insert Sensor to Database Sequence Diagram......................... 124
Figure D-45: Add New Plant Sequence Diagram ......................................... 125
Figure D-46: Control End Devices Automatic Sequence Diagram .............. 126
Figure D-47: Control End Device Sequence Diagram ................................. 127
Figure D-48: Show End Device Sequence Diagram..................................... 128
Figure D-49: Login Screen Interface ............................................................ 130
Figure D-50: Zone Management Screen ....................................................... 131
Figure D-51: Add Zone Screen ..................................................................... 132
Figure D-52: Choose plant from library Screen ........................................... 133
Figure D-53: Add new plant Screen ............................................................. 134
Figure D-54: Show plant info Screen ........................................................... 135
Figure D-55: Update zone Screen ................................................................. 136
Figure D-56: Show sensor info Screen ......................................................... 138
Figure D-57: History Sensor ......................................................................... 139
Figure D-58: Show Actuator Screen ............................................................. 140
Figure D-59: Entity Relationship Diagram (ERD) ....................................... 141
Figure D-60: Add index of sensors to database Flow Chart ......................... 145
Figure D-61: Control Water Pump through Algorithm Flow Chart ............ 146
Figure D-62: Control Light through Algorithm Flow Chart......................... 147
Figure E-1: Physical Diagram ....................................................................... 148
Figure F-1: Create Environment on Server ................................................... 177
Figure F-2: New Folder in Windows ............................................................ 177
SUMMER 2016

PAGE 11 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Figure F-3: Using TortoiseGit to clone data from Server ............................. 178
Figure F-4: Copy SSH on Web openshift ..................................................... 178
Figure F-5: Paste URL to Clone ................................................................... 179
Figure F-6: Prepare file ".war" ...................................................................... 179
Figure F-7: Copy to folder webapp ............................................................... 179
Figure F-8: Git Commit --> "master" ........................................................... 180
Figure F-9: Fill all information and push Commit ........................................ 181
Figure F-10: Push on Server openshift ......................................................... 181
Figure F-11: Choose branches for master ..................................................... 182

SUMMER 2016

PAGE 12 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Definitions, Acronyms, and Abbreviations


Name
DIMOSG

Definition
Search Engine Platform for Traveling Information based on
Apache Lucene
Data source Websites contains traveling information used to parse data
Data item General name for end device/ sensor parsed from data source
Keyword
Search keyword of users
Actuators Represent for machines such as pump, pressure, motor
6LoWPAN IPv6 over Low power Wireless Personal Area Networks
Zone
An area where user want to put their garden in.
OS
Operator system
IoT
Internet of Things
CTR
Click-through rate
Users
The un-authenticated users
APP
Application
MCU
Microcontroller
ADC
Analog-to-Digital Conversion
2
IC
Inter-Integrated Circuit Interface
SPI
Serial Peripheral Interface
UART
Universal Asynchronous Receiver/Transmitter
DIO
Direct Input/output
RF
Radio frequency
GPRS
General Packet Radio Service
HTTP
Hypertext Transfer Protocol
RES
Resistor
CAP
Capacitor
DC
Direct current
ADDR
Address
VCC
Positive power supply
GND
Negative power supply
SCL
Serial clock line
SDA
Serial data line
TX
Transmit
RX
Receive
Wi-Fi
Wireless Fidelity
IR
Infrared
IEEE
Institute of Electrical and Electronics Engineers
Ref
Reference

SUMMER 2016

PAGE 13 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

A. Report No. 1 Introduction


1. Project Information
- Project name: Design and Implement The Model of Smart Garden
- Project Code: DIMOSG
- Product Type: Embedded System (webserver, mobile application)
- Start Date: 10th May 2016
- End Date: August 2016

2. Introduction
Nowadays, in this country, agricultural land is shrinking by rapid growth of
industry, which accompanies harmful effects for environment and air quality.
Green patches are being replaced by skyscrapers in the city. People are putting
in boxes and far away from nature. Day by day, people who work in office does
not have enough time and space to relax. A small garden around house or
balcony of apartment which not only decorate your house but that also keep
your healthy with fresh air around your place. That is good place to reduce
stress and lighten your mind which cannot be done being inside four walls.
Besides that, there are many reports about the unhealthy side effects found
in foods we eat everyday. Furthermore, large food that is introduced by
chemical to grow faster and use pesticides to prevent loss from being destroyed
by worms. Daily, it is easier and cheaper for a normal Vietnamese family to
find and buy unhealthy foods than try to find organically grown fruits and
vegetables. Therefore, a small garden around your place is a solution, which
not only makes your houses closer to nature, greener, but also can provide a
part of fresh and safe food for your family.
However, a small garden is also need enough land area, time, and effort to
take care. Moreover, not all people have ability to take good care of plants
without experience and knowledge.
We came up with an idea of building a system, which help anybody who
wants to set up a small garden around their house to spend less time and effort
on caring daily. This system can even build in a small area for people live in
small place in city.

3. Current Situation
There are many kinds and styles of garden, which have many differences
kinds systems to take care. According searching on the internet, in Vietnam and
on the world, we found some similar current systems that apply to build a smart
garden. Those systems can help people save time and effort in caring garden.
Here are overview and benefits of its.

SUMMER 2016

PAGE 14 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Similar trade products on the world:
+ Edyn Smart Garden System: This system includes two parts: Edyn
Garden Sensor and Edyn Water Valve. Edyn Garden Sensor will tracks light,
humidity, temperature, soil nutrition and moisture and cross-references
collected data with plant, soil science, and weather databases to recommend
which plants will thrive; monitors continuously and alerts users to changes that
require immediate action. Edyn Water Valve automatically controls existing
water system based on data collected by the Garden Sensor and adapts to
changes in the weather forecast. Edyn app provides information on what plants
that will grow best, the optimal time for planting, and even plant groupings with
the same conditional needs. It can also be used to control the Edyn Water Valve
manually. Advantage: Solar Powered, in addition to rechargeable lithium iron
phosphate battery when not in full sun; Measures ambient temperature,
humidity, light intensity and soil electrical conductivity. Many sensors is just
in one device; Water and fertilizer resistant; Connects to the cloud.

Figure A-1: Overview of Edyn System

+ Parrot Flower Power: This system also receive indexes from sensors like
light, temperature, analysis fertilizer, and soil moisture. All sensors is
integrated in one device which collects a variety of plant-relevant data
accurately and uses it in conjunction with its excellent database to make plantspecific recommendations. Advantage: Has a huge database about plant (7000
plants).

Figure A-2: Overview of Parrot device

SUMMER 2016

PAGE 15 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Similar systems in Vietnam:
+ There are similar projects about smart garden in other university. Wireless
sensor networks in agriculture from University of Economic and Industries
in Long An (2013). They build a Wi-Fi station for monitoring and controlling
environmental parameters, such as the environmental parameters (air
temperature, air humidity, light, insects, weeds, etc.) and other parameters
related to soil conditions (soil moisture, pH, etc.). The data are collected, stored,
and transmitted wirelessly to the farmers to handle in server, through which
they can control and take appropriate actions for their farm to increase
production and quality.

Figure A-3: Wireless Sensor Network in Agriculture


+ There are some companies such as vuonnhaxanh or vuonthongminh, which
has some smart systems for garden. Main purpose of their system is measure
light and temperature sensors, or timer for controlling volume of water valve,
turn light for plants.
+ In traditional way, Vietnam gardeners are usually take care garden based
on personal feeling about weather and give some predictions. Somebody apply
more modern which is based on measured indexes in caring garden. However,
they still have to measure indexes above manually and separately. After that,
they also have to calculate and make plans base on those indexes and plants
information.

4. Problem Definition
According searching and reading documents of current situations, we give
some disadvantage of those above systems if applied.
+ With Edyn Garden System, they connect to Wi-Fi network to send
valuable insights through the corresponding Edyn app. That is a big problem if
the garden has a large area (outside Wi-Fi distance). Price of Edyn is about
100$ without tax which is high with Vietnamese average income for a small
SUMMER 2016

PAGE 16 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
garden. There has not a support and warranty system, so Vietnamese gardener
has not high reliability with this system.
+ With Parrot Flower Power, the device can only transmit data to a
Bluetooth device, meaning have to be close to the device to get any data,
limiting ability to monitor your plant or get alerts on the go.
+ With the current system in the market, we must have paid so much for
using the smart garden and it is not suitable for Viet Nam environment. In
addition, some kind of control application is hard for Vietnamese people.
+ With similar projects, such as Wireless sensor networks in agriculture,
they have a huge device, which is not comfortable with a small garden.
+ With traditional ways of gardener in Vietnam: Measuring equipment,
for temperature, humidity, light and PH degree in the market, have many
different types and individual. Gardener will spend lots of time to get indexes
from these devices manually. It is also difficult to combine these indexes
together to find a solution for taking care of plants. Besides that, plants are
usually influenced by extreme weather events and by gradual climate changes.
With this routine in Vietnameses gardening, people have many things to do if
it is rain too much or dry in a long time.

5. Proposed Solution
The proposed solution is Design and implement the model of smart garden
to combine advantages and solve disadvantages of current systems.
Reference Edyn and Parrot systems, we will combine all sensors in a device
at named nodes, the system will be automatic controlled when indexes change
compare with users indexes defined. Besides that, there is manual mode for
users who want to control the system by themselves.

Webserver

INTERNET

System at home
Modem
Actuator
Devices

Sensors
Agriculture
Gateway/Router

Users Mobile

Figure A-4: System Introduction Overview


SUMMER 2016

PAGE 17 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
This system will resolve problems such as limit transmit and control
distance, size of systems or applicable with any area The system will need
more reactive based on indexes and weather condition than just control volume
of water valve. This system can not only using measuring devices automatically
but also combines their indexes to make a better response for controlling water,
fertilize, reminding improving soil, tracking life cycle of plants. This system
has some backup solution when the weather changes. The gardener have less
thing to do, they can manage garden from anywhere outside the home.
DIMOSG system includes a mobile application, a web server, background
process, and hardware device.
5.1. Feature functions
Hardware devices:

+ Tracking indexes of plants and surrounds by four sensor, which are


includes five elements: Ambient Light, Temperature, Humidity, Soil Moisture,
pH Degree.
+ Transmit via wireless signal that includes plants data indexes or
command to control end devices with hardware process center.
+ Data processing hardware center will communicate with web server
via Internet to send all data status data to cloud for processing and tracking
status of controlling end devices.
Webserver and Background process:

+ This part, which is main processing block of system, is putting in the


cloud for connecting between user interfaces and hardware devices easier,
providing plant data for mobile app, processing and storing indexes that are
received from Hardware devices.
Mobile application:

+ Users can control and track multiple plants in only one application,
which show plants indexes and environment. Nearly indexes of plants will be
monitoring and updating 24/7. Users can switch control (manual or automatic)
as they want. The part help users can manage the system from anywhere have
Internet.
5.2. Advantage and Disadvantage
Advantages:

+ Spend less time for gardening but increase productivity of plants.


+ Waste reduction of resources such as water, fertilize.
+ Simply collect data and monitor the conditions of land and plants.
+ Decrease of plant disease, forecasting effective.
+ Setting up for each kind of plant a criteria condition which user want.
+ Can be tracking and providing indexes for agriculture research centers.
Disadvantage:

+ The lack of technology knowledge from Vietnam gardener


+ Accuracy and durability of sensors and electric devices in a long time
with hard weather.
SUMMER 2016

PAGE 18 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

6. Functional Requirements
Hardware component:

+ Setting period time for each hardware to transmit indexes of plants to


Webserver via wireless signal and Internet.
+ Control end devices based on commands which is received from
Webserver.
+ Identify hardware based on which user set up.
Webserver component:

+ Store indexes which received from hardware.


+ Store conditions which user set up for each kind of plants.
+ Process indexes through algorithms found stored conditions, and change
status commands for end devices.
+ Provide services for managing on mobile component.
Mobile component:

+ Change mode control for system: manual or automatic.


+ Tracking status of end devices in automatic mode and control them in
manual.
+ Add/Update criteria conditions for each plant.
+ Getting report for plants indexes.
+ Setting time for fertilizer, store life cycle of plants.
+ Setting range conditions ground users wants.

7. Role and Responsibility


Table A-1: Role and Responsibility
No

Full Name

Role

Position

Contact

1 Nguyn c Li

Product owner Supervisor loind@fpt.edu.vn

2 Phan Thnh Sang

Developer

Leader

sangptse61252@fpt.edu.vn

3 L Vn Php

Developer

Member

phaplvse60608@fpt.edu.vn

4 Phm Hong Chinh

Developer

Member

chinhph60147@fpt.edu.vn

5 Hunh Hu Ngh

Developer

Member

nghihhse61055@fpt.edu.vn

SUMMER 2016

PAGE 19 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

B. Report No. 2 Software Project Management Plant


1. Problem Definition
1.1. Name of this Capstone Project

Official name: Design and Implement the Model of Smart Garden.


Vietnamese name: Thit K v Xy Dng M Hnh Vn Thng Minh.
Abbreviation: DIMOSG.
1.2. Problem Abstract

Gardening is a job, which asks people to spend time and effort for caring.
The gardeners need to track indexes of plants and combine its together to
monitor and give a best way for taking care the garden if they want their
garden grow up better, higher productivity This is not easy even with a
small garden when the gardener have to measure indexes usually; after that
they have to calculate a better plan manually which is fit with measured
indexes. However, as we mentioned above, people who want plant a small
garden around the house, face too much pressure and difference things of
works in a day and that make them have less time to take care a garden day
by day.
As we mentioned above, when people have a small garden around the
house, they need to spend more time and effort to take care it. If they want
a good green garden, and keep the plants healthy, they have many things to
do such as tracking and combine together indexes of plant, calculate a better
plan manually which is fit with measured indexes, estimate when fertilize
and how much weigh is enough, and remind to spray by themselves day by
day. Additionally, changes in the weather are also a difficult problem for
people who do not stay at home all day to handle it.
Our suggestion here is an embedded system, which help the user saving
time and effort in caring garden. It can replace people to do their jobs, for
example:
+ Tracking indexes period time daily.
+ Auto control devices like water pump, misting based on users set up
conditions to save resources of water.
+ Auto response with changes of weather to protect plants in some cases
+ User just needs one device to monitor and control the system from
anywhere in anytime.
Besides, our system must be easy to use and set up when the user want
to extent their garden. The system have to help user manage each zones
kind of plants, it need to store all measured indexes for creating resource
for some research center about agriculture.
1.3. Project Overview
1.3.1. Current Situation

There are the problems encountered in this project


SUMMER 2016

PAGE 20 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
+ Knowledge of garden: lack of information about trees and their indexes.
One tree has many variety indexes in different unit such as light is lux, soil
moisture is present or temperature is degree. It is complex to combine those
indexes together to compute range standard suitable values for each area or
each tree.
+ Endurance in severe weather: the system uses much kind of sensors,
which are communicate with environment (such as water, humidity, or
chemical fertilizers) directly. With our budget as a student, we just do this
project with some cheaper sensors so maybe it will not have a long durable
time.
+ The variety of model: gardener can plant kind of tree in an area or split
them in each potted plant. There are two device relate with soil is pH
sensors and soil moisture. We need a solution to get indexes from two
device in a same soil. If there are many potted plant and much kind of trees,
the system must equipped sensors for each kind. That make cost rise.
1.3.2. The Proposed System

+ According to the technology research in first week, we decide to focus


on how to processing sensors indexes, managing devices, giving protocol
between modules with server, and users with server. We also pay attention
supply power for modules and devices.
+ According researching of sensors, we have to choose a microcontroller,
which can read indexes from environment sensors, so it must have more
than one interface such as I2C, UART To reduce complicated of wires in
garden when deploy system, the microcontroller must communicate
together wireless.

Figure B-1: Network Topology Overview


+ Based on above reasons and agreement of supervisor, we will choose
a MCU, which use ARM-Cortex M3 microcontroller for systems core.
This MCU will read indexes of sensors through I2C and analog. It should
SUMMER 2016

PAGE 21 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
has a RF core or integrated with a RF module, which help communicate
with other module via RF connection. An edge router can be chosen to
connect with MCU to communicate with Webserver via Wi-Fi.
+ We will try to implement a system, which is star network, or mesh
network.
+ We also chosen some cheaper sensors, which just get approximate
values for sending to webserver. The important thing is we can processing
all indexes and combine them together to have a better plan or response
automatically.
+ There are many kinds of sensors in agriculture such as wind, rain, pH
v.v... According researching about other system, the team chose to track
four basic sensors: ambient light, temperature, humidity, pH degree, and
soil moisture.

Figure B-2: Proposed Solution System Overview

SUMMER 2016

PAGE 22 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- There are four parts in this model:
1.3.2.1. Peripheral block

Figure B-3: Peripheral Block in System


This block includes one microcontroller one packet of environment
sensors; attach a packet of end devices like solenoid valve, light, and roof
motor. This block provided following features:
+ Measure indexes of sensors.
+ Send indexes to main controller via wireless signal.
+ Receive commands for controlling end devices from main controller.
+ Identify zone of plants for managing.
1.3.2.2. Main Controller

Figure B-4: Main Controller in System


This is a place, which have one microcontroller connect to an edge
router or a gateway for connecting Internet and a packet of main end
devices. They will provide features such as:
+ MCU will receive indexes from peripheral blocks via wireless signal,
after that send indexes to Webserver through an edge router or a gateway
via Wi-Fi.
+ MCU control main end devices based on commands, which
requested from Webserver by an edge router or a gateway and it will send
commands to each Peripheral Blocks, which identify via wireless signal
for controlling branch line of end devices.
+ An edge router communicates with Webserver via Wi-Fi.

SUMMER 2016

PAGE 23 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
1.3.2.3. Webserver

Figure B-5: Webserver in System


The Webserver, which place in cloud, will provide the following
features:
+ Store all sensors indexes, which received from Main controller.
+ Using algorithm to calculate based on indexes to update status of
end devices to database.
+ Store data of user set up about criteria conditions of plant
+ Provide data for Mobile Application.
+ Provide APIs for Mobile Application and Main Controller to
request data.
1.3.2.4. Mobile Application

Figure B-6: Mobile User in System


Users with following features will mainly use this part:
+ Manage zones of plant with each Peripheral Block.
+ Display nearly indexes of plants.
+ Display status of end devices.
+ Manage plants conditions in zones.
+ Display a list suggestion of plants conditions.
+ Change mode control of each zone, automatic or manual.

SUMMER 2016

PAGE 24 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
1.3.3. Boundaries of the system

A user who wants to use this system, have to equip enough device
includes:
+ A mobile device run with application installed and internet connected.
+ A model for planting at home with hardware devices (sensors, MCU,
router/gateway, actuator devices).
The complete product includes:
A mobile application for user who can:
+ Monitor system that work automatic or Control system in manual
+ Monitor garden status anytime anywhere have internet connected.
+ Display and update personal plant library with criteria conditions
by themselves.
+ Manage zones of plant based on hardware devices.
A webserver provide data and services for mobile application and
hardware devices. It process and store all users data.
A model of hardware devices includes:
+ Plantation model that made from reused items around the house.
+ Embedded system with packets of sensors and end devices attach
to MCUs, wireless connection between MCUs, and one main
hardware process center (Main Controller) to connect with
Webserver via Internet.
1.3.4. Future plans

Currently, the system only deploy on a single platform: Android. Besides


that, the system just uses some environment sensors for agriculture. We
design a scalable system to be bigger model with more functions and run
on more platforms:
+ Run on multiple platform on client side: iOS, Windows Phone,
Windows Application.
+ Use more sensors for plants such as wind, rainfall, fertilizer level in
moisture To predict weather for plants, to track indexes more detail for
caring plants.
+ The star network is chosen as the good solution for this short project.
However, at the beginning we will try to implement a mesh network, which
is new technology on the market. If there is not enough time, we will
implement it in the future.

Figure B-7: 6LoWPAN Mesh Network


SUMMER 2016

PAGE 25 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
1.3.5. Development Environment
1.3.5.1. Hardware requirements

- For Sub Controller


Table B-1: Hardware Requirements - Sub Controller
Devices
Minimum Requirements
Recommended
Controller
Microcontroller
ARM Cortex
CC1310 Launchpad
Sensors
Light sensor
Using photo resistor LM393 Ambient Light BH1750
Temperature
DHT 11, DHT 22
HDC1008
Humility
AOSOONG AM2320
Texas Instrument
Read analog from module
Soil Moisture Sensor
Soil Moisture
LM393 comparator chip
using LM393 chip.
Read analog from module
pH
DFRobot PH Meter Kit
of pH degree
Component
Water pump
Aquarium Pump
Relay with solenoid valve
Light
Led
Light 150W
Misting machine Misting machine
Relay with solenoid valve
Roof
Motor with truckle
Motor with truckle
- For Main Controller
Table B-2: Hardware Requirement - Main Controller
Devices
Minimum Requirements Recommended
Controller
Microcontroller
ARM Cortex
CC1310 Launchpad
(RF connection)
Wireless signals
Wi-Fi, RF
Module Wi-Fi /
Wi-Fi transceiver
Raspberry Pi 3 Model B
Edge Router
ESP8266 V7
with Wi-Fi connection
Component
Main water pump
Aquarium Pump
Misting machine
Water pressure machine
- For Mobile Device
Table B-3: Hardware Requirements - Mobile Device
Devices
Minimum Requirements Recommended
Android
Android 4.3
Android 5.0

SUMMER 2016

PAGE 26 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- For Webserver
Table B-4: Hardware Requirement - Webserver
Devices
Minimum Requirements Recommended
Tomcat 7 (JBoss EWS
Server
2.0) or higher
MySQL 5.5 or higher
phpMyAdmin 4.0 or
higher

DBMS

1.3.5.2. Software Requirements

- Project management:
Table B-5: Software Requirements of Project Management
Software
Name / Version
Description
Slack Cautionary Tale
Slack brings all
Real-time
2.0.6
communication together in
messaging
Group in Facebook
one place
Microsoft Excel
It's tempting to start a project
plan in Excel because it helps
you quickly list all your
projects, arrange them how
you want them, and even
create something that
Task Plan
resembles a Gantt Chart view
Trello.com
Trellos boards, lists, and
cards enable you to organize
and prioritize your projects in
a fun, flexible and rewarding
way.
A free Git & Mercurial client
Source Control
Source Tree 1.8.3.0
for Windows or Mac
- Embedded Development
Table B-6: Software Requirements of Embedded Development
Software
Name / Version
Description
Windows 7 or above
OS
Linux - Contiki OS 3.0
IAR Workbench
IAR Embedded Workbench
provides a complete C/C++
compiler and debugger tool
IDE
chain that supports over
10,000 MCU devices
Code Composer Studio
SUMMER 2016

PAGE 27 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

PCB Editor 16.6


CAM350 10.0
PCB layout

Schematic

Allegro Design Entry CIS

Product design

Corel

Code Composer Studio is an


integrated development
environment (IDE) that
supports TI's Microcontroller
and Embedded Processors
portfolio
The application for laying out
a printed circuit board.
The industry de facto standard
for verification, optimization
and output generation to
efficiently and effectively
drive PCB fabrication
Design Entry Capture and
Capture component
information system (CIS) is
the most widely used
schematic design solution

- Software Development
Table B-7: Software Requirement of Software Development
Software
Name / Version
Description
Android Studio
The official Android IDE
from Google, your best way
to build Android apps.
Spring Tool Suite
Visual Studio Professional
2012 is a professional-quality
IDE
integrated development
environment that simplifies
the tasks of creating,
debugging, and deploying
software for Windows,
Microsoft Office and the web
SQL Server 2012
Relational database
management system
developed by Microsoft
DBMS
MySQL
MySQL is an open source
relational database
management system.
Star UML
StarUML is one of the most
Modeling tool
popular UML tools in the
world
SUMMER 2016

PAGE 28 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Document tool
OS

Edraw Max
Microsoft Visio 2013
Adobe Photoshop
Microsoft Word
Microsoft Excel
Microsoft Power Point
Window 7 or above

2. Project organization
2.1. Software Process Model
2.1.1. Overall Description

Agile development is methods allow the development team to focus on


the software itself rather than on its design and documentation. Agile
methods universally rely on an incremental approach to software
specification, development, and delivery. They are best suited to
application development where the system requirements usually change
rapidly during the development process during the development process.
Scrum is one the models of Agile method. It is an iterative and
incremental agile software development framework for managing product
development. It defines "a flexible, holistic product development strategy
where a development team works as a unit to reach a common goal",
challenges assumptions of the "traditional, sequential approach" to product
development, and enables teams to self-organize by encouraging physical
co-location or close online collaboration of all team members, as well as
daily face-to-face communication among all team members and disciplines
involved.
References:
http://www.agiledata.org/essays/evolutionaryDevelopment.html
https://en.wikipedia.org/wiki/Scrum_(software_development)

Figure B-8: Scrum Model


SUMMER 2016

PAGE 29 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.1.2. Reasons for choosing

We use Scrum model, which is an iterative and incremental agile


software development framework for managing product development, to
develop this project. We apply customized this model because follow
reasons:
+ The team must study RF waves, Wi-Fi, ZigBee, 6LowPan, and
protocol interfaces of hardware such as I2C, UART...
+ The team has to study how sensors measure indexes in real
environment.
+ The project use new hardware of Texas Instrument CC1310
Launchpad. This hardware includes new integrated cores such as RF
core and Sensor Controller. Team does not sure about configuration
RFs nodes in system, communication between sensors and MCU.
+ CC1310 Launchpad is a new product which has not in Vietnam
market, the team need order device through third party, we do not sure
when we have device to work.
+ The team has to study about kind of gardens, agriculture then apply
algorithms to solve indexes of plants.
+ The team just has some knowledge about electronic and board design.
We must solve power supply for nodes, modules, and limit electronic
wires in the garden.
For those reasons, the requirements of the project cannot be stable, clear,
and fix. It even can be rapidly changed. However, the team must be
implement at the same time in this project is 4 months due to FPT
University Capstone Project timeline, so the team needs model, which is:
+ Easy to change: According problems, which we encountered in this
project, we lack of knowledge about gardening and sensors in
agriculture. We choose this model to change requirements, functions
easily when some wrong sensors indexes or not suitable with kind of
garden.
+ Easy to update: According with research and implementation, we can
update easily document, scope, coding with supervisor agreement.
+ Resources share: There are many phases in this project and we just
have four member. This model permit us share resources easily, one
person can work more than task.
+ Soon bugs: We work on this model to do more test case iterative, so
we can detect bugs soon and fix it.
2.2. Roles and responsibilities

Table B-8: Roles and Responsibilities


No
1

Full name
Nguyn c Li

SUMMER 2016

Role in Group
Supervisor
Project manager

Responsibilities
Defining business
Supporting in technique issues
Controlling the development process

PAGE 30 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Team leader
BA
Developer
Tester

Phan Thnh Sang

BA
Phm Hong Chinh Developer
Tester

L Vn Php

BA
Developer
Tester

Hunh Hu Ngh

BA
Developer
Tester

Managing process
Clarifying requirements
Preparing documents and reports
Creating task plan
Reviewing documents and reports
Committing all individual works.
Design and implement hardware.
Researching components, document
Design and implement mobile
application.
Supporting each other.
Test hardware system.
Implement document and reports
Review documents and reports
Committing all individual works
Researching components, document
Implement chart.
Test hardware component.
Implement document and reports
Review documents and reports
Design and implement web server.
Design and implement database.
Modeling system.
Test software system.
Implement document and reports
Review documents and reports.
Test software system.
Design and implement mobile app.

2.3. Tools and Techniques

Table B-9: Tools and Techniques


No Tools/Techniques
1

For Embedded Software

2
3
4
5

For Hardware Design


For Webserver
For Android Application
For Managing Database

For Managing documents,


reports, models

SUMMER 2016

Name/Version
IAR Workbench 7.4
Code Composer Studio 6.1.3
SmartRF Studio 7
Flash Programmer 2
OrCAD PCB Editor16.6
Spring Tool Suite
Android Studio 2.1
MySQL Workbench 6.2
Microsoft Office 2013
Microsoft Visio 2013
StarUML 2.7.0
Software Idea Modeler

PAGE 31 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

3. Project Management Plan


3.1. Software development life cycle

Table B-10: Software development life cycle


Phase
Increment 0:
Analysis &
Research

Increment 1:
Research
Planning
Design

SUMMER 2016

Description
- Collect requirement
- Research the same system
- Research tools and
technique
- Research hardware
(sensor, MCU)
- Identify and clarify
requirement
- Define test phase
- Create introduction report
- Create Software project
management plan report
- Create Software
Requirement Specification
report
- Define requirement
- Define performance
measures
- Research giant.
- Research hardware,
sensor
- Connect sensor with
MCU.

Deliverables

Resource
needed

- Introduction report
- Research report

- 7 man-days

- Software project
management plan
- Software
Requirement
Specification
- Connect and transfer
data with hardware.
- Connect and transfer
data with internet
- Connect and transfer
data with mobile
application
- Test report

- 14 mandays

PAGE 32 OF 197

Dependencies
and
Risk
Constrains
- N/A
- Missing requirement
- Unclear scope of
project
- Lack of member
share of understand

- Depend on
introduction
report,
research
reports,
hardware
device

- Lack of Experience.
- Late for shipping
hardware
- Measure is not
exactly
- Test case cannot
cover all cases

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- Research RF connection.
- Research connect MCU
to Internet
- Research Web server
Research
mobile
application
- Design database
- Design test case
Increment 2
- Create Software Design
Implementation Description report
- Implement transfer data
from sensor to MCU and
MCU to server
- Implement control with
algorism in web server and
sent to mobile application
- Implement Web
SERVICES and hardware
get API, controlling water
supplying system.
- Testing hardware transfer
- Design user interface
- Design model of demo
Increment 3
- Create System
Implementation Implementation & Test
(communication report
in system)
- Implement schematic of
Testing
board
- Implement hardware
connects together
SUMMER 2016

- Performance
measures report

- Software Design
Description report
- Mobile application
- Web server and Web
API
- Test report
- Performance
measures report

- 21 mansday

- Depend on
introduction
report,
research
reports,
hardware

- Lack of Experience.
- Measure is not
exactly
- Hardware work not
good
- Test case cannot
cover all cases

- Create System
- 21 mansImplementation & Test day
report
- Board for hardware
- Web server for
control and transfer and
save data

- Depend on
introduction
report,
research
reports,
hardware

- Lack of Experience.
- Measure is not
exactly
- Hardware is not
exactly
- Test case cannot
cover all cases

PAGE 33 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- Implement transfer data
- Mobile Application
with wireless
for control and show
communication
information
- Implement transfer data
- Test report
from mobile application to - Performance
server
measures report
- Implement control water
supplying
- Implement model for
demo
- Test transfer data
- Test control signal from
server to MCU
Increment 4
- Create installation guide
- Installation guide
Deployment
- Create User guide
- User guide
- Integration test
- Integration test report
- Implement modeling
- Modeling garden
garden.
3.2. Increment Detail
3.2.1. Increment 0: Analysis and Research

- 7 mans-day

- All functions - Lack of experience


and reports
- Hard to grow plant
are completed - Depend on weather

Table B-11: Increment 0: Analysis and Research


Task
- Collect requirement
- Research the same system
- Research tools and
technique
SUMMER 2016

Description
Meeting with supervisor and get all information about requirement of
systems
Find some current systems all over the world and popular ways in
local
Find out strength and weakness for each current system.
Predict tools and technique for the system based on requirement and
current system.
PAGE 34 OF 197

Author
Sangpt, Chinhph, Phaplv
Chinhph, Phaplv
Sangpt
GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- Clarify requirement
- Research hardware

Define main functions which are approved by supervisor


Research popular module sensors in local market (how to work, IO,
accuracy, pros and cons.)
Define test phase for each part in system.

- Define test phase


- Create introduction report
3.2.2. Increment 1: Research - Planning - Design

Sangpt, Chinhph, Phaplv


Chinhph, Phaplv
Sangpt
Sangpt, Chinhph

Table B-12: Increment 1: Research - Planning - Design


Task
- Create Software project management
plan report
- Create Software Requirement
Specification report
- Research Gantt chart.
- Research hardware, sensor

- Connect sensors with MCU.


- Research RF connection.
- Research connect MCU to Internet
- Research Web server
- Research mobile application

SUMMER 2016

Description

Author

Define phase of project and what is need to


do for each part in system
Identify detail requirements of system.

Sangpt

Giving plan management for project.


Define model for management and
development of project
Compare sensors based on functions and
sensors report in Increment 0.
Choose sensors which approved by
supervisor for system
Interfaces: I2C, UART, SPI
Communicate between MCUs via RF
Communicate MCU with Internet
Identify tool and technique to create Web
service
Define tools and techniques to create mobile
application for user

Sangpt

PAGE 35 OF 197

Sangpt, Chinhph, Phaplv, Nghihh

Sangpt, Phaplv, Chinhph, Nghihh

Phaplv, Chinhph
Sangpt, Chinhph
Sangpt, Phaplv
Phaplv

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- Design database
- Design test case
3.2.3. Increment 2: Implementation

Store all information of system for tracking


and processing.
Create test case for each situation in system

Phaplv, Nghihh
Chinhph, Nghihh

Table B-13: Increment 2: Implementation


Task
- Create Software Design Description report
- Implement transfer data from sensor to
MCU and MCU to server
- Implement control with algorism in web
server and sent to mobile application
- Implement Web SERVICES and hardware
get API, controlling water supplying system.
- Testing hardware transfer

Description

Transmit indexes from sensors in subcontroller to Main Controller


Connect between Mobile Application and
Web API
Implement connection of Web
SERVICES with Main Controller
Do test case based on design in
Increment 1
- Design user interface
Design mobile application interface
- Design model of demo
Identify kind of trees, model of garden
for demo
3.2.4. Increment 3: Merge Implementation - Testing

Author
Sangpt, Chinhph, Phaplv, Nghihh
Sangpt, Chinhph
Phaplv, Nghihh
Sangpt, Phaplv
Nghihh, Chinhph
Phaplv, Chinhph
Chinhph, Nghihh

Table B-14: Increment 3: Merge Implementation - Testing


Task
- Create System Implementation & Test
report
- Redefine requirement

SUMMER 2016

Description
Rechecking requirement based on results of
Increment 2. Find out risks and problem of
system.
Fix requirements with supervisor agreement.

PAGE 36 OF 197

Author
Sangpt, Phaplv, Nghihh, Chinhph
Chinhph, Nghihh

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- Redefine performance measures

Check performance measures of sensors.


Replace when necessary.
- Redesign test case
Redesign test case, which suitable with changes.
- Implement schematic of board
Design schematic of board in sub and main
controller.
Packet sensors with MCU and MCU with
module Wi-Fi
- Implement hardware connects together Combine all in one system in real environment
for experimentally and testing
- Implement transfer data in system
Implement transfer data with Wireless
Connection and Mobile Application with
Webserver
- Implement control actuators
Control actuators in system which combined all
parts together
- Implement demo model
Create a small model to demo
- Test transfer data
Testing transfer data based on test case
Fix bugs.
- Test control signal from server to MCU Test rightness of control signal from server to
MCU based on plan or sensors indexes.
3.2.5. Increment 4: Deployment

Sangpt, Phaplv
Chinhph, Nghihh
Sangpt, Chinhph

Sangpt, Phaplv, Chinhph, Nghihh


Phaplv, Nghihh
Sangpt, Chinhph
Chinhph, Nghihh
Sangpt, Phaplv, Chinhph, Nghihh
Sangpt, Phaplv, Chinhph, Nghihh

Table B-15: Increment 4: Deployment


Task
- Create installation guide
- Create User guide
- Integration test
- Implement modeling garden.
SUMMER 2016

Description
Create guide of installation.
Create guide for user how to control the
system
Retest all test case in combined system.
Fix bugs.
Deploy system to demo garden model
PAGE 37 OF 197

Author
Chinhph, Nghihh
Chinhph, Nghihh
Chinhph, Nghihh
Sangpt, Phaplv
Sangpt, Phaplv, Chinhph, Nghihh
GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
3.3. Task sheet

Place at folder Task sheet.


3.4. All Meeting Minutes

Place at folder Meeting Minutes.

4. Coding Convention
- C/C++ and Python: Using to develop program on hardware.
- Java: Using to develop Webserver.
- Android: Using to develop mobile application. The coding convention is
base on Java.
Summary:
Naming Conventions:
- Variable name should short yet meaningful. If the name is more than
one word, it must be in mixed case, starting word with a lowercase.
- Constants name should be uppercase with all words separated by
underscores.
- Methods name should be verbs, in mixed case with the first word
lowercase, the first letter of each internal word capitalized.
- Class name should be nouns, in mixed case with the first letter of each
internal word capitalized.
Package and import statements:
- Package statements are the first non-comment line.
- Import statement is after package statement.
Constants
- Numerical constants should not be coded directly.
Variable Assignments:
- Avoid assigning several variable to the same value in a single
statement.
Comments:
- Using /* */ and """ """ for block comments.
- Using // and # for line comments.
Return statements:
- A return statement with a value should not use parentheses.
Using C/C++ coding convention from
https://google.github.io/styleguide/cppguide.html
Using Python coding convention from
https://google.github.io/styleguide/pyguide.html
Using Java coding convention from
http://www.oracle.com/technetwork/java/codeconvtoc-136057.html
Using Android coding convention form
http://source.andoird.com/source/code-style.html
References: Code Conventions for the Java TM Programming Language
SUMMER 2016

PAGE 38 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

C. Report No. 3 Software Requirement Specification


1. User Requirement Specification
User wants build a small garden around the house but they do not have
enough time and effort to take care daily. User needs a model, which helps
them save resources in gardening. A model is built for caring garden usually
to create green corner in user place. The model should meet the below needs:
1.1. Model requirements

Easy to setup, use, replace and low cost.


Limit complication of numeric electronic wires grid in garden.
1.2. Monitoring the status of garden

Users can tracking indexes of garden through sensors.


Users can monitor the status of garden from anywhere in anytime.
1.3. Response with expected problems

System can automatically react with problems, which is harmful for


garden.
1.4. Manage the model

Users can manage all devices, tracking reliability and durability of


devices; add, remove or configure specific devices.
Users can start or stop any automatically actions in their garden
1.5. Schedule

Users will be received auto schedule after processing indexes on server.


Users need to be notified some reminder with situations which meet
plants requirement or auto actions deadline nearly.
1.6. Consumption and durability

All sensors that used in the system have to a long life low power.
All sensors have a great durability when usually contact with water day
by day.
1.7. Security

Users have to be authenticated before using the system


1.8. Interoperability

New end devices can be added to the system and interact with other ones
regardless of manufacturing origin such as sensors, pumps, solenoid valve.

SUMMER 2016

PAGE 39 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

2. System Requirement Specification


2.1. External Interface Requirement
2.1.1. User interface

The user interface use English language in android application.


The user interface for android application is designed base on material
design and display best on screen size larger than 4.
The user interface must be simple, friendly, clearly and easy to use.
The interface is divided by tabs, which will allow users to switch easily
between different parts of application.
Meet all the main functions and easily to identify each of functions.
Use obvious icon to avoiding misunderstanding.
2.1.2. Hardware interface

Each hardware component must meet the following requirements: easy


to replace, low cost, easy to implement, stable and high durable.
2.1.2.1. Raspberry Pi 3

Figure C-1: Raspberry Pi 3 Overview


To communicate and bridge between hardware with Webserver, the
model need a microprocessor, which can connect Wi-Fi to Internet, it
will work stable day by day. Especially, the microprocessor must be easy
to connect with below MCUs. After reconsider projects requirement and
finding many kinds of microprocessor in the market, we decide to choose
Raspberry Pi 3 (Mode B). Raspberry Pi 3 is not a simple microprocessor,
but a series of credit card sized single-board computer. It has a
reasonable cost and provides features that the project need: fast CPU,
easy to connect with Wi-Fi, USB ports (for UART interface with MCU).

SUMMER 2016

PAGE 40 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Table C-1: Raspberry Pi 3 Hardware Specification
Specifications
System on Chip Broadcom BCM2837
1.2GHz Quad-Core ARM Cortex-A53
(SoC)
4x ARM Cortex-A53, 1.2GHz
CPU
Dual Core Video-Core IV Multimedia Co-Processor.
GPU
Provides Open GL ES 2.0, hardware-accelerated
OpenVG, and 1080p30 H.264 high-profile decode.
Capable of 1Gpixel/s, 1.5Gtexel/s or 24GFLOPs
With texture filtering and DMA infrastructure.
1GB LPDDR2 (900 MHz)
RAM
10/100 Ethernet
Networking
Broadcom BCM 43438 chip provide 2.4 GHz
802.11b/g/n wireless LAN
Bluetooth 4.1 Classic, Bluetooth Low Energy
Bluetooth
micro SD
Storage
40 pin header, populated
GPIO
HDMI, 3.5mm analogue audio-video jack
Ports
4 x USB 2.0, Ethernet, Camera
Serial Interface (CSI), Display Serial Interface (DSI)
800mA (4.0W)
Power ratings
5V, 2.5A via Micro USB or GPIO header
Power source
85.60 * 56.5 mm (3.370 x 2.224 in) not including
Size
protruding connectors
45g
Weight
Connectors
Video Output

HDMI (rev 1.3 & 1.4)


Composite RCA (PAL and NTSC)

Audio Output

Audio Output 3.5mm jack, HDMI


USB 4 x USB 2.0 Connector.

Camera Connector 15-pins MIPI Camera Serial Interface (CSI-2)


Display Connector Display Serial Interface (DSI) 15 ways flat flex cable
connector with two data lanes and a clock lane.
Memory Card Slot Push/pull Micro SDIO

SUMMER 2016

PAGE 41 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.1.2.2. CC1310 Launchpad

The model must be easy to setup, widen and avoid complicated of


electric wires in garden. Solution is using wireless devices at each nodes
in garden. There are many kinds of wireless signal such as infrared
radiation (IR), Bluetooth, radio frequency (RF), or Wi-Fi. Here is a table,
which display comparison between above wireless signal.

Figure C-2: CC1310 LaunchPad Description

SUMMER 2016

PAGE 42 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Table C-2: Comparison of Standard Wireless Network Protocol

Data Rate

RF

802.11
(Wi-Fi)

Bluetooth

20, 40, and 250


Kbits/s

11 & 54 Mbits/sec

1 Mbits/s

50-100 meter

10 meters
Ad-hoc, very small
networks

10-100 meters
Ad-hoc, peer to peer,
star, or mesh
868 MHz
Operating
900-928 MHz
Frequency
1 and 2.4 GHz
Low
Complexity
Very low
Power Consumption
(low power is a
(Battery option
design goal)
and life)
128 AES plus
apptication layer
Security
security
Range
Networking
Topology

SUMMER 2016

Point to hub

IR
Wireless
20-40 Kbits/s
115 Kblits/s
4 & 16 Mbitts/s
<10 meters
Point to point

2.4 and 5 GHz

2.4 GHz

800-900 nm

High

High

Low

High

Medium

Low

64 and 128 bit


encyption

PAGE 43 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Based on the table, RF is the most suitable choice for this project.
Because the model requires a high-speed data transmission and long
distance, transmission is matched with houses, which have many hidden
corners, or the garden is placed outside far from house. RF help the
model can easy to work in two control modes: Automatic and Manual.
There are many kinds of module RF in Vietnam market, but they are
separate modules. After discussion in team, we decide to order CC1310
Launchpad to implement this project. It is a great starting point for your
Sub-1 GHz wireless Internet of Things (IoT) applications. Powerful
functionality out-of-the box, all I/Os exposed and easy-to-get-started
examples. Because CC1310 device is the first part in a Sub-1-GHz
family of cost-effective, ultralow power wireless MCUs. The CC1310
device combines a flexible, very low power RF transceiver with a
powerful 48-MHz Cortex-M3 microcontroller in a platform supporting
multiple physical layers and RF standards. A dedicated Radio Controller
(Cortex-M0) handles low-level RF protocol commands that are stored in
ROM or RAM, thus ensuring ultralow power and flexibility. The lowpower consumption of the CC1310 device does not come at the expense
of RF performance; the CC1310 device has excellent sensitivity and
robustness (selectivity and blocking) performance. The CC1310 device
is a highly integrated, true single-chip solution incorporating a complete
RF system and an on-chip DC-DC converter. Besides, CC1310
Launchpad also have 12-Bit ADC, 200 k samples/s, 8-Channel Analog
MUX and many interfaces which connect with environment sensors such
as I2C, UART, SPI, I2S. The model can integrated many different
devices and sensors.

SUMMER 2016

PAGE 44 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Table C-3: CC1310 Launchpad Specification
Specification
Microcontroller
Powerful ARM Cortex-M3
All Digital Peripheral Pins Can Be Routed to Any
Peripherals
GPIO
12-Bit ADC, 200 k samples/s, 8-Channel Analog
MUX
Interfaces: I2C, UART, SPI, SSI, I2S
Excellent Receiver Sensitivity -124dBm Using
RF section
Long-Range Mode, -110dBm at 50kbps
Excellent Selectivity: 52dB
Excellent Blocking Performance: 90dB
Programmable Output Power up to +14dBm
Single-Ended or Differential RF Interface
Suitable for Systems Targeting Compliance With
Worldwide Radio Frequency Regulations
+ ETSI EN 300 220, EN 303 131, EN 303 204
(Europe)
+ FCC CFR47 Part 15 (US)
+ ARIB STD-T108 (Japan)
Wireless M-Bus and IEEE 802.15.4g PHY
Full-Feature and Low-Cost Development Kits
Tools and
Multiple Reference Designs for Different RF
Development
Configurations
Environment
Packet Sniffer PC Software
Sensor Controller Studio
SmartRF Studio
SmartRF Flash Programmer 2
IAR Embedded Workbench for ARM
Code Composer Studio
315, 433, 470, 500, 779, 868, 915, and 920MHz ISM
Applications
and SRD Systems
Low-Power Wireless Systems With 50kHz to 5MHz Channel Spacing
Wireless Alarm and Security Systems
Industrial Monitoring and Control
Wireless Healthcare Applications
Wireless Sensor Networks
Active RFID
IEEE 802.15.4g, IP-Enabled Smart Objects
(6LoWPAN), Wireless M-Bus, KNX Systems, WiSUN, ZigBee and Proprietary Systems
SUMMER 2016

PAGE 45 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.1.2.3. Sensors

Table C-4: Description of Light Sensor


Ambient Light Sensor BH1750 FVI

Figure C-3: Ambient Light Sensor


Position
Description

Duty
Specification

SUMMER 2016

Light intensity sensor


Plants get energy from light through a process called
photosynthesis. This is how light affects the growth of a
plant. Without light, a plant would not be able to produce
the energy it needs to grow. This is a BH1750 light
intensity sensor breakout board with a 16-bit AD converter
built-in, which can directly output a digital signal; there is
no need for complicated calculations. This is a more
accurate and easier to use version of the simple photo
resistor, which only outputs a voltage that needs to be
calculated in order to obtain meaningful data. With the
BH1750 Light Sensor, intensity can be directly measured
by the lux meter, without needing to make calculations.
The data, which is output by this sensor, is directly output
in Lux (lx). When objects, which are lighted in
homogeneous get the 1 lx luminous flux in one square
meter, their light intensity is 1 lx. Sometimes to take good
advantage of the illuminant, you can add a reflector to
illuminant. So that there will be more luminous flux in
some directions and it can increase the illumination of the
target surface. References: DFRobot, 2014
BH1750 using two SI2302 transistors to calculate light
intensity and send it to MCU via I2C interface.
Power supply voltage: +3 to +5VDC / Interface: I2C
Wide range and High resolution (1 65535)
It is possible to select 2 types of I2C slave address
Small measurement variation (+/- 20%)
Size: 0.85*0.63*0.13*(21*16*3.3mm) (DFRobot, 2014)
PAGE 46 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Table C-5: Description of Temperature & Humidity Sensor
Temperature & Humidity Sensor
Adafruit HDC1008

Figure C-4: Temperature and Humidity Sensor


Position
Description

Duty
Specification

SUMMER 2016

Temperature and Humidity Sensor


Temperature affects the productivity and growth of a plant
depending upon whether the plant variety is a warm-season
or cool-season crop. Temperatures that are too low or high
for a warm-season crop will prevent fruit set. Humidity
plays a major role in plant growth. Moisture in the air in the
form of water vapor greatly affects plant health.
Humidifiers-when grouped together the relative humidity is
increased, benefiting all plants around. The HDC1008 is an
I2C sensor. That means it uses the two I2C data/clock wires
available on most microcontrollers, and can share those
pins with other sensors as long as they do not have an
address collision. For future reference, the default I2C
address is 0x40 but you can adjust it by connecting the
address pins to Vin ('high' logic voltage), for four possible
addresses: 0x40, 0x41, 0x42 or 0x43
Adafruit HDC1008 measure temperature and humidity send
them to MCU that request after that.
Power supply voltage: +3 to +5VDC / Interface: I2C
It is possible to select 2 types of I2C slave address
The humidity has a typical accuracy of 4% with an
operating range that is optimized from 10% to 80% RH.
The temperature output has a typical accuracy of 0.2C
from -20~85C.
PAGE 47 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Table C-6: Description of Soil Moisture Sensor
Soil Moisture Sensor Using LM393 Module

Figure C-5: Soil Moisture Sensor


Position
Description

Duty
Specification

SUMMER 2016

Soil Moisture Sensor


Water helps a plant by transporting important nutrients
through the plant. Nutrients are drawn from the soil and
used by the plant. Water carries the dissolved sugar and
other nutrients through the plant. Different types of plants
require different amounts of water.
This Moisture Sensor can be used to detect the moisture of
soil or judge if there is water around the sensor, let the
plants in your garden reach out for human help. They can
be very easy to use, just insert it into the soil, and then read
it. With the help of this sensor, it will be realizable to make
the plant remind you: Hey, I am thirsty now, please give
me some water.
References: Seed Studio, 2014
This is a summary of the moisture sensor, which can be
used to detect the moisture of the soil. When the soil
moisture deficits, the sensor output value will decrease.
Power supply: 3.3v or 5v / Current: 35mA
Output voltage signal: 0~4.2v / Size: 60x20x5mm
Pin definition: Analog output, GND, Power
Surface finish: Immersion Gold (Robot Wiki, 2014)

PAGE 48 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Table C-7: Description of Analog pH Meter Module Kit

Analog pH Meter Kit Dfrobot pH Meter Kit

Position
Description

Analog pH Meter
Temperature affects the productivity and growth of a plant.
One common effect of the application of water with a high pH,
or of a high soil pH, is chlorosis. The tiny bacteria and other
organisms that inhabit the soil, huge numbers of them in a
teaspoon of soil, are most active at a pH of 6.3 to 6.8, and so the
processes that break down plant waste, such as leaves, are most
active at that level. Peat bogs, for example, have a very acid
environment; act as preservatives for organic matter.

Duty
Specification

Module Power: 5.00V


Circuit Board Size: 43mm32mm
pH Measuring Range: 0-14
Measuring Temperature: 0-60
Accuracy: 0.1pH (25 )
Response Time: 1min
pH Sensor with BNC Connector
PH2.0 Interface ( 3 foot patch )
Gain Adjustment Potentiometer
Power Indicator LED
2.1.2.4. End Devices

Model of this project will process indexes of sensors and control


actuators after that. Actuators such as water pump, light, mist machine,
traction motor, fertilizer pump In scope of this project, the model will
SUMMER 2016

PAGE 49 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
control water pump, light, misting machine and fertilizer pump automatic
and user can control that devices and a traction motor in manual mode.
User can plant in different zones, that will be waste if the model setup
a packet of end devices (include two pump, one misting machine and one
light) for each node. Solution is used to control two pumps at main
controller and use two solenoid valves to active at each zone.
2.1.2.5. User Interface Device

The system is managed by user via mobile, so hardware interface for


users is most popular in mobile market such as mobile using android,
iOS or windows phone. With knowledge which team studied, we are
recommend android mobile.

Figure C-6: Platforms of mobile devices


2.1.3. Software Interface

- Mobile Application: Android OS (v4.0 or above)


- Java Web server: Springs & Hibernate
- Database: MySQL
2.1.4. Communication Protocol

The system will applied to variety kinds of garden, small or large garden;
it must satisfied distance communication in a garden. Users need a simple
system which not affect too much garden space so electric wired between
devices, so a wireless system is recommend with Wi-Fi and RF waves.
The device MCU in system has many kinds of protocol such as I2C, SPI,
and UART to communicate with sensors. We recommend use I2C protocol
to control easily and add more sensors to the systems.

SUMMER 2016

PAGE 50 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2. System Overview Use Case

Figure C-7: System Overview Use Case


SUMMER 2016

PAGE 51 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3. List of Use Case
2.3.1. <Guest> Login

Figure C-8: <Guest> Login use case


Table C-8: <Guest>Login use case
USE CASE GC01
Use Case No.
GC01
Use Case Version 2.0
Login
Use Case Name
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor:
- Guest
Summary:
- This use case allows Guest login to the system on mobile application.
Goal:
- Guest will become user to use functions in the system after they login.
Triggers:
- User must input username and password which was provided and press button
Login
Preconditions:
- Guest must have provided account from system.
- Mobile connects Internet.
Post Conditions:
- Success: Guest will moves to main page after login
- Fail: Display a popup message for error.
Main Success Scenario:
Step
Actor Action
System Response
1
Access mobile application
Display Login Screen
2
Guest inputs information to fill Check validation of username
2 fields with username and
and password
password which were
provided
3
Press Login button
Check login data in database
[Alternative 1]
Log user into the system
Move to main page

SUMMER 2016

PAGE 52 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Alternative Scenario:
Step
Actor Action
1
Guest input invalid username
or password
Exceptions:
No
Actor Action
1
Access mobile application
2
Not fill enough fields or
wrong format of textbox
No
Actor Action
1
Access mobile application
2
Fill invalid provided account
information
3
Press Login button

System Response
System show error message.
System Response
Display Login Screen
Display "Username or password
is wrong" message.
System Response
Display Login Screen
Check validation of username
and password
Display "Invalid username or
password" message.

Relationships: - NA
Business Rules:
- After login to system, guest will be redirected to main screen of system.
2.3.2. <User> Manage Zone Overview Use Case

Figure C-9: <User> Manage Zone Overview Use Case

SUMMER 2016

PAGE 53 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.2.1. <User> View Zone Use Case

Figure C-10: <User> View Zone Use Case


Table C-9: <User> View Zone Use Case
USE CASE UC02
Use Case No.
UC02
Use Case Version 2.0
Use Case Name View Zone
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor:
- User
Summary:
- This use case allows User view all zone in system and view information of
each zone.
Goal:
- User can monitor and manage zone of plant clearly, separately.
Triggers:
- User login to system to view all zones.
- User choose a zone to view
Preconditions:
- N/A.
Post Conditions:
- Success: Show all exists zones in system. Show indexes of a zone that is
chose.
- Fail: Display a popup message for error.
Main Success Scenario:
Step
Actor Action
System Response
1
User goes to main screen
Mobile application display all
[Alternative 1]
exist zone in system.
2
[Alternative 2]
Display all indexes of that
User chooses a zone to view zone

SUMMER 2016

PAGE 54 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Alternative Scenario 1:
Step
Actor Action
System Response
1
User choose Add button
Navigate to Add Zone
Alternative Scenario 2:
Step
Actor Action
System Response
1
User send command to
Back to Main Screen
backward for choosing
another zone
Exceptions: - N/A
Relationships: - NA
Business Rules:
- User can add new zone while view all zone.
- After view a zone, user can change and update indexes of zone by choose
each index.
2.3.2.2. <User> Add Zone Use Case

Figure C-11: <User> Add Zone Use Case


Table C-10: <User> Add Zone Use Case
USE CASE UC03
Use Case No.
UC03
Use Case Version 2.0
Add
Zone
Use Case Name
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary:
- This use case allows User add a new zone to system.
Goal:
- User can create a new zone with defined indexes to create scenario for hardware
response with expected problems.
Triggers:
- User input all information for zone and sends command to create a new zone.
Preconditions: - N/A
Post Conditions:
- Success: New zone will be created and added to database.
- Fail: Display a popup message for error.
SUMMER 2016

PAGE 55 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Main Success Scenario:
Step Actor Action
1
User goes to Add button

2
3

[Alternative 1]
[Alternative 2]
[Alternative 3]
User send command to add a
new zone

Alternative Scenario 1:
Step Actor Action
1
User choose a library
suggestion
Alternative Scenario 2:
Step Actor Action
1
User input a new plant which
has not in library

System Response
Display Add Zone Screen
System request information for new
zone
Zone information:
- Zone Name
- Device Code ( to distinguish
between zones)
Plant information:
- Plant Name
- Plants defined indexes of sensors
- Fertilizer date
Add new zone with input information
of user
System show successful message.
[Exception 1]
[Exception 2]
System Response
Display Library Suggestion
System Response
Add new plant to library with new
information.
Add new zone with new plant

Alternative Scenario 3:
Step Actor Action
System Response
1
User send command to
Clear input information.
backward for choosing another Back to Last Screen
zone
Exceptions:
No Actor Action
System Response
1
User input already exist Device System show warning message to
Coe
check Device Code again.
No Actor Action
System Response
2
User input exist plant name in
System show warning message Plant
library
name already exist.
Relationships: - NA
Business Rules:
- After added zone, information of zone will be stored in database.
- Mobile Application can show all zones, which include new zone.
- Mobile Application wills navigate to new zones screen with input information.
- Hardware will work with scenario that created for new zone.
SUMMER 2016

PAGE 56 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.2.3. <User> Update Zone Use Case

Figure C-12: <User> Update Zone Use Case


Table C-11: <User> Update Zone Use Case
USE CASE UC04
Use Case No.
UC04
Use Case Version 2.0
Use Case Name Update Zone
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary:
- This use case allows User update information of zone.
Goal:
- User can edit and update defined indexes to create a new scenario for
hardware response with expected problems.
Triggers:
- User edits information for zone and sends command to update zone.
Preconditions:
- User goes to View Zone,
Post Conditions:
- Success: Zones information will be updated.
- Fail: Display a popup message for error.
Main Success Scenario:
Step
Actor Action
System Response
1
User goes to Update Zone Display Update Zone Screen
Screen
System displays all
information of zone.
2
User chooses to change
indexes of zone.
3
[Alternative 1]
Update zone with input
User send command to
information of user
update a zone
System show successful
message.
SUMMER 2016

PAGE 57 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Alternative Scenario 1:
Step
Actor Action
System Response
1
User send command to
Clear input information.
backward for choosing
Back to Last Screen
another zone
Exceptions: - N/A
Relationships: - NA
Business Rules:
- After update zone, information of zone will be stored in database.
- Mobile Application can show zone with updated indexes.
- Mobile Application wills navigate to View zones screen with input
information.
- Hardware will work with updated information in scenario.
2.3.2.4. <User> Delete Zone Use Case

Figure C-13: <User> Delete Zone Use Case


Table C-12: <User> Delete Zone Use Case
USE CASE UC05
Use Case No.
UC05
Use Case Version 2.0
Use Case Name Delete Zone
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary:
- This use case allows User delete a zone.
Goal: - User can delete a zone that they want.
Triggers:
- User chooses a zone to delete and send command to delete.
Preconditions: - User goes to Main Screen.
Post Conditions:
- Success: Display a message Delete successful.
- Fail: Display a popup message for error.
SUMMER 2016

PAGE 58 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Main Success Scenario:
Step
Actor Action
1
User goes to Main Screen
2

User chooses a zone to


delete.
User send command to
delete a zone

System Response
Mobile application displays all
zones in system.
Delete zone and information in
database.
System show successful
message.

Alternative Scenarios: - N/A


Exceptions: - N/A
Relationships: - NA
Business Rules:
- All information of zone that deleted cannot reuse or recover.
- After delete, mobile application navigates to main screen show all remain
zone.
2.3.3. <User> Manage Library Overview Use Case

Figure C-14: <User> Manage Library Overview Use Case


2.3.3.1. <User> View Library Use Case

Figure C-15: <User> View Library Use Case

SUMMER 2016

PAGE 59 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Table C-13: <User> View Library Use Case
USE CASE UC06
Use Case No.
UC06
Use Case Version 2.0
Use Case Name View Library
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor:
- User
Summary:
- User need to understand standard information of plants to manage system
based on indexes of sensors. Library give user recommends information of
tree.
Goal:
- User can understand easily about information of plants, which they do not
need to find in other places outside system.
Triggers:
- NA
Preconditions:
- System must provide information on core database, which join with a
personal database for each user.
Post Conditions:
- Success: User can view list of plants, which is on core database and
personal database.
- Fail: Display a popup message for errors. Log errors to system in case
conflict between personal database and core database.
Main Success Scenario:
Step
Actor Action
System Response
1
Access Library Screen
Get Joined database between
[Alternative 1]
core database and personal
database.
Show list of plants
2
User choose one plant which Navigate to Information of
they want
Plants
[Alternative 1]
Show standard information of
plants
Alternative Scenario 1:
Step
Actor Action
System Response
1
Access Library screen
Get Joined database between
core database and personal
database.
Show list of plants
2
User touch Add button
Navigate to Add new page
SUMMER 2016

PAGE 60 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Exceptions:
No
Actor Action
1
Access Library screen

System Response
Errors from join database or
system
Display errors message

Relationships: - N/A
Business Rules: - Through View Library, User can choose a suggestion
plant for adding to zone.
2.3.3.2. <User> Add Library Use Case

Figure C-16: <User> Add Library Use Case


Table C-14: <User> Add Library Use Case
USE CASE UC07
Use Case No.
UC07
Use Case Version 2.0
Use Case Name Add Library
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary:
- Allow user can add more to their database (personal) with some kind of
plants which they want
Goal:
- User can control the system with any kind of plant, there are not depend
too much on core database of system
Triggers:
- User defined information for a plant and send command to add library.
Preconditions:
- System must provide a personal database for each user to avoid conflict
between difference users on core database.
Post Conditions:
- Success: User can add any plants, which they want to personal database
which system can work on. Users set threshold of sensors to control
actuators by themself.
SUMMER 2016

PAGE 61 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- Fail: Display a popup message for errors. Log errors to system in case
conflict between personal database and core database.
Main Success Scenario:
Step
Actor Action
System Response
1
Access Library Screen
Get Joined database between
core database and personal
database.
Show list of plants
2
Touch Add button
Navigate to Add new screen
with fields which ask to input
full data on
3
User fill all fields in screen
4
[Alternative 1]
Insert new data to database.
User touch Add button
Display message Add
successful
Alternative Scenario 1:
Step
Actor Action
System Response
1
User send command to
Clear input information.
backward for choosing
Back to Last Screen
another zone
Exceptions:
No
Actor Action
System Response
1
User inputs exist plant name Display warning message
duplicate plant name.
Relationships: - N/A
Business Rules:
- After add library, user can choose that plant to add a new zone.
- Added information creates a scenario for system work to responseexcepted problems.

SUMMER 2016

PAGE 62 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.4. <User> View Sensor Status Use Case

Figure C-17: <User> View Sensor Status Use Case


2.3.4.1. <User> Get Temperature Use Case

Figure C-18: <User> Get Light Use Case


Table C-15: <User> View Temperature Specification
USE CASE UC08
Use Case No.
UC08
Use Case Version 2.0
Use Case Name Get Temperature
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor:
- User
Summary:
- User can monitor temperature via web server and mobile application.
Goal:
- Users can view nearly temperatures index.
SUMMER 2016

PAGE 63 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Triggers:
- User chooses a zone to view index.
Preconditions:
- User must logged into the system.
- Temperature sensor must be connected to the system.
Post Conditions:
- Success: User can view index of temperature in a zone.
- Fail: Display a message error
Main Success Scenario:
Step
Actor Action
System Response
1
User choose a zone
Navigate to View Zone Screen
2
User access to temperature
Display index of temperature
sensors tab
index
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
2.3.4.2. <User> View Humidity Use Case

Figure C-19: <User> Get Humidity Use Case


Table C-16: <User> Get Humidity Specification
USE CASE UC09
Use Case No.
UC09
Use Case Version 2.0
Use Case Name Get Humidity
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary:
- User can monitor humidity via web server and mobile application.
Goal:
- Users can view nearly humiditys index.
Triggers:
- User chooses a zone to view index.
SUMMER 2016

PAGE 64 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Preconditions:
- User must logged into the system.
- Humidity sensor must be connected to the system.
Post Conditions:
- Success: User can view index of humidity in a zone.
- Fail: Display a message error
Main Success Scenario:
Step
Actor Action
System Response
1
User choose a zone
Navigate to View Zone Screen
2
User access to humidity
Display index of humidity
sensors tab
index
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
2.3.4.3. <User> Get Light Index Use Case

Figure C-20: <User> Get Light Index Use Case


Table C-17: <User> Get Light Index Specification
USE CASE UC10
Use Case No.
UC10
Use Case Version 2.0
Use Case Name Get Light Index
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary:
- User can monitor light index via web server and mobile application.
Goal:
- Users can view nearly ambient lights index.
Triggers:
- User chooses a zone to view index.
Preconditions:
- User must logged into the system.
SUMMER 2016

PAGE 65 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- Ambient light sensor must be connected to the system.
Post Conditions:
- Success: User can view index of ambient light in a zone.
- Fail: Display a message error
Main Success Scenario:
Step
Actor Action
System Response
1
User choose a zone
Navigate to View Zone Screen
2
User access to light sensors Display index of ambient light
tab
index
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
2.3.4.4. <User> Get pH Degree Use Case

Figure C-21: <User> Get pH Degree Use Case


Table C-18: <User> Get pH Degree Specification
USE CASE UC11
Use Case No.
UC11
Use Case Version 2.0
Use Case Name Get pH Degree
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary:
- User can monitor pH Degree via web server and mobile application.
Goal:
- Users can view nearly pH degree.
Triggers:
- User chooses a zone to view index.
Preconditions:
- User must logged into the system.
- PH degree sensors must be connected to the system.
Post Conditions:
- Success: User can view index of pH degree in a zone.
SUMMER 2016

PAGE 66 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- Fail: Display a message error
Main Success Scenario:
Step
Actor Action
1
User choose a zone
2
User access to pH Degree
sensors tab
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A

System Response
Navigate to View Zone Screen
Display index of pH Degree
index

2.3.4.5. <User> Get Soil Moisture Use Case

Figure C-22: <User> Get Soil Moisture Use Case


Table C-19: <User> Get Soil Moisture Specification
USE CASE UC12
Use Case No.
UC12
Use Case Version 2.0
Use Case Name Get Soil Moisture
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary:
- User can monitor soil moisture via web server and mobile application.
Goal: - Users can view nearly soil moistures index.
Triggers:
- User chooses a zone to view index.
Preconditions:
- User must logged into the system.
- Soil moisture sensors must be connected to the system.
Post Conditions:
- Success: User can view index of soil moisture in a zone.
- Fail: Display a message error
Main Success Scenario:
Step
Actor Action
System Response
1
User choose a zone
Navigate to View Zone Screen
SUMMER 2016

PAGE 67 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2

User access to soil moisture


sensors tab
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A

Display index of soil moisture


index

2.3.5. <User> Control End Devices Overview Use Case

Figure C-23: <User> Control End Devices Overview Use Case


2.3.5.1. <User> Switch On/Off Light Use Case

Figure C-24: <User> Switch On/Off Light


Table C-20: <User> Switch On/Off Light Specification
USE CASE UC13
Use Case No.
UC13
Use Case Version 2.0
Use Case Name Switch On/Off Light
ChinhPH60147
Author
08/06/2016
High
Date
Priority

SUMMER 2016

PAGE 68 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Actor: - User
Summary:
- This use case allow user to turn on/off light in manual.
Goal:
- Turn on/off light based on command which received on mobile application
Triggers:
- Light is connected to the system.
Preconditions: - N/A
Post Conditions:
- Success: Light is turned on/off.
- Fail: Display a message error.
Main Success Scenario:
Step
Actor Action
System Response
1
User access to a zone
Display indexes of zone
2
User access to Control
Display status of devices in
Device tab
zone
3
Turn on/off light
Light is turned on/off
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
2.3.5.2. <User> Change Control Mode Use Case

Figure C-25: Change Control Mode Use Case

SUMMER 2016

PAGE 69 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Figure C-26: Control Manual Use Case

Figure C-27: <User> Change Control Mode Use Case


Table C-21: <User> Change Control Mode Specification
USE CASE UC14
Use Case No.
UC14
Use Case Version 2.0
Use Case Name Change Control Mode
ChinhPH60147
Author
08/06/2016
High
Date
Priority
Actor: - User
Summary: - This use case allows user can change mode of control, from
automatic to manual and reverse.
Goal:
- Change mode of control between automatic and manual.
- The system response with change of mode control.
Triggers: - N/A
Preconditions: - N/A
Post Conditions:
- Success: Automatic/Manual is on/off.
- Fail: Display a message error.
Main Success Scenario:
Step
Actor Action
System Response
1
[Alternative 1]
SUMMER 2016

PAGE 70 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
[Alternative 2]
User send command to
change mode of control in a
node
Alternative Scenario 1:
Step
Actor Action
1
User choose Automatic
mode
Alternative Scenario 2:
Step
Actor Action
1
User choose Manual mode

Update status of mode to


database.
Display a successful message.
System Response
Enable scenario for algorithm
based on sensor
Change value from Manual to
Automatic
System Response
Change status of end devices
to off.
Disable scenario for algorithm.
Change value from Automatic
to Manual.

Exceptions:
Step
Actor Action
System Response
1
User change control mode
Reload status of mode control
unsuccessful
to the last state on database.
Relationships: N/A
Business Rules:
- After change to Automatic, the system will work based on indexes of
sensors through algorithm.
- After change to Manual, the system still receive index from sensors but
does not use algorithm to control end devices.
2.3.5.3. <User> Switch On/Off Devices Automatic Overview Use Case

Figure C-28: <User> Switch On/Off Devices in Automatic Overview Use


Case
SUMMER 2016

PAGE 71 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
<User> Switch On/Off Roof in Automatic Use Case

Figure C-29: <User> Switch On/Off Roof in Automatic Use Case


Table C-22: <User> Switch On/Off Roof in Automatic Specification
USE CASE UC15
Use Case No.
UC15
Use Case Version 2.0
Use Case Name Switch On/Off Roof in Automatic
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary: - This use case define how the system control roof in automatic
Goal: - System control status of roof device through algorithm.
Triggers: - Automatic mode is enabled.
Preconditions:
- Received sensors to meet fully comparison with user define indexes in
zone through algorithm.
Post Conditions:
- Success: Algorithm switch on/off roof successful.
- Fail: Display an error message.
Main Success Scenario:
Step
Actor Action
System Response
1
Receive sensors index about
temperature and humidity.
Put received indexes with
defined indexes into algorithm.
Switch On when
Switch Off when
User sends command to
Display status of roof device.
view status of roof device.
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
SUMMER 2016

PAGE 72 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
<User> Switch On/Off Water in Automatic Use Case

Figure C-30: <User> Switch On/Off Water in Automatic Use Case


Table C-23: <User> Switch On/Off Water in Automatic Specification
USE CASE UC16
Use Case No.
UC16
Use Case Version 2.0
Use Case Name Switch On/Off Water in Automatic
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary: - This use case define how the system control water in automatic
Goal: - System control status of water pump through algorithm.
Triggers: - Automatic mode is enabled.
Preconditions:
- Received sensor of soil moisture to meet fully comparison with user
defines indexes in zone through algorithm.
Post Conditions:
- Success: Algorithm switches on/off water successful.
- Fail: Display an error message.
Main Success Scenario:
Step
Actor Action
System Response
1
Receive sensors index about
soil moisture.
Put received indexes with
defined indexes into algorithm.
Switch On when
Switch Off when
User sends command to
Display status of water device.
view status of water device.
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
SUMMER 2016

PAGE 73 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
<User> Switch On/Off Water in Automatic Use Case

Figure C-31: <User> Switch On/Off Misting in Automatic Use Case


Table C-24: <User> Switch On/Off Misting in Manual Use Case
USE CASE UC17
Use Case No.
UC17
Use Case Version 2.0
Use Case Name Switch On/Off Misting in Automatic
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary: - This use case define how the system control misting in
automatic
Goal: - System control status of misting through algorithm.
Triggers: - Automatic mode is enabled.
Preconditions:
- Received sensor of temperature and humidity to meet fully comparison
with user defines indexes in zone through algorithm.
Post Conditions:
- Success: Algorithm switches on/off misting successful.
- Fail: Display an error message.
Main Success Scenario:
Step
Actor Action
System Response
1
Receive sensors index about
temperature and humidity.
Put received indexes with
defined indexes into algorithm.
Switch On when
Switch Off when
User sends command to
Display status of misting
view status of misting
device.
device.
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
SUMMER 2016

PAGE 74 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.5.4. <User> Switch On/Off Devices Manual Overview Use Case

Figure C-32: <User> Switch On/Off Devices in Manual Overview Use Case
<User> Switch On/Off Roof in Manual Use Case

Figure C-33: <User> Switch On/Off Roof in Manual Use Case


Table C-25: <User> Switch On/Off Roof in Manual Specification
USE CASE UC18
Use Case No.
UC18
Use Case Version 2.0
Use Case Name Switch On/Off Roof in Manual
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor:- User
Summary: - This use case allows user can control on/off roof device
without algorithm.
SUMMER 2016

PAGE 75 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Goal: - User control roof device directly.
Triggers: - Manual mode is enabled.
Preconditions: - Algorithm is disabled.
Post Conditions:
- Success: Switch on/off roof device successful.
- Fail: Display an error message.
Main Success Scenario:
Step
Actor Action
System Response
1
User sends command to
Change status of roof device.
control roof device.
Update status to database.
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
<User> Switch On/Off Roof in Manual Use Case

Figure C-34: <User> Switch On/Off Water in Manual Use Case


Table C-26: <User> Switch On/Off Water in Manual Specification
USE CASE UC19
Use Case No.
UC19
Use Case Version 2.0
Use Case Name Switch On/Off Water in Manual
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor:
- User
Summary:
- This use case allows user can control on/off water device without
algorithm.
Goal:
- User control water device directly.
SUMMER 2016

PAGE 76 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Triggers:
- Manual mode is enabled.
Preconditions:
- Algorithm is disabled.
Post Conditions:
- Success: Switch on/off water device successful.
- Fail: Display an error message.
Main Success Scenario:
Step
Actor Action
System Response
1
User sends command to
Change status of roof device.
control roof device.
Update status to database.
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
<User> Switch On/Off Misting in Manual Use Case

Figure C-35: <User> Switch On/Off Misting in Manual Use Case


Table C-27: <User> Switch On/Off Misting in Manual Specification
USE CASE UC20
Use Case No.
UC20
Use Case Version 2.0
Use Case Name Switch On/Off Roof in Manual
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - User
Summary:
- This use case allows user can control on/off misting device without
algorithm.
Goal:
- User control misting device directly.
SUMMER 2016

PAGE 77 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Triggers:
- Manual mode is enabled.
Preconditions:
- Algorithm is disabled.
Post Conditions:
- Success: Switch on/off misting device successful.
- Fail: Display an error message.
Main Success Scenario:
Step
Actor Action
System Response
1
User sends command to
Change status of misting
control misting device.
device.
Update status to database.
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
2.3.6. <Main Controller > Switch On/Off Devices Overview Use Case

Figure C-36: <Main Controller> Switch On/Off Devices Overview Use Case

SUMMER 2016

PAGE 78 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.6.1. <Main Controller> Switch On/Off Light Use Case

Figure C-37: <Main Controller> Switch On/Off Light


Table C-28: <Main Controller> Switch On/Off Light Specification
USE CASE UC21
Use Case No.
UC21
Use Case Version 2.0
Use Case Name Switch On/Off Light
ChinhPH60147
Author
08/06/2016
High
Date
Priority
Actor:
- Main Controller on Hardware
Summary:
- This use case shows that Main Controller control light device.
Goal:
- Output GPIO to control light device
Triggers:
- Light is connected to the system.
Preconditions:
- N/A
Post Conditions:
- Success: Light is turned on/off.
- Fail: Try to get status of light again.
Main Success Scenario:
Step
Actor Action
System Response
1
Receive changes of status light
from mobile.
Request status of light
Response status
Turn on/off light
Alternative Scenario: - N/A
Exceptions:
Step
Actor Action
System Response
1
Request status fail
Waiting for new request
2
Request status success
Response status fails.
Stop response.
Relationships: - N/A
Business Rules: - N/A
SUMMER 2016

PAGE 79 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.6.2. <Main Controller> Switch On/Off Water Use Case

Figure C-38: <Main Controller> Switch On/Off Water


Table C-29: <Main Controller> Switch On/Off Water Specification
USE CASE UC22
Use Case No.
UC22
Use Case Version 2.0
Use Case Name Switch On/Off Light
ChinhPH60147
Author
08/06/2016
High
Date
Priority
Actor: - Main Controller on Hardware
Summary:
- This use case shows that Main Controller control water pump.
Goal: - Output GPIO to control water pump.
Triggers:
- Water pump is connected to the system.
Preconditions: - N/A
Post Conditions:
- Success: Water Pump is turned on/off.
- Fail: Try to get status of water pump again.
Main Success Scenario:
Step
Actor Action
System Response
1
Receive changes of status
water pump from mobile.
Request status of water
Response status
pump
Turn on/off water pump
Alternative Scenario: - N/A
Exceptions:
Step
Actor Action
System Response
1
Request status fail
Waiting for new request
2
Request status success
Response status fails.
Stop response.
Relationships: - N/A
Business Rules: - N/A
SUMMER 2016

PAGE 80 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.6.3. <Main Controller> Switch On/Off Misting Use Case

Figure C-39: <Main Controller> Switch On/Off Misting


Table C-30: <Main Controller> Switch On/Off Misting Specification
USE CASE UC23
Use Case No.
UC23
Use Case Version 2.0
Use Case Name Switch On/Off Misting
ChinhPH60147
Author
08/06/2016
High
Date
Priority
Actor: - Main Controller on Hardware
Summary:
- This use case shows that Main Controller control misting.
Goal: - Output GPIO to control misting.
Triggers:
- Misting is connected to the system.
Preconditions: - N/A
Post Conditions:
- Success: Misting is turned on/off.
- Fail: Try to get status of misting again.
Main Success Scenario:
Step
Actor Action
System Response
1
Receive changes of status
Misting from mobile.
Request status of Misting
Response status
Turn on/off Misting
Alternative Scenario: - N/A
Exceptions:
Step
Actor Action
System Response
1
Request status fail
Waiting for new request
2
Request status success
Response status fails.
Stop response.
Relationships: - N/A
Business Rules: - N/A

SUMMER 2016

PAGE 81 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.6.4. <Main Controller> Switch On/Off Roof Use Case

Figure C-40: <Main Controller> Switch On/Off Roof


Table C-31: <Main Controller> Switch On/Off Roof Specification
USE CASE UC24
Use Case No.
UC24
Use Case Version 2.0
Use Case Name Switch On/Off Roof
ChinhPH60147
Author
08/06/2016
High
Date
Priority
Actor: - Main Controller on Hardware
Summary:
- This use case shows that Main Controller control roof device.
Goal: - Output GPIO to control roof device.
Triggers: - Roof device is connected to the system.
Preconditions: - N/A
Post Conditions:
- Success: Roof device is turned on/off.
- Fail: Try to get status of roof device again.
Main Success Scenario:
Step
Actor Action
System Response
1
Receive changes of status
Roof device from mobile.
Request status of Roof
Response status
device
Turn on/off Roof device
Alternative Scenario: - N/A
Exceptions:
Step
Actor Action
System Response
1
Request status fail
Waiting for new request
2
Request status success
Response status fails.
Stop response.
Relationships: - N/A
Business Rules: - N/A
SUMMER 2016

PAGE 82 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.7. <Main Controller > Tracking Sensors Overview Use Case

Figure C-41: <Main Controller> Tracking Sensors Overview Use Case


2.3.7.1. <Main Controller> Tracking Ambient Light Use Case

Figure C-42: <Main Controller> Tracking Ambient Light


Table C-32: <Main Controller> Tracking Ambient Light Specification
USE CASE UC25
Use Case No.
UC25
Use Case Version 2.0
Use Case Name Tracking Ambient Light
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - Main Controller on Hardware
Summary:
- This use case shows that Main Controller tracking ambient light.
Goal: - Tracking ambient light to send it to system
Triggers: - Ambient Light Sensor is integrated to hardware.
Preconditions: - N/A
Post Conditions:
SUMMER 2016

PAGE 83 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
- Success: Tracking ambient light successful.
- Fail: Try to get light again.
Main Success Scenario:
Step
Actor Action
System Response
1
Send ambient light to
Receive index of light.
system
Insert to database.
Put index into algorithm to
control roof
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
2.3.7.2. <Main Controller> Tracking Temperature Use Case

Figure C-43: <Main Controller> Tracking Temperature


Table C-33: <Main Controller> Tracking Temperature Specification
USE CASE UC26
Use Case No.
UC26
Use Case Version 2.0
Use Case Name Tracking Temperature
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor: - Main Controller on Hardware
Summary: - This use case shows that Main Controller tracking temperature.
Goal: - Tracking temperature to send it to system
Triggers: - Temperature sensor is integrated to hardware.
Preconditions: - N/A
Post Conditions:
- Success: Tracking temperature sensor successful.
- Fail: Try to get temperature again.
Main Success Scenario:
Step
Actor Action
System Response
1
Send temperature to system Receive index of temperature.
Insert to database.
Alternative Scenario: - N/A
Exceptions: - N/A
Relationships: - N/A
Business Rules: - N/A
SUMMER 2016

PAGE 84 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.7.3. <Main Controller> Tracking Humidity Use Case

Figure C-44: <Main Controller> Tracking Humidity Use Case


Table C-34: <Main Controller> Tracking Humidity Specification
USE CASE UC27
Use Case No.
UC27
Use Case Version 2.0
Use Case Name Tracking Humidity
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor:
- Main Controller on Hardware
Summary:
- This use case shows that Main Controller tracking humidity.
Goal:
- Tracking humidity to send it to system
Triggers:
- Humidity is integrated to hardware.
Preconditions:
- N/A
Post Conditions:
- Success: Tracking humidity successful.
- Fail: Try to get humidity again.
Main Success Scenario:
Step
Actor Action
1
Send humidity to system

System Response
Receive index of humidity.
Insert to database.
Put index into algorithm to
control misting.

Alternative Scenario: - N/A


Exceptions:- N/A
Relationships: - N/A
Business Rules: - N/A

SUMMER 2016

PAGE 85 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.7.4. <Main Controller> Tracking pH Degree Use Case

Figure C-45: <Main Controller> Tracking pH Degree Use Case


Table C-35: <Main Controller> Tracking pH Degree Specification
USE CASE UC28
Use Case No.
UC28
Use Case Version 2.0
Use Case Name Tracking pH Degree
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor:
- Main Controller on Hardware
Summary:
- This use case shows that Main Controller tracking pH Degree.
Goal:
- Tracking pH degree to send it to system
Triggers:
- pH Degree Sensor is integrated to hardware.
Preconditions:
- N/A
Post Conditions:
- Success: Tracking pH Degree successful.
- Fail: Try to get pH degree again.
Main Success Scenario:
Step
Actor Action
System Response
1
Send pH degree to system
Receive index of pH.
Insert to database.
Alternative Scenario: - N/A
Exceptions:- N/A
Relationships: - N/A
Business Rules: - N/A

SUMMER 2016

PAGE 86 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3.7.5. <Main Controller> Tracking Soil Moisture Use Case

Figure C-46: <Main Controller> Tracking Soil Moisture Use Case


Table C-36: <Main Controller> Tracking Soil Moisture Specification
USE CASE UC29
Use Case No.
UC29
Use Case Version 2.0
Use Case Name Tracking Soil Moisture
ChinhPH60147
Author
08/06/2016
Normal
Date
Priority
Actor:
- Main Controller on Hardware
Summary:
- This use case shows that Main Controller tracking Soil Moisture.
Goal:
- Tracking Soil Moisture to send it to system
Triggers:
- Ambient Soil Moisture is integrated to hardware.
Preconditions:
- N/A
Post Conditions:
- Success: Tracking Soil Moisture successful.
- Fail: Try to get Soil Moisture again.
Main Success Scenario:
Step
Actor Action
System Response
1
Send Soil Moisture to
Receive index of Soil
system
Moisture.
Insert to database.
Put index into algorithm to
control water pump.
Alternative Scenario: - N/A
Exceptions:- N/A
Relationships: - N/A
Business Rules: - N/A

SUMMER 2016

PAGE 87 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

3. Software System Attribute


3.1. Usability

The system is expected to apply for garden of users who has a garden in
home but they do not have enough time to take care or tracking usually.
There are many plant indexes which gardener are tracking to get higher
productivity in agriculture but the system has some basic sensors which can
help users keep plants live and limit harmful weather with their garden.
System provides friendly GUI for users on their mobile, which is closely
with people in nowadays.
3.2. Reliability

System is expected to run continuously for years without errors (or in


some cases recover by themselves if an error occurs).
Ensure that when system starts a "mission", it has a high probability of
completing that mission without experiencing a failure.
System can safely be shut down for repair, or another way to repair
without stopping system.
3.3. Availability

The server shall be working 24/7. When the system goes in undermaintenance, the page or application will display message "System is
maintaining at the moment. Please check again later". Current system will
work directly with index from sensors.
3.4. Security

Guarantee the personal data of user and protect processes of RF signal


transceiver from unexpected intervention.
3.5. Maintainability

All code shall be fully documented. All program files shall include
comments concerning authorship and date of last change.
The code shall be modular to permit future modifications.
3.6. Portability

The system shall be designed to control and run on Web platform,


Android platform. Make sure that control device must be portable device
as smartphone, tablet
Provided hardware can be plug-and-play
3.7. Performance

This is the system's performance characteristics:


Capacity: end users at the same time.
Response time for a transaction:
Average: 3 second
Maximum: 10 seconds

SUMMER 2016

PAGE 88 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

4. Conceptual Diagram

Figure C-47: Conceptual Diagram

SUMMER 2016

PAGE 89 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

D. Report No. 4 Software Design Description


1. Design Overview
- This document describes the technical and user interface design of
DIMOSG System. It includes the architectural design, the detailed design of
common functions and business functions, and the design of database model.
- The architectural design describes the overall architecture of the system
and the architecture of each main component and subsystem.
- The detailed design describes static and dynamic structure for each
component and functions. It includes class diagrams, class explanations and
sequence diagrams for each use cases.
- The database design describes the relationships between entities and
details of each entity.
- Document overview:
Section 2: gives an overall description of the system architecture
design.
Section 3: gives component diagrams that describe the connection
and integration of the system.
Section 4: gives the detail design description, which includes class
diagram, class explanation, and sequence diagram to details the
application functions.
Section 5: describe screens design and how users interact to systems.
Each screen includes functions, types of input/output, and event
handling.
Section 6: describe a fully attributed ERD.
Section 7: describe algorithms.

SUMMER 2016

PAGE 90 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

2. System Architecture Design

Figure D-1: System Architecture Design


SUMMER 2016

PAGE 91 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.1. Software Architecture Description

Figure D-2: Software Architecture Description


There are two parts in software architecture of this system: Android
application and Web Server.
+ Android application is developed by JAVA language programing with
Android Studio. This application is used to show all user interface, request and
response data with web server via Internet.
+ Web server is developed under Spring MVC Hibernate architecture style.
We choose this architecture because of following advantages:
- Web application contains Web services with MVC architecture; we can
separate business code with Controller and Model. Therefore, we can use
the business code in web service without repeat the code.
- We can organize the code better for maintainability, extensibility,
reusability so we can expand the scope to other kind of illnesses such as flu,
fever...
- In scope of 3-members team, MVC architecture makes it easier to split the
big project into small modules and make it easier to assign each module for
members in our team.
This project follows MVC architecture with following components:
Controller is the part of the web server that acts like event handler to handles
user interaction. Web Controller is the parts of the controller that acts like event
handler for web and server communication via HTTP protocol.
Model is the parts of the web server that acts like a data transfer object
between the system and database, handle business of system. Business is the
parts of the model that do business processing to solve domain problems.
Business Component is the parts of the business that do business of system.
Business Objects is the parts of the business that define some objects to use
in business component.

SUMMER 2016

PAGE 92 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2. Hardware Architecture Description

Figure D-3: Hardware Architecture Description


The hardware architecture contains two parts: Main Controller and Sub
Controller. Main Controller connects with Web Server via Wi-Fi and with Sub
Controller via RF.
2.2.1. Main Controller Detail Design Description

Figure D-4: Main Controller Detail Design Description


Main Controller includes Raspberry Pi 3 and CC1310 Launchpad. We
use UART Serial Port to communicate data between them. Raspberry Pi 3
connects with Web server via HTTP request and HTTP response. CC1310
send and receive data to Sub Controller via RF which created by RF core
in each CC1310 at nodes.
CC1310 at Main Controller is used to communicate with Sub Controller
at nodes via RF Core.

SUMMER 2016

PAGE 93 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2.1.1. Raspberry Pi 3

Figure D-5: Raspberry Pi 3 Overview


Overview: Raspberry Pi 3 is a powerful mini computer, which is use
Broadcom BCM 43438 chip to provide 2.4 GHz 802.11b/g/n wireless
LAN. It is easy to connect hardware system with a Wi-Fi network.
Raspberry Pi 3 plays a role as router or gateway to request and response
with Webserver. There are four USB serial ports, which allow transfer
and receive data with other MCUs more simple because it has a serial
port library on Raspberry. MCUs just send and receive packet via UART
through serial ports with Raspberry.
Detail Specifications: Here are functions that used in system.
Table D-1: Detail Description of Raspberry Pi 3
Specifications
System on Chip Broadcom BCM2837
1.2GHz Quad-Core ARM Cortex-A53
(SoC)
4x ARM Cortex-A53, 1.2GHz
CPU
RAM
Networking
Storage
Ports

1GB LPDDR2 (900 MHz)


Broadcom BCM 43438 chip to provide 2.4 GHz
802.11b/g/n wireless LAN
micro SD
4 x USB 2.0

Power ratings

800mA (4.0W)

Power source

5V, 2.5A via Micro USB or GPIO header

Size
Weight
SUMMER 2016

85.60 * 56.5 mm (3.370 x 2.224 in)


45g
PAGE 94 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2.1.2. CC1310 Launchpad

Figure D-6: CC1310 LaunchPad Overview


Overview: This is the first kit Launchpad with a Sub-1 GHz radio,
which offers long-range connectivity, combined with a 32-bit ARM
Cortex-M3 processor on a single chip. It is a wireless MCU targeting low
power, long-range wireless applications. LaunchPad with Sub-1GHz
radio for wireless applications with integrated PCB trace antenna
Broadband antenna supports both 868 MHz ISM band for Europe and
915 MHz ISM band for US with a single board. The CC1310 device
combines a flexible, very low power RF transceiver with a powerful 48MHz Cortex-M3 microcontroller in a platform supporting multiple
physical layers and RF standards. A dedicated Radio Controller (CortexM0) handles low-level RF protocol commands that are stored in ROM
or RAM, thus ensuring ultralow power and flexibility. The low-power
consumption of the CC1310 device does not come at the expense of RF
performance; the CC1310 device has excellent sensitivity and robustness
(selectivity and blocking) performance.

SUMMER 2016

PAGE 95 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Detail Specifications: Here are functions that used in Main Controller.
Table D-2: Detail Description of CC1310 LaunchPad in Main Controller
Specifications
Microcontroller ARM Cortex M3 48 MHz
128 KB Flash + 128 KB ROM
Memory
20 + 2 + 8 KB SRAM
IEEE 802.15.4g/e proprietary Sub-1 GHz radio
Wireless
Protocol
Broadcom BCM 43438 chip to provide 2.4 GHz
Networking
802.11b/g/n wireless LAN
Wide Supply Voltage Range: 1.8 to 3.8 V
Low Power
Active-Mode RX: 5.5 mA
Active-Mode TX at +10 dBm: 12.9 mA
Active-Mode MCU 48 MHz Running Coremark:
2.5 mA (51 A/MHz)
Active-Mode MCU: 48.5 CoreMark/mA
Active-Mode Sensor Controller at 24 MHz:
0.4 mA + 8.2 A/MHz
Sensor Controller, One Wake Up Every Second
Performing One 12-Bit ADC Sampling: 0.85 A
Standby: 0.6 A (RTC Running and RAM and
CPU Retention)
Shutdown: 185 nA (Wakeup on External Events)
Excellent Receiver Sensitivity 124 dBm Using
RF Section
Long-Range Mode, 110 dBm at 50 kbps
Excellent Selectivity: 52 dB
Excellent Blocking Performance: 90 dB
Programmable Output Power up to +14 dBm
Single-Ended or Differential RF Interface
Suitable for Systems Targeting Compliance With
Worldwide Radio Frequency Regulations
ETSI EN 300 220, EN 303 131,
EN 303 204 (Europe)
FCC CFR47 Part 15 (US)
ARIB STD-T108 (Japan)
Wireless M-Bus and IEEE 802.15.4g PHY
Power source 5V, 0.5A - 3A via Micro USB or DIO pin

SUMMER 2016

PAGE 96 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2.2. Sub Controller Detail Design Description

Sub Controller, that at each node in garden, has a CC1310 Launchpad


which to send and receive data to Main Controller via RF. In addition,
CC1310 connect with end devices such as water pump, pressure pump, light,
and traction motor via DIO pins. I2C sensors wired with CC1310 via SCK
and SDA pins. Signals from analog sensors will processed with Analog
Digital Converter 12-bit inside CC1310.
2.2.2.1. CC1310 Launchpad

Overview: As mentioned above, CC1310 Launchpad is used to


communicate RF in the system from Main Controller to Sub Controller.
Besides that, the 32-bit ARM Cortex-M3 processor runs at 48 MHz as
the main processor and a rich peripheral feature set that includes a unique
ultra-low power sensor controller. This sensor controller is ideal for
interfacing external sensors and for collecting analog and digital data
autonomously while the rest of the system is in sleep mode.
Detail Specifications: Here are functions that used in Sub Controller.
Specification
Microcontroller ARM Cortex M3 48 MHz
128 KB Flash + 128 KB ROM
Memory
20 + 2 + 8 KB SRAM
IEEE 802.15.4g/e proprietary Sub-1 GHz radio
Wireless
Protocol
Broadcom BCM 43438 chip to provide 2.4 GHz
Networking
802.11b/g/n wireless LAN
All Digital Peripheral Pins Can Be Routed to
Peripherals
SUMMER 2016

PAGE 97 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Low Power

RF Section

Power source
SUMMER 2016

Any GPIO
Four General-Purpose Timer Modules
(Eight 16-Bit or Four 32-Bit Timers, PWM Each)
12-Bit ADC, 200 k samples/s, 8-Channel Analog
MUX
Continuous Time Comparator
Ultralow Power Clocked Comparator
Programmable Current Source
UART - 2 SSI (SPI, MICROWIRE, TI)
I2C - I2S
Real-Time Clock (RTC)
AES-128 Security Module
True Random Number Generator (TRNG)
Support for Eight Capacitive Sensing Buttons
Integrated Temperature Sensor
Wide Supply Voltage Range: 1.8 to 3.8 V
Active-Mode RX: 5.5 mA
Active-Mode TX at +10 dBm: 12.9 mA
Active-Mode MCU 48 MHz Running Coremark:
2.5 mA (51 A/MHz)
Active-Mode MCU: 48.5 CoreMark/mA
Active-Mode Sensor Controller at 24 MHz:
0.4 mA + 8.2 A/MHz
Sensor Controller, One Wake Up Every Second
Performing One 12-Bit ADC Sampling: 0.85 A
Standby: 0.6 A (RTC Running and RAM and
CPU Retention)
Shutdown: 185 nA (Wakeup on External Events)
Excellent Receiver Sensitivity 124 dBm Using
Long-Range Mode, 110 dBm at 50 kbps
Excellent Selectivity: 52 dB
Excellent Blocking Performance: 90 dB
Programmable Output Power up to +14 dBm
Single-Ended or Differential RF Interface
Suitable for Systems Targeting Compliance With
Worldwide Radio Frequency Regulations
ETSI EN 300 220, EN 303 131,
EN 303 204 (Europe)
FCC CFR47 Part 15 (US)
ARIB STD-T108 (Japan)
Wireless M-Bus and IEEE 802.15.4g PHY
5V, 0.5A - 3A via Micro USB or DIO pin
PAGE 98 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2.2.2. Ambient Light Sensor

Figure D-7: Module BH1750-FVI


Overview: Reason for using ambient light sensor BH1750 FVI:
- Cheap sensor, easy to buy via market.
- Detect light and convert to ambient light unit (lux) quickly.
- I2C interface, less pin more peripheral devices.
Specification:
+ Block diagram

Figure D-8: BH1750-FVI Block Diagram


PD: Photo diode with approximately human eye response.
AMP: Integration-OPAMP for converting from PD current to Voltage.
ADC: AD converter for obtainment Digital 16bit data.
Logic + I2C Interface: Ambient Light Calculation and I2C BUS
Interface. It is including below register.
Data Register this is for registration of Ambient Light Data. Initial
Value is "0000_0000_0000_0000".
Measurement Time Register this is for registration of measurement
time. Initial Value is "0100_0101".
OSC: Internal Oscillator (typ. 320 kHz) is CLK for internal logic.
+ Input and Output Pins:
Table D-3: BH1750 Ouput Pins
No.
Name
I/O
Description
1
VCC
Power Supply 3.3V
2
GND
Ground
3
SCL
I
Serial Clock Line
4
SDA
I-O Serial Data Line
SUMMER 2016

PAGE 99 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Figure D-9: BH1750 Flow Chart


The BH1750-FVI can measure ambient light in many modes. There
are six modes resolution mode and two ways to change measurement
time. It also has two different slave address of I2C when ADDR Pin is
changed. As we discussed, 0x23 is chosen slave address and 0x10
(Continuously H-Resolution Mode) is used as definite mode to measure
ambient light.
2.2.2.3. Temperature and Humidity Sensor HDC 1008

Figure D-10: Module HDC1008


Overview: This sensor using I2C interface. It has 2 address select pins.
It also 3-5V power and logic safe so the system do not need any level
shifters or regulators to use with a 5V or 3V microcontroller.
Note: TI has indicated that there is a 'settling' effect for the humidity
and that you will need to re-hydrate the sensor once you receive it. To
rehydrate it, place it in a location with 85% humidity for 24 hours or 60%
humidity for 10 days.

SUMMER 2016

PAGE 100 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Specification:
+ Block diagram

Figure D-11: HDC1008 Block Diagram


Table D-4: HDC1008 Output Pins
No.
Name
I/O
Description
1
VCC
3-5V
2
GND
Ground
3
SCL
I
Serial Clock Line. 3-5V logic
4
SDA
I-O Serial Data Line. 3-5V logic
5
RDY
I
Interrupt/ready. Open collector
6
A0
Address pin A0 = Address + 1
7
A1
Address pin A0 = Address + 2
RDY - This is the interrupt/'ready' pin from the HDC100x. The chip has some
capability to 'alert' you when data is ready to be read from the sensor. We do
not use this pin in our library but it is available if you need it! It is open
collector so you need to use a pull-up resistor if you want to read signal from
this pin.
A0 A1 - These are the address select pins. Since you can only have one device
with a given address on an i2c bus, there must be a way to adjust the address
if you want to put more than one HDC100X on a shared i2c bus. The A0/A1
pins set the bottom 2 bits of the i2c address. There are pull-down resistors on
the board so connect them to VIN to set the bits to '1'. They are read on power
up, so de-power and re-power to reset the address.

SUMMER 2016

PAGE 101 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2.2.4. Soil Moisture Sensor using LM393

Figure D-12: Module Soil Moisture Sensor using LM393


Overview: This is a simple water sensor can be used to detect soil
moisture when the soil moisture deficit module outputs a high level, and
vice versa output low. Use this sensor produced an automatic plantwatering device, so that the plants in your garden without people to
manage. Small board analog output AO and AD module connected
through the AD converter, to get more precise values of soil moisture.
Specification:
+ Schematic

Figure D-13: Module Soil Moisture Sensor Schematic


SUMMER 2016

PAGE 102 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

No.
1
2
3
4

Table D-5: Soil Moisture Sensor Output Pins


Name
I/O
Description
VCC
3.3-5V
GND
Ground
DO
O Digital value output connector (0 or 1)
AO
O Analog value output connector
2.2.2.5. PH Meter DFRobot PH Meter Kit

Figure D-14: Module DFRobot pH Meter


Overview: It has an LED, which works as the Power Indicator, a
BNC connector and PH2.0 sensor interface. You can just connect the pH
sensor with BNC connector, and plug the PH2.0 interface into any analog
input on MCU to read pH value easily.

SUMMER 2016

PAGE 103 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Specification:
- Module Power: 5.00V
- Module Size: 43mmx32mm
- Measuring Range: 0-14PH
- Measuring Temperature: 0-60
- Accuracy: 0.1pH (25 )
- Response Time: 1min
- PH Sensor with BNC Connector
- PH2.0 Interface (3-foot patch)
- Gain Adjustment Potentiometer
- Power Indicator LED
Table D-6: Module pH Meter Kit Output Pins
No.
Name
I/O
Description
1 VCC
5V
2 GND
Ground
4 AO
O Analog value output connector
2.2.3. Shield Power Supplier and Controller
2.2.3.1. DC Switching Regulators

Figure D-15: LM2576-ADJ chip

Figure D-16: LM2576-ADJ pinout

Table D-7: LM2576-ADJ Description


Description
DC DC Switching Regulators
Category
Integrated Circuits (ICs)
Type
Step-Down (Buck)
Output Type
Adjustable
Voltage - Output
1.23 V ~ 37 V
Current - Output
3A
Frequency - Switching
52kHz
Voltage - Input
4 V ~ 40 V

SUMMER 2016

PAGE 104 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

2.2.3.2. Diodes Schottky

Figure D-17: Diodes Schottky SS34


Description
DIODE SCHOTTKY
Diode Type
Schottky
Voltage - DC Reverse (Vr) (Max)

40V

Current - Average Rectified (Io)

3A

Voltage - Forward (Vf) (Max)

500mV @ 3A
Fast Recovery =< 500ns, > 200mA
(Io)
500A @ 40V

Speed
Current - Reverse
2.2.3.3. JACK DC 002

Description
Socket

SUMMER 2016

Figure D-18: Jack DC 002


Jack DC 002
1.35 mm in D, 3.5mm Out D

PAGE 105 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2.3.4. SWITCH MSS-22D18

Figure D-19: Switch on Shield


Table D-8: Switch Description
Description
Switch MSS-22D18
Temperature
-2080
Rated Load
DC 30V 0.3A
Contact Resistance
80m MAX
Insulation Resistance
100M
Withstand Votage
AC250V 50Hz 1min
Operating Force
200gf100gf
Life
10,000cycles min.
Size
3.5x9.1MM
2.2.3.5. Tantalum Capacitors 1210

Figure D-20: Tantalum Capacitors


Table D-9: Tantalum Capacitors Description
Description
CAP TANT 100UF 6.3V 10% 1210
Category
Capacitors
Capacitance
100F
Voltage - Rated
6.3V
Tolerance
10%
Operating Temperature -55C ~ 125C
Package / Case
1210 (3528 Metric)
Size / Dimension
0.138" L x 0.110" W (3.50mm x 2.80mm)
SUMMER 2016

PAGE 106 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2.3.6. Ceramic Capacitor 0805

Figure D-21: CAP 10F 50V CERM CHIP 0805 SMD


Table D-10: CAP 10F 50V CERM CHIP 0805 SMD Description
Description
CAP CER 10UF 50V 20% X5R 0805
Capacitance
10F
Tolerance
20%
Voltage - Rated
50V
Operating Temperature -55C ~ 85C
Package / Case
0805 (2012 Metric)
0805 (2012 Metric)
0.079" L x 0.049" W (2.00mm x 1.25mm)

Figure D-22: CAP 100nF 50V CERM CHIP 0805 SMD


Table D-11: CAP 100nF 50V CERM CHIP 0805 SMD Description
Description
CAP 100nF 50V CERM CHIP 0805 SMD
Capacitance
100nF
Voltage - Rated
50V
Tolerance
5%
Package / Case
0805 (2012 Metric)
Operating Temperature -55C ~ 125C
0805 (2012 Metric)
0.079" L x 0.049" W (2.00mm x 1.25mm)

SUMMER 2016

PAGE 107 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2.3.7. Red Side LED 0805

Figure D-23: Red Side LED 0805


Table D-12: CAP 100nF 50V CERM CHIP 0805 SMD Description
Description
CAP 100nF 50V CERM CHIP 0805 SMD
Power Consumption
80mW
Color
Red
Forward Current
20mA
Forward Voltage
1.8-2.6VDC
Reverse Current
10uA
Reverse Voltage
5V
Dimensiones LxWxH (mm) 1.5 x 1.0 x 0.5 (0805)
2.2.3.8. USB Female

Figure D-24: AF180 Female USB-A connector


Table D-13: USB Female Description
Description AF180 Female USB-A connector
USB TYPE
Female A

SUMMER 2016

PAGE 108 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2.3.9. Power inductors

Figure D-25: RH127 100uH 3A


Table D-14: RH127 100uH 3A
Description
RH127 100uH 3A
Inductance
100uH
Test Frequency 1Khz
DC Resistance
0.22Ohm
Current
3A
Size
SMD L x W x H = 12 x 12 x 8 mm
2.2.3.10. Opt isolators

Figure D-26: PC817X2NIP0F


Table D-15: PC817X2NIP0F
Description
PC817X2NIP0F
Package / Case:
SMD-4
Output Type:
NPN Phototransistor
Number of Channels:
Number of Channels:
Isolation Voltage:
5000 Vrms
Mounting Style:
SMD/SMT
2.2.3.11. High-Voltage, High-Current Darlington Transistor Arrays

Figure D-27: ULN2003A


SUMMER 2016

PAGE 109 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Table D-16: ULN2003A Description
Description
ULN2003A
Current (Single Output) 500-mA-Rated Collector
High-Voltage Outputs
50 V
Inputs
Compatible With Various Types of Logic
supply voltages
6 V to 15 V.
Applications
Relay-Driver Applications
2.2.3.12. SMD 0805 5% Resistor

Figure D-28: 220 Ohm 0805 5%


220 Ohm 0805 5%

Figure D-29: 1K Ohm 0805 5%


1K Ohm 0805 5%

Table D-17: SMD 0805 5% Resistor


SMD Resistor 1K OHM (Code
102) 1/8W 5% 0805 SMD
Description
SMD Resistor 220 OHM (Code
221) 1/8W 5% 0805 SMD
Category
Resistors
Resistance (Ohms)
220, 1k
Power (Watts)
1/8W
Tolerance
5%
Packaging
Tape & Reel (TR)
Composition
Thick Film
Temperature Coefficient
100ppm/C
2.2.3.13. Terminal Blocks

Description
Number of pin
voltage
SUMMER 2016

Figure D-30: 3-Pin 128V-5.0 Terminal


3-Pin 128V-5.0 Terminal
3 Pins
125 V
PAGE 110 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
current
Contact resistance
Pin diameter
Pitch

10 A
20 milliohm
1.1 mm
5 mm
Figure D-31: 3-Pin 128V-5.0 Terminal

2.2.3.14. Relay YL303H-S-5VDC

Figure D-32: Relay YL303H-S-5VDC


Table D-18: Relay YL303H-S-5VDC Description
Description
Relay YL303H-S-5VDC
Current (A)
7- 12
Voltage supply 5VDC
Load
7A 250VAC
12A 125VAC
12A 24VDC
2.3. Software Hardware Connection Architecture Description

Figure D-33: Hardware - Software Connection Architecture Description


The model use wireless protocol to communicate between hardware and software.
There is Internet Connected for almost people, who live in the city, the model use WiFi to connect hardware to Webserver via HTTP protocol. This solution not only helps
keep stable of data in transceiver but also helps user control their system from anywhere
in anytime.

SUMMER 2016

PAGE 111 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

3. Component Diagram
3.1. Physical Component Diagram

Figure D-34: Physical Component Diagram


SUMMER 2016

PAGE 112 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
3.2. Logical Component Diagram

Figure D-35: Logical Component Diagram


3.3. Component Dictionary
Table D-19: Component Dictionary
Component Dictionary: Describes components
Android application
Android Application
Component to handle database
Database
Gateway Node handle control equipment and
Main Controller
upload data to gateway/router
Router/Gateway to request and response with
Raspberry Pi 3
server
Microcontroller provides I2C, SPI, UART
CC1310 Launchpad
protocol and GPIO control. Component to
Smart RF
handle provide RF transfer/receive services
Component to handle provide collect data from
Sub Controller
sensors process and control end devices.
Component to handle provide collect
HDC1008 Module
temperature and humidity data process for Data
Collector Node
Component to handle provide collect ambient
BH1750 Module
light for Data Collector Node
Component to handle provide collect soil
LM393 Module
moisture data process for Sub Controller
SUMMER 2016

PAGE 113 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

4. Detailed Description
4.1. Class Diagram

Figure D-36: Class Diagram


4.2. Class Diagram Explanation
4.2.1. Library Info

Table D-20: Library Info Explanation


Attribute
libID
libPlantName
libTypePlant
libHighPH
libLowPH
libHighLight
libLowLight
libHighHumidity
libLowHumidity
libHighTemperature
libLowTemperature
libHighSoilMoisture
SUMMER 2016

Type
Int
String
String
Float
Float
Float
Float
Float
Float
Float
Float
Float

Visibility
Private
Private
Private
Private
Private
Private
Private
Private
Private
Private
Private
Private

Description
Unique identifier of a plant in library
Plant of name
Type of plant
High threshold of pH degree
Low threshold of pH degree
High threshold of light intensity
Low threshold of light intensity
High threshold of humidity
Low threshold of humidity
High threshold of temperature
Low threshold of temperature
High threshold of soil moisture

PAGE 114 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
Float

libLowSoilMoisture

Private

Low threshold of soil moisture

4.2.2. Account

Table D-21: Account Explanation


Attribute
Username
Password
Fullname
Role
email
phone
Method
checkLogin
getUser

Type
String
String
String
String
String
Integer
Type
boolean
void

Visibility
Private
Private
Private
Private
Private
Private
Visibility
Private
Private

Description
Unique username for each user
Password of User
Full Name of User
Role of User
Email of User
Phone of User
Description
Check username and password
Get username of user

4.2.3. User Library

Table D-22: User Library Explanation


Attribute
userLibID

Type
Int

Visibility
Private

username
userPlantName
userTypePlan
userHighPH
userLowPH
userHighLight
userLowLight
userHighHumidity
userLowHumidity
userHighTemperature
userLowTemperature
userHighSoilMoisture
userLowSoilMoisture
userFertilizeDate

String
String
String
Float
Float
Float
Float
Float
Float
Float
Float
Float
Float
Datetime

Private
Private
Private
Private
Private
Private
Private
Private
Private
Private
Private
Private
Private
Private

userLifeCycleOfPlant
Method
insertUserLibrary
updateUserLibrary
deleteUserLibrary
getUserLibrary
getListUserLibrary

Int
Type
void
void
void
Library
List

Private
Visibility
Private
Private
Private
Private
Private

Description
Unique identifier of a plant which user
define in user library
User who define a plant
Name of plant which user define
Type of plant which user define
High threshold of pH degree
Low threshold of pH degree
High threshold of light intensity
Low threshold of light intensity
High threshold of humidity
Low threshold of humidity
High threshold of temperature
Low threshold of temperature
High threshold of soil moisture
Low threshold of soil moisture
Date of Fertilize Date which user
define
Life Cycle of a plant
Description
Insert new plant to Library Info
Update a plant in Library Info
Delete a plant in Library Info
Get ID of a plant in Library Info
Get List of plant from Library Info

4.2.4. Zone

Table D-23: Zone Explanation


Attribute
zoneID
zoneName
SUMMER 2016

Type
Int
String

Visibility
Private
Private

Description
Unique ID for each zone
Zone Name

PAGE 115 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
userLibraryID
deviceCode

Int
String

Private
Private

location
createDate
Method
checkExistDevice
getZone
updateZone
deleteZone
addZone

String
Datetime
Type
boolean
List<zone>
void
Boolean
Void

Private
Private
Visibility
Private
Private
Private
Private
Private

ID of plant in a zone
Device code to identify devices in
zone
Location of zone
Date create zone
Description
Check end devices exist in system
Get ZONE
Update information of plant in zone
Delete zone
Add zone

4.2.5. Sensor Info

Table D-24: Sensor Info Explanation


Attribute
sensorID
zoneID
ph
light

Type
Int
Int
Float
Float

Visibility
Private
Private
Private
Private

humidity
temperature

Float
Float

Private
Private

soilMoisture
syncTime

Float
Datetime

Private
Private

Method
insertSensor
getSensorInfo

Type
Visibility
boolean
Private
List<zone> Private

getSensorInfobyZoneID Int

Private

Description
Unique ID for set of sensors
Zone ID include sensors
pH degree (reach realtime)
light intensity (reach
realtime)
Humidity (reach realtime)
Temperature degree (reach
realtime)
Soil Moisture (reach realtime)
Synchonization Date when
get indexes from sensors
Description
Insert new sensor
Get indexes of sensors from
Sub C
Get indexes of sensor from
zoneID

4.2.6. End Devices

Table D-25: End Devices Explanation


Attribute
enddeviceID
zoneID
statusPump
statusCovered
statusMisting
statusFertilize
statuslamp
statusPH
Method
updateEnddevice
getEnddeviceByZoneID

SUMMER 2016

Type
Int
Int
Bit
Bit
Bit
Bit
Bit
Bit
Type
boolean
Int

Visibility
Private
Private
Private
Private
Private
Private
Private
Private
Visibility
Private
Private

Description
ID of set enddevices in one node
Zone ID include end devices
Startus of pump
Status of covered
Status of misting
Status of machine fertilize
Status of lamp
Waning high or low index PH
Description
Update status enddevice
Return result is enddevice.

PAGE 116 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3. Interaction Diagram
4.3.1. Login Sequence Diagram

Figure D-37: Login Sequence Diagram


SUMMER 2016

PAGE 117 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.2. Show Zone Sequence Diagram

Figure D-38: Show Zone Sequence Diagram


SUMMER 2016

PAGE 118 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.3. Update Zone Sequence Diagram

Figure D-39: Update Zone Sequence Diagram


SUMMER 2016

PAGE 119 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.4. Add Zone Sequence Diagram

Figure D-40: Add Zone Sequence Diagram


SUMMER 2016

PAGE 120 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.5. Delete Zone Sequence Diagram

Figure D-41: Delete Zone Sequence Diagram


SUMMER 2016

PAGE 121 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.6. Show Sensor Sequence Diagram

Figure D-42: Show Sensor Sequence Diagram


SUMMER 2016

PAGE 122 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.7. Show History Sensors Sequence Diagram

Figure D-43: Show History Sensors Sequence Diagram


SUMMER 2016

PAGE 123 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.8. Insert Sensor to Database Sequence Diagram

Figure D-44: Insert Sensor to Database Sequence Diagram


SUMMER 2016

PAGE 124 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.9. Add New Plant Sequence Diagram

Figure D-45: Add New Plant Sequence Diagram


SUMMER 2016

PAGE 125 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.10. Control End Devices Automatic

Figure D-46: Control End Devices Automatic Sequence Diagram


SUMMER 2016

PAGE 126 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.11. Control End Device Sequence Diagram

Figure D-47: Control End Device Sequence Diagram


SUMMER 2016

PAGE 127 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.3.12. Show End Device Sequence Diagram

Figure D-48: Show End Device Sequence Diagram


SUMMER 2016

PAGE 128 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

5. Interface
5.1. Component Interface

Table D-26: Component Interface


Signature
public boolean checkLogin
(String username, String password)
public List<Zone> getZoneInfo
(Integer userLibID)
public void
addZone(Zone zone)
public List<Userlibrary>
getUserlibraryList (String username)
public void addUserlibrary
(Userlibrary userlibrary)
Userlibrary getUserlibrary
(Integer userLibID)
public String updatezone
(UserlibraryDTO userlibraryDTO)
public SensorinfoDTO
findSensorInfo( Integer zoneID)
public List<SensorinfoDTO>
listsensor(Integer zoneID)
public Enddevice
updateEnddeviceByUser
(Enddevice enddevice)
SUMMER 2016

Description

Input

Check login user

Request(userna
me, password)
Show list zone of
Request
user
(userLibID)
Add new one zone
Request
in system
(zone)
Show list userlib of Request
user
(user)
Add new one plant
Request
in library
(userlibrary)
Show information of Request
plant in zone
(userLibID)
Update information Request(userlib
of zone and plant
raryDTO)
Show sensorinfo of Request
zone
(zoneID)
Show list sensor
Request
have insert in sever (zoneID)
Update actuator in
Request
zone
(enddevice)

PAGE 129 OF 197

Output
Json
Boolean
Object
Json
Message
List
object
Object
Json
Object
Json
Object
Json
Object
Json

Output
Format

Exception

Boolean

Rollback

Object

Rollback

Show
object
List
object

Rollback
Rollback

Object

Rollback

Object

Rollback

Object

Rollback

Object

Rollback

List json

List
object

Rollback

Object
Json

Object

Rollback

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.2. User Interface Design
5.2.1. Login

Figure D-49: Login Screen Interface


Fields
No
1
2

Field
Description
Name
Username Fill user
name
Password Fill password

Buttons/Hyperlinks
No
Function
3
NG
NHP

SUMMER 2016

Read
Control Data Leng
Mandatory
only
Type Type
th
No
Yes
Textbox String N/A
No

Yes

Description
Login into
the system

PAGE 130 OF 197

Textbox String N/A


Validation
N/A

Outcome
Transfer to
show zone

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.2.2. Zone Management

Figure D-50: Zone Management Screen


Fields
No
1
2

Field
Name
Danh
sch
khu
Khu
A

Description
All zone of
user
Zone name

Read
Control Data
Mandatory
Length
only
Type
Type
No
Yes
Label
String N/A
No

Yes

Buttons/Hyperlinks
No Function Description
3
+
Add new zone the system

SUMMER 2016

PAGE 131 OF 197

Label

Validation
N/A

String N/A

Outcome
Transfer to
show add zone

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.2.3. Add zone

Figure D-51: Add Zone Screen


Fields
No Field
Name
1
To
khu
vc
mi
2
Chn
t th
vin
3
Khu
Vc
4
M
Thit
B
5
a
im

Description Read Mandatory Control Data Length


only
Type
Type
Funson of
No
Yes
Label
String N/A
screen
List plant of No
user

Yes

Area name
of user
Device
code

No

Yes

drop
String N/A
down
list
Textbox String N/A

No

Yes

Textbox String N/A

Location of
plant

No

Yes

Textbox String N/A

Buttons/Hyperlinks
No Function Description
4
+
Add new zone the system

SUMMER 2016

PAGE 132 OF 197

Validation
N/A

Outcome
Transfer to
show zone

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.2.4. Choose plant from library

Figure D-52: Choose plant from library Screen


Fields
No Field Description Read Mandatory Control Data Length
Name
only
Type
Type
1
Chn Show plant No
Yes
Drop
String N/A
t th form library
dow list
vin
2
Bng Plant name No
Yes
Label
String N/A
lng
Buttons/Hyperlinks
No
Function
Description
Validation
Outcome
1
Hy
Cancel choose plant
N/A
Transfer to
show zone
2
Thm Vo
Add new plant the
N/A
Transfer to
Th Vin
system
add new plant

SUMMER 2016

PAGE 133 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.2.5. Add new plant

Figure D-53: Add new plant Screen


Fields
No Field
Name
1
Tn
cy
2
Ging
cy
3

PH
4

nh
Sng

m
t

SUMMER 2016

Description Read
only
Enter plant No
name
Enter type
No
plant
Enter
No
boundary
high, low ph
Enter
No
boundary
high, low
light
Enter
No
boundary
high, low
Humidity
Enter
No
boundary
high, low
Soil
moisture

Mandatory Control Data Length


Type
Type
Yes
Textbox String N/A
Yes

Textbox

String N/A

Yes

Textbox

String N/A

Yes

Textbox

String N/A

Yes

Textbox

String N/A

Yes

Textbox

String N/A

PAGE 134 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Nhit

Ngy
Bn
Phn
S
Enter
Lng Weight of
Phn Fertilizer
Bn

Enter
No
boundary
high, low
Temperature
Enter date
No
fertilizer

Yes

Textbox

Yes

Datetime Date

No

Yes

Textbox

Buttons/Hyperlinks
No Function
Description
1
Hy
Add new zone the
system
2
Thm Vo
Add new plant the
Th Vin
system

Validation
N/A
N/A

String N/A

N/A

String N/A

Outcome
Transfer to
show zone
Transfer to
add new plant

5.2.6. Show plant info

Figure D-54: Show plant info Screen


Fields
No Field
Name
1
Cay
cai
SUMMER 2016

Description
Plant name

Read Mandatory Control


only
Type
No
Yes
Label
PAGE 135 OF 197

Data Length
Type
String N/A
GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

2
3
4
5
6
7
8
9

Khu
A

PH
nh
Sng

m
t
Nhit

Ngy
Bn
Phn
S
Lng
Phn
Bn

Zone name

No

Yes

Label

String N/A

High, ow ph No

Yes

Textbox

String N/A

High, low
light
High, low
Humidity
High, low
Soil
moisture
High, low
Temperature
Date
fertilizer

No

Yes

Textbox

String N/A

No

Yes

Textbox

String N/A

No

Yes

Textbox

String N/A

No

Yes

Textbox

String N/A

No

Yes

Datetime Date

Weight of
Fertilizer

No

Yes

Textbox

N/A

String N/A

5.2.7. Update zone

Figure D-55: Update zone Screen

SUMMER 2016

PAGE 136 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Fields
No Field
Name
1
Cay
cai
2
Khu
A
3

PH
4
nh
Sng
5

m
6
7
8
9

m
t
Nhit

Description Read Mandatory Control Data Length


only
Type
Type
Plant name No
Yes
Label
String N/A
Zone name

No

Yes

Label

Enter high,
low ph
Enter high,
low light
Enter high,
low
humidity
Enter high,
low soil
moisture
Enter high,
low
temperature
Choose date
fertilizer

No

Yes

Textbox String N/A

No

Yes

Textbox String N/A

No

Yes

Textbox String N/A

No

Yes

Textbox String N/A

No

Yes

Textbox String N/A

No

Yes

Date
time

No

Yes

Textbox String N/A

Ngy
Bn
Phn
S
Enter
Lng weight of
Phn fertilizer
Bn

Buttons/Hyperlinks
No Function
Description
1
CP NHT Update info plan and
zone

SUMMER 2016

PAGE 137 OF 197

Validation
N/A

String N/A

Date

N/A

Outcome
Transfer to
information
plant in zone

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.2.8. Show sensor info

Figure D-56: Show sensor info Screen


Fields
No Field
Name
1
CM
BIN
2

PH
3
nh
Sng
4

m
t
Nhit

SUMMER 2016

Description Read
only
Sensor in
No
zone
Index
No
sensor PH
Index
No
sensor nh
Sng
Index
No
sensor
humidity
Index
No
sensor soil
moisture
Index
No
sensor
temperature

Mandatory Control Data Length


Type
Type
Yes
Label
String N/A
Yes

Label

String N/A

Yes

Label

String N/A

Yes

Label

String N/A

Yes

Label

String N/A

Yes

Label

String N/A

PAGE 138 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Buttons/Hyperlinks
No Function
1
Cp nht ln cui

Description Validation
The latest
N/A
time tracking

Outcome
Choose history
sensor

5.2.9. History sensor

Figure D-57: History Sensor


Buttons/Hyperlinks
No
Function
1
11/08/2016
11:02:39

SUMMER 2016

Description
Time insert sensor

PAGE 139 OF 197

Validation
N/A

Outcome
Show index
sensor

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.2.10. Show actuator

Figure D-58: Show Actuator Screen


Buttons/Hyperlinks
No Function
1
My Bm

Description
Status of pump

Validation
N/A

Mi Che

Status of covered

N/A

My Phun Sng

Status of Misting

N/A

Status of lamp

N/A

Bn phn vo lc

Show date
Fertilize

N/A

SUMMER 2016

PAGE 140 OF 197

Outcome
Update status
actuator
Update status
covered
Update status
misting
Update status
lamp
Show date
fertilize

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

6. Database Design
6.1. Entity Relationship Diagram (ERD)

Figure D-59: Entity Relationship Diagram (ERD)

SUMMER 2016

PAGE 141 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
6.2. Data Dictionary

Table name
account

userlibrary

SUMMER 2016

Attributes

Description

Null

username{PK}

Unique identifier, information user

No

password

Unique identifier

No

fullname

Unique identifier, information user

No

role

Unique identifier, information user

No

email

Unique identifier, information user

No

phone

Unique identifier, information user

No

userlibID

Manager user library

No

username

Unique identifier, user plant of user

No

userPlantName

Unique identifier, information plant

No

userTypePlan

Unique identifier, information plant

No

userHighPH

Unique identifier, information plant

No

userLowPH

Unique identifier, information plant

No

userHighLight

Unique identifier, information plant

No

userLowLight

Unique identifier, information plant

No

userHighHumidity

Unique identifier, information plant

No

PAGE 142 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

zone

enddevice

SUMMER 2016

userLowHumidity

Unique identifier, information plant

No

userHighTemperature

Unique identifier, information plant

No

userLowTemperature

Unique identifier, information plant

No

userHighSoilMoisture

Unique identifier, information plant

No

userLowSoiMoisture

Unique identifier, information plant

No

userFretilizeDate

Unique identifier, information plant

No

userWeightFertilize

Unique identifier, information plant

No

zoneID

Unique identifier, manager zone

No

zonename

Unique identifier, information zone

No

userlibID

Unique identifier, information plant

No

deviceCode

Unique identifier, information device

No

location

Unique identifier, information of zone

No

dateOfGrow

Unique identifier

No

enddeviceID

Unique identifier, manager enddevice

No

statuspump

Unique identifier, status of enddevice

No

statuscovered

Unique identifier, status of enddevice

No

PAGE 143 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

sensorinfo

SUMMER 2016

statusmissting

Unique identifier, status of enddevice

No

zoneID

Unique identifier, manager enddevice

No

automatically

Unique identifier, control or automatic

No

statuslamp

Unique identifier, status of enddevice

No

statusFertilize

Unique identifier, status of enddevice

No

sensorID

Unique identifier, manager sensor

No

ph

Unique identifier, index sensor read

No

light

Unique identifier, index sensor read

No

humidity

Unique identifier, index sensor read

No

temperature

Unique identifier, index sensor read

No

soilMoisture

Unique identifier, index sensor read

No

synctime

Unique identifier, time tracking

No

zoneID

Unique identifier, manager information sensor

No

PAGE 144 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

7. Flowchart
7.1. Add index of sensors to database

Figure D-60: Add index of sensors to database Flow Chart


SUMMER 2016

PAGE 145 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
7.2. Control Water Pump through Algorithm

Figure D-61: Control Water Pump through Algorithm Flow Chart


SUMMER 2016

PAGE 146 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
7.3. Control Light through Algorithm

Figure D-62: Control Light through Algorithm Flow Chart

SUMMER 2016

PAGE 147 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

E. Report No. 5 System Implementation & Test


1. Introduction
1.1. Overview

In this section, contains information about the test plan, test approach,
test process, test environment, test pass/fail criteria, checklist to check test
this system.
1.2. Test Approach

White box testing: Developers self-test code that they wrote and fix
themselves
Black box testing: Test on each function of each module in system to
ensure each module execute the right function. Then integration testing to
test the function in system when integrate. Finally, system test to test the
whole system.
Goal: Discover bug in system fix bug regression test completed
system.

2. Database Relationship Diagram


2.1. Physiscal Diagram

Figure E-1: Physical Diagram

SUMMER 2016

PAGE 148 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2. Data Dictionary

Table name
account

userlibrary

SUMMER 2016

Attributes

Description

Domain

Null

username{PK}

Unique identifier, information user

VARCHAR(255) no

password

Unique identifier

VARCHAR(255) no

fullname

Unique identifier, information user

VARCHAR(255) no

role

Unique identifier, information user

VARCHAR(255) no

email

Unique identifier, information user

VARCHAR(255) no

userlibID

Manager user library

INT

no

username

Unique identifier, user plant of user

VARCHAR

no

userPlantName

Unique identifier, information plant

VARCHAR

no

userTypePlan

Unique identifier, information plant

VARCHAR

no

userHighPH

Unique identifier, information plant

FLOAT

no

userLowPH

Unique identifier, information plant

FLOAT

no

userHighLight

Unique identifier, information plant

FLOAT

no

userLowLight

Unique identifier, information plant

FLOAT

no

userHighHumidity

Unique identifier, information plant

FLOAT

no

PAGE 149 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

zone

enddevice
SUMMER 2016

userLowHumidity

Unique identifier, information plant

FLOAT

no

userHighTemperature

Unique identifier, information plant

FLOAT

no

userLowTemperature

Unique identifier, information plant

FLOAT

no

userHighSoilMoisture

Unique identifier, information plant

FLOAT

no

userLowSoiMoisture

Unique identifier, information plant

FLOAT

no

userFretilizeDate

Unique identifier, information plant

DATETIME

no

userWeightFertilize

Unique identifier, information plant

FLOAT

no

userlifeCyleOfPlant

Unique identifier, information plant

INT

no

zoneID

Unique identifier, manager zone

INT

no

zonename

Unique identifier, information zone

VARCHAR

no

userlibID

Unique identifier, information plant

VARCHAR

no

deviceCode

Unique identifier, information device

VARCHAR

no

location

Unique identifier, information of zone

VARCHAR

no

dateOfGrow

Unique identifier

DATETIME

no

enddeviceID

Unique identifier, manager enddevice

INT

no

PAGE 150 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

sensorinfo

SUMMER 2016

statuspump

Unique identifier, status of enddevice

BIT

no

statuscovered

Unique identifier, status of enddevice

BIT

no

statusmissting

Unique identifier, status of enddevice

BIT

no

zoneID

Unique identifier, manager enddevice

INT

no

automatically

Unique identifier, control or automatic

BIT

no

statuslamp

Unique identifier, status of enddevice

BIT

no

statusFertilize

Unique identifier, status of enddevice

BIT

no

sensorID

Unique identifier, manager sensor

INT

no

ph

Unique identifier, index sensor read

FLOAT

no

light

Unique identifier, index sensor read

FLOAT

no

humidity

Unique identifier, index sensor read

FLOAT

no

temperature

Unique identifier, index sensor read

FLOAT

no

soilMoisture

Unique identifier, index sensor read

FLOAT

no

synctime

Unique identifier, time tracking

DATETIME

no

zoneID

Unique identifier, manager information sensor

INT

no

PAGE 151 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

3. Performance Measures
4. Test plan
The purpose of the test is to verify the functionality of the system.
Functions need to be tested. Functions to ensure technical requirements and
system requirements of the user. Error (error) will not happen after the trial.
The next content will describe which function will be tested and which
will not and plan for them
4.1. Features to be tested

We separate two part for testing: hardware and software


4.1.1. Hardware

After assembling hardware devices to system, we test all of them to


ensure that all hardware devices working well.
Here is list of hardware devices that we tested:
Table E-1: Hardware Test Plan
Functions
Description
Ambient
We tested light indoor, outdoor and with other light sources
Light Sensor such as flashlight, lamp at some points of time in day.
BH1750
The max of ambient light is 65535 lx and there are 0 lx at night
or dark light.
Each light of sun indoor and outdoor, we tested around 100
times. If the sensor can get index of light between 0 to 65535
and they have similar indexes which measure in same
environment and same time; the result of test case is Passed,
otherwise the result is Failed
Temperature Standard of temperature and humidity is on weather forecast.
Humidity We tested temperature and humidity at the same time in some
Sensor
points of time in a day.
HDC1008 We tested the sensor in differents environment such as:
morning, afternoon, night, sunny or wetty.
Each measurement, we tested around 100 times, if the result is
also similar with which get in same environment and time, the
test case is Passed, otherwise test case is Failed.
AM2320
At the beginning of project, we choose AM2320 for reading
temperature and humidity. We spent 2 weeks with hundred
times to implemet and test this sensor, but there are Fail result
when the sensor could not connect with MCU and reading right
output. Data
LM35We decide to change to LM35 for reading temperature and
HR202
HR202 for humidity. LM35 working right but HR202 make
noise with other sensor and did not output right index. We spent
more two days.
SUMMER 2016

PAGE 152 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Soil
Moisture
Sensor

This sensor is tested in different kinds of soil such as sand, silt


and clay plus humus, loam, and scoria.
In each kind of soil, we put sensor in variety of water level.
The sensor just can dectect when the soil is dry (0% - 15%) or
wet (80% - 100%). When we fill water more, the sensor could
not dectect clearly changes of volume water. Arround 300
tested times, we assigned Passed for test cases which could
sensitivy dry or wet, and Failed for otherwise.
pH Sensor The sensor is put in an environment which has 7 pH degees
(neutral). The sensor has a quite high cost with our balance so
we tested it in some environment which is a little different with
standard environment such as putting in drink water, water
well or salt water. If the sensor give index still pH is 7 which is
not reality in real environment, the result of test case is
Failed, otherwise the result is Passed
DIO
Before setup real devices for model, we chose led light to test
Controll
control DIO on MCU. Define status of a pin is high level, the
End Devices led is off, when assign a low level to make the led on and
otherwise. Follow above scenario, the resul is Passed and
Failed is otherwise.
CC1310
At Sub Controller:
LaunchPad + CC130 Launchpad is tested with sensors to read indexes and
control devices. After tested separate sensors, we tested
CC1310 with all sensors in different environment at the same
time. We did the test hundred times to read all sensors. The test
case was Passed if the CC1310 could get all indexes,
otherwise if there are missing one or more indexes of five
sensors, the result is Failed.
RF Communicate:
+ We also tested the distance of RF in different topographic in
many regions such as obstructions of buildings, walls or metal.
Besides that, we also tested distance on the straight line, how far
they could work. The test case is Passed if sub and main still
send and receive signals, otherwise is Failed.
+ We also tested process of transceiver with 3 nodes at the same
time. If the main controller can control and receive all indexes
from 3 nodes, the test case is Passed, otherwise is Failed.
Raspberry We tested ability of serial port connection between Raspberry
Pi 3
and CC1310 Launchpad. We defined some packets to transfer
and receive sequentially, continously or parallel. If one of them
could not transfer or receive, the test case is Failed, otherwise
is Passed. We need to find the best way to communicate
between them without error or delay too long.
SUMMER 2016

PAGE 153 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
4.1.2. Software

The features of user and web services will be focused and list below:
Table E-2: Software Test Plan
Functions
Description
Web Services Automatic Services
+ Update status of end devices to database after system do
algorithms.
+ Counting how much time algorithm work and update to
database.
Services are provided for Raspberry Pi 3.
+ Insert sensor indexes from hardware to database.
+ Stress test with request and response services continuously
in a long time.

Android
Application

Services are provided for Android Application


+ Login
+ View sensor indexes
+ View zone
+ Add new zone
+ View library
+ Add new library
+ Update zone
+ Delete zone
+ Change mode of control
+ Control End Devices in Manual
+ Update status of devices in Automatic
Black box testing on user interface.

4.2. Features not to be tested:

- N/A.
4.3. Test environment

Web server: Firefox (newest version), Chrome (newest version).


OS: Windows 10, Windows 7.
Android application: test on Android OS 4.0
Hardware: test on CC1310

SUMMER 2016

PAGE 154 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

5. System Testing Test Case


5.1. Component Testing
5.1.1. Ambient Light Sensor BH1750

ID

Test Case
Description

TC001 BH1750 Sensor with


light indoor at
morning, afternoon,
night
TC002 BH1750 Sensor with
light outdoor at
morning, afternoon,
night
TC003 BH1750 Sensor with
distance of flashlight
source
TC004 BH1750 Sensor with
lamp
TC005 BH1750 Sensor with
dark light

SUMMER 2016

Table E-3: Test case of ambient light


Inter-test
Test Case
Expected
Case
Procedure
Output
Dependence

After integrating sensor


to Arduino, MCU send
Result is a
command to get value
value which
from sensor and print it
in 0 - 65535
to Console screen or
UART

Similar with above test 0


case, sensor put in box
without light

PAGE 155 OF 197

Result

Test
Date

Pass

Week 2

25-50 lux

Pass

Week 2

25-50 lux

Pass

Week 2

Pass

Week 2

Pass

Week 2

From 10000
To 65535
lux
From 10000
To 30000
lux
0 lux

Note

N/A

N/A

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.1.2. Temperature an Humidity Sensor

ID

Test Case
Description

TC006 AM2320 Sensor

TC007 LM35 Temperature


Sensor
TC008 Module Humidity
HR202 using chip
LM393 comparator
TC009 HDC1008 in test
environment
TC010 HDC1008 in real
environment

SUMMER 2016

Table E-4: Test case of Temperature and Humidity


Inter-test
Test Case
Expected
Case
Result
Procedure
Output
Dependence
Read value
Fail
from sensor:
temperature
and humidity
After integrating sensor
Read analog
Pass
to Arduino, MCU send
from sensor
command to get value
and convert to
from sensor and print it
temperature
to Console screen or
Read analog
Fail
UART
from sensor
and convert to
N/A
humidity
Integrated sensor to
CC1310.MCU send
command to get data.
Read value temperature
and humidity at the
same time in the same
environment

Converted
value is the
same with
weather
forecast

PAGE 156 OF 197

Test
Date
Week 4

Week 5

Week 5

Pass

Week 8

Pass

Week 8

Note
Maybe that is
not
compatible
with MCU
Get around
environment
temperature
Can not get
right value
from sensor,
make noise
other modules
Temperature:
30. Humidity:
50-80%
The module
have to put in
reset standard
environment
to get right
value
GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.1.3. Soil Moisture Sensor using LM393

ID

Test Case
Description

TC011 Soil Moisture Sensor


in dry sand.
Soil Moisture Sensor
in wet sand.
TC012 Soil Moisture Sensor
in dry silt.
Soil Moisture Sensor
in wet silt.
TC013 Soil Moisture Sensor
in dry clay and humus
Soil Moisture Sensor
in wet clay and
humus.
TC014 Soil Moisture Sensor
in dry loam.
Soil Moisture Sensor
in wet loam.
TC015 Soil Moisture Sensor
in dry scoria
Soil Moisture Sensor
in wet scoria.

SUMMER 2016

Table E-5: Test case of Soil Moisture Sensor


Inter-test
Test Case
Expected
Case
Procedure
Output
Dependence

After integrating sensor


to Arduino, MCU send
command to get value
from sensor and print it
to Console screen or
UART

Value output
is analog 16
bit: 0 4096.
Convert to
percent value

PAGE 157 OF 197

Result

Test
Date

Pass

Week 3

Pass

Week 3

Note
Dry sand: 020%
Wet sand: 7099%
Dry silt: 0%
Wet silt: 5099%
Dry sand: 020%
Wet sand: 7099%

Pass

Week 3

Pass

Week 8

Dry: 0-20%
Wet: 70-99%

Pass

Week 8

Dry: 0-20%
Wet: 70-99%

N/A

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.1.4. PH Meter DFRobot Kit

Test Case
Description

ID

TC016 Measure pH in test


environment
TC017 Measure pH in acid
environment
TC018 Measure pH in
basicity environment
TC019 Measure pH in
neutrality
environment

Table E-6: Test Case of pH Meter Kit


Inter-test
Test Case
Expected
Case
Procedure
Output
Dependence
After integrating sensor
to Arduino, MCU send
command to get value
Read analog
from sensor and print it
value from
to Console screen or
sensor: and
N/A
UART.
convert to pH
Read value temperature
degree.
and humidity at the
same time in the same
environment.

Result

Test
Date

Note

Pass

Week 4

pH degree: 7

Pass

Week 5

pH degree < 7

Pass

Week 5

pH degree > 7

Pass

Week 5

pH degree
around 7

5.1.5. DIO Control End Devices

ID

Test Case
Description

TC020 Test how MCU


output signal to
control actuators

SUMMER 2016

Table E-7: Test Case of DIO Control End Devices


Inter-test
Test Case
Expected
Case
Result
Procedure
Output
Dependence
Assume an actuator or
Pass
MCU output
an end device is a led.
low level, led
Numbers of led is
is on.
numbers of actuators in
N/A
MCU output
system. MCU output
high level, led
low level or high level
is off.
to control actuators
PAGE 158 OF 197

Test
Date

Note

Week 3

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.1.6. CC1310 LaunchPad

ID

Test Case
Description

TC021 Read all indexes of


sensors at the same
time

TC022 Packet transmit RF


between two CC1310

TC023 Distance transmit RF


straight line between
two CC1310

SUMMER 2016

Table E-8: Test Case of CC1310 LaunchPad


Inter-test
Test Case
Expected
Case
Procedure
Output
Dependence
After integrating all
Light: 0sensors to CC1310,
65535
MCU send command to Temperature:
All test case
get value from sensor
0-1000
of separate
and print it to Console
Humidity: 0
sensors is
screen or UART serial 100 %
passed.
by USB ports via
pH: 0-14
puTTy application.
Soil moisture:
0-100%
Set up a sample packet
N/A
and transmit to other.
The received side is
connect with IDE and
Packet is
print packet to Console received.
screen or UART serial
by USB ports via
puTTy application.
Set up a sample packet Packet is
N/A
to transmit. Put two
received at
CC1310 in a straight
distance of
line distance which far 100 m
than 2 meters. The
straight line
received side is connect
PAGE 159 OF 197

Result

Test
Date

Pass

Week 9

Pass

Week 9

Pass

Week 10

Note

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

TC023 Transmit RF through


obstructions such as
wall, building.

with IDE and print


packet to Console
screen or UART serial
by USB ports via
puTTy application.
Set up a sample packet
to transmit.
+ Put two CC1310 in
two different room.

+ Put a CC1310 on 5th


floor, other put on 1st
floor.
The received side is
connect with IDE and
print packet to Console
screen or UART serial
by USB ports via
puTTy application.
TC024 Transmit RF closer
distance and overlap
signal waves between
two CC1310.
SUMMER 2016

Set up a sample packet


to transmit.
Put two CC1310 closer
together, their antenna
is opposite or diagonal.

without
obstructions

Packet is
N/A
received
when there
are less four
wall than
between two
CC1310s.
Packet is
received
when put two
CC1310 in
different
room in
different floor

Pass

Week 10

Packet is
received.

Pass

Week 9

PAGE 160 OF 197

N/A

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

TC025 Transceiver RF
between two CC1310

TC026 Transceiver RF
between more than
two CC1310

TC027 Size of packet which


is transmit via UART
CC1310

SUMMER 2016

The received side is


connect with IDE and
print packet to Console
screen or UART serial
by USB ports via
puTTy application.
Set up a sample packet
on CC1310 named A to
transmit. Set up a
condition when the
received side CC1310
named B has a packet, it
resend another packet B
Set up a CC1310 as a
master, and two others
as slaves. In each slave
CC1310, set up a
named packet. Transmit
packets to master.
Master set up status 1 or
0 to transmit to slave
for controlling turn
on/off light
Set up a packet that has
size of small to big. 060 byte. Transmit it to
UART, CC1310
connect with computer,

Pack A is
received in
CC1310 B
and packet B
is received in
CC1310 A

Pass

Week 11

Master
DIO Control Pass
received two End Devices
named packet
and resend
status to
named slave,
turn on/off
Led on slaves

Week 11

UART
received
packet

Week 10 Enough size


of data for
transmitting
indexes of
sensors

PAGE 161 OF 197

N/A

N/A

Pass

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

UART received and


print on Console or
UART serial by USB
ports via puTTy
application.
TC028 Baud rate of UART
Set up 8 byte of packet.
transmit from
+ Set up baud rate is
CC1310 to Raspberry 115200
+ Set up baud rate is
9600
Transmit to Raspberry
TC029 UART transmit from
CC1310 and
Raspberry via UART
serial ports
Set up 8 byte of packet.
TC030 UART transmit from Transmit to Raspberry.
CC1310 to Raspberry
via UART TX RX
with USB TTL

SUMMER 2016

Raspberry
received
packet

Raspberry
received
packet

PAGE 162 OF 197

N/A

Pass

Week 10 Compatible
baud rate is
9600

N/A

Pass

Week 10

N/A

Pass

Week 10

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.1.7. Raspberry Pi 3

ID

Test Case
Description

TC031 Raspberry request


object of data from
Webserver

TC032 Raspberry request a


link to insert to
database.

TC033 Time to response


after Raspberry
request

SUMMER 2016

Table E-9: Test Case of Raspberry Pi 3


Inter-test
Test Case
Expected
Case
Result
Procedure
Output
Dependence
Raspberry request a
Pass
link, which Webserver
provides.
Successful
Webserver
Webserver set up data
to return if request
successful.
Webserver provide a
Webserver
Pass
link, which allow
inserting to database.
Data inserted
Webserver return to
to database
raspberry value of
inserted data.
Raspberry request a
Data inserted Webserver
Pass
link, which provided for into database Internet
inserting to database
Time is less
connection
and run algorithm on
than 1 second is stable
server.
if internet
Counting time when
connection is
raspberry received a
stable.
response data

PAGE 163 OF 197

Test
Date

Note

Week 6

Week 6

Week 6

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.1.8. Mobile

ID

Test Case
Description

TC034 Test user login app.

TC035 Test user add new


zone

TC036 Test user add new


plant

SUMMER 2016

Table E-10: Test Case of Mobile App


Inter-test
Test Case
Expected
Case
Result
Procedure
Output
Dependence
User open app on Mobile
Pass
mobile. User to enter application
username and password. show zone
Click Login button
selection
screen.
User click ADD on Mobile
Pass
screen zone. User to application
choose from library, show list zone
user choose plant, of user.
enter Device code,
enter location after click
Done button.
User clicks ADD Mobile
Pass
NEW
on
screen application
Library.
show
User enter: plant, notification
High PH, Low PH, Add
High Light, Low success
Light,
High
Humidity,
Low
Humidity, High soil
moisture, Low soil
moisture,
High
PAGE 164 OF 197

Test
Date

Note

From
(over 40
20/06/16 times)
To
13/07/16
From
(over 40
20/06/16 times)
To
13/07/16

From
20/06/16
To
13/07/16
(over 40
times)

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

TC037 Test update zone

TC038 Test checking index


sensors

SUMMER 2016

Temperature,
Low
Temperature, choose
Date
Fertilize,
Weight of Fertilize .
Click DONE button
User click Update
button on screen
Indexes. User fix:
plant, High PH,
Low PH, High
Light, Low Light,
High Humidity, Low
Humidity, High soil
moisture, Low soil
moisture, High
Temperature, Low
Temperature, choose
Date Fertilize,
Weight of Fertilize ,
Device code ,
location.
Click DONE button
User click sensor tab
User click list day of
sensor
User choose one day

Mobile
application
show
notification
Update
success

Pass

From
20/06/16
To
13/07/16
(over 40
times)

Mobile
application
shows sensor
information
of day.

Pass

From
20/06/16
To
13/07/16
(over 40
times)

PAGE 165 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

TC039 Test control device

User click Actuator


tab.
User
unselect
Automatically
User on/off the device

Mobile
application
On/off the
device of user

Pass

From
20/06/16
To
13/07/16
(over 40
times)

5.1.9. Webserver

ID

Test Case
Description

TC040 Test login

TC041 Test list zone of user

SUMMER 2016

Table E-11: Test Case of Webserver


Inter-test
Test Case
Expected
Case
Result
Procedure
Output
Dependence
URL of input page:
Web browser
Pass
http://smartgardenshow
thanhsang.rhcloud.com/ information
SmartGarden/rest/accou of user
nt/chinh/123456/loginjs
on Check information of
user show web browser
with information in
database
URL of input page:
Web browser
Pass
http://smartgardenshow zone
thanhsang.rhcloud.com/ info follow
SmartGarden/rest/zone/ username
sang/findzonebyuserlidi
d Check information
PAGE 166 OF 197

Test
Date

Note

From
(over 40
25/02/1 times)
6 To
13/04/1
6
(over 40
times)
From
(over 40
25/02/16 times)
To
13/04/16
(over 40
times)
GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

TC042 Test Add zone

TC043 Test list library of


user

TC044 Test add new one


plant

SUMMER 2016

zone follow username,


show web browser with
information in database.
URL of input page:
http://smartgardenthanhsang.rhcloud.com/
SmartGarden/rest/zone/
insertzone Use http
Requester: content
Type: application/json
Data: "devideCode":"",
location":"","userLibId"
:""zone name":""}
Check information in
database
URL of input page:
http://smartgardenthanhsang.rhcloud.com/
SmartGarden/rest/userli
brary/sang/findalluserli
braryCheck information
show on bowser with
index of database
URL of input page:
http://smartgardenthanhsang.rhcloud.com/
SmartGarden/rest/userli
brary/insertuserlib

Web browser
show
information
zone

Pass

From
25/02/16
To
13/04/16
(over 40
times)

Web browser
show
information
follow
username

Pass

From
25/02/16
To
13/04/16
(over 40
times)

Web browser
show library
information

Pass

From
25/02/16
To
13/04/16

PAGE 167 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

TC045 Test show


information one plant

SUMMER 2016

Use Http Requester:


Content type:
application/json data
{"userFertilizeDate":"",
"userHighHumidity":"",
"userHighLight":"","use
rHighPh":"","userHigh
SoilMoisture":"","user
HighTemperature":"" ,"
userLibId":"","userLow
Humidity":"","userLow
Light":"","userLowPh":
"","userLowSoilMoistur
e":"","userLowTempera
ture":"","userPlanName
":"","userTypePlan":"",
"userWeightFertilize":"
","username":""}
Check information in
database
URL of input page:
http://smartgardenthanhsang.rhcloud.com/
SmartGarde/rest/userlib
rary/2/infoplan
Check information
show on bowser with
index of database

(over 40
times)

Web browser
show
information
follow zone

PAGE 168 OF 197

Pass

From
25/02/16
To
13/04/16
(over 40
times)

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

TC046 Test Update zone

TC047 Test show sensor


information
SUMMER 2016

URL of input page:


http://smartgardenthanhsang.rhcloud.com/
SmartGarden/rest/userli
brary/updatezone
Use Http Request:
Content type:
application/json
Data: "dateOfGrow":"",
"devideCode":"","locati
on":"","userFertilizeDat
e":"","userHighHumidit
y":"","userHighLight":"
","userHighPh":"","user
HighSoilMoisture":"","
userHighTemperature":
"","userLibId":"","user
LowHumidity":"","user
LowLight":"","userLow
Ph":"","userLowSoilMo
isture":"","userLowTem
perature":"","userPlanN
ame":"","userTypePlan"
:"","userWeightFertilize
":"","username":"","zon
ename":""}
URL of input page:

Web browser
show
information
plant follow
zone

Pass

From
25/02/16
To
13/04/16
(over 40
times)

Web browser
show

Pass

From
25/02/16

PAGE 169 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

TC048 Test show history


sensor information

TC049 Test show status


actuator

TC50

Test control actuator

SUMMER 2016

http://smartgardenthanhsang.rhcloud.com/
SmartGarden/rest/senso
rinfo/2/sensorinfolistjso
n Check information
show on bowser with
index of database
URL of input page:
http://smartgardenthanhsang.rhcloud.com/
SmartGarden/rest/senso
rinfo/1/listsensor
Check information
show on bowser with
index of database
URL of input page:
http://smartgardenthanhsang.rhcloud.com/
SmartGarden/rest/endde
vice/1/enddevicelistjson
Check information
show on browser with
index of database
URL of input page:
http://smartgardenthanhsang.rhcloud.com/
SmartGarden/rest/endde
vice/postupdateenddevi

information
of sensor
follow zone

To
13/04/16
(over 40
times)

Web browser
show history
information
of sensor
follow zone

Pass

From
25/02/16
To
13/04/16
(over 40
times)

Web browser
show status

Pass

From
25/02/16
To
13/04/16
(over 40
times)

Web browser
show status
have update

Pass

From
25/02/16
To
13/04/16

PAGE 170 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

ce Use Http Request:


Content type:
application/json:
{"enddeviceId":"","zon
eId":"",
"statusFertilize":"",
"statuscovered":"",
"statusmisting":"",
"statuspump":"",
"automatically":""}

SUMMER 2016

PAGE 171 OF 197

(over 40
times)

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
5.2. Integration Test

Table E-12: Test Case Integration Test


ID

Test Case
Description

Test Case
Procedure

+ User change status of light or covered


on mobile app.
+ Update status of control to database.
+ Raspberry request Webserver to get
status of control.
+ Transmit status to CC1310 in Main
Controller via UART
+ CC1310 in Main Controller detects
status of control which CC1310 sub is
belong to. Send it to CC1310 Sub via RF.
Control Light/
+ CC1310 Sub Controller receives status
TC051
Covered Manual
of control, output DIO to control light or
covered.

SUMMER 2016

PAGE 172 OF 197

Inter-test
Case
Dependence
+ Change
status on
mobile
+ Update data
The light
on Webserver
or covered
+ HTTP
will turn
request on
on/off
Raspberry
after user
+Transmit
change
UART, Pi 3
status of
and CC1310
them on
+ Transmit
mobile
and receive
app.
data via RF
Average
time
process: 3
+ DIO Control
second
End devices
Expected
Output

Result

Test
Date

Pass

Week 13

GROUP 1

Note

Capstone Project 2016: Design and Implement The Model of Smart Garden

Control Water
Pump/Misting
TC052
Machine
Manual

SUMMER 2016

+ User change status of water pump or


misting machine
+ Update status of control to database.
+ Raspberry request Webserver to get
status of control.
+ Transmit status to CC1310 in Main
Controller via UART
+ CC1310 in Main Controller detects
status of control which CC1310 sub is
belong to. Send it to CC1310 Sub via RF.
CC1310 analyze status to output DIO
control main pump of water or misting
machine.
+ CC1310 Sub Controller receives status
of control, output DIO to control light or
covered.

PAGE 173 OF 197

The water
pump or
misting
machine
will turn
on/off
after user
change
status of
them on
mobile
app.
Average
time
process: 3
second

+ Change
status on
mobile
+ Update data
on Webserver
+ HTTP
request on
Raspberry
+Transmit
UART, Pi 3
and CC1310
+ Transmit
and receive
data via RF.
+DIO Control
End Devices

Pass

Week 13

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

+ CC1310 Sub get index of ambient light


+ CC1310 send index with named code
via RF to Main
+ CC1310 Main transmit data via UART
to Raspberry Pi 3
+ Raspberry Pi 3 request link to insert
light index to database.
+ Webserver insert into database.
+ Webserver run algorithm with current
index. Update status of Covered to
Control Covered
database.
TC053
Automatic
+ After request, Webserver response a
status of covered to Raspberry
+Raspberry transmit UART to CC1310
Main
+ CC1310 Main transmits command to
control covered to CC1310 Sub.
+ CC1310 Sub output command to
control covered

SUMMER 2016

PAGE 174 OF 197

Get index of
ambient light
Transceiver
RF between
Main and Sub.
The
Transceiver
covered
UART
will turn
between Main
on/off
and Raspberry
after
Insert sensor to
index of
database
sensors
Update end
put in an
devices status
algorithm.
DIO control
Average
end devices
time: 3
second.

Pass

Week 13

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Control Water
Pump/Misting
TC054
Machine
Automatic

SUMMER 2016

+ CC1310 Sub get index of soil moisture,


temperature and humidity
+ CC1310 send index with named code
via RF to Main
+ CC1310 Main transmit data via UART
to Raspberry Pi 3
+ Raspberry Pi 3 request link to insert
light index to database.
+ Webserver insert into database.
+ Webserver run algorithm with current
index. Update status of Covered to
database.
+ After request, Webserver response a
status of covered to Raspberry
+Raspberry transmit UART to CC1310
Main
+ CC1310 Main control main pump or
main misting machine and transmits
command to control covered to CC1310
Sub.
+ CC1310 Sub output command to
control covered

PAGE 175 OF 197

Get index of
soil moisture,
temperature,
humidity.
The water Transceiver
pump or
RF between
misting
Main and Sub.
machine
Transceiver
will turn
UART
on/off
between Main
after
and Raspberry
index of
Insert sensor to
sensors
database
put in an
Update end
algorithm. devices status
Average
DIO control
time: 3
end devices
second.

Pass

Week 13

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Get & Insert


TC055 sensor to
database.

SUMMER 2016

+ CC1310 Sub gets all indexes of sensor:


light, temperature, humidity, soil moisture
and pH.
+ CC1310 Sub transmit all indexes to
CC1310 Main via RF
+ CC1310 Main transmit data to
Raspberry via UART
The data
+ Raspberry request Webserver to insert
of all
received data into database.
sensors
indexes
are
inserted
into table
sensor in
database.

PAGE 176 OF 197

+ Get all
indexes of
sensors
+ Transceiver
RF between
Main and Sub.
+ Transceiver
UART
between Main
and Raspberry
Insert sensor to
database

Pass

Week 13

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

F. Report No. 6 Software Users Manual


1. Installation Guide
1.1. Setting up environment
1.1.1. Hardware requirement

- Raspberry pi 3
- Circuit board, which includes cc1310, sensors and actuator designed
by our team.
- Model of Hydroponic Garden
- Android phone
- Ensure stable power system 220v ~ 50 Hz.
- Wi-Fi coverage.
1.1.2. Software requirement

- Raspbian environment for Raspberry Pi (25/7/2016 release date or


newer)
- Android 4.0 or higher.
- Software enabled "smart garden" on the smart phone.
- Check the connections on Wi-Fi on smart phone and raspberry.
1.2. Setting up the environment at server side

Create enviroment on server http://openshift.redhad.com

Figure F-1: Create Environment on Server


New folder in windows

Figure F-2: New Folder in Windows


SUMMER 2016

PAGE 177 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Install TortoiseGit, after that use Git to Clone data

Figure F-3: Using TortoiseGit to clone data from Server


Copy SSH on Web openshift

Figure F-4: Copy SSH on Web openshift

SUMMER 2016

PAGE 178 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Paste to URL

Figure F-5: Paste URL to Clone


After Clone finish, prepare file .war
Figure F-6: Prepare file ".war"
Copy to folder webapp

Figure F-7: Copy to folder webapp

SUMMER 2016

PAGE 179 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Choose Git Commit -> master

Figure F-8: Git Commit --> "master"

SUMMER 2016

PAGE 180 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Fill all information and push Commit

Figure F-9: Fill all information and push Commit


Push on server openshift

Figure F-10: Push on Server openshift


SUMMER 2016

PAGE 181 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Choose branches, the default is master

Figure F-11: Choose branches for master


Build server complete

SUMMER 2016

PAGE 182 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
1.3. Setting up the environment at client side
1.3.1. Setting up for mobile application

- Telephone preparation android 4.4 or higher.


- In the phone:
Vietnamese: Ci t Bo mt enables Ngun khng xc nh.
English: Setting Security enables Unknown Sources

- Download software: https://www.facebook.com/smart-garden


- After download:

SUMMER 2016

PAGE 183 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Click to select the file SmartGarden.apk. Select install

After application installed,

SUMMER 2016

PAGE 184 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Icon of software Smart Garden,

SUMMER 2016

PAGE 185 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

2. Users Guide
2.1. Login

No.
Item
1 Username
2 Password

Description
Fill out username which is registered
Fill out password

You must enter a valid name and password provided by the publisher.
After the test, correctly you click "login". For security reasons, if you
forget your password, please contact the publisher to retrieve the
username and password

SUMMER 2016

PAGE 186 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.2. Show zone

No.
1
2
3

Item
+
Zone
DELETE

Description
You can add a new zone.
Contains information on the zone
You can delete the zone.

Display the user's zone, with a new user will not have any zone
displayed. When user click on "+" to add a new zone. You need only
enter the number required by the system.
When user click on "DELETE". They must be sure you want to delete
the zone. They will choose the zone you want to delete. The display
will appear the message "Are you sure you want to delete" user click
"Ok" to clear the zone.

SUMMER 2016

PAGE 187 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.3. Add zone

No
1
2
3
4
5

Item
Back
Choose from library
Device code
Location
Create date

Description
Back screen shows zone
The user will select plants at the library
Enter the correct product code
Users enter the area you want to name
The system will automatically retrieve the date
and time

Users who want to add a zone. They must make sure that there is a real
part here we called "node". On the node will have the code, this is the
device that the user must enter the code in the "Device code".
"Choose from the library": users will choose plants that they want to
grow in the zone. If the plant does not exist, a user can add new ones.
Location: users can enter the location you want.
Create date: users do not need this option. Auto save system date and
time to add new users. Users can view the creation date, when
necessary.

SUMMER 2016

PAGE 188 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.4. Library info

No
Item
Description
Back screen shows zone
1 Back
Plant where the user can choose
2 Plant name
3 ADD NEW LIBRARY Finish choose plant
The user chooses to plant they want on zone.

SUMMER 2016

PAGE 189 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.5. Add new plant

No.
1
2
3
4

Description
Back
Back screen add zone
Plant
Enter plant name
PH
PH input indicators include 2 upper and lower
Light
Light input indicators include 2 upper and
lower
Humidity input indicators include 2 upper and
5 Humidity
lower
Soil moisture input indicators include 2 upper
6 Soil moisture
and lower
Temperature input indicators include 2 upper
7 Temperature
and lower
Select dates for fertilizing plants
8 Date Fertilizer
9 Weight of Fertilizer Fertilizer for plants
Finish add new plan.
10 DONE
Add a new user to the library tree. They must be fully and accurately
enter the parameters of the tree. They can consult online or based on
actual experience itself.
Date Fertilizer: The next day fertilizing (Unfinished function).
Weight of Fertilizer: Unfinished function.

SUMMER 2016

Item

PAGE 190 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.6. Show plant info

No.
1
2
3
4

Item
<=
Khu O
bng lng
PH

Light

Humidity

Soil moisture

Temperature

9
10

Date Fertilizer
Weight of
Fertilizer
Device code
Location
Create day

11
12
13
SUMMER 2016

Description
Back screen choose zone
Show zone name
Plant were planted in the zone name
PH input indicators include 2 upper and
lower
Light input indicators include 2 upper and
lower
Humidity input indicators include 2 upper
and lower
Soil moisture input indicators include 2
upper and lower
Temperature input indicators include 2
upper and lower
Select dates for fertilizing plants
Fertilizer for plants
Manufacturer's code
Location name
The system will automatically retrieve the
date and time
PAGE 191 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

Update

14

will speak at the following guidelines

Showing all the information of the plant.


2.7. Update Zone

No.
1
2

Item

3
4

<=
Khu O
Bng Lng
PH
Light

Humidity

Soil moisture

Temperature

8
9
10
11

Date Fertilizer
Weight of Fertilizer
Device code
Location

SUMMER 2016

Description
Back screen choose zone
Show zone name
Plant were planted in the zone name
PH input indicators include 2 upper and lower
Light input indicators include 2 upper and
lower
Humidity input indicators include 2 upper and
lower
Soil moisture input indicators include 2 upper
and lower
Temperature input indicators include 2 upper
and lower
Select dates for fertilizing plants
Fertilizer for plants
Manufacturer's code
Location name
PAGE 192 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

12

Create day

13

Update

The system will automatically retrieve the


date and time
Button for user send command to update zone

When user want to change index of plant in zone. They will change
index by click line on screen.
Must ensure that the parameters are correct. Click the button update
to finish.
2.8. Show sensor info

No.
1
2
3
4
5
6
7
8
9
SUMMER 2016

Item
<=
Khu O
Bng lng
PH
Light
Humidity
Soil moisture
Temperature
Last check

Description
Back screen choose zone
Show zone name
Plant were planted in the zone name
PH sensor that measured
Light sensor that measured
Humidity sensor that measured
Soil moisture sensor that measured
Temperature sensor that measured
The latest update now
PAGE 193 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden

10

Weight of Fertilizer

Fertilizer for plants

Display which sensor parameters measured. Users cannot edit the


information it. The parameters are updated approximately every 30
minutes trying. Users can review the history of the sensor.
2.9. History sensor

User clicks date to show on screen.


Select the date and time you want to see

SUMMER 2016

PAGE 194 OF 197

GROUP 1

Capstone Project 2016: Design and Implement The Model of Smart Garden
2.10. Show actuator

No.
1
2
3
4
5
6
7

Item
Back
Khu O
Bng lng
Status Pump
Status Covered
Status Misting
Automatically

Description
Back screen choose zone
Show zone name
Plant were planted in the zone name
Show the status of pump
Show the status of covered
Show the status of Misting
On/off control

Users can view the status of the actuator.


There are two modes for users to choose:
+ Automatic control mode. Users can only view. Users cannot control
the actuator.
+ Manual control mode. Users can control any device that appears on
the screen. Automatic mode turns off.

SUMMER 2016

PAGE 195 OF 197

GROUP 1

You might also like