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

Module 4 Experiment File

The document outlines various robotics experiments, including the operation of an auto On/Off light switch, implementation of a battery charger indicator, and a motorized robotic arm, among others. Each experiment includes a list of required components, theoretical background, circuit diagrams, and programming code for implementation. The document serves as a practical guide for students in a robotics module at Maharishi University of Information Technology, detailing hands-on projects to enhance learning in robotics and electronics.

Uploaded by

dk3012098
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Module 4 Experiment File

The document outlines various robotics experiments, including the operation of an auto On/Off light switch, implementation of a battery charger indicator, and a motorized robotic arm, among others. Each experiment includes a list of required components, theoretical background, circuit diagrams, and programming code for implementation. The document serves as a practical guide for students in a robotics module at Maharishi University of Information Technology, detailing hands-on projects to enhance learning in robotics and electronics.

Uploaded by

dk3012098
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 31

Page No.

Sign
S.NO EXPERIMENT NAME
1. Operation of auto On Off Light Switch

2. Implementation of a battery charger


indicator
3. Implementation of a Motorized Robotic
Arm
4. Design and implantation of 9 and 12 volt
linear power supply
5. To find edge in an image and convert
video to frames
6. Making a Wheg climbing robot

7. Implementation of rope climbing robot

8. Design and implementation of a Solar


Hexa Robot using Double Shaft DC motor
9. Design and implementation of a Four
wheel wireless robot
10. Implementation of a Line follower Robot

Robotics Module-4 (PRB-651)

L T P
LIST OF PRACTICALS
0 0 2
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Experiment No. 1: Operation of auto On Off Light Switch


Requirement:

1. Arduino Board
2. Resistance 220 ohm
3. Wire
4. LED

Theory : There are 14 I/O (input/output) pins in your Arduino uno board. These pins
are numbered from 0 to 13. They can be configured as either input or output. We have
used pin number 12and 13 as output. We have configured them as output inside
the setup() function. Inside the loop(), we have written commands to blink LED’s
alternatively. When LED1 is ON, LED2 will be OFF. After 1 second LED1 will turn
OFF and at the same time LED2 will turn ON. Wait another 1 second and you will
see LED2 turning OFF and LED1 turning ON. This cycle repeats.

Program :

const int LED1 = 12;

const int LED2 = 13;

void setup()

pinMode(LED1,OUTPUT);
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

pinMode(LED2,OUTPUT);

void loop()

digitalWrite(LED1,HIGH);

delay(1000);

digitalWrite(LED1,LOW);

digitalWrite(LED2,HIGH);

delay(1000);

digitalWrite(LED2,LOW);

}
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Circuit Diagram :
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Experiment No. 2: Implementation of a battery charger indicator


Requirement:

 Arduino Uno or compatible.

 Male pins (we need four pins only).

 Two same value resistors (here I use 12K).

 Two pin female connector. Photo shows three pin because that is what I have. Here I use

power switch connector to motherboard instead :)

 A battery (I use 7.4V lipo battery).

 16x2 LCD with I2C adapter. Later on you can switch this to a red LED to indicate low

battery at your desired voltage level.

 A mini breadboard is optional for testing phase

Theory : When we are using a battery powered Arduino such as RC robots or Temperature
Controller, we might want to check the battery voltage if it needs to be charged or replaced. It
happens to me with my RC Panzer. Sometimes when my kids are about to run it, it moves very
slow, low battery. Then they are disappointed and need to wait for charging time. I would rather
had noticed this battery condition on the last run but I am too lazy to check it with multimeter.
Arduino Uno needs 5 volts power to run, then we need at least 7.4 volts to 9 volts battery. Since
Arduino pins support only 5 volts maximum, then we need a Voltage Divider. It is simply made
up of two resistors in series. To divide the voltage to half, we need two resistor with the same
value. 1K to 20K resistors can be used, but the larger the resistance the lower the power
consumed by the Voltage Divider.
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Circuit diagram :

Program :

/ Print battery voltage

// to 16x2 LCD via I2C

// with Voltage Divider (2x 10K resistor)

/*

Resistors are aligned in series.

One end goes to Battery - and also to Arduino GND

The other goes to Battery + and also to Arduino Vin


MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

The middle (connection between two resistors) goes to Arduino A0

*/

#include <Wire.h>

#include <LCD.h>

#include <LiquidCrystal_I2C.h>

#define I2C_ADDR 0x27 //Add your address here. Find it from I2C Scanner

#define BACKLIGHT_PIN 3

#define En_pin 2

#define Rw_pin 1

#define Rs_pin 0

#define D4_pin 4

#define D5_pin 5

#define D6_pin 6

#define D7_pin 7

#define led_pin 13

LiquidCrystal_I2C
lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Experiment No. 3: Implementation of a Motorized Robotic Arm

Requirement:

 Arduino Uno
 1000uF Capacitor (4 pieces)
 100nF Capacitor (4 pieces)
 Servo Motor (SG 90- four pieces)
 10K pot- Variable Resistor (4 pieces)
 Power Supply (5v- preferably two)

Theory : This Arduino Robotic Arm can be controlled by four Potentiometer attached to it,
each potentiometer is used to control each servo. You can move these servos by rotating the pots
to pick some object, with some practice you can easily pick and move the object from one place to
another. We have used low torque servos here but you can use more powerful servos to pick heavy
object.

Servo Motor:
First we talk a bit about Servo Motors. Servo Motors are excessively used when there is a need for
accurate shaft movement or position. These are not proposed for high speed applications. Servo
motors are proposed for low speed, medium torque and accurate position application. So these
motors are best for designing robotic arm.
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Servo motors are available at different shapes and sizes. We are going to use small servo motors,
here we use four SG90 servos. A servo motor will have mainly there wires, one is for positive
voltage another is for ground and last one is for position setting. The RED wire is connected to
power, Black wire is connected to ground and YELLOW wire is connected to signal.

Circuit Diagram:
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Program :
#include <Servo.h>
Servo servo0;
Servo servo1;
Servo servo2;
Servo servo3;
int sensorvalue0;
int sensorvalue1;
int sensorvalue2;
int sensorvalue3;
void setup()
{
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

pinMode(A0,INPUT);
pinMode(3,OUTPUT);
servo0.attach(3);

pinMode(A1,INPUT);
pinMode(5,OUTPUT);
servo1.attach(5);

pinMode(A2,INPUT);
pinMode(6,OUTPUT);
servo2.attach(6);

pinMode(A3,INPUT);
pinMode(9,OUTPUT);
servo3.attach(9);
}
void loop()
{
sensorvalue0 = analogRead(A0);
sensorvalue0 = map(sensorvalue0, 0, 1023, 0, 180);
servo0.write(sensorvalue0);
sensorvalue1 = analogRead(A1);
sensorvalue1 = map(sensorvalue1, 0, 1023, 0, 180);
servo1.write(sensorvalue1);
sensorvalue2 = analogRead(A2);
sensorvalue2 = map(sensorvalue2, 0, 1023, 0, 180);
servo2.write(sensorvalue2);
sensorvalue3 = analogRead(A3);
sensorvalue3 = map(sensorvalue3, 0, 1023, 0, 180);
servo3.write(sensorvalue3);
}

Experiment No. 4: Design and implantation of 9 and 12 volt linear power supply.
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Requirement:

1. Voltage regulator
2. Diode & capacitor
3. Transformer
4. Wire

Theory :

Step Down the Voltage Level : The step-down converters are used for converting the high voltage
into low voltage. The converter with output voltage less than the input voltage is called as a step-
down converter, and the converter with output voltage greater than the input voltage is called as
step-up converter. There are step-up and step-down transformers which are used to step up or step
down the voltage levels. 230V AC is converted into 12V AC using a step-down transformer. 12V
output of stepdown transformer is an RMS value and its peak value is given by the product of
square root of two with RMS value, which is approximately 17V.
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Convert AC to DC

230V AC power is converted into 12V AC (12V RMS value wherein the peak value is around
17V), for this purpose, 17V AC power must be primarily converted into DC power. But first and
foremost, we must know how to convert AC to DC? AC power can be converted into DC using
one of the power electronic converters called as Rectifier. There are different types of rectifiers,
such as half-wave rectifier, full-wave rectifier and bridge rectifier. Due to the advantages of the
bridge rectifier over the half and full wave rectifier, the bridge rectifier is frequently used for
converting AC to DC.

Smoothing the Ripples using Filter

15V DC can be regulated into 12 V DC using a step-down converter, but before this, it is
required to obtain pure DC power. The output of the diode bridge is a DC consisting of ripples
also called as pulsating DC. This pulsating DC can be filtered using an inductor filter or a
capacitor filter or a resistor-capacitor-coupled filter for removing the ripples. Consider a
capacitor filter which is frequently used in most cases for smoothing.
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Circuit diagram :
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Experiment No. 5: To find edge in an image and convert video to frames


Keywords : Content analysis, Video content extraction, Image processing, Temporal segmentation,
Scene segmentation.

Theory :
Introduction : The increase in the diversity and availability of electronic information led
to additional processing requirements, in order to retrieve relevant and useful data: the
accessibility problem. This problem is even more relevant for audiovisual information,
where huge amounts of data have to be searched, indexed and processed. Most of the
solutions for this type of problems point towards a common need: to extract relevant
information features for a given content domain. A process which underlies two difficult
tasks: deciding what is relevant and extracting it. In fact, while content extraction
techniques are reasonably developed for text, video data still is essentially opaque.
Despite its obvious advantages as a communication medium, the lack of suitable
processing and communication supporting platforms has delayed its introduction in a
generalized way. This situation is changing and new video based applications are being
developed. In our research group, we are currently developing tools for indexing video
archives for later reuse, a system for content analysis of TV news [1], and hypervideo
systems where hyperlinks are established based on content identification in different
video streams. These applications greatly rely on efficient computational support,
combining powerful image analysis and processing tools. The developed toolkit
prototype offers, in its processing components, all the functionality of these algorithms,
hiding the implementation details and providing an uniform access methods to the
different signal processing algorithms. The advantages offered by the use of libraries of
specialised components have been largely debated [1, 4]: normalization, reutilization,
flexibility, data abstraction and encapsulation, etc. The produced prototype results from
the application of these principles to video content extraction, making available several
abstractions commonly used by the related applications: a set of tools which extract
relevant features of video data and can be reused by different applications. Next sections
present a description of some of these tools and algorithms.

Toolkit overview :
videoCEL is basically a library for video content extraction. Its components extract
relevant features of video data and can be reused by different applications. The object
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

model includes components for video data modelling and tools for processing and
extracting video content, but currently the video processing is restricted to images.

At the data modelling level, the more significant concepts are the following:
• Images, for representing the frame data, a numerical matrix whose values can be colors, color
map entries, etc.;
• ColorMaps, which map entries into a color space, allowing an additional indexation level;
• ImageDisplayConvertes and ImageIOHandlers, that convert images in the specific formats of
the platforms and vice-versa.

Edges and Edge detection techniques


In simple terms, edges are those places in a picture where the pixel intensity changes suddenly.
They are just some connected pixels that lie on the boundary between two regions with different
pixel intensities.
For our eyes, it is so easy to identify edges. But how can we make the computer detect edges in a
picture? Let’s understand.
In principle, we first calculate the first derivative of the image. Then we look for those points
which are peaks, and have values larger than their neighboring points Set of those connected
‘extrema’ points is an edge.
But any image does contain at least some noise. We have to first of all filter out any noise.
OpenCV offers a variety of filters for denoising.
We choose an appropriate filter depending upon the nature of the noise. We will make the use of
Gaussian blur function as an example in our Edge detection with OpenCV example.
OpenCV has a lot of inbuilt functions to detect edges, corners, circles, etc. in an image. You can
see some of them here: OpenCV feature detection. Now let us see how to perform Edge
detection in OpenCV. I will use the Python binding of OpenCV. You can follow along or
download the code from the link available at the end of the post.

import cv2
import numpy as np

img = cv2.imread('image.jpg',cv2.IMREAD_GRAYSCALE)
rows,cols = img.shape

sobel_horizontal = cv2.Sobel(img,cv2.CV_64F,1,0,ksize = 5)
sobel_vertical = cv2.Sobel(img,cv2.CV_64F,0,1,ksize=5)
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

cv2.imshow('Original',img)
cv2.imshow('Sobel Horizontal Filter',sobel_horizontal)
cv2.imshow('Sobel Vertical Filter',sobel_vertical)

cv2.waitKey(0)

See the results.


Here is the original image converted to grayscale on line number 4.

Original image

And here are the results for each filter.


MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Sobel filter results

As you can see, the result is not much impressive. The filters are calculating the
gradient change from either horizontal or vertical side. Also, noise is still causing
problems.

Experiment No. 6: Making a Wheg climbing robot


Requirement:

1. BO DC motor Double shaft


2. 3.7 Volt/240 mAH Li-Po Battery
3. PVC pipe 7 mm Diameter
4. At 5 mm from edge make a 2 mm diameter hole on BO motor

Theory : A robot that can vertically and self-governing move vertically along an
unpleasant surface, for example, stucco, offers extensive military and citizen points of
interest. Situated high on a building, the robot, serving as a perception stage, could give
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

significant military insights and also support in hunt and salvage operations. Such a robot
could additionally be utilized for unmanned breadths of unfriendly territories and serve as
a stage for convey guns and explosives. As far as non military person utilize, the robot
could be utilized within development to indicator back the advancement or state of
different operations being executed at hazardously abnormal amounts. Then again, there
are still issues for the humanoid robots to acknowledge true human-like strolling. As of
now, a large portion of the biped robots stroll with knee curved and waist drop down
moving with consistent waist tallness. This firm sort of customary strolling example is
ended up being more vitality devouring.

Following features of the robot comes under the requirements of the robot:

Simple Design
Portable in use. Light weight.
Automatic operation while working

Circuit diagram :
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Experiment No. 7: Implementation of rope climbing robot

Requirement:

1. Servo motor
2. Two way Switch
3. 3.7v Li-ion Battery
4. Hot Glue Gun
5. Soldering Iron

Theory :
Design of Backbone A mechanical model, formulated based on the observation of the sloth,
would essentially be a set of four bar mechanisms (see Ghosh and Mallik [4]). The entire body of
the bear and the grippers can be modeled as four bar mechanisms, performing actions similar to
that of the bear. Beginning with the backbone, it can be modeled if it were to be thought of as
two links hinged at the center. This is of course an approximation, since the bear’s back is more
flexible than this. However, this approximation is valid and serves our purpose at the moment. In
future, if needed, more redundancies may be added.

The links would have to rotate about the central joint in order to mimic the sloth. Not only that,
we would need to control this rotation if we are to control the climbing. For this purpose, a
power source has to be placed at the joint. A motor could be placed between the two links. In the
actual fabrication of our robot, we chose to place a worm and worm-wheel mechanism at the
center. The reasons were obvious; this is a self locking mechanism, it ensures that the link
doesn’t fall back into place once the motor has been deactivated. Besides this obvious advantage,
it can provide the appropriate speed reduction in order to make the motion of the sloth slow and
steady. Choosing the appropriate power transmission mechanism at the centre is crucial as a lot
of torque acts at this point, especially if the robot is to carry huge payloads.
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Circuit diagram :
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Experiment No. 8: Design and implementation of a Solar Hexa Robot using Double
Shaft DC motor

Requirements
1. DC motor
2. capacitor
3. resistor

Theory :
Robotics has achieved its greatest success to date in the world of industrial
manufacturing. Robot arms, or manipulators, comprise a 2 billion dollar industry. Bolted
at its shoulder to a specific position in the assembly line, the robot arm can move with
great speed and accuracy to perform repetitive tasks such as spot welding and painting
(figure 1.1). In the electronics industry, manipulators place surface-mounted components
with superhuman precision, making the portable telephone and laptop computer possible.

A mobile robot needs locomotion mechanisms that enable it to move unbounded


throughout its environment. But there are a large variety of possible ways to move, and
so the selection of a robot’s approach to locomotion is an important aspect of mobile
robot design. In the laboratory, there are research robots that can walk, jump, run, slide,
skate, swim, fly, and, of course, roll. Most of these locomotion mechanisms have been
inspired by their biological counterparts
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Circuit diagram :
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Experiment No. 9: Design and implementation of a Four wheel wireless robot


Component List :

1. DC motor
2. Motor driver

3. Battery

4. Transmitter & receiver module

Theory : Setup the hardware connections with the Arduino and the servo motors. The
continuous rotation servo motors are those kinds of servo motors that cannot be
controlled or set at a particular angle, unlike normal servos. Servos have three wires
coming from them: Red- Power, Black -Ground, White/Yellow- PWM /PPM Signal. The
left servo motor (white/yellow wire) is hooked up to Arduino digital pin 9 and the right
servo motor (white/yellow wire) Arduino digital pin 10. The black wires of both the
motors are connected to Arduino GND and the Red wires to the positive terminal of the
battery holder. Connect the RX pin of the Bluetooth module to TX pin (digital pin 1) on
the Arduino and the TX pin on the module to the RX pin on the Arduino (pin 0). Connect
Vcc and Gnd of the module to the Arduino. Connect the negative terminal of the battery
holder to Arduino GND. The connections will look like this:
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Program : The code uses the Arduino servo library and simple commands. Servo is
controlled using commands like: servo.write(90) -> stops the servo, servo.write(180) -
>rotates servo clockwise and servo.write(0)-> rotates servo anti-clockwise. Screenshot of
the Arduino code:
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Experiment No. 10: Implementation of a Line follower Robot

Requirement:

(1) DC motor
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

(2) Motor driver

(3) Battery

(4) IR sensor

Theory : The workings of a line follower robot are pretty straightforward. These robots have
the capability to detect a black or dark line on a lighter surface depending on the contrast. They
estimate whether the line underneath them is shifting toward their left or right as they move over
them. Based on that estimation, they give respective signals to the motors to turn left or right so
as to maintain a steady center with respect to the line.
These robots usually use an array of IR (infrared) sensors in order to calculate the reflectance of
the surface beneath them. The basic criteria is that the black line has a lesser reflectance value
(black absorbs light) than the lighter surface around it. This low value of reflectance is the
parameter used to detect the position of the line by the robot. The higher value of reflectance will
be the surface around the line. So in this linear array of IR sensors, if the leftmost or rightmost IR
sensor presents the low value for reflectance, then the black line is toward the left or right of the
robot correspondingly. The controller then compensates for this by signaling the motor to go in
the opposite direction of the line.

Line Follower Block Diagram


MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

The IR sensor array consists of individual IR LEDs and IR photodiodes. The IR light emitted by
the LED strikes the surface and is reflected back to the IR photodiode. The photodiode then
gives an output voltage proportional to the reflectance of the surface (high value for a light
surface and low for a black or dark surface).

Connecting the Components Together for the Line Follower


Set up the hardware connections with the Arduino and the servo motors. The continuous rotation
servo motors are those types of servo motors that cannot be controlled or set at a particular angle,
unlike normal servos. Servos have three wires coming from them: Red=Power, Black=Ground,
White/Yellow=PWM/PPM Signal. The left servo motor (white/yellow wire) is hooked up to
Arduino digital pin 9 and the right servo motor (white/yellow wire) to Arduino digital pin 10.
The black wires of both the motors are connected to Arduino GND and the red wires to the
positive terminal of the battery holder.
MAHARISHI UNIVERSITY OF INFORMATION TECHNOLOGY
Lucknow Campus
ROBOTICS MODULE-4 (PRB-651)

Arduino Connections for Line Followe

You might also like