Robot Programming Using Arduino E
Robot Programming Using Arduino E
Arduino
Robot programming using
Arduino
1 Contents
2 Introduction
............................................................................................................................................. 4
3 Program
Guide........................................................................................................................................ 5
4 Trainee Guidelines
................................................................................................................................. 6
.................................................................................................................................. 12
6.4.1 Inputs..............................................................................................................................................
15
6.4.2 Outputs...........................................................................................................................................
15
....................................................................................29
7.5 Electric
buzzer..................................................................................................................................... 31
7.9 Quiz
......................................................................................................................................................... 42
Robot programming using Arduino
sensor........................................................51
a display......................................................................................................................... 64
......................................................................................................................................................... 67
3
8.9 Challenges
............................................................................................................................................ 68
2 Introduction
Praise be to Allah alone, and prayers and peace be upon those after
whom there is no prophet, Muhammad, and upon the machine and
all his companions. And after:
In this bag, we seek to deliver some scientific concepts that help the
trainee to understand the basic principles in the design and
programming of the robot, as the stages of designing the robot
depend on multiple sciences, for example, when building any robot, the
structure of the robot must be formed, and in order to design the
structure, it is necessary to deal with the principles of mechanical
design such as (determining dimensions, determining cutting weights,
determining the center of gravity, gears, pulleys, etc.), and in order for
this mechanical model to move, it must be Adding electronic
elements to it from sensors and motors and then we program them in
order to perform the required functions.
4
Robot programming using Arduino
3 Program Guide
Software Name: Robot Programming Using Arduino Microcontroller
• Computer.
• Internet
• ZOOM
• Register for a CAD Mask
account
• Register on Onshape
5
Robot programming using
Arduino
4 Trainee Guidelines
1- Commitment to attend
projects
6
Robot programming using
Arduino
Session time: 30
minutes Objectives:
- Register on
Tankrickad
- Download Arduino
IDA
- Recognize the
Tinkercad
Session
encountered
Requirements:
Laptop
Internet
Register on
Tankrickad
7
Robot programming using Arduino
1. Register on Tankrickad
4- When the file is finished downloading to the device, click on it and proceed
with the installation and please allow the driver installation process when
you receive a warning from the operating system.
9
Robot programming using
Arduino
- You can watch the video clip to learn how to install the program and how to
register on the CAD disguise site
https://youtu.be/2CbNabqbwyE
10
Robot programming using
Arduino
Session time: 45
minutes Objectives:
- Learn about the
concept of robot and
the sciences related
to robot building
- Know the basic
components of any
robot
- Identify the concept
of inputs and outputs
and differentiate
between them
- Identify the Arduino
controller
Session Requirements:
Laptop
Internet
Register on
Tankrickad
11
Robot programming using Arduino
Another definition:
Example:
- E-Portal
From the previous definition, can you cite examples of robots in our daily
lives?
.....................................................................................................................................................................................
......
...................................................................................................................................................................................
........
............................................................................................................................. .................................
12
Robot programming using Arduino
Our daily lives are hardly devoid of watching many examples of robots, and
here we will divide some of the types of robots based on applications
Industri
Android
al
Tutorial
13
Robot programming using Arduino
There are three basic related sciences related to robot construction and design:
Mechanics
Electronics & Electrical
Programming
ت
اﻻﻟﻜﺘﺮوﻧ ﯿ ﺎ
Where when building any robot you will need a team specialized in these
sciences, we need mechanics at the beginning of the design you need to design
the structure of the robot and calculate and distribute loads and also you may
need to build mechanical mechanisms to implement a specific project and then
comes the science of electronics and electricity and after the implementation and
selection of the appropriate design for the robot begins the stage of choosing the
appropriate sensors and motors for the implementation of the project and also the
design of electrical circuits and the selection of the appropriate power source and
then comes the programming stage where we program the robot Using sensors
and motors for the required important implementation.
14
Robot programming using Arduino
4. Robot components
Input
Output
Control
6.4.1 Input
6.4.2 Output
Outputs: It is any element that receives commands from the controller, such as
electric motors, where the outputs run out of movement or reaction commands
for the robot
6.4.3 Control
Example:
The human body, the human mind is in control of his body, so it is equivalent
to the controller (controller) and to interact with man and take his decisions,
there must be inputs to his mind so that he interprets what is around him, if we
take the relationship of the eye with the mind, we know that the eye sends
certain nerve signals to the brain, which interprets them and the mind takes the
decision on them, so the eye provides the mind with information, so we call it
inputs.
If we take an example of the opposite, which is the muscles of the forearm,
they do not send the mind any information, but they take information from the
mind in the form of commands and move, so we call them outputs, meaning that
the information comes out of the mind to them.
15
Robot programming using Arduino
It is an open source electronic board designed to develop many ideas and projects
related to self- control in an easy and simple way by using open source programs
Arduino C, which is available for free.
16
Robot programming using
Arduino
Session time: 5
hours Objectives:
Identification of
electronic
elements:
LED
Lighting
Buzzer
Electrop
horesis
Identify the
types of electric
motors and the
difference
between them
Learn how to
connect
electric motors
servo
servo
motor
DC
Motor
Stepper
step
motor
Programming:
Session
Output
Requirements:
Program
Laptopming
(LED,
Register on
Buzzer)
Tankrickad
Delay
Program
ming
comman
d
Finite
frequenc
y
function
Continuo
us
repetitio 17
n
function
Output
Robot programming using Arduino
1. LED element ?
The passage of electric current through the light-emitting diode raises atoms in
the semiconductors used in the manufacture of the valve, which produces a ray of
light
18
Robot programming using Arduino
1. Required
In this activity, we will connect the lighting directly with the Arduino positive
pole with 5V and the negative pole with without programming and then we will
run
7.1.3.2 Circuit
connection
7.1.3.3 Conclusion
What happened?
............................................................................................................................................................................
......
............................................................................................................................................................................
...............
......................................................................................................................................
.....................................................
- In order to connect the LED we need a resistor in order to lower the current
to the LED so that it does not burn out
19
Robot programming using Arduino
1. Required
Through the previous activity, the multimer was used to measure the current
and voltage value of the LED
7.1.4.2 Circuit
connection
7.1.4.3 Conclusion
current: .....................
20
Robot programming using Arduino
2. Electrical Resistance
21
Robot programming using Arduino
1. Required
Through the previous activity using Ohm's law and the millimeter, calculate
the appropriate resistance value for LED operation if you know that the
appropriate current value for LED is 20 mA
7.2.3.2 Circuit
connection
7.2.3.3 Conclusion
value: ................................
22
Robot programming using Arduino
3. Experiment board
This board consists of several sectors and the holes of these holes serve as
connection points where the ends of the various electronic parts can be installed
where they are connected respectively to the surrounding holes horizontally in the
two sectors on the edge of the board, while for the sectors in the middle, the holes
are connected respectively vertically.
23
Robot programming using Arduino
1. Required
We will program the lighting so that it lights up for a second and closes for a
second and repeats that continuously
7.3.3.2 Circuit
connection
24
Robot programming using
Arduino
7.3.3.3 Programming
7.3.3.4
Conclusion
This line is
responsible for
applying an
electrical voltage of
either 5 V (HIGH)
or 0 V (LOW) where
we write the port
number
This line is used to
tell the controller
how long you have
to wait before
executing the next
25
Robot programming using Arduino
1. Required
We will program the lighting so that it lights up for a second and closes for a
second and repeats it 3 times
2. Circuit connection
26
Robot programming using
Arduino
7.3.4.3 Programming
7.3.4.4
Conclusion
Here we used the iteration function to repeat the commands for the
required
27
Robot programming using Arduino
The passage of electric current through the light-emitting diode raises atoms in
the semiconductors used in the manufacture of the valve, which produces a ray of
light
28
Robot programming using Arduino
1. Required
We will do a project to control the RGB LED element and the color
control method
7.4.3.2 Circuit
connection
29
Robot programming using
Arduino
7.4.3.3 Programming
7.4.3.4
Conclusion
30
Robot programming using Arduino
5. Electric Buzzer
The electric buzzer has a positive and negative electrode The buzzer operates
at a voltage of 6-12 volts and carries a direct current of about 25 mA
31
Robot programming using Arduino
1. Required
2. Circuit connection
7.5.3.3
Programming
7.5.3.4
Conclusion
32
Robot programming using Arduino
Since the invention of the first electric motor, interest in the manufacture of
electric motors of all kinds began throughout history, and their use in abundance
in the field of technology and engineering, and electric motors (in English: electric
motors) depend in their work on the principle of electromagnetic induction in
converting electrical energy into kinetic energy managed to accomplish a job.
1. How it works
The movement of the electric motor is rotational
movement either clockwise or counterclockwise
Operates on 6V DC power
Its speed is 200 rpm
............................................................................................................................................................................
......
............................................................................................................................................................................
...............
33
Robot programming using Arduino
2. Servo motor
1. How it works
It is similar to a conventional electric motor in addition to the presence of
a resistance
and an electronic board that works to translate the
transmitted signal to determine the desired turning
angle.
Servo is used in many small and large industrial
applications. This engine can be used to power
remote- controlled toy cars, robots, airplanes, parts
of robots, production lines, and food industries
The servo motor contains 3 wires red expresses the
positive terminal, black expresses the negative
terminal, and
orange expresses the signal terminal
3. Stepper
Motor
34
Robot programming using Arduino
1. Required
35
Robot programming using
Arduino
7.6.4.1 Programming
36
Robot programming using
Arduino
7.6.4.2 Conclusion
37
Robot programming using Arduino
1. Digital signage
Arduino boards have 10-bit multi-channel digital ports, meaning that when a
voltage is read via the Arduino's analog-digital converter, the read voltage will be
stored as a value between 0 and 1023 . If we assume that the input voltage range
is between 0 and 5 volts, this means that when a voltage value of 5 volts is read
on the sewer of the analog-digital converter, a value of
1023 will be
saved.
38
Robot programming using
Arduino
2NC type, i.e. normally closed: It is always closed and when pressed it opens
and when the hand is raised, it turns again into closed
2. How it works
39
Robot programming using Arduino
1. Required
7.8.3.2 Circuit
connection
7.8.3.3
Programming
40
Robot programming using
Arduino
7.8.3.4 Conclusion
After we used the condition function to check the status of the button if it
is in a state of pressure (and expressed in programming with the word
HIGH) the lighting works and
41
Robot programming using Arduino
7.9 Quiz
3 We have a robotic arm for which we want to choose the best motor
suitable for the arm is
o DC MOTOR
o SERVO MOTOR
o STEPPER MOTOR
o SERVO MOTOR & STEPPER MOTOR
1 What do we mean by
o Output 5V value from port No. 2 this?
o Turn on the neutral lighting in port
number 2
o Switch control
o None of the above
42
Robot programming using Arduino
10. Challenges
Through what you learned in the activities, add 2 LED and write a program to
turn on the lighting No. 1 and close the light No. 2 for a second and then work the
opposite Light No. 2 and close the light No. 1 for a second (note Use the
experiment board to connect the electrical circuit)
From what you learned in the activities make a project that simulates the work
of the traffic light in addition to the pedestrian signal
Through what you learned in the activities in this section, make a program to
control the speed of the servo controller to move from an angle of 0 to 180 and
then return from 180 to 0
43
Robot programming using
Arduino
minutes Objectives:
44
Robot programming using Arduino
Digital Signage
1. Analog
45
Robot programming using
Arduino
46
Robot programming using Arduino
The resistance that we will explain is the variable resistance with an arm, the
value of which changes with the angle of the arm in it
8.2.2 How it
works
47
Robot programming using Arduino
1. Required
We will use variable resistance to control the lighting. We will make the light
light light up and off quickly. It depends on the resistance value.
2. Circuit connection
8.2.3.3
Programming
48
Robot programming using
Arduino
8.2.3.4 Conclusion
49
Robot programming using Arduino
50
Robot programming using
Arduino
1. Required
We will make a project to control the lighting through the light sensor in the
event of darkness the lighting works and in the case of lighting the light goes out
8.3.3.2 Circuit
connection
51
Robot programming using
Arduino
8.3.3.3
Programming
8.3.3.4
Conclusion
After we used the condition function to check the value of the lighting if it
is dark (and we express it in programming that it is less than 800) the
lighting works and if in the
52
Robot programming using Arduino
4. Ultrasonic
•It is a sensor through which we can calculate the distance between the robot
and any obstacle in front of it
•The distance sensor is used in our daily lives, and one of the most famous
examples is its use in the car, through which the driver is alerted to the presence
of an obstacle behind him if he moves backwards
53
Robot programming using Arduino
1. Required
We will do a project if the reading of the distance sensor is less than 20 the
lighting works and if it is bigger the light turns off
8.4.3.2 Circuit
connection
54
Robot programming using
Arduino
8.4.3.3 Programming
55
Robot programming using
Arduino
8.4.3.4 Conclusion
After we used the condition function to make sure of the value of the
distance if there is an obstacle in front of it (and we express it in
programming that it is less than 20 lighting
56
Robot programming using Arduino
1. What is PWM?
1. Required
We will control the intensity of the lighting using PWM so that we reduce the
lighting or increase the lighting
8.5.2.2 Circuit
connection
57
Robot programming using
Arduino
8.5.2.3 Programming
8.6 Second session: Sending commands and data from Arduino to the
computer
Most Arduino boards provide the feature of sending and receiving data directly
with the computer via the USB port , and this feature can be exploited in the
implementation of some wonderful projects
58
Robot programming using Arduino
We had used Arduino to read some sensors such as light and heat and show
the result on the lighting to illustrate this reading Now we will use the serial
interface feature to send the results of reading the sensors to the computer,
where the results can be read in numbers and perform calculations
59
Robot programming using Arduino
1. Required
In this activity, we will read the value of the rays falling on the sensor and
lighting and display them on the screen
8.6.1.2 Circuit
connection
60
Robot programming using
Arduino
8.6.1.3 Programming
8.6.1.4
Conclusion
61
Robot programming using Arduino
1. Required
62
Robot programming using
Arduino
8.6.2.3 Programming
8.6.2.4
Conclusion
63
Robot programming using Arduino
LCD screens 16 X216 X2 are mostly based on multi-segment LEDs. There are
different types of displays available in the market in different combinations such as
8×2, 8×1, 16×10×2, however, 16×2 LCD screen is widely used in hardware, DIY
circuits and electronic projects due to lower cost.
64
Robot programming using Arduino
1. Required
We will do a project to control the LCD screen and print the word
Hello World
8.7.3.2 Circuit connection
method
65
Robot programming using
Arduino
8.7.3.3 Programming
8.7.3.4
Conclusion
The location of the column and row from which the printing
will start has been determined and the sentence to be
printed has been selected
66
Robot programming using Arduino
8. Quiz
67
Robot programming using
Arduino
9. Challenges
From what you learned in the activities, make a project that shows the reading
of the light sensor on the LCD screen (16,2)
Through what you learned in activities, make a project that simulates the work
of warning in the car about reversing and approaching a car or an obstacle
Through what you learned in the activities, make a project using the distance
sensor and the RGB LED element in the neighborhood If the distance is less than
80, it lights up red, if it is less than 60, it lights up green, and if it is less than 40,
it lights up blue.
68
Robot programming using Arduino
69