0% found this document useful (0 votes)
9 views8 pages

Workshop Guide

The document provides a workshop guide for building a line follower bot using various components, including a plastic chassis, motors, an Arduino Nano, and an IR line tracking module. It outlines the basics of Arduino programming, including key functions and a sample code for controlling the bot's movements. The procedure for assembling the bot and programming it is also detailed, along with a circuit diagram and example code structure.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views8 pages

Workshop Guide

The document provides a workshop guide for building a line follower bot using various components, including a plastic chassis, motors, an Arduino Nano, and an IR line tracking module. It outlines the basics of Arduino programming, including key functions and a sample code for controlling the bot's movements. The procedure for assembling the bot and programming it is also detailed, along with a circuit diagram and example code structure.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

WORKSHOP GUIDE

AIM:-
To make a line follower bot, which follows a path, usually shown
by a black track on a light surface.

COMPONENTS PROVIDED:-
Each of the 30 teams will be provided a kit for building this bot.

The kit shall consist of:-


• Plastic chassis: base/foundation of the bot.
• 2 fixed wheels: the primary wheels on a mobile robot.
• 1 castor wheel: Spins on a single axis and can only roll in
one direction at a time; provides support to fixed wheels.
• 2 BO motors: Battery Operated Motor uses DC alongside
gears to provide enough torque while maintaining speeds;
the most common motor used in small projects.
• Arduino Nano: an open-source microcontroller platform
based on easy-to-use hardware and software(Arduino IDE).

• L298N Motor Driver: helps to


control DC motors according to
the Arduino code along with
powering up the motors safely
without damaging the
microcontroller due to excessive
voltage.
• 8-channel IR Line Tracking module:
the main sensor which will help us
tracking the black path.
• Li-ion battery pack: these are
rechargeable
batteries;
come with a 3.7V
rating; lightweight with a higher
capacity.
BASICS OF ARDUINO PROGRAMMING:-
An Arduino code is primarily divided into 2 different parts(or
functions to be more precise):-
• void setup(): block of code that runs only once; mostly
consists of assignment of pins to be input or output and to
establish serial communication.
• void loop(): block of code that runs repeatedly; consists of
the main logic of our project.
Some important Arduino functions:-
1. pinMode(pin_number, mode): used to configure a specific
pin on the Arduino board as either an input or an output.
E.g. pinMode(13, OUTPUT); configures digital pin 13 of the
Arduino as an output pin.
2. digitalWrite(pin_number, state): function is used to set the
state of a digital pin to either HIGH or LOW; essential for
controlling digital output pins on the board, such as turning
on or off LEDs, motors, or relays.
E.g. digitalWrite(13, HIGH); sets digital pin 13 as high, i.e.
provides a 5V to pin 13.
3. digitalRead(pin_number): used to read the state of a digital
pin, returning either HIGH or LOW; crucial for reading the
state of sensors, switches, or any other digital input devices
connected to the board. E.g. int x = digitalRead(2);
4. delay(milliseconds): function is used to pause the execution
of the program for a specified amount of time. This function
is handy for creating delays between actions, such as
blinking an LED at a certain frequency or waiting for a
sensor to stabilize before taking a measurement.
E.g. delay(1000); pauses the code for 1s.
5. analogRead(pin_number): used to read the voltage value
from an analog pin(measured in a scale from 0-1023); used
for interfacing with analog sensors such as light sensors,
temperature sensors potentiometers and more.
E.g. int x = analogRead(A0);
6. analogWrite(pin_number, value): used to generate a PWM
(Pulse Width Modulation) signal on a digital pin. It is a
technique used to simulate analog output by rapidly
toggling a digital signal between HIGH and LOW states. Only
the pins marked with a tilde (~) symbol,i.e. 3, 5, 6, 9, 10,
and 11 have PWM feature.
E.g. analogWrite(13, 255); values range from 0-255.

Blink example:-
//the setup function runs only once
void setup() {
pinMode(13, OUTPUT); // initialize digital pin 13 as an output.
}

// the loop function runs over and over again forever


void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

PROCEDURE:-
• Solder jumper wires to the motor and attach them to the
chassis using double sided tape.
• Attach the fixed wheels to the shaft and attach the castor
wheel to the chassis.
• Attach the Arduino Nano, the Li-ion cell pack, the motor
driver and the 8-channel IR sensor to the chassis.
• Make the connections according to the circuit diagram(your
connections may not be exactly the same).
• Program the Arduino and test the bot.

CIRCUIT DIAGRAM:-
SAMPLE CODE:-
//Specify Motor connections
//Specify Sensor connections
//Declare variables to store sensor outputs

void setup() {
// put your setup code here, to run once:

//Set MOTOR PINS as OUTPUT


//Set SENSOR PINS as INPUT
// Turn off motors - Initial state
}
void forward() //function to move the bot FORWARD
{
//write your code here
}

void left() //function for LEFT turn


{
//write your code here
}

void right() //function for RIGHT turn


{
//write your code here
}

void stop() //function to STOP the bot


{
//write your code here
}

void loop() {
// put your main code here, to run repeatedly:

//Reading the output from the sensors


//The following are the different cases:-
//if all sensors sense BLACK or all of them sense WHITE ==>
STOP the bot
//if the 2 MIDDLE sensors sense BLACK ==> Bot moves AHEAD
//if the 2 RIGHT sensors sense BLACK ==> Bot takes a RIGHT
TURN
//if the 2 LEFT sensors sense BLACK ==> Bot takes a LEFT TURN

delay(10);
}

You might also like