crops monitoring using spherical robot muhammad luqman hakim

Transcription

crops monitoring using spherical robot muhammad luqman hakim
CROPS MONITORING USING SPHERICAL ROBOT
MUHAMMAD LUQMAN HAKIM BIN SAWAL
UNIVERSITI TEKNOLOGI MALAYSIA
iv
CROPS MONITORING USING SPHERICAL ROBOT
MUHAMMAD LUQMAN HAKIM BIN SAWAL
A thesis submitted in fulfilment of the
requirements for the award of the degree of
Bachelor in Engineering (Electrical- Instrumentation and Control)
Faculty Of Electrical
Universiti Teknologi Malaysia
JUNE 2014
vi
Specially dedicated to Mak and Ayah.
Kakak and Adik.
I Love you all.
vii
ACKNOWLEDGEMENT
Foremost, I would like to express my sincere gratitude to my supervisor Dr. Zool
Hilmi Ismail for the continuous support of my final year project study and research,
for his patience, motivation, enthusiasm, and immense knowledge. His guidance
helped me in all the time of research and writing of this thesis. I could not have
imagined having a better advisor and mentor for my final year project. I also like to
show to gratitudes and thanks to all my friend especially my best friend Khairul Anam
for always help me went I want to bu the component at Cytron. Also to my other
friends that help me to complete my final year project. Last but not least, I like to thank
my family that always support me especially my parent Sawal Abdullah and Zaidah
Yazid for giving birth to me at the first place and supporting me spiritually throughout
my life and my sibling too, my sister and little brother Nurul Mazni and Muhammad
Idham.
.
viii
ABSTRACT
Malaysia has change his economic policy to industrial economic country but
agriculture still contributes to Malaysia Gross Domestic Product. In order to obtain
more revenue, crops must have good quality. Therefore, the plant that produces crops
must be well maintained and monitored regularly. However, it is troublesome to check
every plant it will take more time, very costly and tend to make error if using human
labor. Although some technologies has been introduces to monitor condition of crops
like using satellite and drones but this technologies is very costly and need an expert
to operate it. Therefore the objective of this project is to develop a system that can
help farmer especially smallholder to monitored their crops efficiently and effectively.
In this project the system is a ground mobile robot. This robot also can assist and
complement the aerial system work. The robot will be make using spherical ball.
Inside the spherical ball is where all the stuff like electronic compartment, servo
motors and sensors will be placed. Moreover, the moving part also will be operate
inside the spherical ball. After that the test field will be made to make sure that the
robot can operate properly. The expected result will be the robot can moving forward
with certain speed. In conclusion, this project proposed the development of a system
(spherical robot) that can help farmer to monitor their crops efficiently and effectively.
ix
ABSTRAK
Malaysia telah mengubah dasar ekonomi ke negara ekonomi perindustrian
tetapi pertanian masih menyumbang kepada Keluaran Dalam Negara Kasar (KDNK)
Malaysia . Dalam usaha untuk mendapatkan lebih banyak pendapatan , tanaman mesti
mempunyai kualiti yang baik. Oleh itu , tanaman mesti diselenggara dengan baik dan
dipantau secara berkala. Walau bagaimanapun, sukar untuk memeriksa setiap pokok
kerana mengambil lebih banyak masa, sangat mahal dan cenderung untuk membuat
kesilapan jika menggunakan tenaga manusia. Walaupun beberapa teknologi telah
digunakan untuk memantau keadaan tanaman seperti menggunakan satelit dan
pesawat tetapi teknologi ini adalah sangat mahal dan memerlukan pakar untuk
mengendalikannya. Oleh itu, objektif projek ini adalah untuk membangunkan satu
sistem yang boleh membantu petani terutamanya pekebun kecil untuk tanaman
mereka dipantau dengan cekap dan berkesan. Dalam projek ini sistem yang dibina
ialah robot yang bergerak di atas tanah. Robot ini juga boleh membantu dan
melengkapkan kerja sistem udara. Robot ini menggunakan bola sfera di mana di dalam
bola sfera terdapat beberapa komponen seperti komponen elektronik , motor servo dan
sensor. Selain itu , bahagian yang bergerak juga akan beroperasi di dalam bola sfera
itu. Selepas itu ujian akan dilakukan untuk memastikan bahawa robot boleh beroperasi
dengan baik. Keputusan ujian dijangkakan robot boleh bergerak ke hadapan dengan
kelajuan tertentu. Kesimpulannya , projek ini mencadangkan pembangunan sistem
( robot sfera ) yang boleh membantu petani untuk memantau tanaman mereka dengan
cekap dan berkesan.
x
TABLE OF CONTENTS
CHAPTER
1
2
TITLE
PAGE
ACKNOWLEDGEMENT
vii
ABSTRACT
viii
ABSTRAK
ix
TABLE OF CONTENTS
x
LIST OF TABLES
xii
LIST OF FIGURES
xiii
LIST OF ABBREVIATION
xiv
LIST OF SYMBOL
xv
LIST OF APPENDICES
xvi
INTRODUCTION
1
1.1 Introduction
1
1.2 Problem Statement
2
1.3 Objectives of The Project
3
1.4 Scope of The Project
4
1.4.1 Mechanical
4
1.4.2 Electronic
5
1.4.3 Software
6
LITERATURE REVIEW
7
2.1 Introduction
7
2.2 Spherical Robot
7
2.3 Mechanical, Hardware,Electronic &
Software Implementation
10
xi
CHAPTER
3
4
TITLE
METHODOLOGY
16
3.1 Introduction
16
3.2 Methodology Flow Chart
17
3.2.1 Getting Project Title & Objective
18
3.2.2 Litererature Review & Project Proposal
18
3.2.3 Hardware,Electronic &Software Implementation
19
3.2.4 Mechanical Design
33
3.2.5 Experiment & Collecting Data
35
RESULT & DISCUSSION
37
4.1 Preliminary Experiment & Result
37
4.1.1 Experiment
37
4.1.2 Result
37
4.2 Experimental Result
5
6
PAGE
38
4.2.1 Spherical Robot Movement Test Result
38
4.2.2 Temperature & Humidity Sensor Result
40
4.2.3 GPS Tracking Experiment Result
43
CONCLUSION
45
5.1 Introduction
45
5.2 Conclusion
45
5.3 Limitation & Future Improvement
47
PROJECT MANAGEMENT
49
6.1 Introduction
49
6.2 Project Schedule
50
6.3 Cost Estimation
53
REFERENCES
57
xii
LIST OF TABLES
TABLE NO.
TITLE
PAGE
3.1
The C++ code for microcontroller 1
22 3.2
The C++ code for microcontroller 2
32 4.1
The result of spherical robot movement experiment
39 6.1
Project Gantt chart (semester one)
51 6.2
Project Gantt chart (semester two)
52 6.3
Cost estimation for electronic & electrical component
53 6.4
Cost estimation for mechanical (moving mechanism)
55
6.5
Total cost estimation for one spherical robot
56 xiii
LIST OF FIGURES
FIGURE NO.
TITLE
PAGE
2.1
Type of spherical robot.
8 2.2
The ROSPHERE inner pendulum.
11
2.3
The ROSPHERE prototype.
12
2.4
The hardware architecture of ROSPHERE.
13
2.5
The software architecture of ROSPHERE.
14
2.6
The autonomous positioning & navigation system
(left to right: camera with visual processor;
GPS system; gyroscope).
14
3.1
Methodology flow chart.
17
3.2
The microcontroller & its functionality on the robot.
20
3.3
Flow chart for microcontroller 1
21
3.4
Flow chart for microcontroller 2
32
3.5
The complete spherical robot moving mechanism
34
3.6
More picture of moving mechanism from different angle
34
3.7
The complete spherical robot with moving mechanism inside 35
4.1
Graph of temperature & humidity at smooth surface
40
4.2
Graph of temperature & humidity at grassy surface
41
4.3
Graph of temperature & humidity at ground surface
41
4.4
Graph of temperature & humidity at sand surface
42
4.5
Graph of temperature & humidity at paved road surface
42
4.6
Maps of GPS tracking application (i) ground surface;
(ii) grassy surface; (iii) smooth surface (cement)
4.7
43
Maps of GPS tracking application (i) sand surface;
(ii) paved road surface
44 xiv
LIST OF ABBREVIATION
ABBREVIATION
TITLE
PAGE
UAV
Unmanned Aerial Vehichle
2,3,47
WSI
Water Stress Index
1
WSN
Wireless sensor network
2
DOF
Degree of Freedom
IMU
Initial measurement unit
GPS
Global Positioning System
SD
Secure Digital
Wi-Fi
Wireless
12,14
mAh
Ampere Hour
12,54
kg
Kilogram
12
USB
Universal Serial Bus
14
NABC
Need, Approach, Benefit, Competition
18
FYP
Final Year Project
19,50,51,52
PVC
Polyvinyl Chloride
34,48,55
PCB
Printed Circuit Board
4,5,9,10
5,12,14,15
5,8,12,14,15,38,43,44,46
5,20,21,48,53,54
34
xv
LIST OF SYMBOLS
º
-
Degree
xvi
LIST OF APPENDICES
APPENDIX
TITLE
PAGE
A
Humidity Sensor Module Cicuit
59
B
Temperature Sensor Module Circuit
60
INTRODUCTION
1.1
Background
Agriculture is one of the important field in Malaysia. Before Malaysia change
its economy policy to industrial based economy, the economy of Malaysia depend on
agricultural product. Although the economy policy has been change, agriculture still
contributes to Malaysia economic growth.
In agriculture, the most important objective to achive is each tree or plant
produce fine and good agriculture product. To get this the farmer must know how to
get this good crops. The farmer must know what changes that happen to their crop in
terms of color and shape of the plant, when to water the plant and the temperature of
surrounding that suitable for their crops.
Before the farmer has to check one by one their crop to know about the
condition of their crop. This method is will take a very long time, highly cost in terms
of worker payment and prone to errors. Then they implement a technology where they
can check the humidity of the crops using Water Stress Index (WSI) that can be
obtained using satellite or plane images [1].
2
But this method is very costly and depend on the condition of the weather.
Currently, Unmanned Aerial Vehicles (UAV) is use for this purpose with lower cost
compared to the previous method. But this method need someone that highly skill to
operate the UAV and this is not applicable to the smallholders.
Other than that, ground method such as single sensors or Wireless Sensor
Network (WSN) can be a good static solution for this problem. On other hand, using
ground mobile robot that will be equipped with sensor like humidity sensor would
reduce a cost of the entire WSN.
1.2
Problem Statement
Although the technologies that been use now to monitor crops is good but still
not widely use in Malaysia. The system also is very costly and need skillful person to
operate it. Other than that, below is the list the disadvantages of using current
technology:
1.2.1
Using human to monitor the crop. Although it will give a great view to
the farmer about their crop but it will take more time to check one by
one and they will tend to do an error. It also very costly in terms of
worker payment if they have a very big farm.
3
1.2.2
Satellite crop monitoring is a technology that can facilitate the realtime crop vegetation index monitoring via spectral analysis of high
resolution satellite images for different fields and crops which enables
to track positive and negative dynamics of crop development. This
technology is very costly and not applicable to smallholders.
1.2.3
Another technology use to monitor the crop is UAV. This UAV will be
operate from ground by someone and it will take the aerial image of
the crop fields. Although this technology is very useful and can reduce
the time in problem statement one, but it still very costly and not
applicable to smallholders.
1.3
Objective of The Project
The aims of this project is:
1.3.1
To develop a ground mobile robot that can monitor the crop and stored
the monitoring data for farmer.
1.3.2
To develop a low cost ground robot that minimize the damage to the
crop while performing monitoring task and at the same time to be able
to have direct measurement from plant surroundings.
4
1.4
Scope of The Project
The scope of this project depend on the mechanical, electronic and software
part. Below is the detail of each part:
1.4.1
Mechanical
1.
Spherical Transparent Ball
One of the main part on the robot. The moving mechanism and circuit
will be inside the ball. The diameter of the ball is around 12.5inch.
2.
Moving mechanism
Also one of the important part in this project. It consist of fixed main
axis. The moving part will rotate at the main axis using pendulum
principle. This system will used inner pendulum with two rotational
DOFs [1].
3.
Ballast
The important bottom part of the moving mechanism. The ballast use
in this project is the battery that acts as power supply to electronic part.
The ballast must be in center of the gravity in the robot. It to make sure
that the robot moving straight without deviate from it moving path.
5
1.4.2
Electronic
1.
Microcontroller (Arduino UNO)
The most important things in this project. This microcontroller will
control all the electronic part in this project like 5 DOF Inertial
Measurement Unit (IMU), sensor and servo motor.
2.
Sensor
Sensor use in this project is temperature sensor and humidity sensor.
The sensor will be used to take direct measurement of the field
(temperature and humidity) during use.
3.
Continuous Rotation Servo Motor
Continuous rotation servo motor also the important device in this
project. It very crucially important to moving part. Servo motor will be
controlled by microcontroller to make the moving mechanism part
rotate.
4.
Smartphone
Acts as the GPS tracker for the robot. Can use any applications that can
track GPS position and stored the data for future reference.
5.
Data Logger Shield with SD card
As a bridge that will stored the data collected from sensor into SD card
for future reference for the farmer.
6
1.4.3
Software
The software that will be use is C++. It’s the language that will be used to write
the coding for the microcontroller. This is also the important part in this project. It’s
because if coding part is not complete the project cannot be continued.
LITERATURE REVIEW
2.1
Introduction
In this chapter, the review will be made about any related reference that other
people do to complete their project, thesis, journal and etc. The main part is the moving
mechanism in spherical ball and the electronic part use to make the moving
mechanism moving. The approach the reseachers use to make the moving mechanism
and also what type of circuit used will be review and discuss.
2.2
Spherical Robot
Spherical robot is a kind of mobile robot with a shape of ball that has control
system and driving mechanism inside the sphere [2]. In this project, the spherical
robot will be used because it’s flexible movement and can protect the moving
mechanism and the electronic control system inside the sphere. Therefore it is suitable
to use in harsh environment, such in rain or snow weather and bumpy surface [2].
8
Figure 2.1: Type of spherical robot.
The Figure 2.1 shows the several type of spherical robot the reseachers make
[2]. According to the previous researcher this robot has been design as tools and toys.
Other than that, in the research paper, new kind of robot called BYQ-8 have been
developed thet equipped with GPS positioning and visual navigation system to achive
the research objectives that it to learn about autonomous movement and navigation.
Many researchers have developed different kind of spherical robot system
especially the moving mechanism inside the sphere considering the relocation of
internal mass distribution of the ball for propulsion. For example in [2], the researcher
has developed a BYQ-8 that driven through the left and right hemispherical shells
differently to realize movement. The sphere has a gap between left hemisphere and
right hemisphere but it still look like a ball.
According to researcher in [1], the movement of sphere robot are induced by
instability because by considering their regular shape, it may recover from collisions
easily. The robot also tends to fall into a recoverable configuration in any type of
direction of the impact. Other than that, several researchers have proposed some
approaches to design a mechanical system that allow shifting the center mass of a
sphere and consequently inducing self-motion [1]. The reseachers also purpose four
typical method to archive this goal [3]:
9
1.
Spring Central member. A central body that includes a driven wheel in
one of its ends and a passive wheel in the other, with a spring that
guarantees contact between both wheel and the spherical shaped body.
The main bad choice of this design is the energy loss to friction
between the sphere and both wheels [1].
2.
Car driven. In order to induce motion, the robot will depend on the
vehicle inside the sphere. The main disadvantages for this method is
when the robot moves on surfaces with depressions and bumps it lack
of contact [1].
3.
Ballast mass with fixed axis. This system will use an inner pendulum
with two rotational DOFs. The first DOF rotates around the fixed
transverse axis and the second around a longitudinal axis [4]. This
method design has been chosen to design the spherical robot on this
project [1].
4.
Ballast mass with moving axis. It the same like above method but it has
an additional DOF that allows the main axis to move [1].
The prototype of their spherical robot, ROSPHERE is a non-holonomic robot
[1]. That why, the vehicle requires forward or backward displacements to rotate.
Therefore the prototype they build take advantages of the movement of masses along
radial axes in order to modify the position of the center of mass. This method will be
used to complete this project.
10
2.3
Mechanical, Hardware, Electronic and Software Implementation
Different hardware, electronic and software implementation has been
introduced in research to make the spherical robot. In [1], the researchers discuss this
topic very detail. In terms of mechanical part, the researchers use :

Two-degree of freedom pendulum;

A spherical shaped body (30 cm of diameter)

A fixed main axis;

The ballast or hanging mass.
The inner pendulum has two DOFs. First DOF rotates the hanging masss about
the fixed axis and the second DOF rotates about a perpendicular axis because it has a
mechanically limited range of rotation. Other than that, the designed robot has the
center of mass as far as possible from the geometrical center because this will easily
induce the movement.
11
Figure 2.2: The ROSPHERE inner pendulum.
Figure 2.2 shows the inside pendulum moving mechanism of ROSPHERE
where the ballast mass is hanging below the fixed main axis. While Figure 2.3 shows
the ROSPHERE prototype. Where a transparent spherical ball is used.
12
Figure 2.3: The ROSPHERE prototype.
For hardware, a novel embedded computing system composed by a Robovero
and an Overo Fire embedded computer has been used as microcontroller [1]. Other
than that, the robot also equipped with Wi-Fi, Bluetooth and Xbee module as
communication alternatives. For sensing abilities a low cost Inertial Measurement
Unit (IMU) used for guidance, navigation and control system that capable to measure
angular velocities and acceleration, a gyroscope with pan-tilt correction capability and
a single GPS. While the analog-digital converter used to connect the external sensor
like humidity and temperature. For power source a 2200 mAh battery has been used.
For overall the weight of this robot is only 2.5 kg.
To make a more robust control algorithm that useful when the traction is very
low for example a very wet surfaces, the researchers recommend to use optical
13
encoder. This encoder is used to measure the rotational speed of the sphere and
compare it with the real speed of the robot [1].
Software implementation has been split into two parts. The first part is
responsible for the high level and the second for the low level (sensor and actuators
level) [1].
Figure 2.4: The hardware architecture of ROSPHERE.
14
Figure 2.5: The software architecture of ROSPHERE.
Figure 2.4 shows the hardware architecture and Figure 2.5 shows the software
architecture of the ROSPHERE. LPC1769 has been choosen as microcontroller. This
microcontroller will control the IMU, servo motor, communication part (GPS and
Xbee) and sensor. This all is on the Robovero part, while the Overo part consist of
Wi-Fi only. This two embedded computer connected with each other using USB. For
software, the C++ and Python language have been used to control microcontroller and
Overo part.
Figure 2.6: The autonomous positioning and navigation system (left to right:
camera with visual processor; GPS system; a gyroscope).
15
In [2] , the researcher do not provide the detail about components of the robot.
Moreover, it only stated the type of hardware use like in Figure 2.6. For
microcontroller ARM processor AT91SAM7X256, Puck-size 3DM-GX1 IMU for
gyroscope and PCB-EX11DP CCD camera with visual processor been used to make
the robot. Other than that, the robot also equipped with NEWSTAR220E for GPS
system.
METHODOLOGY
3.1
Introduction
This part is very important because all the detail about hardware implantation,
electronic implantation and all the step and approach taken to complete this project.
This chapter also will include the system working process in detail. For more
understanding, the flow chart of the methodology and system flow will be included.
17
3.2
Methodology Flow Chart
START
Getting Project Title and Objective
Hardware and
Literature review and
electronic
Software
project proposal
implementation
implementation
Microcontroller
System integration
Assemble circuit
programming
System testing
Debug and troubleshoot
YES
Error?
YES
Debug and troubleshoot
NO
Mechanical design
NO
Meet
specification?
YES
Assemble all parts
Collecting Experiment Data
Finalize Documentation
End
Figure 3.1: Methodology flow chart.
18
3.2.1
Getting Project Title and Objective
For project title, after discussion with supervisor about several project, project
title have been introduced. The objective is listed after that about the purpose of this
project. The objective is listed with proposal that been made to explain a little bit about
this project.
3.2.2
Literature Review and Project Proposal
In project proposal, it consists of some rough explanation about this project.
The information listed is problem statement, objective of this project, simple
explanation about methodology and approach taken to complete this project and
expected outcomes. Other than that, the NABC approach explanation also been listed
together in this proposal. The N means the need of this project and why to do this
project. The A is approach taken to satisfying the need of this project. The B is benefit
per cost. The explanation is about how this project can benefit others and the value of
this project. The C is competition. Is basically the list of competitor of this project and
what advantages this project has than other competitor?
For literature review, the past journal or thesis is been review or discussed in
this part. It can also consists of information regarding this project on internet. The
reference will be related about this project. It will be this discussion about what other
researcher do to complete their project, the advantages and disadvantages of their
project and also the challenges of their project and what improvement they make to
overcome the challenges they facing to complete their project.
19
3.2.3
Hardware, Electronic and Software Implementation
This part is the most important before mechanical design process. On this part,
the microcontroller will be the main part of the system. The microcontroller will
control all the electronic part on this project. The device have been highlighted in
chapter 1. The microcontroller will use C++ language as a coding. For first semester
FYP, the task is to complete the coding process to control the servo motor and
gyroscope for stability.
This process take longer time because this process will consist of system test
after hardware and electronic part is integrate together with software part. After coding
part is been writing using Arduino coding software and upload into the
microcontroller, the system will be test. This is to check whether the coding is good
or not. If the coding is not good it will go through the debug and troubleshoot process
to make the perfect coding. This process will be repeated times to make the perfect
coding.
20
Figure 3.2: The microcontroller and its functionality on the robot.
Figure 3.2 shows the microcontroller use for the robot. Microcontroller 1 will
control the data logger shield, temperature sensor and humidity sensor. The sensor will
take the relative measurement from surrounding the robot like from farm surrounding
and stored the data in the SD card for farmer reference. The data is in the Excel file
type format. The farmer can use Excel to simulate the graph of the data collected from
the sensor for temperature and humidity.
21
START
INITILIAZATION
Check data logger
shield
SD card exist?
NO
YES
Read data from
temperature sensor
Read data from
humidity sensor
Read data from
temperature sensor
Change digital value
to analog value
Print value to SD
card
Figure 3.3: Flow chart for microcontroller 1.
22
Table 3.1: The C++ code for microcontroller 1.
#include <SD.h>
#include <Wire.h>
#include "RTClib.h"
#define LOG_INTERVAL 5000
#define SYNC_INTERVAL 1000 // mills between calls to flush() - to write data to
the card
uint32_t syncTime = 0; // time of last sync()
#define ECHO_TO_SERIAL 1 // echo data to serial port
#define WAIT_TO_START
0 // Wait for serial input in setup()
// the digital pins that connect to the LEDs
#define redLEDpin 2
#define greenLEDpin 3
// The analog pins that connect to the sensors
#define humidityPin 0
#define tempPin 1
#define BANDGAPREF 14 // special indicator that we want to measure the bandgap
23
#define aref_voltage 3.3
// tie 3.3V to ARef and measure it with a multimeter!
#define bandgap_voltage 1.1
RTC_DS1307 RTC; // define the Real Time Clock object
// for the data logging shield, use digital pin 10 for the SD cs line
const int chipSelect = 10;
// the logging file
File logfile;
void error(char *str)
{
Serial.print("error: ");
Serial.println(str);
// red LED indicates error
digitalWrite(redLEDpin, HIGH);
while(1);
}
void setup(void)
{
Serial.begin(9600);
Serial.println();
// use debugging LEDs
24
pinMode(redLEDpin, OUTPUT);
pinMode(greenLEDpin, OUTPUT);
#if WAIT_TO_START
Serial.println("Type any character to start");
while (!Serial.available());
#endif //WAIT_TO_START
// initialize the SD card
Serial.print("Initializing SD card...");
pinMode(10, OUTPUT);
// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
error("Card failed, or not present");
}
Serial.println("card initialized.");
// create a new file
char filename[] = "LOGGER00.CSV";
for (uint8_t i = 0; i < 100; i++) {
filename[6] = i/10 + '0';
25
filename[7] = i%10 + '0';
if (! SD.exists(filename)) {
// only open a new file if it doesn't exist
logfile = SD.open(filename, FILE_WRITE);
break; // leave the loop!
}
}
if (! logfile) {
error("couldnt create file");
}
Serial.print("Logging to: ");
Serial.println(filename);
// connect to RTC
Wire.begin();
if (!RTC.begin()) {
logfile.println("RTC failed");
#if ECHO_TO_SERIAL
Serial.println("RTC failed");
26
#endif //ECHO_TO_SERIAL
}
logfile.println("millis,stamp,datetime,tempC,humidity,vcc");
#if ECHO_TO_SERIAL
Serial.println("millis,stamp,datetime,tempC,humidity,vcc");
#endif //ECHO_TO_SERIAL
// If want to set the aref to something other than 5v
analogReference(EXTERNAL);
}
void loop(void)
{
DateTime now;
// delay for the amount of time between readings
delay((LOG_INTERVAL -1) - (millis() % LOG_INTERVAL));
digitalWrite(greenLEDpin, HIGH);
// log milliseconds since starting
uint32_t m = millis();
27
logfile.print(m);
// milliseconds since start
logfile.print(", ");
#if ECHO_TO_SERIAL
Serial.print(m);
// milliseconds since start
Serial.print(", ");
#endif
// fetch the time
now = RTC.now();
// log time
logfile.print(now.unixtime()); // seconds since 1/1/1970
logfile.print(", ");
logfile.print('"');
logfile.print(now.year(), DEC);
logfile.print("/");
logfile.print(now.month(), DEC);
logfile.print("/");
logfile.print(now.day(), DEC);
logfile.print(" ");
logfile.print(now.hour(), DEC);
logfile.print(":");
logfile.print(now.minute(), DEC);
28
logfile.print(":");
logfile.print(now.second(), DEC);
logfile.print('"');
#if ECHO_TO_SERIAL
Serial.print(now.unixtime()); // seconds since 1/1/1970
Serial.print(", ");
Serial.print('"');
Serial.print(now.year(), DEC);
Serial.print("/");
Serial.print(now.month(), DEC);
Serial.print("/");
Serial.print(now.day(), DEC);
Serial.print(" ");
Serial.print(now.hour(), DEC);
Serial.print(":");
Serial.print(now.minute(), DEC);
Serial.print(":");
Serial.print(now.second(), DEC);
Serial.print('"');
#endif //ECHO_TO_SERIAL
analogRead(tempPin);
29
delay(10);
int tempReading = analogRead(tempPin);
analogRead(humidityPin);
delay(10);
int humidityReading = analogRead(humidityPin);
// converting that reading to voltage,
float voltage1 = tempReading * aref_voltage / 1024;
float temperatureC = (voltage1 - 0.5) * 100 ;
float temperatureF = (temperatureC * 9 / 5) + 32;
float voltage2 = humidityReading * aref_voltage / 1024;
float
percentRH
=(voltage2-0.958)/0.0307;
percentrelative humidity
logfile.print(", ");
logfile.print(temperatureC);
logfile.print(", ");
logfile.print(percentRH);
#if ECHO_TO_SERIAL
Serial.print(", ");
Serial.print(temperatureC);
Serial.print(", ");
//
Translate
voltage
into
30
Serial.print(percentRH);
#endif //ECHO_TO_SERIAL
// Log the estimated 'VCC' voltage by measuring the internal 1.1v ref
analogRead(BANDGAPREF);
delay(10);
int refReading = analogRead(BANDGAPREF);
float supplyvoltage = (bandgap_voltage * 1024) / refReading;
logfile.print(", ");
logfile.print(supplyvoltage);
#if ECHO_TO_SERIAL
Serial.print(", ");
Serial.print(supplyvoltage);
#endif // ECHO_TO_SERIAL
logfile.println();
#if ECHO_TO_SERIAL
Serial.println();
#endif // ECHO_TO_SERIAL
digitalWrite(greenLEDpin, LOW);
31
// write data to disk!
if ((millis() - syncTime) < SYNC_INTERVAL) return;
syncTime = millis();
// blink LED to show syncing data to the card & updating FAT!
digitalWrite(redLEDpin, HIGH);
logfile.flush();
digitalWrite(redLEDpin, LOW);
}
Figure 3.3 show the flow chart of program for microcontroller 1 while in Table
3.1 shows the C++ programming code for microcontroller 1. The code for
microcontroller 1 is more complex than microcontroller 2. While Microcontroller 2
will only control the servo motor. The servo motor used in this project is the
continuous rotation type. It is because if use the normal servo motor that can rotate
only from 0º to 180º it cannot move straight but move to the front and back
continuously. Figure 3.4 shows the flow chart of program for microcontroller2 while
Table 3.2 shows the C++ programming code for microcontroller 2 to control the
continuous servo motor.
32
START
INITILIAZATION
Moving Servo
motor
Figure 3.4: Flow chart for microcontroller 2.
Table 3.2: The C++ code for microcontroller 2.
#include <Servo.h>
Servo myservo1;
Servo myservo2;
void setup()
{
myservo1.attach(9);
myservo1.write(-90);
myservo2.attach(10);
myservo2.write(90);// set servo to mid-point
}
33
void loop() {}
3.2.4
Mechanical Design
This process will be executed after the upper part is complete. This process
also can be executed whether the upper part process is not complete. The components
use in mechanical part has been given in Chapter 1. The mechanical part will consist
the moving mechanism and spherical ball. Commercial transparent spherical ball that
has diameter around 12.5 inch has been chosen for this project. For moving
mechanism, it is important to create a mechanical system that allow shifting the center
of mass of a sphere and consequently inducing self-motion [1]. From [1], the
researcher has come out with 4 type of mechanical system for moving mechanism and
choose one from the list. The reseachers choose ballast mass with fixed axis system
[1]. This system uses an inner pendulum with two rotational degree of freedom. It will
move around the fixed transverse axis and longitudinal axis. After all the part above
is complete, all part will be assemble to become complete robot.
34
Figure 3.5: The complete spherical robot moving mechanism.
Figure 3.5 above shows the complete spherical robot moving mechanism. It
show all the part should be to make the spherical ball moving. Other than that, the
material use to make the moving mechanism is Perspek and PVC pipe. Also some
hinge, bolt and nut and PCB stand.
Figure 3.6: More pictures of moving mechanism from any angle.
35
At the fixed axis inside end, a fixed gear will move the robot from the torque
given by the gear at servo motor. One servo motor gear rotate clockwise while the
other servo motor gear rotate anticlockwise. Servo motor and the ballast and
smartphone compartment is fixed at the bottom of the electronic compartment. When
the servo motor rotates it will moves along with the ballast and smartphone
compartment. This will make the spherical robot moving to the front because the
ballast make the moving mechanism feel heavy at the front. If no ballast is attached,
the moving mechanism will rotate 360º along the fixed axis. It is the different when
ballast is not attached and ballast is attached.
Figure 3.7: The complete spherical robot with moving mechanism inside.
3.2.5
Experiment and Collecting Data
The experiment is to test the robot whether it can function perfectly especially
the moving mechanism part. From the testing been conducted, the robustness of the
robot can been known. The experiment also will look about the movement of the robot
and the stability when moving on different ground like wet or dry ground. Other than
that, the experiment examines the functionality of the sensor when the spherical robot
36
moving and also the result obtained from application use on smartphone to record the
positioning of the spherical robot using GPS. The data from the experiment will be
collected and analyses. The detail of the preliminary experiment and result for
semester one and the detail of semester two experiment than been conducted can be
referred in Chapter 4.
RESULT AND DISCUSSION
4.1
Preliminary Experiment and Results
4.1.1
Experiment
In first semester, the schedule is to complete the hardware, electronic and
software implementation. The experiment is create a coding for microcontroller to
control the servo motor and gyroscope. The experiment still in progress when this
report is writing.
4.1.2 Result
The result of the experiment is not complete because the experiment still in
progress because debug and troubleshoot take more time to get a perfect coding.
38
4.2
Experimental Results
As mention in chapter 3.2.5, the experiment has been divided into three part.
First part is the experiment on the functionality and robustness of the spherical robot
moving on different type of surface. Second part is the robustness of the coding of
microcontroller 1 where it control the sensor. Also to look whether the sensor function
properly and the data logger can record the data detect from the sensor. The last
experiment result is the result from application use on smartphone to record the
positioning of the spherical robot using GPS. All these experiment are carried out
simultaneously.
4.2.1 Spherical Robot Movement Test Results
The experiment have been carried out on five different type of surface such as
smooth surface (cement), grassy surface, and ground surface without grass, sand
surface and paved road. The condition of the test surface also been observed before
experiment is carried out. After that observation of the movement of spherical robot
on each surface has been made during the experiment. The results can been seen on
Table 4.1 below.
39
Table 4.1: The results of spherical robot movement experiment.
Test Surface
Smooth
(Cement)
Grassy
Ground
Sand
Paved road.
Test Surface Condition
Observation

Dry and not wet.

Move but not smoothly.

Flat surface.

Tend to deviate from its path (straight).

Move back if cannot move forward.

Not wet and muddy

Move smoothly.

Grass not thick.

Move forward following the path.

Has small rock on surface

Small deviation from its path.

Not wet and muddy.

Move smoothly on surface without rock.

Has some grass.

Stop moving when collide with big rock.

Has small and big rock on

Move forward following its path on surface without rock.
surface.

Small deviation from its path.

Not wet and muddy.

Move smoothly.

Fine sand.

Stop moving forward inside big hole.

Deviate from its path when move on small hole.

Good paved.

Move smoothly.

No big hole.

Small deviation from its path.

Flat surface.
4.2.2
80
70
60
50
40
30
20
10
0
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
40
Temperature and Humidity Sensor Results.
The sensor measures the temperature and humidity of surrounding during the
experiment is conducted. Below shows the graph of the temperature and humidity of
five surfaces.
Temperature and Humidity Graph
tempC
humidity
Figure 4.1: Graph of temperature and humidity at smooth surface.
80
70
60
50
40
30
20
10
0
tempC
humidity
Figure 4.3: Graph of temperature and humidity at ground surface.
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
tempC
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
"2165/165/165…
80
70
60
50
40
30
20
10
0
"2165/165/165…
41
Temperature and Humidity Graph
humidity
Figure 4.2: Graph of temperature and humidity at grassy surface.
Temperature and Humidity Graph
42
Temperature and Humidity Graph
70
60
50
40
30
20
10
0
tempC
humidity
Figure 4.4: Graph of temperature and humidity at sand surface.
Temperature and Humidity Graph
70
60
50
40
30
20
10
0
tempC
humidity
Figure 4.5: Graph of temperature and humidity at paved road surface.
From the above figure, the reading of temperature and humidity during
experiment been conducted, as expected the result is linear and steady. No changing
much in reading during one place to another place.
43
4.2.3
GPS Tracking Experiment Results.
During the experiment, smartphone is use as the GPS tracker for the spherical
robot. One application that can record the GPS tracking is used during the process.
Below shows the map from the record of the GPS during experiment.
(i)
(ii)
(iii)
Figure 4.6: Maps of GPS tracking application. (i) Ground surface, (ii) Grassy
surface, (iii) Smooth surface (cement).
44
(i)
(ii)
Figure 4.7: Maps of GPS tracking application. (i) Sand surface, (ii) Paved road
surface.
CONCLUSION
5.1
Introduction
All aspects of prior discussions will be concluded in this chapter as to
determine whether this project achieve its objective or not. It covers the conclusion of
the methodologies and also the results. In addition, this chapter will stated the
limitation and the future improvement that can been made to the spherical robot.
5.2
Conclusion
From chapter 1, two project objectives have been highlighted. The first
objective is to develop a ground mobile robot that can monitor the crop and stored the
monitoring data for the farmer. This objective has been successfully achieved via the
fully operated spherical robot equipped with temperature sensor and humidity sensor.
When the spherical robot moves along the farm while recording the temperature and
humidity along the farm. In chapter 4.2.2, it shows the result of the temperature and
46
humidity taken during experiment. As expected the result remained stable and no
larger changes between one point to one point. The results also does not have a big
gap between each surface during experiment.
The second objective is to develop a low cost ground robot that can minimize
the damage to the crop while performing monitoring task and at the same time to be
able to have direct measurement from plant surroundings. This objective is slightly
achieved because no test has been made on the farm yet but from the experiment
conducted, as long as the robot has it center of gravity is in center position, the robot
has no problem to move forward between the crop rows. That why the robot use a
slow speed to make sure that the robot not across the crop rows and damage the crops
on the rows. From the experiment conducted if the spherical robot slightly deviate
from forward path and slightly hit something from it side, it will bounce back to its
path. Therefore the problem whether it will damage the crop can be reduced.
From chapter 4.2.1, shows the result of spherical robot moving mechanism
during experiment at five different surface. It shows that at smooth surface, the robot
tend to deviate from it forward path and also can move to the back if it hit something
from the front. Also this spherical robot cannot been use on wet and muddy surface
and has some big rock on the surface because it will not move at all at wet and muddy
surface and will not move forward if it hit rock from the front. The moving mechanism
will rotate 360º inside the ball if this happen. Therefore the suitable time to use this
spherical robot is during dry day and make sure to check the condition of the ground.
Also the spherical robot can be used at the crops that been planted in rows only. Some
changes are required to the spherical robot if want to use on other farm.
Other than that, from chapter 4.2.3, it shows the maps of GPS tracking during
experiment conducted. Any application can be used to track the GPS of the spherical
robot because smartphone is used as the GPS tracker. This application will record the
GPS tracking data and farmer can check the maps for reference after usage the robot.
On overall, the objective of the project has been achieve and the robot can been operate
47
properly without problem if the condition for the surface is met. To make the spherical
robot more powerful some improvement and modification need to be made. The next
part will discuss about the limitation of the project and the future improvement that
can been made.
5.3
Limitation and Future Improvement
Although the spherical robot has been successfully developed, it still has many
limitations. First it the type the ball used. The type of spherical ball used is the
commercial one used for gerbil and hamster. To make the spherical robot that can
move on any surface without any condition needed the more suitable and can immune
to shock and concussion. The system also not included with accelerometer and
gyroscope. If this sensors are added into the system, it will make the robot can move
more smoothly and counter back if the spherical robot deviates from its path. Also
some sensor can be added to measure the rotation speed of the spherical ball to develop
advanced controller at extreme slippery surface and also at farm that has slopes. The
robot also can move to the left or right and the end of the crop rows if some
improvement been made to the robot with addition of sensor that can detect the end of
the crops rows to move to another crop rows.
In addition, the spherical robot use two microcontroller to control the servo
motor and sensor because of the limitation on the Arduino microcontroller itself. For
improvement, one microcontroller that more powerful than microcontroller use now
can be used to control all the electronic part of the robot. Other than that, the sensor
used is not appropriate because the temperature and humidity is same from one place
to one place in Malaysia mostly. Therefore some improvement can be made to monitor
the crop like using image sensor to record the video or take picture of the crop from
the ground with the uses of UAV that take video and picture from above ground. The
image sensor can also be used together with temperature and humidity sensor and the
48
data recorded can be transfer to the farmer wirelessly without stored in the SD card.
This will enhance data accuracy and make connectivity easier.
In terms of mechanical part especially the moving mechanism, some Perspex
and PVC pipe have been used to make the moving mechanism. For more accurate and
good build of moving mechanism, the moving mechanism can be made using mold
build like the researcher used in [1]. This will make the moving mechanism more
beautiful and can move properly without stuck.
PROJECT MANAGEMENT
6.1
Introduction
The project management plays an important role on any project development.
One of its objective is to achieve all project objective and goal with effective and
efficiency of project planning, organizing and controlling resource within specific
period of time. The primary aspect to be consider in this project are the research scope,
research time, project budget and also the human resource use to perform all the
required activities needed to completed the project. Based on the primary aspect stated,
project schedule had been tabulated using Gantt chart that gives clear guideline in time
management to complete this project.
Other than that, cost of the every component use also be stated to ensure
minimal project cost to develop low cost spherical robot as stated in the second
objective of this project. The cost is split into two parts, the electronic and electrical
component and mechanical component use to develop moving mechanism. After that
component price is tabulated to compute the final cost of the spherical robot.
50
6.2
Project Schedule
Table 6.1 shows the project Gantt chart for the first semester. The table shows
that the late start of the project. Only in October the project is actually start in terms
develop project proposal. This proposal had been made after confirm the project that
want to be built in one year with supervisor. During the process until FYP 1
presentation, some reference like journal, thesis and internet source be sought to help
with the development of the project. In addition to that, some component be bought
like microcontroller and servo motor to make the code for microcontroller to control
the servo motor. During the process debug and troubleshoot also been made to get
accurate code.
51
Table 6.1: Project Gantt Chart (First Semester)
NO. ACTIVITY 1 Project Proposal 2 Literature Review 3 4 5 6 7 8 Hardware Implementation Software Implementation Debug and Troubleshoot Project Report (FYP 1) Project Presentation (FYP1) Preparation Project Presentation (FYP1) OCT NOV DEC JAN FEB Execute Follow Up MAR APR MAY 52
Table 6.2: Project Gantt Chart (Second Semester)
NO. ACTIVITY Feb Mar April 1 Project Design (Moving Mechanism) 2 Moving Mechanism Build 3 Assemble Electronic and Mechanical Part 4 Collecting and Analyze Experiment Data 5 Experiment Data Verification 6 Project Presentation (FYP2) Preparation 7 Project Presentation (FYP2) 8 Thesis, Report and Journal Execute Follow Up May June 53
Table 6.2 above shows the project Gantt chart for second semester. The project has been
build late because the design process take around five weeks to complete to get the actual moving
mechanism. After the design is completed the moving mechanism is build. This part also running
simultaneously with development of electronic and electrical part. After that the electronic and
mechanical part is assemble together to complete the robot. Then, the experiment been made and
the data is analyze and verify.
6.3
Cost Estimation
The cost is divided into two part. The first part is cost for electronic and electrical and the
second is the mechanical (moving mechanism). Table 6.3 shows the cost use to develop the
electronic and electrical part. The component needed is microcontroller, sensor, data logger shield,
SD card, switch, servo motor, gear and some jumper wire to connect the component.
Table 6.3: Cost Estimation for Electronic and Electrical Component.
Component Name
Cost per Unit (RM)
Unit needed
Subtotal (RM)
Arduino Uno
72
2
144
Data Logger
98
1
98
13
1
13
Shield
Temperature
Sensor Module
54
Humidity Sensor
19.50
1
19.50
SD Card
26
1
26
Switch
2
1
2
Servo Motor
39
2
78
Servo Bracket
16
2
32
Small Gear at
20
2
40
20
2
40
Smartphone Cover
30
1
30
Jumper Wire
5
Many
5
2200 mAh Lipo
85
1
85
160
1
160
Module
Servo Motor
Big Gear at Fixed
Axis
Battery
Lipo Battery
charger with
Power Adapter
55
Power socket for
1
2
2
Total (RM)
772.5
Arduino Uno
Table 6.4: Cost Estimation for Mechanical (Moving Mechanism).
Component Name
Cost Per Unit
Unit needed
Subtotal (RM)
Perspex
30
1
30
PVC pipe
1.50 per feet
3
4.50
PVC socket
50 cent
3
1.50
Spherical Ball
37
1
37
12
2
24
Total (RM)
97
(20cmx20cm)
(3mm thick)
(12.5 inch
diameter)
Aradite Glue
56
Table 6.4 shows the cost estimation to make the spherical robot without the electrical and
electronic part attach. The spherical robot can be made at below RM 100. While Table 6.5 below
shows the total cost estimation for one spherical robot build. The total cost to build it is around RM
869.50.
Table 6.5: Total Cost Estimation for One Spherical Robot.
Component
Subtotal (RM)
Electrical And Electronic
772.5
Mechanical Part
97
TOTAL
869.5
57
REFERENCES
1.
Hernández, J.D., Barrientos, J., del Cerro, J., Barrientos, A. and Sanz, D. (2013) "Moisture
measurement in crops using spherical robots", Industrial Robot: An International Journal,
Vol. 40 Iss: 1, pp.59 – 66
2.
Hou, K., Sun, H., Jia, Q. and Zhang, Y. (2012). “An Autonomous Positioning and
Navigation System for Spherical Mobile Robot”, Procedia Engineering, Vol.29, pp. 25562561.
3.
Armour, R.H. and Vincent, J.F.V. (2006) “Rolling in nature and robotics: a review”, Journal
of Bionic Engineering, Vol. 3 No.4, pp. 195-208.
4.
Michoud, F. and Caron, S. (2002) “Roball, the rolling robot”, Autonomous Robots, Vol.12
No. 2, pp. 211-222.
5.
Yu, T., Sun, H., Jia, Q., Zhang, Y. and Zhao, W. (2012) “Hierarchical Sliding Mode Control
of a Spherical Mobile Robot”, 2nd International Conference on Materials, Mechatronics and
Automation, pp. 364-369.
6.
Minghui, Z., Qiang, Z., Jinkun, L. and Yao, C. (2011) “Control of a Spherical Robot: Path
Following Based on Nonholonomic Kinematics and Dynamics”, Chinese Journal Of
Aeronautics, Vol. 24 Iss: 3, pp. 337-345.
7.
Liankuan, Z. and Deqin, X. (2012) “Collaborative image compression with error bounds
in wireless sensor networks for crop monitoring”, Computer and Electronics in
Agriculture, Vol.89, pp. 1-9.
58
8.
Sakamotoa, T., Gitelson, A.A., Nguy-Robertsonb, A.L., Arkebauerc, T.J., Wardlowb,
B.D., Suykerb, A.E., Vermab, S.B. and Shibayamaa, M. (2012) “An alternative method
using digital cameras for continuous monitoring of crop status”, Agriculture and Forest
Meteorology, Vol. 154-155, pp. 113-126.
59
APPENDIX A
Humidity Module Sensor Module Circuit
60
APPENDIX B
Temperature Sensor Module Circuit