obstacle avoiding robot project

1,739 views 12 slides Feb 17, 2022
Slide 1
Slide 1 of 12
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12

About This Presentation

obstacle avoiding robot project report for engineering students


Slide Content

1
DepartmentOfElectricalEngineering
INSTRUMENTATION&MEASURMENTATION(LAB)OBSTACLEAVOIDINGROBOT
GroupMembers
AishaNaeemKhan02-133182-075
MoosaNaeemKhan02-133182-074
BEE-7C
FALL2021
Submittedto
Engr.AyeshaWaris

2
TableofContents
1.Abstract.................................................................................................................3
2.Introduction..........................................................................................................3
3.LiteratureReview................................................................................................4
4.ComponentsandToolsDescription....................................................................5
5.BlockDiagram/FlowChart.................................................................................6
6.Methodology.........................................................................................................6
6.1.ProposedModel………………………………………………………6
6.2Circuit/SimulationDiagram......................................................…...7
6.3CodeandDescription……………………………………..10
7.ResultsandDiscussions.....................................................................................11
8.ConclusionandFutureWork...........................................................................11
9.ProjectSummary...............................................................................................11
10.ProjectPictures..................................................................................................12
11.References...........................................................................................................12

3
1.ABSTRACT
Wearedesigninganobstacleavoidingrobotthatwillchangetrajectorywhenitsenses
objectsinitspath.
Theresultsofthedistancecalculationusedtocontrolthemovementoftherobot,hanse
therobotisabletoavoidunknownobstacles.Thisobstaclerobotdividedinto3parts,
namelyArduinoUnoasacontroller,L298Ndriverasamotor/wheelcontrollerand
ultrasonicsensor(s)HC-SR04asasendingandreceivingdeviceforultrasonicsignals.
Theultrasonicsensordesignontheobstaclerobotplacedatthefrontoftherobotwith
theobstaclepositioninfront.Fromthedataanalysis,theobstaclerobotcandetermine
theaccuracylevelofthedetecteddistanceandcanstopaccordingtothedetected
obstacledistance.
Thetestresultsshowthattheobstaclerobotislessaccurateindetectingtheobstacles
infrontofit,asevidencedbythetestresultsthatthereisanaverageerrorof0.118.
Howevertherearestillmanyapplicationsfortheworkdonethatcanbeusedin
vaccums,goombas(cleaners),selfdrivingcarsetc.
2.INTRODUCTION
ARobotisasetofmechanicaldevicesthatcanperformphysicaltasks,eitherhuman
supervisionandcontrol,orusingpredefinedprograms.Therobotthatisthetopicof
thisresearchisatypeofobstaclerobotorinotherwordsarobotthatcanmovefrom
placetoplace.Obstaclerobotsareroboticconstructionswhosecharacteristicsare
havingactuatorsintheformofwheelstomovetheentirerobotbody,sothattherobot
canmovepositionsfromonepointtoanother.
Inthiswork,wehavepresentedarobot,whichiscompact,autonomousandfully
functional.Thisrobot/smartcarisbuilttosenseanyobstacleinitspath,toavoiditand
resumeitsrunninginvolvingthepre-computationofanobstaclefreepath.Ultrasonic
sensorswereadaptedtoimplementareal-timeobstacleavoidancesystemforwheeled
robots,sothattherobotcancontinuallydetectsurroundings,avoidobstacles,andmove
towardthetargetarea.Ofcoursewehavenotgivenitapredefinedpath,whichmakes
thingsconsiderablyeasiertoimplement.
WeuseanArduinoUNOwithaMotorShieldalongwithStepperMotorstomakethe
car,andforsensingweincorporateanUltrasonicSensorwhichaccuratelyand

4
efficientlydetectsanyobstaclesintherobot’spath.TheArduinoiscodedsuchthatthe
robotmovesbackwardwhenanobstaclearisesinfrontofitwithamaximumlimitof
50cmsinidealtestingconditions.
Throughouttheconstructionofthismodel,weeducatedourselvestotheArduino
codinglanguage,theMotorShieldfunctionality,andcomprehensively,withthe
workingofanultrasonicsensoranditsfeatures.
3.LITERATUREREVIEW
Fromtheindustrialside,robotshaveachievedgreatsuccess,suchasmanipulator
robots,humanoidrobots,andandroidrobotsthatusedbylargecompanies.But
despiteallthesuccessthathasbeenachieved,thisroboticrobothasonefundamental
drawback,namelylimitedmobility,thereforeobstaclerobotsarepresentandableto
travelaroundtheentireautomotivecompanywithoutusingasteeringwheel,
performingtheirabilitieswhereveraseffectivelyaspossible.
Theapplicationofultrasonicsignalshasbeenwidelycarriedout,especiallyinthe
robotindustry.Thefollowingaresomepreviousstudiesintheapplicationofultrasonic
signals:
Inthethesisentitled"DesignofaFireExtinguishingCarRobotBasedonthe
ATmega252Microcontroller",whichdiscussestheuseoflightsensorsandultrasonic
sensorsincontrollingcarrobotsforthepurposeoffindingpoints.fireandextinguishit;

5
Inthethesisentitled"DesignofaMovingObjectTrackingCarRobotBasedonPA
(Proportional-Derivative)ControllerUsingtheATmega8535Microcontroller".
whichusesfuzzy-PIDlogicandultrasonicsensorstochartapathforitself.
Inspiredbythis,thisresearchwilldevelopaobstaclerobotthatcontrolledusing
ArduinoUnoasitscontrol,L298Ndriverasamotorcontrollerandultrasonicsensor
HC-SR04asadistancesensortodetectthedistancetothesurroundingobstructions.
Theresultsofthedistancereadingwillusedasinformationtocontrolthemovementof
therobotobstaclesuchasstoppingbasedonthedistanceofthedetectedobstacle
4.COMPONENTSANDTOOLSDESCRIPTION
Weareusing:
4.1.Batteries
9Vsapproxforbothmotorandarduino
4.2.Chasis
Formountingwheels,arduinoandothercomponentson.
4.3.
L298NH-brigemotordriver
.
ItsICconsistsoflogicaltransistors(TTL)withNANDgatesthatfunctiontomake
iteasiertodeterminethedirectionofrotationofadcmotororsteppermotor.The
advantageofthisL298Nmotordrivermoduleisintermsofprecisionincontrolling
themotorsothatthemotoriseasiertocontrol.
4.4.
ArduinoUNO
Whichisourmicrocontrollerofchoicehereasitisopensourceand
easytouse.
4.5.SensorHC-SR04
TheHC-SR04isanultrasonicsensorthatusedtomeasurethe
distancebetweenanobstacleandthesensor.TheU
ngittakesfortheechoofthesoundtoreflectback
4.6.Motors&castorwheel
Theyareof5Vsandarethewheelsrunningthisoperation.

6
5.BLOCK/FLOWDIAGRAM
6.METHODOLOGY
6.1.ProposedModel/Circuit
Theproposedmodelhas3
sensorsmountedatthefront.

7
6.2.Code
inttrigPin1=3;//Trigger
intechoPin1=4;//Echo
inttrigPin2=12;//Trigger
intechoPin2=13;//Echo
inttrigPin3=A0;//Trigger
intechoPin3=A1;//Echo
intrevleft4=10;//MotorPins
intfwdleft5=11;//High
intrevright6=8;
intfwdright7=9;//High
intenright=6;
intenleft=5;
longduration,cm,inches,duration2,
cm2,duration3,cm3;
voidsetup(){
//SerialPortbegin
Serial.begin(9600);
//Defineinputsandoutputs
pinMode(trigPin1,OUTPUT);
pinMode(echoPin1,INPUT);
pinMode(trigPin2,OUTPUT);
pinMode(echoPin2,INPUT);
pinMode(trigPin3,OUTPUT);
pinMode(echoPin3,INPUT);
pinMode(revleft4,OUTPUT);//Set
MotorPinsAsO/P
pinMode(fwdleft5,OUTPUT);
pinMode(revright6,OUTPUT);
pinMode(fwdright7,OUTPUT);
pinMode(enright,OUTPUT);
pinMode(enleft,OUTPUT);
}
voidloop(){
//ThesensoristriggeredbyaHIGH
pulseof10ormoremicroseconds.
//GiveashortLOWpulsebeforehand
toensureacleanHIGHpulse:
digitalWrite(trigPin1,LOW);
delayMicroseconds(5);
digitalWrite(trigPin1,HIGH);
delayMicroseconds(10);
digitalWrite(trigPin1,LOW);
//Readthesignalfromthesensors:a
HIGHpulsewhose
//durationisthetime(inmicroseconds)
fromthesending
//ofthepingtothereceptionofits
echooffofanobject.
pinMode(echoPin1,INPUT);
duration=pulseIn(echoPin1,HIGH);
//Convertthetimeintoadistance
cm=(duration/2)/29.1;//Divideby
29.1ormultiplyby0.0343
inches=(duration/2)/74;//Divide
by74ormultiplyby0.0135
delay(50);
if(cm>20)//ConditionForAbsence
OfObstacle
{
digitalWrite(fwdright7,HIGH);//
MoveForward

8
digitalWrite(revright6,LOW);
digitalWrite(fwdleft5,HIGH);
digitalWrite(revleft4,LOW);
analogWrite(enright,135);//Runin
halfspeed
analogWrite(enleft,135);//Runin
halfspeed
}
if(cm<20)//ConditionForPresence
OfObstacle
{
digitalWrite(fwdright7,LOW);//Stop
digitalWrite(revright6,LOW);
digitalWrite(fwdleft5,LOW);
digitalWrite(revleft4,LOW);
delay(500);
digitalWrite(fwdright7,LOW);//
MoveBackward
digitalWrite(revright6,HIGH);
digitalWrite(fwdleft5,LOW);
digitalWrite(revleft4,HIGH);
delay(500);
digitalWrite(fwdright7,LOW);//Stop
digitalWrite(revright6,LOW);
digitalWrite(fwdleft5,LOW);
digitalWrite(revleft4,LOW);
delay(100);
checkLeftDistance();
delay(20);
checkRightDistance();
delay(20);
if(cm2>cm3)
{
digitalWrite(fwdright7,HIGH);//
MoveLeft
digitalWrite(revright6,LOW);
digitalWrite(revleft4,LOW);
digitalWrite(fwdleft5,LOW);
}
elseif(cm3>cm2)
{
digitalWrite(fwdright7,LOW);//
MoveRight
digitalWrite(revright6,LOW);
digitalWrite(revleft4,HIGH);
digitalWrite(fwdleft5,LOW);
}
else
{
digitalWrite(fwdright7,HIGH);//
MoveLeft
digitalWrite(revright6,LOW);
digitalWrite(revleft4,LOW);
digitalWrite(fwdleft5,LOW);
}
delay(500);
}
}
voidcheckLeftDistance()
{
digitalWrite(trigPin2,LOW);
delayMicroseconds(4);
digitalWrite(trigPin2,HIGH);
delayMicroseconds(10);
digitalWrite(trigPin2,LOW);
duration2=pulseIn(echoPin2,HIGH);
cm2=(duration2/2)/29.1;
Serial.print("Leftdistance:");

9
Serial.print(cm2);
Serial.println("cm");
}
voidcheckRightDistance()
{
digitalWrite(trigPin3,LOW);
delayMicroseconds(4);
digitalWrite(trigPin3,HIGH);
delayMicroseconds(10);
digitalWrite(trigPin3,LOW);
duration3=pulseIn(echoPin3,HIGH);
cm3=(duration3/2)/29.1;
Serial.print("Rightdistance:");
Serial.print(cm3);
Serial.println("cm");
}
[/code]

10
6.3.Code/CircuitDescription
Therobotisswitchedonbygivingit9VDCpowerfromanexternalbattery.The
motorsstartsrotatingandthustherobotstartsmovingforward.
Howeverweneedtoknowhowtheultrasonicsensorworktoexplainfurther.
Theultrasonicsensorusessonartodeterminethedistancetoanobject.What
happensitthat:
Theultrasoundtransmitter(trigpin)emitsahigh-frequencysound(40kHz).
Thesoundtravelsthroughtheair.Ifitfindsanobject,itbouncesbacktothemodule.
Theultrasoundreceiver(echopin)receivesthereflectedsound(echo).
Thetimebetweenthetransmissionandreceptionofthesignalallowsusto
calculatethedistancetoanobject.Thisispossiblebecauseweknowthesound’s
velocityintheair.Theformula:
distancetoanobject=((speedofsoundintheair)*time)/2
Duringthistime,thecenterultrasonicsensorkeepscheckingtoseeifanythingisin
frontofit.
Sowecannowexplainthatthecentralulltrasonicsensorkeepscheckingtoseeif
anythingisinfrontofitwithina20cmdistance.Ifthereisnt,itwillkeepgoingina
straightline.
However,ifthereissomethinginfrontofit,therobotwillstopandbackupalittle,
asthesensorsensesdistancelessthan20cm.Itwillthenusethesensorstotheleft

11
andtherightandcalculatewherethereismoredistancefromanobject.Andit
moveinthatdirection.
Thiscodewillkeeprunninginaloop.7.RESULTSANDDISCUSSIONS
Aswehaveseen,therobotwilldetectobstaclesandchangeitstrajectoryaccordingly.
Itwillsensewithultrasonicsensorsifanythingisinfrontwithin20cmofitand
changedirectionaccordingly.Thereisanerrormarginintheultrasonicsensor.
Itwillsendmaximumdistanceifobjectinquestionistouchingiti.e.0cm.
Howevertherobotstillworkswellenoughanddemonstratestheconceptofobstacle
avoidancewell.
8.CONCLUSIONANDFUTUREWORK
Thistechniquecanalsobeusedasavisionbeltforblindpeoplebychangingthe
ultrasonicsensorbyakineticsensor,whichisatypeofmicrowavesensorwhose
sensingrangeisveryhighandtheoutputofthissensorvaryinaccordingtotheobject
positionchanges.Thistechniqueenablesblindpeopletonavigateobstacleseasilyby
placingthreevibratosinleft,rightandthecentreofabeltnamedasVisionBelt.
Ontopofobstacleavoidingrobottemperature/pressuresensorscanbeaddedto
monitortheatmosphericconditionsaround.Thisisusefulinplaceswherethe
environmentisnotsuitableforhumans.Sametechnologycanbeusedinvarious
applicationsbymodifyingtheprogramforexampleLine/PathfinderRobot,
automaticvacuumcleaneretc.
Theycanbeusedasservicesrobots,fortheLowCostObstacleAvoidanceRobot,
purposeofhouseholdworkandsomanyotherindoorapplications.
9.PROJECTSUMMARY
Thegoalofourprojectistocreateanautonomousrobotwhichintelligentlydetectsany
obstacleinitspathandnavigatesitaccordingtheactionswesetforit.

12
10.PROJECTPICTURES
11.REFERENCES
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8545591/
https://ieeexplore.ieee.org/abstract/document/8570477
https://www.academia.edu/35334413/Obstacle_Avoiding_Smartcar_using_Arduino_an
d_Ultrasonic_Sensors_J_Component_Report
https://randomnerdtutorials.com/complete-guide-for-ultrasonic-sensor-hc-sr04/
https://forum.arduino.cc/t/digital-pin-0-and-1/475928/7
https://hardwarefun.com/tutorials/controlling-speed-of-dc-motors-using-arduino
https://www.researchgate.net/publication/356808148_Ultrasonic_Signal_Implementati
on_in_Arduino-Based_Obstacle_Robot_Control_System
https://www.slideshare.net/shubhamthakur614/final-report-obstacle-avoiding-roboat
https://hardwarefun.com/tutorials/controlling-speed-of-dc-motors-using-arduino
https://hardwarefun.com/tutorials/controlling-speed-of-dc-motors-using-arduino