DEGREE PROJECT, IN MF123X , FIRST LEVEL STOCKHOLM, SWEDEN 2015
Lawn Analyzer
MARTIN EDLUND
KTH ROYAL INSTITUTE OF TECHNOLOGY
!
!
!
!
!
!
!!
!
!
!
!
!
!
!
!
This!page!has!intentionally!been!left!blank.!!
! !
Bachelor’s Thesis MMK 2015:4 MDAB 057
Lawn Analyzer
Martin Edlund
Approved
2015-05-20
Examiner
Martin Edin Grimheden
Supervisor
Fredrik Asplund
A BSTRACT '
This!thesis!is!a!demonstrator!on!the!question!if!measurements!of!grass!height!of!a!lawn!
can!be!sampled!with!a!custom;built!sensor!unit.!These!samples!are!put!to!validation!on!
their! accuracy! and! application.! Applying! theory! and! research! on! data! accusation,!
hardware!components!and!robot!control,!this!thesis!presents!information!regarding!the!
necessary!hardware!and!software!to!construct!a!platform!fit!for!this!task.!Creation!of!a!
web!service!also!facilitates!as!the!control!system!for!the!demonstrator,!which!provides!
manual!control,!diagnostics!and!data!output!logging!to!the!end!user.!
!
The! proposed! design! solution! for! the! sensor! uses! optical! infrared! barriers! to! detect!
straws!of!grass!and!motion!sensing!circuits!to!provide!feedback!on!object!detection.!This!
design! solution! was! developed! with! requirements! and! specifications! that! derive! from!
examination! of! the! restrictions! that! accommodate! commercial! robotic! lawnmowers.!
Results! from! the! demonstrator! shows! that! the! required! height! resolution! can! be!
established! with! the! design.! The! tolerances! from! the! first! functional! tests! conform!
throughout!the!validation!and!provide!proof!that!the!design!solution!is!operational!for!
the!stated!purpose.!The!height!data!output!is!discussed!as!feedback!in!scheduling!and!
path! planning! of! robotic! lawnmowers,! where! more! advanced! control! systems! could!
enable!more!efficient!use!of!resources!in!tomorrow’s!appliances.!
! !
!
!
!
!
!
!
!!
!
!
!
!
!
!
!
!
This!page!has!intentionally!been!left!blank.!!
! !
Kandidatarbete MMK 2015:4 MDAB 057 Lawn Analyzer
Martin Edlund
Godkänt
2015-05-20
Examinator
Martin Edin Grimheden
Handledare
Fredrik Asplund
S AMMANFATTNING '
Detta!examensarbete!behandlar!huruvida!en!gräsmattas!höjd!kan!mätas!med!automatik!
av!en!egenkonstruerad!givare.!Detta!sker!genom!konstruktion!och!validering!av!mätdata!
och! funktion.! ! Genom! att! applicera! informationssökning! och! presentera! teori! kring!
datainsamling,! komponenter! och! robotstyrning! ger! detta! arbete! en! beskrivning! av!
hårdvara!och!mjukvara!som!krävs!för!att!konstruera!en!prototypmodell!som!kan!utföra!
uppgiften.!En!webbplattform!skapas!även!för!att!möjliggöra!fjärrstyrning!och!hantering!
av!manuell!styrning,!diagnostisk!och!data!insamling!från!systemet.!
!
Det! presenterade! lösningsförslaget! bygger! på! infraröd! optisk! teknik! där! grässtrån!
bryter! ljuset! och! rörelsesensorer! ger! återkoppling! om! marknivån.! Utvecklingen! av!
lösningsförslaget! sker! i! enlighet! med! en! kravspecifikation! som! utgår! ifrån!
begränsningarna! hos! en! kommersiell! robotgräsklippare.! ! Arbetets! resultat! påvisar! att!
lösningsförslagets! prototyp! uppfyller! det! etablerade! toleranskravet! på! gräshöjden.!
Felgränserna! från! de! inledande! funktionella! testerna! förblir! konstanta! genom! den!
efterföljande! analysen.! Sist! diskuteras! hur! mätvärdena! kan! användas! för! återkoppling!
inom! schemaläggning! och! rörelseplanering! av! robotgräsklippare,! där! mer! avancerade!
styr! och! reglersystem! kan! möjliggöra! ett! effektivare! utnyttjande! utav! resurserna! hos!
morgondagens!apparater.!
!
!
!
!
!
!
!
!
!!
!
!
!
!
!
!
!
This!page!has!intentionally!been!left!blank.!
!
C ONTENTS '
!
ABSTRACT'...'III! SAMMANFATTNING'...'V! CONTENTS'...'VII! NOMENCLATURE'...'IX!
1.! INTRODUCTION'...'1!
1.1! BACKGROUND!...!1!
1.2! PURPOSE!...!2!
1.3! SCOPE!...!3!
1.4! METHOD!...!3!
2.! THEORY'...'5!
2.1! NARROW!BEAM!INFRARED!BARRIER!...!5!
2.2! SLIDE!POTENTIOMETERS!...!6!
2.3! CONTROL!ALGORITHMS!FOR!AUTONOMOUS!LAWNMOWERS!...!7!
2.4! ARDUINO!AND!EMBEDDED!LINUX!MODULE!...!8!
2.5! SECONDARY!SENSORS!AND!INTERFACES!...!9!
3.! DEMONSTRATOR'...'13!
3.1! REQUIREMENTS!AND!SPECIFICATIONS!...!13!
3.2! DESIGN!CONCEPTS!...!14!
3.3! IMPLEMENTATION!OF!DESIGN!SOLUTION!...!17!
3.4! FUNCTIONAL!TESTS!...!20!
3.5! INTEGRATION!...!22!
3.6! SYSTEM!TESTING!AND!VALIDATION!...!25!
4.! DISCUSSION'AND'CONCLUSIONS'...'29!
4.1! DISCUSSION!...!29!
4.2! CONCLUSIONS!...!29!
5.! RECOMMENDATIONS'AND'FUTURE'WORK'...'31!
5.1! RECOMMENDATIONS!...!31!
5.2! FUTURE!WORK!...!31!
REFERENCES'...'33!
!
! !
!
!
!
!
!
!
!!
!
!
!
!
!
!
!
!
This!page!has!intentionally!been!left!blank.!
N OMENCLATURE '
This% Nomenclature% section% presents% all% symbols% used% in% this% thesis% in% alphabetical% order.%
Followed%by%the%abbreviations%and%acronyms%that%are%shorter%forms%of%a%word%or%phrase%
that%has%been%used.%
Symbols
Symbol Description
V! Electric!potential!in!volt!(V)!
!! Resistance!(!)! !
σ! Standard!Deviation!
! !
Abbreviations
AVR! Atmel!AVR,!a!microcontroller!family!
App! Application!on!a!smartphone!
DC! Direct!Current!
GND! Electric!ground!potential!
GPS! Global!Positioning!System!
GNSS! Global!Navigation!Satellite!System!
I2C! Inter;Integrated!Circuit!(Low;speed!serial!bus)!!
IC! Integrated!Circuit!
IMU! Inertial!Measurement!Unit!
IO! Input!Output!
IR! Infrared!
LED! Light!Emitting!Diod!
PWM! Pulse!Width!Modulation!
REST! Representational!State!Transfer!API!
RTK! Real!Time!Kinematic!
UART! Universal!Asynchronous!Receiver/Transmitter!
WiSoC! Wireless!System!on!a!Chip!
! !
!
!
!
!
!
!
!!
!
!
!
!
!
!
!
!
This!page!has!intentionally!been!left!blank.!
1. I NTRODUCTION '
This introduction chapter describes the background for the ideas behind this bachelor thesis and its presented purpose, including a research approach and its defined limitations. At the end comes an explanation on a suggested work methodology that is required for solving the stated problem.
1.1 Background
The! range! of! connected! online! home! appliances! is! rapidly! increasing! in! our! modern!
welfare! societies.! In! 2015! the! leading! manufactures! are! launching! a! series! of! new!
solutions! to! bring! adaptive! control! systems! and! modern! remote! management!
technologies! to! regular! appliances,! as! the! kitchen! oven! and! washing! machine.!
Integration!of!control!systems!that!can!adjust!and!make!intelligent!decisions!to!decrease!
the! human! interaction! in! the! daily! management! could! increase! savings! of! energy! and!
consumables! through! accurate! and! proper! dosage,! of! for! example! detergents.! (BSH Home Appliances AB, 2015)!
!
Inspiration! from! modern! home! appliances! gave! birth! to! the! idea! of! creating! a!
measurement!tool!that!could!track!the!health!and!growth!of!a!lawn.!Utilizing!data!from!
grass!growth,!soil!humidity!and!many!more!easily!gathered!data!sources!could!help!with!
guidance! of! how! to! maintain! a! lawn! in! perfect! conditions! at! a! sustainable! effort.!
Counting!both!labor!when!cutting!the!grass!and!the!usage!of!fertilizers!and!irrigation.!!
!
Agriculture!on!the!other!hand!is!on!the!edge!of!a!major!change!that!transforms!farming!
into! a! data! driven! productivity! platform.! This! platform! measures! performance! and!
creates!reseeding!schedules,!among!many!other!aspects!to!increase!the!output!of!a!farm.!
Solutions!that!automates!data!gathering!from!compressed!pasture!heights!are!available!
to! help! scale! and! improve! the! measurements! of! paddocks! that! brings! comparable!
statistics!into!the!decision;making!equations.!(Monford AG Systems Ltd, 2015)!
!
The!usage!of!smart!phones!and!the!development!of!narrow!problem!solving!applications!
are!also!affecting!how!farmers!track!and!control!their!fields!of!data!to!ease!and!improve!
yield!estimates!and!livestock!growth.!The!National!Institute!of!Food!and!Agriculture!in!
the!United!States!for!instance!regularly!publishes!a!document!with!popular!and!helpful!
Apps! for! agriculture.! The! list! includes! Apps! that! help! with! managing! farm! vehicles! to!
GPS;mapping! soil! data! gathering! and! providing! easy! access! to! chemical! datasheet.
(USDA, 2015)!
!
Home!farming!or!only!the!restricted!task!of!keeping!a!lawn!in!good!condition!creates!a!
challenge! that! requires! planning! and! scheduled! work.! In! the! Nordics! the! grass! season!
begins!in!March!or!April!when!the!lawn!requires!fertilizers!and!raking!to!start!a!healthy!
growth!after!the!cold!winter.!!There!are!many!suggestions!and!guidelines!on!how!to!get!
the!perfect!lawn!but!the!utmost!involves!a!lot!of!work,!fertilizers!and!other!chemicals!to!
create!a!hospitable!soil!for!the!grass!to!grow.!(Odla.nu i Sverige AB, 2014)!The!debate!on!
moss! and! the! suitable! solutions! often! end! with! an! effortless! but! expensive! answer! of!
robotics.!While!maintaining!a!frequent!cutting!schedule!the!electric!robotic!lawnmower!
is!a!more!sustainable!and!environmentally!friendly!machine!than!the!gasoline;powered!
manual!lawnmower.!The!continuous!and!frequent!mowing!creates!a!positive!impact!on!
grass!growth!that!gradually!will!reduce!the!amount!of!moss.!(GARDENA, 2015)!
!
These! facts! on! robotic! mowers! and! a! research! review! of! their! control! systems! and!
movement!behavior,!nursed!the!idea!of!implementing!a!solution!that!enables!the!robotic!
mowers! to! measure! grass! growth! as! illustrated! in! Figure! 1! below! whilst! cutting! to!
enable! better! movement! patterns! and! scheduling.! Gathering! this! data! and! including!
additional! parameters! such! as! soil! humidity! and! acidity,! air! temperature! and! sunlight!
could! create! a! statistical! database! that! empowers! feedback! to! strategic! decisions! on!
irrigation,!cutting!and!fertilization!of!a!lawn.!!This!thesis!focuses!on!how!measurements!
can!be!taken!in!an!automated!fashion!of!grass!growth!from!the!scale!of!a!lawnmower.!
!
1.2 Purpose
A!degree!project!in!Mechatronics!MF123X!at!the!Royal!Institute!of!Technology!targets!
individual! studies! where! a! problem! is! defined! and! a! possible! solution! is! established!
through!creation!and/or!development!of!a!component!or!subsystem.!While!applying!the!
acquired!knowledge!to!highlight!and!discuss!the!suggested!solution,!validation!of!its!key!
properties!are!critical!to!evaluate!and!answer!the!problem.!
!
This! report! presents! the! creation! of! a! sensor! system! with! the! purpose! of! measuring!
grass! height! from! a! moveable! platform.! The! system! includes! surrounding! control! and!
data! gathering! solutions! that! enables! the! mentioned! feedback! of! growth! rate! and!
additional! environmental! sensor! data.! A! custom;built! grass! sensor! creates! the!
fundamental!problem!of!this!thesis!that!follows!as:!
!
With! what! precision! can! a! custom;made! instrument! measure! the! height! of! grass! on! a!
typical! Swedish! moss;infiltrated! lawn?! Can! this! data! of! possible! growth! rate! be! of!
interest!in!scheduling!and!controlling!of!movement!patterns!of!robotic!lawnmowers!if!
the!sensor!would!be!an!integrated!part!of!the!feedback!in!these!appliances?!
!
!
Figure!1.!Definition!of!grass!height.!
1.3 Scope
A!lawn!can!contain!grass!and!moss!of!different!heights!that!fill!an!uneven!and!graded!
surface.! Because! of! this,! the! design! of! the! required! measurement! range! and! testing!
applications! will! be! adjusted! to! a! given! specification! from! a! commercial! robotic!
lawnmower!while!not!implementing!any!weatherproofing.!
!
The! measurement! system! focuses! on! the! collection! of! a! reliable! value! of! grass! height!
while!implementing!functions!for!autonomic!movement,!secondary!sensor!inputs,!data;
presentation! and! user! system! control! as! an! inferior! part! of! the! project.! Factors! that!
could!affect!real!world!performance!for!an!end!user!such!as!dirt!and!irregular!cleaning!
of! the! sensors! will! not! be! evaluated! in! the! design! and! testing.! They! will! instead! be!
discussed!as!possibilities!of!improvements.!!
!
1.4 Method
Designing!and!constructing!a!device!that!can!measure!the!height!of!grass!on!a!lawn!will!
commence!with!an!initial!requirement!specification.!The!procedure!will!then!result!in!a!
suggestion! of! two! different! technical! proposals! that! will! be! devised! in! sketches! and!
evaluated! in! theory! prior! to! implementing! and! building! of! the! selected! iteration.! The!
suggested! solution! might! require! testing! and! evaluation! of! different! electrical!
components.!These!will!be!presented!in!the!theory!section.!!
!
Continuing,!functional!tests!will!describe!and!show!what!and!how!the!measurements!are!
done!and!the!result!from!these!tests.!The!sensor!module!will!then!be!incorporated!with!
the! movable! robotic! platform,! including! the! other! secondary! sensors! such! as!
temperature!and!humidity.!Then!the!assembly!will!be!tested!together!as!a!group!in!this!
integration!test!phase.!!
!
The!last!phase!of!system!testing!and!validation!will!reveal!on!the!measured!performance!
and!results!while!checking!these!against!the!overall!system!objective.!The!measurement!
platform!will!be!tested!for!autonomous!measurement!sampling!and!the!deviations!of!the!
tests!will!be!presented.!
! !
!
!
!
!
!
!
!!
!
!
!
!
!
!
!
This!page!has!intentionally!been!left!blank.!!
!
2. ''THEORY '
The% theoretical% exposition% is% a% section% of% approachable% knowledge% and% research% results%
within%the%thesis%domain.%This%chapter%presents%a%theoretical%locus%as%the%starting%point%of%
the%rendered%result%of%this%thesis.%%
2.1 Narrow beam infrared barrier
Infrared! light! and! the! detection! of! it! have! been! used! in! countless! of! commercial!
applications! for! many! decades.! From! remote! controllers! to! alarm! systems! and! visitor!
counters! in! stores.! ! This! section! is! about! a! pair! of! matching! infrared! (IR)! emitter!
(SFH4110)!and!phototransistor!(SFH3100)!that!have!the!special!characteristics!of!a!very!
narrow!field!of!view!or!half!angle!as!mentioned!in!the!data!sheets!and!illustrated!below!
in!Figure!2.!(OSRAM GmbH, 2007)!
!
Figure!2.!Light!radiation!characteristics!of!SFH4110.! !
This!narrow!beam!of!infrared!radiation!allow!for!a!high!coupling!between!the!emitter!
and!phototransistor!in!barrier!applications.!It!also!allows!for!multiple!barriers!to!exist!
nearby!without!the!need!of!different!modulation!frequencies.!!
!
A! simple! barrier! can! be! constructed! with! a!220!!resistor! in! series! with! the! emitter!
connected!between!+5!!!and!ground,!GND.!The!phototransistor!is!connected!to!+5!!!on!
the!collector!pin!and!in!series!with!a!3,3!!"!resistor!to!GND.!Reading!the!potential!over!
the!resistor!with!an!analog!input!on!a!microcontroller!allows!to!sample!the!amount!of!
infrared! light! into! the! phototransistor.! ! This! example! circuitry! is! shown! in! Figure! 3!
below.!
!
Figure!3.!Circuit!diagram!of!a!simple!infrared!barrier!application! !
!The!light!sensitive!component!also!features!a!daylight!filter!that!filters!out!the!spectrum!
of! photons! that! could! otherwise! interfere! with! the! measurements! in! bright! daylight!
conditions.! The! sensitivity! function! of! the! phototransistor! in! Figure! 4! also! shows! the!
sensitivity!maximum!on!the!950!nm!wavelength.!!
!! !
Figure!4.!Light!spectrum!sensitivity!of!SFH3100.!!
!
2.2 Slide potentiometers
Potentiometers! are! variable! resistances! that! change! on! physical! interaction! with! a! set!
run!path.!A!linear!slide!potentiometer!is!made!out!of!tracks!with!conductive!materials,!
normally! carbon! with! an! adjustable! lever! that! connects! the! in;! or! output! of! the!
component!to!the!carbon!track.!The!position!of!the!lever!along!the!track!determines!the!
resistant!of!the!potentiometer!as!illustrated!in!Figure!5.!
Figure!5.!Physical!sketch!of!typical!slide!potentiometer! !
There!is!a!wide!assortment!of!these!components!available!on!the!market,!with!features!
like!built!in!LED’s!and!motorized!sliders.!!The!most!simple!model!though!of!high!quality!
requires! an! operating! force! of!0,2!N! parallel! to! the! slide! direction! for! change! to! occur.!
Typical!slide!potentiometers!are!also!not!designed!to!be!exposed!to!the!elements!of!an!
outdoors! environment.! Their! lack! of! weatherproofing! creates! a! requisite! for!
encapsulation! if! they! are! applied! in! an! outdoor! appliance.! A! great! feature! of! the!
component! is! that! the! analog! design! and! step;less! register! of! the! conductive! tracks!
enables!measurements!of!lever!movement!to!be!registered!in!a!resolution!scale!that!is!
primarily!limited!by!the!analog!to!digital!converter!in!a!microcontroller.!
!
2.3 Control algorithms for autonomous lawnmowers
Autonomous!robotic!lawnmowers!are!given!the!task!to!follow!a!path!that!passes!every!
point!of!an!unknown!area!of!interest.!During!this!task!the!control!system!needs!to!avoid!
obstacles! while! not! passing! over! an! already! mowed! area! twice.! The! technology! of!
control!theory!used!here!is!grouped!under!the!term!coverage!path!planning.!This!theory!
sets! the! requirement! of! the! robot! for! this! complex! coverage! operation.! ! (Galceran &
Carreras , 2013)!Though!it!is!most!likely!not!possible!to!fulfill!all!the!criteria!that!follows!
in!the!list!below!in!a!complicated!lawn.!
!
1. The!robots!movement!over!the!target!area!must!be!covered!completely.!
2. Filling!of!regions!must!be!done!without!overlapping!paths.!
3. Requiring!nonstop!and!progressive!operation!without!repetition!of!paths.!
4. Obstacle!avoidance.!
5. Straight!lines!or!circles!should!be!used!in!motion!trajectories!to!simplify!control.!
!
The! different! technique! for! establishing! and! recommending! a! good! coverage;planning!
model! involves! the! definition! of! the! area! with! rectilinear! or! curved! boundaries,! if!
regions!of!narrow!passages!exist,!and!the!obstacle!density.!While!a!robotic!lawnmower!
requires!a!home!position!for!charging!the!need!to!wander!and!navigate!back!to!the!start!
position!can!occur!in!the!middle!of!these!procedures.!Modern!lawnmowers!implement!
global! navigational! satellite! systems,! GNSS,! to! map! and! create! waypoints! for! this!
navigation! procedure,! while! also! sectioning! the! lawn! into! regions! that! individually! is!
coverage!planned!with!an!geo;fenced!boundary!restricted!path.!Figure!6!shows!how!a!
system!is!adapting!to!a!lawn.!!
!
Boundary mapping Learning obstacle locations Regular mowing
!
Figure!6.!BOSCH!Logicut!sequencing!of!parallel!trajectory!planning!
!
Furthermost!implementations!also!use!an!underground!perimeter!wire!that!is!installed!
prior! to! the! mowing.! The! robot! will! recognize! the! emitted! electromagnetic! signal! and!
can!determine!the!distance!to!the!boundaries.!This!installation!requirement!deters!some!
potential! customers! that! feel! reluctant! to! this! procedure.! Therefore! precise! global!
navigational! satellite! systems! could! enable! navigation! though! pre! planned! mission!
control! and! high! precision! location! awareness.! Despite! that! GPS! solutions! offer! good!
performance,! the! requirements! for! sub;decimeter! precision! is! not! commercially!
available!but!might!be!when!the!European!GALILEO!GNSS!is!fully!operational.!!Another!
solution!to!obtain!the!required!accuracy!could!be!with!real;time!kinematic!receivers.!
!
Research! done! by! NAV! ON! TIME! in! France! show! that! real;time! kinematic,! RTK,!
techniques! can! be! obtained! at! a! sustainable! market! price! that! fits! the! robotic!
lawnmower! market.! (Melita,! Muscato,! &! Poncelet,! 2013)! The! idea! behind! RTK! is! to!
measure! the! changes! in! phase! from! a! single! GPS! L1! channel! broadcast.! The! algorithm!
then!works!on!eliminating!the!ambiguity!of!triple!differences!in!the!phase!observations.!
Though! this! would! only! require! low;end! single! channel! GPS! receivers,! the! application!
still!needs!a!fixed!point!in!space.!In!the!suggested!solution!the!lawnmowers!charging!and!
base! station! would! function! as! this! fixed! point,! measuring! the! phase! change! and!
exchanging! data! for! the! calculations! with! the! mowing! robot! through! wireless!
communications.!!
!
This! thesis! focuses! on! how! increments! in! grass! growth! can! be! an! accurate! and! useful!
feedback! source! for! the! control! algorithms! of! scheduling! runtime! in! a! grid;sectioned!
planning!system.!!
!
2.4 Arduino and Embedded Linux module
The!Arduino!platform!is!an!open;source!microcontroller!board!architecture!that!enables!
an! easy! method! of! programming! and! connecting! different! sensors! and! devices! to! an!
AVR.! Looking! at! the! most! commercial! of! the! boards,! the! Arduino! Uno! features! a! low;
powered!8;Bit!ATmega328!microcontroller,!that!can!handle!a!couple!of!digital!input!and!
output!(IO)!connectivity!pins!backed!by!PWM!channels!with!three!different!timers!with!
configurable!prescalers.!
!
A! byte;oriented! inter;integrated! circuit,! I2C,! serial! interface! creates! the! possibility! to!
daisy!chain!modules!and!sensor!units!to!the!AVR!and!Arduino!using!only!two!pins.!These!
modules!can!be!accessed!through!read!and!write!operations!addressed!to!the!individual!
devices!on!the!I2C!bus,!sharing!the!communication!link!to!the!microcontroller.!!Though!
the!Arduino!Uno’s!AVR!have!an!EEPROM!i.e.!a!permanent!memory!module!that!stores!
values!when!the!AVR!is!turned!off.!This!storage!area!of!1024!bytes!does!not!leave!room!
for! any! larger! datasets.! Because! of! this,! modules! are! available! that! standardizes! the!
communication! interfaces! with! coding! libraries! to! enable! read! and! writes! of! data! to!
external!memory!circuits!with!gigabytes!of!storage!space.!!
!
The!integration!of!system!on!a!chip!designs!with!more!powerful!MIPS!24K!processors!
close!to!the!AVR!on!the!original!Arduino!board!enables!a!Linux!environment!to!run!in!
parallel! to! the! microcontroller.! Custom! bridging! solutions! between! the! processors!
allows!for!usage!from!the!AVR!to!of!peripherals!on!the!MIPS!AR9331!WiSoC!such!as!USB!
devices!and!memory!cards.!The!Linux!environment!also!forms!a!platform!for!integrated!
web!services!and!network!connectivity,!this!allows!for!simple!but!powerful!interaction!
with! external! devices! on! the! Internet! or! local! network! to! ensue! data! collection! and!
extraction.! This! also! enables! input! of! AVR! control! with! direct! connection! to! Apps! in!
modern!smartphones!and!public!application!programming!interfaces!of!social!networks.!!
!
The!AR9331!WiSOC!used!in!the!Dragino!Yun!shield!that!is!used!in!this!thesis!hardware!
platform!features!an!open;source!Linux!distribution!called!OpenWRT!customized!with!
software! to! manage! the! wireless! programming! of! the! AVR! and! GPIO! communication!
rather! than! acting! as! a! network! router! as! primarily! intended! for! this! WiSoC.! The!
integration!of!the!two!processors!is!illustrated!in!Figure!7!below.!
!!
Figure!7.!Functional!connections!on!top!of!a!silkscreen!image!of!the!Yun!shield!board.!!
2.5 Secondary sensors and interfaces
2.5.1 GPS receiver and serial communications
Acquiring! GNSS! data! to! a! microcontroller! can! be! accomplished! with! a! standalone!
receiver!unit!that!sends!a!structured!data!feed!through!a!standardized!communication!
protocol.!One!of!these!specifications!is!the!NMEA!0183!standard.!The!following!theory!
section!presents!the!necessary!data!structure!that!are!required!to!create!a!lightweight!
navigation! controller! on! an! Arduino! board.! The! communication! to! the! GPS! unit! is! a!
regular!serial!RS;232!port,!and!for!simplifications!only!the!transmitted!signal!from!the!
GPS!unit!is!necessary.!There!are!two!types!of!sentences!that!are!necessary,!presented!in!
Figure!8!and!Figure!9!
!
$GPRMC,223936.00,A,5936.94292,N,01632.55510,E,0.999,,150415,,,A*7D%
%
Figure!8.!An!example!NMEA!0183!GPRMC!sentence.!
!
This! first! row! of! data! in! the! serial! stream! is! the! GPRMC! sentence! that! includes! the!
recommended!minimum!specific!GPS/Transit!data.!The!second!sentence!is!the!GPGGA!
that!specifies!time,!position!and!fix!related!data.!
!
$GPGGA,223936.00,5936.94292,N,01632.55510,E,1,05,4.21,32.3,M,26.9,M,,*61%
%
Figure!9.!An!example!NMEA!0183!GPGGA!sentence.!
This!serial!data!stream!is!updated!and!transmitted!according!to!a!configurable!timer!on!
the!GPS!unit.!Depending!on!the!movement!velocity!of!the!GPS!receiver!and!the!required!
resolution!an!update!rate!of!0.1!to!10!Hz!could!be!desirable.!If!hardware!UART!chips!on!
the! Arduino! board! is! not! available! a! digital! IO! pin! can! be! used! to! emulate! serial!
communications.!!The!serial!data!stream!is!then!read!from!a!buffer!and!an!encoder!class!
tries! to! build! a! NMEA! sentence! and! validate! the! data! checksum! before! the! content! is!
stored!and!used!in!calculations.!!
!
2.5.2 Air temperature and humidity sensor
A! polymer! based! humidity! sensor! like! the! component! inside! the! commercial!
temperature! and! humidity! sensor! module! DHT22,! works! similar! to! a! capacitor.! In!
between!two!comb;formed!electrodes!of!a!precious!metal!is!a!dielectric!polymer!layer.!
This!layer!contains!water!vapor!at!equilibrium!with!the!surrounding!air.!The!amount!of!
vapor!inside!the!polymer!layer!is!equivalent!to!the!capacitance!between!the!electrodes,!
which!provides!the!measurement!to!a!small!microcontroller.!!The!temperature!readings!
come!from!a!regular!thermistor.!!
!
While! the! raw! environmental! facing! sensors! produce! change! in! capacitance! and!
resistance!these!small!changes!need!to!be!accurately!monitored!and!scaled!according!to!
a! linear,! log! or! custom! lookup! table.! Inside! the! DHT22! assembly! there! is! a! tiny!
microcontroller! that! can! be! programmed! to! store! calibration! data.! ! The! output! and!
communication!interface!is!composed!of!a!single!wire!protocol.!This!means!that!through!
half;duplex! operations! a! data! request! is! acknowledged! by! the! microcontroller! in! the!
DHT22!assembly!and!a!serial!data!stream!of!the!humidity,!temperature!and!checksum!is!
sent.! Different! types! of! square! waveforms! represent! the! sequence! form! of! ones! and!
zeros.!Varying!the!time!the!output!is!high!or!low!according!to!the!figure!below.!
!
Figure!10.!Waveform!comparison!of!a!logical!1!and!0!in!the!serial!stream.!!
2.5.3 DC motor control
Controlling!two!DC!motors!with!low;level!outputs!of!a!microcontroller!requires!a!motor!
driver!circuits,!one!for!each!motor.!!These!circuits!need!to!control!the!amount!of!current!
flowing!to!the!motor!and!the!direction!of!the!current.!The!TB6612FNG!is!a!dual!H;bridge!
that!is!basically!a!setup!of!transistors!that!allow!this!control!with!continuous!loads!of!13!
V!and!1.2!A.!
!
The!interface!to!the!circuit!from!an!Arduino!is!made!of!two!IO!pins!for!the!direction!of!
the!current!and!one!pulse!width!modulated,!PWM,!signal!to!adjust!the!amount!of!current!
that! relates! to! the! speed! of! the! motor.! The! dual! setup! doubles! these! connections! and!
also!requires!a!standby!pin!to!be!set!high!to!put!the!TB6612FNG!out!of!a!power!saving!
state.!!
!
PWM! signals! that! drive! a! motor! are! often! generated! at! a! higher! frequency! than! those!
that!control!of!a!LED;light.!First,!the!pulses!in!the!signal!need!to!be!fast!enough!so!that!
the! mechanical! system! can! average! them! out.! Secondly! whining! can! occur! from!
individual!coils!in!the!motor!that!react!in!resonance!to!the!signal!frequency.!An!audible!1!
or! 8! kHz! PWM! signal! can! cause! unacceptable! whining! when! used! in! commercial!
applications.! Regular! motor! controls! in! end! user! devices! often! use! 25! kHz! or! higher!
frequencies!that!humans!cannot!hear.!!
!
At!last!a!too!high!frequency!can!cause!losses!of!power!when!the!transition!time!of!the!
drive!circuitry!is!relatively!high!to!the!pulse!period.!The!25!kHz!PWM!signal!would!have!
a!40!µs!period,!giving!a!few!µs!for!transition!control!in!order!to!be!efficient.!Measuring!
the! actual! transition! time! of! a! H;bridge! can! be! useful! when! selecting! the! PWM! signal!
frequency!when!requiring!silent!and!stable!motor!control.!
!
2.5.4 Motions sensors and atmospheric pressure
Tiny! electronic! devices! called! inertial! measurement! units! IMU! are! used! in! all! types! of!
commercial!applications!today.!Remote!controls!use!them!to!detect!movement!to!enable!
backlight! of! keypads.! Smartphones! use! them! to! register! all! kinds! of! movements! and!
control!for!games!and!Apps.!!These!IMU!devices!refer!to!a!grouping!of!accelerometers,!
gyroscopes!and!magnetometers!that!are!put!in!the!same!assembly.!Barometers!can!also!
be!put!in!to!create!10!degrees!of!freedom,!or!even!11!counting!the!temperature!readings!
from!a!barometer.!!
!
This!thesis!apply!a!commercial!device!called!GY;86!that!features!a!small!circuit!board!
with!three!different!sensors!that!can!be!used!independently!and!accessed!through!and!
I2C!bus.!The!3!axes!accelerometer!and!3!axes!gyroscope!data!comes!from!an!InvenSense!
MPU;6050!that!is!accessed!at!the!7;bit!address!0x68!on!the!shared!I2C!bus.!!The!3!axes!
magnetometer!data!is!from!a!Honeywell!HMC5883L!that!enables!1!to!2!degrees!compass!
heading!accuracy.!This!sensor!is!addressed!at!0x1E.!
!
The! barometric! and! temperature! data! is! sampled! from! a! Measurement! Specialities!
MS5611! unit! that! allows! for! height! measurements! from! the! barometer! data! with! a!
resolution!of!10!cm.!The!hexadecimal!address!pointer!on!the!I2C!bus!to!this!unit!is!0x77.!!
!
Using! open;source! libraries! made! for! the! Arduino,! the! gathering! of! raw! data! can! be!
accomplished!with!a!few!lines!of!code!that!features!a!library!inclusion!and!initiation!of!a!
class!object.!Then!methods!like!mag.getHeading(&mx,%&my,%&mz)!returns!the!raw!values!
of!the!measured!magnet!field!to!the!mx,!my!and!mz!variables.!
!
!
3. D EMONSTRATOR '
This%chapter%defines%the%problem%requirements%and%suggests%drafts%of%multiple%solutions.%
Explaining% why% one% specific% draft% was% selected% for% this% thesis.% Followed% by% the%
implementation% and% the% different% test% phases% while% incorporating% the% solution% to% the%
movable%demonstration%platform.%
3.1 Requirements and Specifications
Beginning! with! the! main! function! considered! below,! it! is! likely! to! distinguish! some!
fundamental!sub!functions!that!form!the!set!of!minimal!requirements!for!the!sensor.!
Function:'Grass'height'measurement''
Measuring!the!length!of!a!grass!straw!where!the!end!position!of!the!straw!relative!the!
soil!level!is!considered!the!height.!Look!at!Figure!1!for!a!simplified!sketch.!
Scenario'of'use'
The!operative!scenario!are!distinguished!as!part!of!a!subassembly!that!can!be!mounted!
on! a! movable! platform,! consider! a! robotic! lawnmower.! The! measurements! could! take!
place!while!the!platform!is!moving!or!while!halting!the!forward!drive!of!the!lawnmower.!
Requirements'
• Time:!The!time!duration!of!getting!measurements!are!allowed!to!be!equal!or!less!
than!60!seconds.!
• Resolution:!Supposing!that!grass!can!grow!up!to!5!mm!each!day!the!desired!height!
resolution!worth!having!is!considered!to!be!less!than!half!i.e.!2.5!mm.!!
• Range:!The!measurement!range!is!defined!from!the!adjustable!cutting!height!of!a!
commercial!robotic!lawnmower!to!the!range!of![20,!60]!mm. (GARDENA, 2014)!
• Size! and! weight:! Looking! at! the! sensor! as! a! separate! entity! from! the! control!
system,!the!size!and!weight!should!be!restricted!to!volume!of!100x100x100!mm!
and!weigh!less!than!0.5!kg.!!
• Slope! detection:! The! sensor! or! control! system! should! be! autonomously! aware! of!
when!the!platforms!declination!is!larger!than!what!is!almost!horizontal!to!enable!
measurements! to! take! place.! Slopes! with! less! than!±5°!in! two! dimensions! are!
considered! acceptable.! This! requirement! could! be! extended! to! enable!
measurements! within! the! possible! declination! range! that! has! been! tested! and!
conforms!to!any!tolerance!specification.!
• Output:!The!data!output!from!the!control!system!should!be!a!single!value!in![mm]!
that!is!a!mean!of!repeated!measurements!at!the!same!location.!The!output!should!
be!the!height!of!the!straw!relative!to!the!soil.!The!control!system!should!be!able!to!
discard!and!repeat!measurements!if!they!deviate!too!much!from!the!other!in!the!
sequence.!The!acceptable!measurement!error!should!statically!be!90%!guaranteed.!!!
3.2 Design concepts
Through! brainstorming! activities! and! discussions! with! fellow! students! about! the!
problem! requirement,! two! concepts! got! processed! to! the! design! phase.! These! two!
concepts! both! have! the! common! principle! of! not! sampling! the! soil! reference! level! in!
regards! to! the! platforms! location.! The! platform! or! lawnmowers! reference! over! the!
ground!varies!since!the!wheels!are!on!top!of!the!grass.!
!
3.2.1 Concept 1: Optical sensor
An!optical!barrier!that!is!moved!vertically!down!towards!the!grass!until!an!obstacle!i.e.!
the!grass!stalks!would!break!the!barrier!creates!a!reference!of!the!vertical!movement.!
Continuing!down!with!the!measurement!up!to!the!time!of!impact!with!the!soil!the!lower!
reference!is!sampled.!The!relative!angle!difference!if!using!a!geared!servo!to!create!the!
linear!movement!equals!the!height!of!the!grass.!The!optical!barrier!can!be!made!up!of!
laser! or! infrared! lights! and! photo! resistors.! Detecting! the! soil! is! done! with! an!
accelerometer! or! IMU! that! registered! vibrations! and! movement! of! the! platform! when!
the!sensor!head!hits!the!ground.!
!
Figure!11.!Principal!sketch!of!the!optical!sensor! !
!
• Time:! Moving! the! sensor! head! up! and! down! is! limited! by! the! servo! speed! and!
physical! tensions! in! the! mechanics.! While! an! algorithm! could! sample! multiple!
readings!of!the!top!barrier!breakage!to!create!a!more!reliable!data!input!with!less!
errors! a! complete! measurement! is! estimated! to! take! around! 20;30! seconds.!
Increasing!the!time!could!allow!for!better!noise!filtering!of!sensor!readings.!!
• Resolution:!Using!a!standard!PWM!controlled!servo!for!the!linear!movement!the!
rotational!output!is!in!the!range!of!0!to!180!degrees!in!steps!of!1!degree.!!Gearing!
this! half! circle! movement! to! the! operational! requirement! of! 60mm,! a! theoretical!
resolution! of! 0,3! mm! is! possible.! Though! gear! tolerances! and! mechanical!
suspension!would!inflict!the!result.!
• Size! and! weight:! Using! infrared! transmitters! allows! to! place! more! than! one! data!
input!on!the!measurement!head!due!to!their!small!size.!With!two!or!more!inputs!
the! reliability! of! detecting! straws! of! grass! could! be! significantly! improved.! ! The!
whole!assembly!is!estimated!to!fit!within!the!required!specifications!while!using!
plastic!or!wood!materials!with!low!density!to!allow!for!a!lightweight!construction.!!
• Measurement!type:!Provided!that!a!single!stalk!of!grass!can!influence!an!infrared!
barrier.!And!while!using!multiple!barriers!together!with!an!algorithm!that!weights!
these!inputs!together,!a!reliable!detection!of!the!typical!upper!level!of!the!grass!on!
a! lawn! can! be! sampled.! Detection! of! the! lower! ground! level! requires! looking! at!
acceleration!and!gyroscopic!data!from!a!motions!sensor!while!stepping!the!servos!
output!forward.!!
!
Designing!this!sensor!concept!for!prototype!manufacturing!causes!the!key!objective!to!
be!the!linear!rack!and!gear.!Getting!a!tight!fit!with!small!tolerances!enables!the!vertical!
movement! of! the! sensor! head! from! the! servos! output! axis! without! any! resistance! or!
gears! slipping.! With! small! and! narrow! beaming! infrared! diodes! the! size! of! the! sensor!
head!can!be!made!simple!and!sturdy.!!To!simplify!the!gearing,!one!big!gear!could!be!used!
instead! of! building! a! set! of! gears! to! provide! the! desired! movement! from! only! half! a!
rotation.! A! rotational! encoder! and! a! continuous! servo! or! electric! motor! could! be! an!
alternative!as!well!as!measuring!the!electric!current!to!establish!when!the!soil!level!is!hit!
and!the!physical!resistance!increases!the!servos!current.!
!
3.2.2 Concept 2: Linear pressure sensor
With! reference! to! the! available! tools! that! farmers! use! to! measure! pastures! came! the!
miniature! version! of! a! sliding! plate! design.! The! idea! is! that! a! circular! plate! is! lightly!
suspended!on!an!axis.!This!axis!is!pushed!vertically!down!into!the!lawn,!impeding!at!the!
firm!soil.!The!grass!would!during!this!motion!lift!the!circular!plate!while!being!slightly!
compressed! and! with! a! linear! encoder! the! relative! distance,! in! other! words! the! grass!
height!could!be!registered.!See!the!sketch!in!Figure!12!below!for!a!graphical!explanation.!!
Figure!12.!Principal!sketch!of!the!pressure!sensor.! !
!
• Time:!Maneuvering!the!mechanics!would!be!limited!by!the!servo!specifications!and!
the!strength!of!the!construction.!An!estimate!on!a!complete!measurement!cycle!is!
less!than!10!sec.!
• Resolution:! Using! a! linear! slide! potentiometer! in! the! construction! the!
measurement! resolution! would! be! limited! by! the! analog! read! IO! pin! of! the!
Arduino.!With!a!10!bits!of!resolution!of!the!input!IO!the!scale!of!a!60!mm!long!slide!
potentiometer!would!settle!at!minimum!of!0,06!mm!in!theory.!!
• Size!and!weight:!Minimizing!the!size!of!the!circular!plate!causes!less!force!from!the!
grass! to! contribute! to! the! pressure! of! pushing! the! plate! upwards.! This! would!
increase!the!specifications!on!a!low!friction!mechanics!and!operating!force!of!the!
potentiometer.!!
• Measurement! type:! Since! the! circular! plate! would! be! pressed! against! the! grass,!
single! stalks! of! grass! that! stand! out! could! be! averaged! when! compressed.!
Producing!an!output!that!cannot!detect!smaller!deviations!of!the!grass!stalks.!
!
Fabricating! a! prototype! of! this! concept! requires! small! yet! solid! bodies! of! the! circular!
plate,! and! the! attachment! to! the! slide! potentiometer.! Any! flexibility! in! the!
perpendicularity!of!the!axis!to!the!plate!causes!irregularities!in!the!measurements.!The!
linear!movement!on!the!rack!with!the!gears!and!rotation!of!the!servo!does!not!require!
any! special! resolution! and! eases! the! production! and! tolerances! of! these! components.!!
Finding! and! ordering! a! good! quality! slide! potentiometer! that! require! very! little!
operating!force!is!key!to!good!performance.!!
3.3 Implementation of design solution
Building!both!concepts!presented!above!and!comparing!their!performance!would!be!key!
to! evaluate! the! estimates.! The! limited! scope! and! the! hypothetical! expansion! of!
integrating!the!solution!as!a!module!on!a!commercial!robotic!lawnmower!give!reason!to!
find!the!more!suitable!of!these!two!concepts!on!paper.!!
!
The!optical!sensor!features!a!more!simple!and!rigid!mechanical!construction!that!could!
handle! more! disturbances! from! unwanted! forces! of! maltreatment! and! system! failure.!
Using!IR!barriers!will!also!enable!the!detection!of!single!straws!of!grass!could!be!useful!
on! a! lawn! with! uneven! growth.! Therefore! concept! 2! is! left! to! theory! and! the! optical!
sensor!follows!in!the!thesis!demonstrator!below.!!
!
Realizing!the!optical!sensor!as!a!prototype!starts!with!constructing!a!CAD!model!shown!
in! Figure! 13! to! establish! physical! correlations! between! components! and! mechanical!
movement.! The! components! for! the! assembly! consist! of! two! pairs! for! infrared!
transmitters!and!phototransistors!as!mentioned!in!section!2.1.!Together!with!a!digital!
micro;size! servo,! wiring! and! a! few! resistors.! The! mechanical! structure,! servo! and!
infrared!light!barriers!would!connect!to!an!Arduino!microcontroller!that!is!coupled!with!
an!IMU.!!
!
Figure!13.!CAD!model!of!the!optical!sensor!assembly.! !
!
The!mechanical!structures!were!designed!to!be!3D!printed!at!the!workshop!lab!though!
stability! and! mechanical! problems! with! the! printers! caused! a! halt.! Through! small!
rework!of!the!design,!the!parts!were!cut!with!laser!from!Masonite!and!MDF!fiberboards.!
Gluing!the!parts!together!with!a!cyanoacrylate!gave!a!strong!bond!that!also!penetrated!
the! fibrous! materials! producing! a! hardened! surface.! The! laser! cutting! also! produced!
excellent!tolerances!for!the!gears!and!rack.!!
!
3.3.1 Hardware and mechanics
The!gearing!for!a!linear!movement!of!90!mm!from!a!180;degree!circular!rotation!of!the!
servo!axis!stated!a!circumference!of!!
90 = ! ∙ !! 2. (1)
Where!!!!is!the!dedendum!diameter!for!the!gears.!Using!a!module!of!1,0!gave!a!!!!of!
28,5! mm! with! 57! teeth! of! a! standard! 20;degree! evolvent! curve.! The! pair! of! infrared!
barriers!was!put!in!a!U;shaped!holder!as!shown!in!Figure!14!below.!
!
!
Figure!14.!The!prototype!sensor!head!with!the!infrared!transmitters!visible.!
The! whole! assembly! fitted! on! the! movable! platform! is! shown! in! Figure! 15! where! the!
thin!30!AWG!signal!cables!are!routed!on!the!gear!down!to!the!sensor!head!to!follow!the!
rotation!and!linear!movement.!
!
!
Figure!15.!The!optical!sensor!assembly!on!the!platform.!
!
3.3.2 Electronics and components
The! two! IR! phototransistors! are! connected! independently! with! a! 3,3kΩ! pull;down!
resistor! to! an! analog! input! on! the! Arduino! Uno! board.! The! output! of! the! circuit! is! a!
steady! state! 5! V! signal! on! each! analog! input! when! no! obstacles! are! in;between! the!
infrared! transmitter! and! the! phototransistor.! This! gets! registered! as! a! 10;bit! integer!
value!of!1023!in!code.!!Putting!an!obstacle!such!as!a!thick!sheet!of!paper!between!the!
barriers!produces!a!decrease!of!the!input!voltage!of!the!Arduino!and!the!input!integer!
reaches!the!steady!state!value!of!0!when!no!infrared!light!reaches!the!phototransistor.!
!
The!servo!is!supplied!with!+5!V!and!common!ground!of!the!platform.!Due!to!the!current!
restrictions!of!the!regulators!on!the!Arduino!Uno,!a!separate!+5!V!voltage!regulator!is!
used.!This!regulator!is!made!out!of!a!single!7805!IC,!a!heat!sink!and!two!capacitors!that!
connect! to! a! 3;cell! lithium;polymer! battery! that! supplies! a! nominal! voltage! of! 11,1! V.!
The!pulse!width!modulated!signal!is!generated!from!pin!9!of!the!Arduino!Uno!using!the!
default!1kHz!PWM!frequency.!!
!
3.3.3 Software and Control system
The!Arduino!have!the!PWMServo!control!class!initialized!to!control!the!movement!of!the!
servo! in! 1;degree! increments.! The! two! analog! input! pins! have! a! simple! smoothing!
algorithm!present!to!filter!high!frequent!out!signal!disturbances.!This!filter!also!averages!
the!sampled!raw!analog!input!a!couple!of!times!between!the!servo!movements.!Figure!
16!below!illustrates!the!flow!of!the!measurement!function!without!any!exception!control!
and!repeats.!!
Figure!16.!Flowchart!of!software!procedure!without!exceptions.! !!
The! exceptions! that! could! occur! in! each! process! are! handled! as! a! function! failure! and!
return! the! Boolean! value! False! instead! of! the! height.! Exceptions! in! raw! values! that!
deviate!in!analog!sampling!will!instead!cause!a!restart!of!that!measurement!process.!If!
the!tilt!and!vibration!detection!is!triggered!before!the!last!process!the!function!will!also!
break!and!return!an!exception.!!
3.4 Functional tests
To!verify!the!functionality!of!the!optical!sensor!assembly,!a!series!of!test!are!performed.!
These!tests!start!at!an!ideal!composition!while!adding!one!element!of!disturbance!at!a!
time! to! the! test.! The! results! are! then! checked! against! the! design! and! requirements!
specification.! These! tests! were! performed! on! a! reference! tussock! held! inside! on! a! flat!
surface,!the!reference!height!of!the!grass!were!measured!manually!using!a!caliper.!The!
individual!tests!are!named!XY!where!X!stands!for!the!test!case!and!Y!is!an!integer!for!
each!assessment!when!the!Lawn!Analyzer!was!reset!and!repositioned.!!
!
Test'case'A'
Test!description:!Plain!grass!at!a!reference!height!of!40!mm.!!
!
Table!1.!Results!of!test!case!A.!
Test Height output Deviation from reference
A1 42 mm 2 mm
A2 40 mm 0 mm
A3 42 mm 2 mm
A4 38 mm -2 mm
σ = 1.7 mm
'
Test'case'B'
Test! description:! Plain! grass! at! a! reference! height! of! 40! mm! with! an! uneven! end!
structure!of!the!grass!stalks.!
!
Table!2.!Results!of!test!case!B.!
Test Height output Deviation from reference
B1 39 mm -1 mm
B2 37 mm -3 mm
B3 42 mm 2 mm
B4 38 mm -2 mm
σ = 1.9 mm
!
Test'case'C'
Test! description:! Plain! grass! at! a! reference! height! of! 40! mm! with! an! uneven! end!
structure!of!the!grass!stalks.!Leveling!the!surface!of!the!soil!to!an!angle!of!10;degrees!in!
one!direction.!!
Table!3.!Results!of!test!case!C.!
Test Height output Deviation from reference
C1 41 mm 1 mm
C2 38 mm -2 mm
C3 38 mm -2 mm
C4 42 mm 2 mm
σ = 1.8 mm
3.4.1 Measurement range
The! required! specifications! state! the! extremes! of! the! grass! height! of! 20! and! 60! mm.!
These!test!cases!follows.!!
!
Test'case'D'
Test!description:!Plain!grass!at!a!reference!height!of!20!mm.!!
!
Table!4.!Results!of!test!case!D.!
Test Height output Deviation from reference
D1 21 mm 1 mm
D2 18 mm -2 mm
σ = 1.5 mm
Test'case'E'
Test!description:!Plain!grass!at!a!reference!height!of!60!mm.!!
!
Table!5!Results!of!test!case!E.!
Test Height output Deviation from reference
E1 58 mm -2 mm
E2 63 mm 3 mm
σ = 2,5 mm
3.4.2 Tolerances
Examining!the!standard!deviations!from!test!case!A!to!E,!they!show!that!the!entire!set!of!
trials!ensures!the!required!resolution!of!2.5!mm!in!measurement!resolution.!
!
3.4.3 Repeatability
Looking! at! the! individual! tests! of! C1,! C2,! C3! and! C4! they! all! conform! to! the! required!
specifications.! The! test! were! conducted! after! moving! and! positioning! the! movable!
platform! close! to! the! location! of! the! previous! measure! while! ensuring! the! reference!
grass!height!of!40!mm.!!!
3.5 Integration
Individual!components!and!subassemblies!can!function!on!their!own!but!when!multiple!
software!modules!are!combined!they!need!to!be!tested!and!validated!to!work!together.!
The!integration!testing!of!this!section!presents!how!the!different!parts!and!modules!are!
connected!and!controlled!as!a!group!while!evaluating!the!previous!functional!test!of!the!
optical!sensor.!
!
3.5.1 Interfaces and schematics
The! Arduino! Uno! used! in! this! demonstrator! used! seven! different! communication!
protocols!to!exchange!data!and!control!signals!with!other!modules.!This!expands!further!
when! adding! the! Yun! shield! that! adds! the! wireless! network! connectivity! and! memory!
storage!module.!Figure!17!presents!a!schematic!view!of!the!different!protocols!and!how!
they!are!logically!connected!to!each!other.!
Figure!17.!Integration!schematics!of!parts!and!modules.! !
!
All! these! parts! are! fitted! on! a! Rover! 5! robotic! base! with! two! integrated! DC! motors! as!
shown! from! a! top! view! of! the! demonstrator! in! Figure! 18! below.! The! Arduino! Uno,! H;
bridges! and! switches! are! not! visible! since! they! are! mounted! under! the! base! plate! or!
other!modules.!
Figure!18.!Top!view!of!the!platform!with!visible!components.! !
!
3.5.2 Parts and modules
This! section! presents! the! individual! modules! and! how! they! are! connected! and!
controlled.!
!
DC! motor! control! of! the! Rover! 5! platform! is! accomplished! with! the! dual! H;bridge!
module!TB6612FNG.!Each!motor!has!a!direction!control!that!requires!two!input!pins!of!
the!H;bridge!to!switch!between!high!and!low!logic;level!signals.!Each!motor!speed!gets!
controlled!through!a!PWM!signal.!
!
Table!6.!H;bridge!connections!to!the!Arduino!Uno.!
Motor A Input Arduino Pin Motor B Pin Arduino Pin
AIN1 Digital 3 BIN1 Digital 10
AIN2 Digital 2 BIN2 Digital 8
PWMA Digital 5 PWMB Digital 6
!The!H;bridge!also!requires!a!common!ground!connection,!a!logic!+5!V!connection!and!
the! motor! voltage! input! directly! from! the! battery.! Each! motor! then! connects! to! the!
output!pins!A01,!A02,!B01!and!B02!respectively.!
!
The!GPS!module!ublox!NEO;6M!sends!the!presented!serial!data!streams!from!2.5.1!to!a!
software!emulated!serial!port!of!the!Arduino!Uno!on!pin!digital!12.!The!GPS!module!is!
also! connected! to! a! common! ground! and! a! +5! V! output! of! the! Arduino! Uno’s! built! in!
regulator.! An! electrolytic! capacitor! is! present! on! this! output! rail! to! filter! disturbances!
and!voltage!drops!between!the!modules.!
!
An!I2C!connection!from!the!Arduino!Uno!uses!the!analog!pin!4!for!SDA!and!pin!5!for!SCL.!
This! two;wire! bus! connects! to! the! GY;86! module! with! HMC5883L! as! compass,! MPU;
6050!as!IMU!and!MS5611!as!barometer.!The!module!also!requires!a!+5!V!supply!and!a!
common! ground.! Temperature! and! humidity! comes! from! the! DHT22! module! that!
connects!to!the!Arduino!Uno!pin!digital!7!using!a!1;wire!protocol.!This!module!also!uses!
a!+5!V!supply!and!a!common!ground.!
3.5.3 Integration tests
To!verify!that!having!multiple!modules!and!engines!connected!to!the!control!system!will!
not!interfere!with!the!results!of!the!functional!tests.!The!most!critical!case!C!gets!
conducted!again!with!all!the!other!modules!active.!
!
Test'case'F'
Test! description:! Plain! grass! at! a! reference! height! of! 40! mm! with! an! uneven! end;
structure!of!the!grass!stalks.!Leveling!the!surface!of!the!soil!to!an!angle!of!10;degrees!in!
one!direction.!All!other!parts!and!modules!are!powered!and!connected.!Engines!are!idle.!
!
Table!7.!Results!of!test!case!F.!
Test Height output Deviation from reference
F1 39 mm -1 mm
F2 40 mm 0 mm
F3 43 mm 3 mm
F4 42 mm 2 mm
σ = 1.6 mm
!
!
The!result!shows!that!the!surrounding!environment!does!not!interfere!with!the!sensor!
readings.! When! testing! of! the! other! parts! and! modules! one! issue! was! observed.! Full!
speed! drive! of! one! or! two! motors! generates! disturbances! that! cause! the! grass! sensor!
servo! to! jitter! and! jump! between! positions! during! the! movement.! Since! this! occurrs!
when!using!a!100%!duty!cycle!of!the!PWM!output!to!the!H;bridges,!a!minor!restriction!
in!the!output!to!a!duty!cycle!of!95%!eliminates!the!problem.!
! !