0% found this document useful (0 votes)
43 views109 pages

Workshop 1

The document discusses a robotics club and its members, projects involving robots, components used to build robots, and basic concepts related to robotics like microcontrollers, Arduino boards, and functions in coding.

Uploaded by

SHIVA VERMA
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)
43 views109 pages

Workshop 1

The document discusses a robotics club and its members, projects involving robots, components used to build robots, and basic concepts related to robotics like microcontrollers, Arduino boards, and functions in coding.

Uploaded by

SHIVA VERMA
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/ 109

Robotics

Workshop-1

ROBOTICS CLUB NITP


Our team

Darshan Jain Divya Bhardwaj


Captain , Robotics Club Secretary, Robotics Club
NITP NITP
Our team

Sudhanshu Ranjan Subhi Singh


Joint Secretary , Robotics Treasurer , Robotics Club
Club NITP NITP
Our team

Swaraj Ankunj Suraj


Technical Lead, Robotics Technical Lead, Robotics
Club NITP Club NITP
Your Amit Kumar Ritik Jha
Electrical Engineering Electrical Engineering
Instructor
Rathod
Purbasha
Niharika Electronics and
Mechanical Communication
Engineering Engineering
Kapish Aryansh
Your Varshney Gupta
Computer Science and Computer Science and
Instructor Engineering Engineering

Ankur Mayank
Electrical Engineering Electrical Engineering
Raja Kumar
Your
Mechanical
Instructor Engineering
PROJECTS

1. HUMAN FOLLOWING BOT

2. OBSTACLE AVOIDING BOT


Table of contents
01 02 03
Arduino PWM signals
A basic guide A Brief Idea of Pulse Width
TinkerCAD
Modulation (PWM)

04 05 06
TinkerCAD Sensors Actuators
projects Ultrasonic Sonar Sensor Servo motor and geared
Infrared Sensor motors
Components
Arduino uno R3 and cable L293D Motor Driver

Infrared Sensor

Ultrasonic Sonar Sensor


Screw Driver
Servo motor
DC Motors and Wheels

Chassis Switch Sonar holder


Precautions
● Do not give power supply to arduino while assembling.

● Battery to be set in holder only after you’ve done


assembling your bot completely.

● Avoid touching the components damped handed.

● Make sure all of your connections are correct and tight.

● Avoid placing arduino board on any conducting surface.


What is a
microcontroller ?
● a compact integrated circuit designed to
govern a specific operation in an
embedded system
● includes a processor, memory and
input/output (I/O) peripherals on a single
chip
● special purpose computers that can do a
task well depending on how you code it
What is the need of
using a
microcontroller?
● It has built in "I/O" (input/output) capabilities. So
it can read and write digital and analog
values/states, and connect directly to the "real
world".
● A microcontroller, unlike a microprocessor can
connect directly to switches, buttons, LCD
displays, LEDS, relays and serial ports.
● Simply saying it just performs the function that
you ask it to do by programming it i.e. it acts as
the brain for the input and output components
that you need to build a system.


Arduino
(General Instruction)
● An Arduino is an open-source microcontroller
development board.

● This allows us to upload programs to this board which


can then interact with things in the real world.

● Basically, if there is something that is in any way


controlled by electricity, the Arduino can interface with
it in some manner. And even if it is not controlled by
electricity, one can probably still use things which are
(like motors and electromagnets), to interface with it.
Some common types of Arduino board :

Arduino UNO R3 Arduino Nano Arduino Mega

Arduino UNO
Basic Structure
of Arduino UNO
• Microcontroller: Microcontroller is the main component of Arduino Uno. The
Arduino Uno board is a microcontroller based on the ATmega328.
• 14 Digital Pins: Arduino Uno Consist of 14 Digital Pins Where output Components
like: LED, LCD, Relay etc. are connected. These work for a value of HIGH or LOW.
• Analog Pins: Arduino Uno Consist of 6 Analog Pins, Analog Pins are usually used to
connect sensor like: IR Sensor , RF Sensor these all sensor have analog value that’s
why they are connected to analog pins, Most of the input components are
connected here. These pins return a value of 0-255.
• PWM – The pulse width modulation pins marked with the (~) symbol can simulate
analog output
• Reset Button: This is used to start the programme again which is once uploaded.
• Voltage Regulator:The function of the voltage regulator is to control the voltage
given to the Arduino board and stabilize the DC voltages used by the processor
and other elements.
• Crystal Oscillator:The crystal oscillator helps Arduino in dealing with time issues.
How does Arduino calculate time? The answer is, by using the crystal oscillator.
The number printed on top of the Arduino crystal is 16.000H9H. It tells us that
the frequency is 16,000,000 Hertz or 16 MHz.
• Power LED indicator:This LED should light up when you plug your Arduino into a
power source to indicate that your board is powered up correctly. If this light
does not turn on, then there is something wrong with the connection.
• Built-in LED: This LED is internally connected to I/O pin 13 of Arduino uno and
lights up when commanded on pin 13.
• Power Supply: The power supply pins are Vin, 5V, 3.3V, GND, IOREF are used to
power Input and output components. The recommended range is 7 to 12 volts to play
your board safe.
• Power Jack: Arduino board can be powered either by USB connection or with an
external power supply. This is used to power the Arduino board where we connect a
dc source from 7-12 volts.
• USB Port: This port function to programme the board or to upload the programme.
The one end of USB cable is connected to the laptop and another to this port. With
help of Arduino software and USB cable, one can upload the programme on the
board.
A Brief Idea of
Pulse Width Modulation
(PWM)
A Brief Idea of Pulse Width Modulation
(PWM):
● Pulse Width Modulation, or PWM, is
a technique for getting analog
results with digital means.
● Digital control is used to create a
square wave, a signal switched
between on and off.
● This on-off pattern can simulate
voltages in between the full Vcc of
the board .
● By changing the portion of the time
the signal spends on versus the time
that the signal spends off.
● The duration of "on time" is called
the pulse width.
● To get varying analog values, you
change, or modulate, that pulse
width.
Arduino IDE
Arduino IDE:
● The Arduino language is C++ thus it is a
case sensitive language.
● Most of the time, people will use a small
subset of C++, which looks a lot like C.
If you are familiar with Java, then you
will find C++ easy to work with and to
recognize.
● The simplest possible Arduino sketch is
this
What are variables?
● name of the memory location. It is used to store data.Its value can be changed, and it can be reused
many times.

● int a=10,b=20;//declaring 2 variable of integer type


float f=20.8;
char c='A';

● A variable can have alphabets, digits, and underscore.


● A variable name can start with the alphabet, and underscore only. It can't start with a digit.
● No whitespace is allowed within the variable name.
● A variable name must not be any reserved word or keyword, e.g. int, float, etc.
Data Types

A data type is an attribute


associated with a piece of data that
tells a computer system how to
interpret its value.
Data Type Definition Examples

Integer (int) Numeric data type for numbers without fractions -707, 0, 707

Floating Point (float) Numeric data type for numbers with fractions 707.07, 0.7, 707.00

Boolean (bool) True or false values 0 (false), 1 (true)

Array List with a number of elements in a specific order—typically of the same type rock (0), jazz (1), blues (2),
pop (3)

Character (char) Single letter, digit, punctuation mark, symbol, or blank space a, 1, !

String (str or text) Sequence of characters, digits, or symbols—always treated as text hello, +1-999-666-3333
Why we need function?
void checkTriangle(int x1, int y1, int x2, int y2, int x3, int y3)
{

// Calculation the area of


// triangle. We have skipped
// multiplication with 0.5
// to avoid floating point
// computations
int a = x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2);

// Condition to check if
// area is not equal to 0
if (a == 0)
cout << "No";
else
cout << "Yes";
}
Function
The function is a block of statement
or instruction enclosed by curly
braces { } that together perform one
of the special tasks
Basic syntax of function
return_type function_name (parameter list){
//function body
return (expression)
}

return_type: Return type can be of any data type such as int, double, char, void, short etc.

function_name: It can be anything.

argument list: Argument list contains variables names along with their data types. These arguments are
kind of inputs for the function. For example – A function which is used to add two integer variables, will
be having two integer argument.

Block of code: Set of statements, which will be executed whenever a call will be made to the function.
Example
If-else
statement
● If else Statement in C programming
language, when we need to execute a block
of statements that too when a particular
condition is met or not met that situation is
known as decision making.
● In C programming, the decision-making
process is used to specify certain orders in
which statements are executed.
Basic syntax of if-else statement
Example
int marks=75
if(marks<=40){
print(“You are fail”)
}
if(40<marks<=50){
print(“You got D grade”) Output:
}
else if(50<marks<=60){ You got A grade
print(“You got C grade”)
}
else if(60<marks<=70){
print(“You got B grade”)
}
else if(70<marks<=80){
print(“You got A grade”)
}
else {
print(“You got A+”)
Basic structure of for loop
for(initialization; test Expression; increment/decrement)
{
Body of Loop
}

initialization: this allows you to initialize the initial value for the loop control.

test expression: This is for testing the condition. If the condition satisfies enter into the for loop
body and execute the code of for loop.

increment/decrement: This is for increments or decrements of the value of the variable each
time after the execution of the for loop body.
Header file
● Language has numerous libraries that include predefined functions to make
programming easier.

● In C language, header files contain the set of predefined standard library functions.

● We request to use a header file in your program by including it with the C


preprocessing directive “#include”.

● All the header file have a ‘.h’ an extension. By including a header file, we can use its
contents in our program.
● This code contains two functions in it.
● The first one is setup().
● Anything you put in this function will be executed by the Arduino just once when the
program starts.
● The second one is loop().
● Once the Arduino finishes with the code in the setup() function, it will move into a loop(),
and it will continue running it in a loop, again and again, until you reset it or cut off the
power.
● Notice that both setup() and loop() have open and close parenthesis? Functions can
receive parameters, which is a way by which the program can pass data between its
different functions.
● The setup and loop functions don’t have any parameters passed to them. If you add
anything within the parenthesis, you will cause the compiler to print out a compilation
error and stop the compilation process.
● Every single sketch you write will have these two functions in it, even if you don’t use
them.
● In fact, if you remove one of them, the compiler again will produce an error message.
Setting up Arduino IDE :
● Step-1: Go to https://www.arduino.cc/ or just search download Arduino IDE on google
● Step-2: Install the latest version of Arduino IDE according to your system.
● Step-3: Install the IDE by leaving everything as default.
● Step-4: Open the IDE.
Writing Our first
programme:
● Connect your Arduino UNO Board via the USB cable to your computer.
● In editor area write in the codes below:

const int ledPin=13;

void setup()
{
pinMode(ledPin,OUTPUT);
}
void loop()
{
digitalWrite(ledPin,HIGH);
delay(1000);

digitalWrite(ledPin,LOW);
delay(1000);
}
● Click on verify button.
● Click on upload button.

● After the uploading is successful the terminal shows the message Done Uploading and you will
see the led on your board blinking at interval of 1 sec.

● If any error or Warning arises it shows them too.


Types of signals processed by Arduino:

Arduino control the devices that work on digital and analog signals.

Digital signals are those signals which have only two discrete values namely:

● 0 or 1
● LOW or HIGH
● True or False

Whereas analog signals are those signals which only continuous values from 0
to full, whatever the full value may be defined as.
Basic Input/Output functions of Arduino:
● pinMode(PIN_NUMBER, INPUT/OUTPUT) :Sets the pin at the location PIN_NUMBER to be either an
INPUT or an OUTPUT. Eg: inMode(ledpin,OUTPUT)

● digitalRead(PIN_NUMBER) :Reads the input at PIN_NUMBER and returns a 1 or 0 (HIGH or LOW)


Eg: int a=digitalRead(12);

● digitalWrite(PIN_NUMBER, VALUE):Writes a value of 1 or 0 (HIGH or LOW) to digital pin PIN_NUMBER.


Eg: digitalWrite(ledpin,HIGH);

● analogRead(PIN_NUMBER):Reads the analog pin PIN_NUMBER and returns an integer between 0 and
1023 . Eg: int b=analogRead(A0);

● analogWrite(PIN_NUMBER, VALUE):Emulates analog output VALUE using PWM on PIN_NUMBER i.e can
only write a value between 0 and 255.(note: only available on pins 3, 5, 6, 9, 10, and 11).
Other commonly used
functions:
● delay(INTEGER): Delays program execution for INTEGER milliseconds

● delayMicroseconds(INTEGER):Delays program execution for INTEGER


microseconds.

● map(value,l1,h1,l2,h2): Re-maps a number from one range to another. That is, a


value of fromLow would get mapped to toLow, a value
of fromHigh to toHigh, values in-between to values in-between,
etc.

● pulseIn(pin,value):Reads a pulse (either HIGH or LOW) on a pin. For example, if


value is HIGH, pulseIn() waits for the pin to go from LOW to HIGH,
starts timing, then waits for the pin to go LOW and stops timing.
Returns the length of the pulse in microseconds or gives up and
returns 0 if no complete pulse was received within the timeout.
Serial Monitor and its
functions:
● The Serial Monitor is an essential tool when creating projects with Arduino. It can be
used as a debugging tool, testing out concepts or to communicate directly with the
Arduino board.
TinkerCAD
TinkerCAD
● Tinkercad is a free web app for 3D design, electronics, and coding.
● We generally use TinkerCAD to simulate electronic circuits.

Getting Started with TinkerCAD

● First go to
https://www.tinkercad.com/
and create a student account.
● Now click on new button and
then select Circuit.
● A new blank project starts.
01

TinkerCAD
Project 1
Basic LED Project
What we are working on

Arduino UNO LED Digital Pins


Code:
void setup(){
pinMode(13, OUTPUT);
}

void loop(){
digitalWrite(13, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(LED_BUILTIN, LOW);
delay(1000); // Wait for 1000 millisecond(s)
}
01

TinkerCAD
Project 2
A simple traffic light circuit
What we are working on

Arduino UNO LED Digital Pins


Code:
void setup(){
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
void loop(){
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(100);
digitalWrite(12, HIGH);
delay(300);
digitalWrite(12, LOW);
delay(100);
digitalWrite(11, HIGH);
delay(1000);
digitalWrite(11, LOW);
delay(100);
}
Sensors
• Sensors are devices that convert
a physical quantity, such as light
intensity or temperature, into an
electrical quantity.
• A thermocouple, for example,
outputs a voltage proportional to
its temperature.
Some sensors that we will be working with

Active InfraRed Sensor Ultrasonic Sonar Sensor


This Sensor module works
on the principle of Ultrasonic Sensor
Reflection of Infrared Rays HC-SR04 is a sensor that
from the incident surface can measure distance
Active InfraRed Sensor:
● This Sensor module works on the principle of Reflection
of Infrared Rays from the incident surface. A continuous
beam of IR rays is emitted by the IR LED.
● Whenever a reflecting surface (white/obstacle) comes in
front of the Receiver (photo diode), these rays are
reflected back and captured.
● Whenever an absorbing surface (Black/No Obstacle)
comes in front of the Receiver, these rays are absorbed
by the surface and thus unable to be captured.
● Here Photodiode is used to capture reflected light of IR
LED.
● A semiconductor diode that, when exposed to light,
generates a potential difference or changes its electrical
resistance.
Working and applications:
Applications:

1.Line Follower sensor


2.Obstacle Avoidance
Robot
3.Edge avoiding robot
4.Anti-falling robot
5.Light/Fire sensing
Code:
void setup(){
pinMode(4,INPUT);
Serial.begin(9600);
}
void loop() {
if(digitalRead(4)==LOW){
Serial.println(“Not Detected”);
}else{
Serial.println(“Detected”);
}}
Ultrasonic Sonar Sensor:
● Ultrasonic Sensor HC-SR04 is a sensor that can
measure distance.

● It emits an ultrasound at 40 000 Hz (40kHz) which


travels through the air and if there is an object or
obstacle on its path It will bounce back to the
module.

● The configuration pin of HC-SR04 is VCC (1), TRIG


(2), ECHO (3), and GND (4).

● The supply voltage of VCC is +5V and you can


attach TRIG and ECHO pin to any Digital I/O in
your Arduino Board.
Working:
● In order to generate the ultrasound we need to set the
Trig pin on a High State for 10 µs.
● That will send out an 8 cycle ultrasonic burst which will
travel at the speed of sound.
● The Echo pins goes high right away after that 8 cycle
ultrasonic burst is sent, and it starts listening or waiting
for that wave to be reflected from an object.
● If there is no object or reflected pulse, the Echo pin will
time-out after 38ms and get back to low state.
● If we receive a reflected pulse, the Echo pin will go down
sooner than those 38ms.
● According to the amount of time the Echo pin was
HIGH, we can determine the distance the sound wave
traveled, thus the distance from the sensor to the
object.
● For that purpose we are using the following basic
formula for calculating distance:
● Distance = Speed x Time/2
Connections:
Code
const int trigPin = 3; void loop() {
digitalWrite(trigPin, LOW);
const int echoPin = 2; delayMicroseconds(2);
long duration; digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
int distance;
digitalWrite(trigPin, LOW);

void setup() { duration = pulseIn(echoPin, HIGH);


pinMode(trigPin, OUTPUT); distance = duration * 0.034 / 2;
pinMode(echoPin, INPUT); Serial.print(distance);
Serial.begin(9600); Serial.println(“cm”);
delay(500);
} }
01

TinkerCAD
Project 3
Working of sonar sensor
What we are working on

Arduino UNO Sonar Sensor Digital Pins


Code:

void loop()
int distance ; long duration;
{
digitalWrite(t1,LOW);
const int t1=13; //trigger
delayMicroseconds(2);
const int e1=12; // echo;
digitalWrite(t1,HIGH);
void setup(){
delayMicroseconds(2);
pinMode(t1,OUTPUT);
digitalWrite(t1,LOW);
pinMode(e1,INPUT);
duration=pulseIn(e1,HIGH);
Serial.begin(9600);
distance=0.034*duration/2;
}
Serial.print(distance);
Serial.println("cm");
}
Actuators:
● An actuator is a device that produces a motion by converting energy and
signals going into the system. The motion it produces can be either rotary or
linear. 
● Some common types of actuators that we will be discussing are:
1. Servo Motors

2. DC Geared Motors
Servo Motors:
● A servo motor is a type of motor that can rotate with great
precision. Normally this type of motor consists of a control
circuit that provides feedback on the current position of the
motor shaft, this feedback allows the servo motors to rotate
with great precision.

● If you want to rotate an object at some specific angles or


distance, then you use a servo motor. It is just made up of a
simple motor which runs through a servo mechanism.

● Servo motors have three wires: power, ground, and signal. The
power wire is typically red, and should be connected to the 5V
pin on the Arduino board. The ground wire is typically black or
brown and should be connected to a ground pin on the board. 
DC Geared Motor:
● A Direct Current (DC) motor is a rotating electrical device that
converts direct current, of electrical energy, into mechanical
energy.
● A coil inside the DC motor produces a magnetic field that creates
rotary motion as DC voltage is applied to its terminal.
● Inside the motor is an iron shaft, wrapped in a coil of wire.
● This shaft contains two fixed, North and South, magnets on both
sides which causes both a repulsive and attractive force, in turn,
producing torque. 
Working of DC Motor In a DC motor, an armature rotates
inside a magnetic field.

The basic working principle of a DC


motor is based on the fact that
whenever a current carrying
conductor is placed inside a magnetic
field, there will be mechanical force
experienced by that conductor.

All kinds of DC motors work under this


principle. Hence for constructing a DC
motor, it is essential to establish a
magnetic field. The magnetic field is
established by using a magnet.

The DC motor that we will be using is


known as Permanent Magnet DC
Motor.
How to change the direction and
speed of rotation of the dc motor?

● The small DC motors (which has 12V or below 12V) made up of permanent magnet i.e.
it contains a permanent magnetic field. If we want to change the direction of the shaft
we change the polarity only. Because it contains only armature winding only. 

● Another method is to use an H-bridge to control the direction of a DC motor. It is a


special circuit which allows motor rotation in both directions. From four terminals of an
H bridge, you can control the direction of a DC motor. 
● Increasing the voltage across terminals of the motor increases its speed of rotation so
we make use of pulse width modulation technique to change its speed i.e. changes the
voltage fed to the motors from 0 to full applied supply.
H-Bridge Control of Motors
• When we switch ON s1 and s4 and switch OFF s3 and s2 the
current flows through the motor from terminal A to B.

• When we switch ON s3 and s2 and switch OFF s1 and s4 the


current through the motor flows from terminal B to A.

• Reversing of the flow of current through the motor reverses the A B


direction of the rotation of motors.

• These switches are not like mechanical switches that we use


instead they are electronic switches which can be turned ON and
OFF via sending electrical signals.

• IC that we generally use as H-bridges are L293D , L298 etc.


Motor Driver Shield (L293D):
● We can’t connect motors directly to
microcontrollers or controller board such as
Arduino in order to control them since they
possibly need more current than a
microcontroller can drive so we need drivers.

● The driver is an interface circuit between the


motor and controlling unit to facilitate driving.

● L293D shield is a driver board based on L293


IC, which can drive 4 DC motors and 2 stepper
or Servo motors at the same time.

● Thus the motor driver shield can not only allow


us to power multiple motors but also due to the
H-bridge IC it can allow us to change the
direction of motors.
Pinouts:
How to Use Arduino L293D Motor Driver
Shield?
● While using this shield 6 analog Pins (which can be used as digital pins
too), pin 2 and pin 13 of Arduino are free.
● In the case of using Servo motor, pins 9, 10 are in use.
● In the case of using DC motor, pin11 for #1, pin3 for #2, pin5 for #3, pin6
for #4 and pins 4, 7, 8 and 12 for all of them are in use.
● In the case of using Stepper motor, pins 11 and 3 for #1, pins 5 and 6 for
#2 and pins 4, 7, 8 and 12 for all of them are in use.
● You can use free pins by wired connections.
Shield Programming
#include <AFMotor.h>
//The Library you need to control the motor:

AF_DCMotor motor(1, MOTOR12_64KHZ)


//Defining the DC motor you are using.

//The first argument stands for the number of the motors in the shield and the second one stands
for the motor speed control frequency.
The second argument can be MOTOR12_2KHZ, MOTOR12_8KHZ, MOTOR12_8KHZ, and
MOTOR12_8KHZ for motors number 1 and 2, and it can be MOTOR12_8KHZ, MOTOR12_8KHZ, and
MOTOR12_8KHZ for motors number 3 and 4.
And if it left unchecked, it will be 1KHZ by default.

motor.setSpeed(200);

//Defining the motor speed. It can be set from 0 to 255.


void loop()
{
motor.run(FORWARD);
delay(1000);
motor.run(BACKWARD);
delay(1000);
motor.run(RELEASE);
delay(1000);
}
//Function motor.run() specifies the motor’s motion status. The status can be FORWARD,
BACKWARD, and RELEASE. RELEASE is the same as the brake but it may take some time
until the motor’s full stop.
Codes for Polarity Check of DC
Motors
void loop(){
motor1.run(FORWARD);
#include <AFMotor.h> void setup() { delay(5000);
//setting the speed of motors
motor1.run(RELEASE);
delay(1000);
//defining motors
motor2.run(FORWARD);
motor1.setSpeed(200); delay(5000);
AF_DCMotor motor1(1, motor2.setSpeed(200); motor2.run(RELEASE);
MOTOR12_8KHZ); motor3.setSpeed(200); delay(1000);
AF_DCMotor motor2(2, motor4.setSpeed(200); motor3.run(FORWARD);
MOTOR12_8KHZ); //begin serial communication delay(5000);
AF_DCMotor motor3(3, Serial.begin(9600); motor3.run(RELEASE);
MOTOR12_8KHZ); delay(1000);
} motor4.run(FORWARD);
AF_DCMotor motor4(4,
delay(5000);
MOTOR12_8KHZ); motor4.run(RELEASE);
delay(1000);
}
01

Turning of
bot
Left turning of bot
● In an attempt to rotate left 90 degree, the rear wheels
spins in opposite direction which are connected to the
Motor Drive.

● But since the distance of the forward wheels A and C is too


high from the rear B and D , hence it cuts out the circular
pull generated by the back wheel which has a very less
diameter.

● Hence the front wheels A and C attempts to drag left. But


high traction on front wheels (AC) exerts an opposing force
making it more difficult for the robot to move left. Further
if the torque generated by motors is not enough then the
body would stay at rest making negligible turning.
In this design when the robot
takes a zero-radius 360 degree
turn (pivot turning), the front
wheel gives almost negligible
resistance to the overall circular
motion generated by the rear
wheels.
Code

void turnLeft() {
motor1.run(BACKWARD);
motor2.run(BACKWARD);
motor3.run(FORWARD);
motor4.run(FORWARD);
delay(1500);
}
Right turning of bot
Code

void turnRight() {
motor1.run(FORWARD);
motor2.run(FORWARD);
motor3.run(BACKWARD);
motor4.run(BACKWARD);
delay(1500);
}
01

Project 1

Obstacle Avoiding Bot


A picture is worth
a thousand words
How does it work?

The basic principle behind the working of ultrasonic sensor is to note down the
time taken by sensor to transmit ultrasonic beams and receiving the ultrasonic
beams after hitting the surface.

Then further the distance is calculated using the formula.


Distance= (Time x Speed of Sound in Air (343 m/s))/2
Circuit Diagram
CODE
01

Project 2

Human Following Bot


A picture is worth
a thousand words
How does it work?

This Arduino robot having a sensor that can detect any object near it and can
follow this object. if you come in front of the robot it will start following you.

This robot consists ultrasonic sensor and IR sensor which help to follow the
object.

Ultrasonic Sonar Sensor detects the distance of object.

IR sensor works on infrared light which can also detect the object near to it. so
there is two IR sensor one is at the left side of ultrasonic sensor and other is at
the right side of the ultrasonic sensor.
Circuit Diagram
CODE
Thank
You

You might also like