0% found this document useful (0 votes)
12 views

d8av3418q_PopBot X2 Line Tracking Robot 2024

Uploaded by

shai0shinso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

d8av3418q_PopBot X2 Line Tracking Robot 2024

Uploaded by

shai0shinso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

Pop-Bot X2

Line Tracking
Lesson 5
Objectives
a.) distinguish the four different scenarios of
PopBot X2 line tracking

b.) relate clearly the significance of learning how to


create a line tracking program for PopBot X2
c.) create accurately a program for the
Pop-Bot X2 line tracking robot to follow
black line from the starting line up to the
finish line through group hands-on activity
Pop-Bot X2 Line Tracking
• Line following or Line tracking is a
popular and common activity in
robotics learning.
The purpose of this activity is to
learn about how to
interface analog infrared
sensors.
• In the POPBOT X2 robot kit, it
has a pair of Infrared reflector
sensors.
• Two IR Reflector sensors will
be installed at the bottom of
the POP-BOT X2 so that it can
detect both
white and black colors.
Robots usually use an array of
IR (infrared) sensors in order to
calculate the reflectance of the
surface beneath them.
IR LED serves as
TRANSMITTER
Photo-transistor
serves as RECEIVER
Parts of IR Sensor
• IR LED – Infrared Light Emitting Diode. It is an
electronic device that emits light when a voltage is
applied to it.

• Phototransistor – A photoconductive semiconductor


device used especially as a photodetector.
Source: https://www.merriam-webster.com/dictionary/led#:~:text=%3A%20an
%20electronic%20device%20that%20emits,light%2Demitting%20diode
• Output connector – It is used to connect
to the wire cable from the Infrared
Reflector Sensor to the Pop-Bot X2
microcontroller board
Transmitter
• It is an electronic device used in
telecommunications to produce radio
waves in order to transmit or send data
with the aid of an antenna.
Source:
https://www.techopedia.com/definition/9759/transmitter
Examples of Transmitter
• For example, many modern devices that have
communication capabilities have transmitters
such as Wi-Fi, Bluetooth, NFC (near field
communication and cellular.
Near Field Communication
Line Tracking Concept
• The basic criteria is that the
black line has a lesser
reflectance value where black
absorbs light than the lighter
surface around it.
❑ Transmitted light will
bounce back to the
sensor on white surface receiver
❑ Transmitted light will be
absorbed by the
sensor on black surface surface and doesn’t
reach the photo-
transistor
Sensor Application
IR Reflector sensor is used to:
❑ Trace a WHITE
or BLACK line

❑ Detect an
edge
Hardware Setup
connect to port
A1 for Right IR
sensor
and port A0 for
Left IR sensor
• How to create a program for a
robot to follow a line tracing
map?
• Heart of line tracking robot is control the
robot to move over the line by sensors
position beside the line. The robot
moving along the line can be in 4
different scenarios.
1 s t S c e n a r i o : A c ti o n w h e n b o t h I R
sensors detect a white line
(1) Both sensors read
values that are white :
The robot will move
forward. Thus, this
program is written so
that the robot moves
forward normally.
2 n d S c e n a r i o : A c ti o n w h e n L e ft
IR sensor detects a black line
(2) The left sensor detects the
black line : This occurs when
the robot is slightly
turned to the right. Thus, the
program is written for the
robot to spin to the left to
resume its normal path
3 r d S c e n a r i o : A c ti o n w h e n R i g h t
IR sensor detects a black line

(3) The right sensor detects


the black line : This occurs
when the robot is
slightly turned to the left.
Thus, the program is written
for the robot to spin to the
right to resume its normal
4 t h S c e n a r i o : A c ti o n w h e n b o t h
IR sensors detect a black line

(4) Both sensor detect the


black line : the program is
written for the robot to make
decision to move forward,
turn left, turn right ,
backward or stop.
Sample IR Line Tracing Program V1
#include <popx2.h> // PopX2 Library
void setup() {
OK(); // Press the Ok button to start line tracing
}

void loop() {

int IRa = analogRead(A1); // right IR sensor


int IRb = analogRead(A0); // left IR sensor
motor(ALL4, 80);
if(IRa < 500) // if the Right IR sensor
detects a black line
{
motor(1, -50); // spin to the right
for 0.5 milliseconds
motor(2, 50);
sleep(500);
}
if(IRb < 500) // if the Left IR sensor detects a black line
{
motor(1, 50); // spin to the left for 0.5 milliseconds
motor(2, -50);
sleep(500); }
} // end of program
Sample IR Line Tracing Program V2
#include <popx2.h> // Include the main library
int L, R;
void setup()
{
setTextSize(2); // Set text size 2x
glcd(1,1,"Press OK"); // Show the start message
sw_ok_press(); // Wait for the OK switch pressing
glcd(1,1,"Moving..."); // Show the operation
message
}
void loop()
{
L=analog(0); // Get the Left line sensor data
R=analog(1); // Get the Right line sensor data
if (L<500&&R<500) // Both sensors detect the
black line.
// It means the crossing line
{
fd(60); // Move forward over the crossing line
sound(2000,200); // Beep a sound
else if(L>500&&R>500) // Both sensors
detect the white area.
{
fd(60); // Move forward with 60% power
}
else if(L<500) // The left IR sensor
detects the black line
{
sl(60); // Spin left a little bit to adjust the robot
// over the line
sleep(20);
}
else if(R<500) // The right line sensor detects the
black line
{
sr(60); // Spin right a little bit to adjust the robot
sleep(20);
}
} // end of program
• Thumbs up: I understand _____ and can
explain it in my own words.

• Wave hand: I’m not completely sure about _____ and


doubt I could explain it.

• Thumbs down: I don’t understand yet _____ and


cannot explain it.
Group Activity
• Directions:
Create a program using Arduino software for the
Pop-Bot X2 robot to follow an assigned line tracing
map from the starting line up to the finish line.
You have 15 minutes to do the said task.
Summary
• The Pop-Bot X2 Line Tracking system is a
sophisticated robotics solution designed for
efficient navigation. It employs advanced
line-following capabilities, allowing the robot
to traverse predefined paths accurately.

• The key component of this functionality lies


in the integration of infrared sensors that
detect the contrast between the robot and
• These sensor inputs are processed in real-time
using the robot's microcontroller, programmed
with Arduino software.

• The Pop-Bot X2's ability to interpret these inputs


and make swift motor adjustments ensures
seamless and precise line tracking, making it a
versatile tool for various applications requiring
autonomous movement.
Written Work 2 – 2nd Quarter
• Explain the fundamental principles and key
considerations involved in implementing line
tracking with the Pop-Bot X2 robot. Explain the
role of the IR sensors, programming logic, and
motor control in achieving accurate line tracking.
Additionally, elaborate on the significance of
calibration in enhancing the robot's performance.
• Provide 1 example (real-life application/s) and
your own personal reflection on how this hands-
on experience with the Pop-Bot X2 robot can
contribute to your understanding of robotics.
How will you apply this lesson in your daily life?

Deadline: December 16, 2024


Purposeful Assignment
• Read in advance the topic entitled “Line
tracing with multiple junctions using Pop-Bot
X2 robot”.

How to create a program for Pop-Bot X2 Robot


to follow a line tracing map with multiple
intersections/ junctions?

You might also like