Professional Documents
Culture Documents
DOCUMENTATION
IN COMPUTER PROGRAMMING
(Avoidance Robot)
DAD BOT
Submitted By: Jade B. Bermas
SECTION: SBECE-1A
Submitted to: Prof. Joselito Trinidad MTE
QUEZON CITY UNIVERSITY
673 Quirino Highway ,San Bartolome, Novaliches, Quezon City
Electronic Engineering
I. Objectives:
II. Description:
This avoidance robot has a concept of an insect called firefly In Filipino, as
you can see in the picture every time when we are starting this robot it has a color red
backlight, helps to easily identify this thing in dark places. This avoidance robot name
was DADBOT the reason behind this name was because since I am a father of one,
some of my friends calling me daddy that’s why I think I should start to put the word
DADDY into my projects because it’s easy to Identify that this thing is one of my
creations.
This avoidance robot has a length around 30 cm and a with around 15cm and a
height around 10 cm, it contains 2 gear motor and one cartwheel in the outside and the
controller that I choose to run the motor was l293d motor shield for Arduino Uno, and
also it contains one servo motor and ultrasonic sensor that indicates the hindrance in its
way so that the robot can easily avoid things that can cause danger.
Also, this robot was run by a 4 pcs of Li-ion that formed into parallel connection
to have a durable and long-lasting use, and I choose to use some step-up inverter so I
can increase the given voltages of this robot into the needed voltage to run this thing.
QUEZON CITY UNIVERSITY
673 Quirino Highway ,San Bartolome, Novaliches, Quezon City
Electronic Engineering
III. Flow Chart:
a c
b
start
Delay(100)
Delay(200)
If distance==25
Int Distance=Read If
distanc distanceR>=distanceL
e=0 ping
Delay(300)
Turn
Turn Left
RIght
Delay(100)
Int Move stop Move
speed Forward
set= 0
Distance= Read
Ping
Delay(200)
End
My
servo Delay(100)
=10
Distance
R= look
Right
Int
My servo
distanc
write=115
e R=0
Delay(200)
Delay(2000) Int
distanc
e L=0
Distance L=
look Left
Distance=read ping
Delay(40)
c
a b
QUEZON CITY UNIVERSITY
673 Quirino Highway ,San Bartolome, Novaliches, Quezon City
Electronic Engineering
1. #include <AFMotor.h
2. #include <NewPing.h>
3. #include <Servo.h
4. #define TRIG_PIN A0
5. #define ECHO_PIN A1
6. #define MAX_DISTANCE 200
7. #define MAX_SPEED 150
8. #define MAX_SPEED_OFFSET 20
17. myservo.attach(10);
18. myservo.write(115);
19. delay(2000);
20. distance = readPing();
21. delay(100);
22. distance = readPing();
23. delay(100);
24. distance = readPing();
25. delay(100);
26. distance = readPing();
27. delay(100);
28. }
33. if(distance<=20)
34. {
35. moveStop();
36. delay(100);
37. moveBackward();
38. delay(300);
39. moveStop();
40. delay(200);
41. distanceR = lookRight();
42. delay(200);
43. distanceL = lookLeft();
44. delay(200);
45. if(distanceR>=distanceL)
46. {
47. turnRight();
48. moveStop();
49. }else
50. {
51. turnLeft();
52. moveStop();
53. }
54. }else
55. {
56. moveForward();
57. }
58. distance = readPing();
59. }
93. if(!goesForward)
94. {
95. goesForward=true;
96. motor1.run(FORWARD);
97. motor2.run(FORWARD);
98. for (speedSet = 0; speedSet < MAX_SPEED; speedSet +=2)
99. {
100. motor1.setSpeed(speedSet);
101. motor2.setSpeed(speedSet);
102. delay(5);
103. }
104. }
105. }
130. }
QUEZON CITY UNIVERSITY
673 Quirino Highway ,San Bartolome, Novaliches, Quezon City
Electronic Engineering
V. Schematic:
QUEZON CITY UNIVERSITY
673 Quirino Highway ,San Bartolome, Novaliches, Quezon City
Electronic Engineering
VI. Pictures:
Materials Quantity Cost = Peso
Gear motor 2 60.00
LED 1 0.00
TP56 1 35.00
Switch 1 13.00
TOTAL: 548.00
QUEZON CITY UNIVERSITY
673 Quirino Highway ,San Bartolome, Novaliches, Quezon City
Electronic Engineering
VII. Costing/Materials:
QUEZON CITY UNIVERSITY
673 Quirino Highway ,San Bartolome, Novaliches, Quezon City
Electronic Engineering
VIII. Reflection:
This project thought me many things first, whenever what happens always
challenge yourself to be better, second, imagination and creativity is the key to
accomplish all the problems that you will encounter during and after you finish to
innovate this project, lastly, we have different kinds of ideas and it can be same
program but it can be different on how we innovate and present it.
At start I always ask myself on how and where do I start, because how can I
make things at my own? And then I realized that I am not alone because I have friends
and a very good professor that will guide me at my journey to accomplished this
programmable robot, I am very glad that I experience this thing’s because I know to my
self that it can help me for the near future and I believed that as long I make mistake’s I
have chance to be a better student and programmer.