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

Robotics

This document provides an overview of robotics, including definitions, classifications, and applications. It defines a robot as a machine that can perform tasks automatically or semi-automatically by mimicking human actions. Robotics combines mechanical, electrical, and software engineering to design and build robots. Robots can be classified based on their mobility, operation/control, and uses. The core components of a robot include sensors, processors, actuators and a power source. Robots are designed to sense their environment, process input, plan actions, and perform tasks through movement. Artificial intelligence is used to endow robots with cognitive abilities such as learning, reasoning, and self-correction.
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)
83 views

Robotics

This document provides an overview of robotics, including definitions, classifications, and applications. It defines a robot as a machine that can perform tasks automatically or semi-automatically by mimicking human actions. Robotics combines mechanical, electrical, and software engineering to design and build robots. Robots can be classified based on their mobility, operation/control, and uses. The core components of a robot include sensors, processors, actuators and a power source. Robots are designed to sense their environment, process input, plan actions, and perform tasks through movement. Artificial intelligence is used to endow robots with cognitive abilities such as learning, reasoning, and self-correction.
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/ 176

Robotics 1

• ICT 215
Introduction to Robotics
• Basic Electronics
• Robot Motion
• Control Systems
• IoT
• Simulations
• Programming
What Is Robotics ?

• Robotics is a branch of artificial intelligence and engineering which is used for


designing and manufacturing of robots.

• Robots are the programmed machines which can perform a series of actions
automatically or semi-automatically.
Robotics
What is a Robot?
• Robot is a Machine that mimics human action to do useful work however the
Robot Institute of America defines Robot as a reprogrammable,
multifunctional manipulator designed to move material, parts, tools or
specialized devices through variable programmed motions for the
performance of a variety of tasks

• Robotics is a combination of 3 Engineering fields

• Mechanical Engineering
• Software Engineering
• Electronics Engineering
Robotics
• Mechanical Engineering Concepts are used to build the physical part of
the Robot
• Electronic Engineering Concepts are used to build the Actuators, Sensors,
Power Systems and the Processing System

• Software Engineering Concepts are used to develop the functionality of


the Robot (Software and Firmware)
ROILA
• The Robot Interaction Language (ROILA) is the first spoken language
created specifically for talking to robots.

• It is constructed to make it easy for humans to learn, but also easy


for the robots to understand. ROILA is optimized for the robots’
automatic speech recognition and understanding
Laws of Robotics
• Isaac Asimov proposed three “Laws of Robotics” and later added the
“zeroth law”
• Law 0: A robot may not injure humanity or through inaction, allow
humanity to come to harm

• Law 1: A robot may not injure a human being or through inaction, allow a
human being to come to harm, unless this would violate a higher order law

• Law 2: A robot must obey orders given to it by human beings, except


where such orders would conflict with a higher order law

• Law 3: A robot must protect its own existence as long as such protection
does not conflict with a higher order law
History of Robotics: I
The first industrial robot: UNIMATE
• 1954: The first programmable robot was designed by George Devol, who
coined the term Universal Automation.
• He later shortened this to Unimation, which becomes the name of the first
robot company (1962).

• UNIMATE originally
automated the manufacture
of TV picture tubes
The Pre-History of Robots
• People have been fascinated withDa Vinci's Mechanical Knight "artificial beings" for thousands of years.

• The ancient Hebrews wrote about a person made out of dirt and clay called a golem. The golem was created to help with menial labor.

• The ancient Greek god Hephaestus was believed to build himself mechanical assistants out of gold.

• Around 400 B.C.E., the Greek mathematician Archytas of Tarentum built a mechanical bird to try and better understand how birds fly.

• Around 1495, Leonardo DaVinci publishes designs for a mechanical knight. Over the next 400 years, several toy automata are built, largely for the
entertainment of royalty.

• The word "robot" is first used in 1921 by Czech playwrite Karel Capek in his play R.U.R. (Rossum's Universal Robots).

The play involves a factory that builds artificial people to be servants for humans.

• In 1926, Metropolis becomes the first movie to portray a humanoid robot on screen.

• In 1927, Westinghouse builds the Televox robot


Building Blocks
Robotics Design
Very much like most human Inventions, Robots are heavily Inspired by nature, take robot arms
for example, they are closely based on the human arm design, think about other robots and
their inspiration from nature
Applications of Robotics Technology
• Helping to fight Forest Fire
• Working with Humans in manufacturing Plants (Cobots)
• Companionship and service to the elderly
• Surgical Assistants
• Food order Delivery
• Autonomous house hold robots that carry out tasks like vacuuming and
mowing the grass
• Search and rescue Missions after natural disasters
• Land Mine detectors
Classification of Robots
Fixed Robots
• Robots with Fixed Base i.e assembly line Robots
• Further categorized by their movement (Mobile)
• Drones fly in air
• Robots designed to move on the ground
• Underwater Robots
Ground Robots can be of 2 types
• Wheeled
• Legged
Operation / control Categorization Method
• Manual Robots-A manual robot is a type of manipulation robotic system
that requires complete human intervention for its operation.
• This manual type of robotic system requires a particular kind of human
control, or intervention to function e.g Toy cars operated remotely
• Semi Automatic Robots – Camera Drone that can be controlled manually but
keeps its balance automatically (Inertia Management Unit)
An autonomous robot is a robot that acts without recourse
to human control

• Elmer and Elsie were the first two electronic robots that
were built in history around the late 1940s by
neurobiologist and cybernetician William Grey Walter. they
were programmed to "think" the way biological brains do
and meant to have free will.

Other examples are


– Robotic Vacuum Cleaners, autonomous cars etc
Fixed Base

Types of Robots: I
Manipulator
Mobile

Types of Robots: II
Legged Robot Wheeled Robot
Autonomous

Types of Robots: III


Autonomous Underwater Vehicle Unmanned Aerial Vehicle
Robot Uses: I

Jobs that are dangerous


for humans

Decontaminating Robot
Cleaning the main circulating pump
housing in the nuclear power plant
Robot Uses: II

Repetitive jobs that are


boring, stressful, or labor-
intensive for humans

Welding Robot
Robot Uses: III

Menial tasks that human


don ’t want to do

The SCRUBMATE Robot


Sense, Think Act Model (Behavior of Robots)
• Robot behavior are modeled closely to human behavior

• Take for instance if you want to pick a bottle from the table

• First you see the bottle with your eyes then your brain gets signals,
plan the action and send signals to muscles on your arm to actuate
your hand

• Robots will see the bottle through a camera, the main controller
gets a signal, process and plan the action and sends back action to
the grippers
• Sensors onboard the robots sense the environment,
processing unit or the microcontroller on the robot “thinks”
of the action that has to be taken reacting to the sensory
input then it sends commands to the actuators of the robot
( wheels, legs or movement mechanism)

• The actuator gives the reaction or the action corresponding


to the sensed input
• There are several characteristics of a robot.

• First characteristic is sensing, a robot should have one or more


sensors to sense the world depending on the application, for
example, an obstacle avoiding robot.

It should have one or more obstacle detection sensors like


ultrasonic sensors, laser distance, or even radar.
Movement

• Robots should have a method to move if it's a mobile robot.

• It could be wheels or legs


• It could be propellers if it’s a drone

• stationary robots, such as the ones you see in factories.

• They also move that actuator arms.


• Energy is another characteristic of the robot. A robot
should have a means or a method to supply the
energy to power its sensors, processors and actuators.

• Most robots use batteries as the source of power.

• Why can stationed robots can be plugged into the


main supply?
Some use alternative energy sources (solar, nuclear reactors, inverters)
coupled with batteries to supply energy like the Mars exploration rover
that can operate very far from human habitats.
• Some robots even use engines as well to power themselves.

• Do you know that the Curiosity rover and the Perseverance rover, which was
sent by Nasa to Mars, uses nuclear radiation as their power source?

• Curiosity, was launched from Earth on November 26, 2011.

• As of November 2, 2023, Curiosity has been on the planet Mars for 3996 sols
(4105 total days; 11 years, 88 days) since landing on August 6, 2012

• Perseverance successfully landed on Mars February 18, 2021, at 20:55 UTC.


• As of 7 November 2023, Perseverance has been active on Mars for 965 sols
• (992 Earth days, or 2 years, 8 months and 20 days) since its landing.
Intelligence

• Thinking more intelligently is a very important characteristic of a robot.

• This characteristic depends on the program the developer logs on to the


robot.

• It could be a simple logic code or an advanced A.I. or machine learning


program that can learn. And adapt its behaviour
What characteristics of a robot makes it smart?

• The ability to make a decision on its own without help from a person is what
makes a robot smart.

• The more decisions a robot can make on its own, the smarter it is.

• Which 3 abilities make a robot artificially intelligent?

• AI Programming Cognitive Skills: Learning, Reasoning and Self-Correction.


Artificial Intelligence emphasizes three cognitive skills of learning, reasoning, and
self-correction, skills that the human brain possess to one degree or another
Artificial Intelligence
• Artificial Intelligence is a method of making a computer, a
computer-controlled robot, or a software think intelligently
like the human mind.

• AI is accomplished by studying the patterns of the human


brain and by analysing the cognitive process.

• The outcome of these studies develops intelligent software


and systems.
Weak AI vs. Strong AI
• When discussing artificial intelligence (AI), it is common to
distinguish between two broad categories: weak AI and strong AI

Weak AI (Narrow AI)


• Weak AI refers to AI systems that are designed to perform specific
tasks and are limited to those tasks only.

• These AI systems excel at their designated functions but lack general


intelligence. Examples of weak AI include voice assistants like Siri or
Alexa, recommendation algorithms, and image recognition systems.
Weak AI operates within predefined boundaries and cannot
generalize beyond their specialized domain.
Strong AI (General AI)
• Strong AI, also known as general AI, refers to AI systems
that possess human-level intelligence or even surpass
human intelligence across a wide range of tasks.

• Strong AI would be capable of understanding, reasoning,


learning, and applying knowledge to solve complex
problems in a manner similar to human cognition.
However, the development of strong AI is still largely
theoretical and has not been achieved to date.
Types of Artificial Intelligence

• 1. Purely Reactive
• These machines do not have any memory or data to work with,
specializing in just one field of work. For example, in a chess game,
the machine observes the moves and makes the best possible
decision to win.

• 2. Limited Memory
• These machines collect previous data and continue adding it to
their memory. They have enough memory or experience to make
proper decisions, but memory is minimal. For example, this
machine can suggest a restaurant based on the location data that
has been gathered.
• 3. Theory of Mind
• This kind of AI can understand thoughts and emotions, as
well as interact socially.

• 4. Self-Aware
• Self-aware machines are the future generation of these
new technologies. They will be intelligent, sentient, and
conscious.
Sensors

A sensor is a component that can change its electrical properties


based on a non-electric physical property change.

As an example, we can take a temperature sensor, which changes its


resistance value relative to the surrounding temperature.

Our smartphone is basically a large collection of sensors, everything


from sensing touch to sensing acceleration and even sensing
surrounding objects using its camera.
Electrical properties of engineering materials?
• Resistivity, Electrical conductivity, temperature coefficient
of resistance, (defines the change in resistance as a function
of the ambient temperature.)
• Dielectric strength and thermoelectricity

• There are several factors that affect the electrical


conductivity of a material, and these include
• temperature, impurities, electromagnetic fields, frequency,
and crystal structure
Sensors
• Sensors are able to measure a physical quantity.

• They are able to convert this input into an electrical signal in order to
record and monitor it. It is imperative that the right sensor is chosen
based upon the robots use and the surrounding environment. Sensors
that measure the same input can also differ in accuracy, precision, and
sensitivity. This needs to be taken into account when designing a robot.

• Sensors can measure a large array of inputs. These include


environmental monitoring, distance, force, speed, pressure,
temperature, magnetic flux, vibration, humidity, rotation, touch,
imaging, light, biometrics, gas, acceleration, current, voltage,
orientation, gravity, tilt sensing, and speech recognition
• In reality, sensors are needed in robotics in order to make them
automated. Without them, a robot is, in essence, blind and deaf.
Sensors allow a robot to overcome these obstacles and collect
information from the surrounding environment, in order to interact
with it.

• Humanoid robots need a multitude of these sensors in order to mimic


the capabilities of their living counterparts. Companies, such as the
infamous Boston Dynamics, equip their robots with sensors that
simulate sight, hearing, and touch, as well as sensors which enable the
robot to understand and navigate its surroundings.

• Common sensor types used in robotics are proximity sensors, position


velocity sensors, temperature sensors, pressure sensors, force and
torque sensors, flow sensors, biosignature sensors, chemical sensors,
inertial sensor etc.
Proximity Sensor
• A proximity sensor is a sensor able to detect the presence of
nearby objects without any physical contact. A proximity sensor
often emits an electromagnetic field or a beam of
electromagnetic radiation, and looks for changes in the field or
return signal
Proximity Sensors
• Proximity sensor is one of the most common types of sensors.

• They sense the proximity between two objects.

• The simplest form is the mechanical proximity sensor, basically a switch that
allows the flow of current when the switch or knob or the lever is being
pressed.

• There are other types of proximity sensors,


Optical proximity sensors use the reflection of light to detect the proximity to an
object.

• There are proximity sensors which work based on the principles of inductors
and capacitance as well

• Apart from basic proximity sensors, advanced proximity sensors like radar sonar,
lidar(Light Ranging and Detection) uses, radio waves, sound waves and light
waves to not only detect the proximity, but also detect the distance between
objects.

• These are commonly used in planes, ships, submarines and even now in
autonomous driving cars.
Temperature Sensors

• Another common sensors used in IoT applications is the


temperature sensors.

• Temperature sensors work by providing readings via electrical


signals. Sensors are composed of two metals that generate an
electrical voltage or resistance when a temperature change occurs
by measuring the voltage across the diode terminals. When the
voltage increases, the temperature also increases.
• There are temperature sensors with different temperature ranges
and resolutions we have to be mindful about when selecting a
temperature sensor.
Position Sensors
• The position sensor is a device that collects information on the precise
position and movement of an object. The information can be obtained by
direct contact with the object or remotely using magnetic sensors. It can also
detect the thickness of a part, the level of a fluid or the angle of rotation of a
shaft.
• If we need to detect a position of a beam, position of a switch, rotation of a
shaft, position sensors are used in these scenarios.
• Location and positional accuracy is very important in some IoT applications, as
such we use vehicle trackers, personal trackers, etc

• So far, the best solution is the satellite navigation systems like GPS.
• GPS models nowadays only cost few dollars and can interface with almost every
microcontroller using simple communication methods.
Force And Pressure Sensors
• Another important type of sensors is the force and pressure
measurement sensors, recognizing a touch input of a user
measuring the weight of a product, measuring force of an
impact, especially in vehicle testing or measuring atmospheric
pressure for weather predictions or measuring the altitude.
Flow Sensors and Gas Sensors
• IoT is heavily adapted in factories to improve efficiency through sensors.
• Flow Censors are commonly used to measure the flow of Liquid
• Gas Censors, are used to identify gases which can be used in IoT enabled gas
monitors that are used to identify harmful gases.
Inertial Measurement Units
• Almost all the smartphones have this sensor.
• Mobile phones use these sensors for the orientation and rotation of the screen
Drones also use these IMU to balance themselves in the air
Vision Sensor
• Vision Sensor are advanced sensors which can capture videos from cameras
and analyze in real time to identify objects, symbols and features.

• These sensors are commonly used in cameras to detect faces and focus, as well
as for advanced things like autonomous vehicles to identify objects on the
road.
Actuators

• One of four main characteristics of a robot is the movement

• As humans have muscles to facilitate the movement, Robots have several


types of actuators which creates movement using electrical energy.

• There are electrical motors, solenoid hydraulic actuators, pneumatic


actuators, artificial muscles, metal actuators.

• Apart from these, there are many actuator types being researched every day.
• The most common type of actuator used in robotics is the motors.

• Motors range from Simple DC motors, which powers our toys to AC motors that
power home appliances and factory or machinery.

• Stepper motors and servo motors can rotate by precise amounts.

• Typically, motors rotate in circular motion, but there are actuators called linear
actuators, which turn this rotational motion into linear motion so that the
movement happens along a straight line.

• DC motors are the simplest actuator types used in robotics, they operate on direct
current, DC motors can be powered from a battery.

• These are commonly used in wheeled robots.


• However, there’s a drawback when you just use DC Motors for a robot.

• Even though DC Motors rotates at high speeds, it doesn’t have sufficient


rotational force to support the load of a robot , which includes sensors,
chassis, battery, wheels and electronics.
• So the solution is to use a gearbox similar to the gear system in the bicycle,
which helps to climb a steep hill.
• Gearbox converts a portion of speed to rotational force, which we call torque, so most
wheeled robots have gearboxes attached to their motors.
• In some robotics applications, like a robot Arm, you should be able to turn a motor in
precise amounts from a command given from the processor or the computer.
• This motor type is called the Servo motor that has a DC motor and gearbox position
sensing potentiometer and a control circuit.
• The control circuit sends the position and rotates the motor accordingly so
we could give power to the motor and tell the direction where the motor
should rotate .

When it comes to super precise applications we need micrometer level


accuracy and stepper motors can be used for that.

• It is complicated than the previous motor types, but commonly used in


machines where there is need for precision and accuracy.

• This can be commonly seen in 3D printers and robot arms when moving
heavy loads, Motor power can be insufficient in some cases, here we use
Hydraulic Actuators which uses Fluid Pressure to work
• Usually, these systems contain electrical pump, which gives the pressure
to the fluid and the electrical valves, which are operated through a
computer to turn on and off to change the direction of the flow, which
eventually changes the direction of the actuation
• Hydraulics may be slow, but for quick actions we use pneumatic actuators
instead of fluid pressure., pneumatic It uses air.

• Usually, there is an electrical pump, which gives the pressurized air to store
inside the tank .

• Similar to the Hydraulic, Pneumatic actuators also have electrical pump and
valves which are operated through a computer to turn on and off to change
the direction of the flow which eventually changes the direction of the
actuation

• For quick action Hydraulics may be slow so we resort to Pneumatic Actuators


Pneumatic Actuators
• Instead of fluid pressure like hydraulics the Pneumatic actuators use
pressurized air to function
• Similar to the hydraulic actuators, pneumatic actuators also have electrical
pumps and valve systems connected to computers to change the direction.

• Pneumatics are commonly used in factory robots to quickly do things and


increase production.

• Apart from these, there are many actuator types, but the emphasis for this
course is on DC Motors with gears , from where you will be able to
understand any type of actuator you are going to use in the future.
What is Electricity?
• Electricity is a form of energy that results from the movement of charged
particles, such as electrons.

• It is a fundamental force of nature that is present in all matter and can be built
up in one place (Static Electricity), or flow from one place to another(Current
Electricity).

• Electric current is the flow of electric charge through a material, and it is


measured in units of amperes (A).
• Voltage, also known as electric potential difference, is the measure of the
electric potential energy per unit charge and is measured in units of volts (V).

• Electric power is the rate at which electric energy is transferred, and it is


measured in units of watts (W)
• Everything in this universe is made up of atoms which consists of protons and
electrons

• Protons are positively charged while electrons are negatively charged

• Generally speaking the electric state of most atoms are neutral, because the
number of protons and electrons are equal but atoms can gain electrons and
become negatively charged or lose electrons and become positively charged.

• Similar charges repel while opposite charges attract


• Potential difference (sometimes called electromotive force) is the force
applied to make the electric current (electrons) move through a wire and
it is measured in Vollts

• Voltage is the difference in electric potential between 2 points


Water in Tank Analogy
Current
• Current is a measure of the flow of electric charge in a circuit. It is typically
measured in units of amperes (A) and is represented by the symbol "I".
• We Use Ammeter to measure current

• In a circuit, current is the flow of electrons through a conductor, such as a


wire. The direction of current is defined as the direction of flow of positive
charge, which is opposite to the direction of flow of electrons.

• Current can be either direct current (DC), where the current flows in one
direction only, or alternating current (AC), where the current changes
direction periodically. Most common sources of electrical energy such as
batteries and generators produce DC, while most power transmission and
distribution systems use AC.
Resistance
• Electrical resistance is the measure of the opposition to current flow
in an electrical circuit. It is measured in ohms (Ω).

• An object with high resistance will impede the flow of electrical


current, while an object with low resistance will allow more current to
flow easily. The resistance of an object can be affected by its
temperature, material, and dimensions.

• Electrical resistors are devices made with predetermined resistance


values
OHM’s LAW
• Ohm's Law states that the current flowing through a conductor
between two points is directly proportional to the voltage applied
across the two points, and inversely proportional to the resistance
between them.

• It can be mathematically represented as I=V/R, where I is the current


in amperes, V is the voltage in volts, and R is the resistance in ohms.
This relationship is true for most materials under normal conditions,
and it forms the basis for many electrical calculations and circuit
analysis.
Ohm’s Law
Ex 2
Reduce the Resistance in the circuit to 6 ohms
Increasing the potential Difference also increases the
current flow so its easy to understand the relationship
of ohms law
Resistance in series and parallel
• In a series circuit the output current in the first resistor flows into the
second resistor and into the third resistor therefore the current is the
same in each resistor
Resistors in Series
• The total resistance of the circuit is equal to the sum of the individual resistances
• The voltage drop across each resistor will be the same
• The sum of voltage across the resistors in the circuit V1+V2+V3 will be equal to the
voltage of the battery if the voltage of the battery was 12v then the sum of the voltages at
each resistor will add up to 12
• The voltage across the circuit is distributed among the resistors in proportion
to their individual resistance values.

• Since the current flowing through the circuit is the same for all the resistors,
the voltage drop across each resistor is inversely proportional to the
resistance value.

• Therefore, a resistor with a higher resistance value will have a higher voltage
drop and a lower resistance value will have a lower voltage drop
Calculate Equivalent Resistance
Current flowing in the circuit
Individual voltages across each resistor
Voltage across each resistor V=I*R
Notice that all the voltages add up to the voltage of the battery
Parallel connection
Unlike series the current has multiple paths to flow
Since all resistances are connected to one volage source we can say the
voltage across all of them is equal
• Find the current flowing in the circuit
• Individual current flowing in the resistors
• Hint : find the equivalent resistances first
Individual current flowing in the resistors
I =V/Req

3/0.5 = 6A is flowing in the socket

For individual currents in the resistors


I =V/R for resistor 1 3/1 = 3A
For resistor 2 3/2 = 1.5A
For resistor 3 3/2 = 1.5A
Equivalent resistance is always lower than the lowest value of
resistors connected in parallel
I = V/R
24/12 =2A

Voltage across each resistor


V = 2X7 = 14V
V = 2X5 = 10V
note 14 + 10 adds up to 24 which is the voltage source
Voltage across R2 is also 10V because R2 AND R34 are connected in parallel
Current I = V/R for R2 = 10/10 = 1A
Current I =V/R for R34 = 10/10 = 1A
Current from R2 = 1A,
voltage drop for resistor R4 = 1x4 = 4V
voltage drop for resistor R6 = 1x6 = 6V
Basic Electronic Components and Circuit Symbols
Microprocessor / Microcontroller
Microprocessor
• microprocessor, any of a type of miniature electronic device that contains the
arithmetic, logic, and control circuitry necessary to perform the functions of a
digital computer's central processing unit. They need additional peripherals like
RAM and ROM to carry out their duties. Example of a microprocessor is the CPU
of a Computer.
• Microprocessors have evolved over time in design and function
• A microprocessor is a computer processor where the data processing logic and
control is included on a single integrated circuit, or a small number of integrated
circuits. The microprocessor contains the arithmetic, logic, and control circuitry
required to perform the functions of a computer's central processing unit.
Microcontroller
• Microcontroller is a compressed micro computer manufactured to
control the functions of embedded systems in office machines, robots,
home appliances, motor vehicles, and a number of other gadgets. A
microcontroller is comprises components like - memory, peripherals and
most importantly a processor.

• This is the primary chip that acts as your Arduino board's brain. They
allow you to program your Arduino for it to be able to execute
commands and decisions based on the code. You will have to know
which type of microcontroller your board uses before loading a new
program from the Arduino Software
Microcontrollers are small integrated chips that are powerful enough to do a lot of tasks like
controlling motors, pumps, other appliances, sending sensor data to cloud, control basic displays
and even act as brain for intermediate some robots.

The power requirement for such chips are low and can even run on batteries for days or months,
they have peripherals like storage and memories built on the chip
Microcontrollers are way cheaper than microprocessors but one should not be used
in place of one another
Comparison
INTRODUCTION TO ARDUINO
• Arduino is an open-source hardware and software company, project,
and user community that designs and manufactures single-board
microcontrollers and microcontroller kits for building digital devices

• Arduino board designs use a variety of microprocessors and


controllers.

• The boards are equipped with sets of digital and analog


input/output (I/O) pins that may be interfaced to various expansion
boards ('shields') or breadboards (for prototyping) and other
circuits.
• The boards feature serial communications interfaces, including
Universal Serial Bus (USB) on some models, which are also used for
loading programs.

• The microcontrollers can be programmed using the C and C++


programming languages, using a standard API which is also known
as the Arduino Programming Language, inspired by the Processing
language and used with a modified version of the Processing IDE.

• In addition to using traditional compiler toolchains, the Arduino


project provides an integrated development environment (IDE) and
a command line tool developed in Go.
Digital Pins /Connectors
Analog Pins
• www.Arduino.cc
• Software
• Download and install
• Launch
• Plug in your Arduino Board
• www.tinkercad.com

• Login with code your Teacher shared

• Enter your nickname

• Go to your classroom

• Select circuits
www.tinkercad.com

join a class

class code for Mechanical


Engineering
D72TYJK6DVBL
www.tinkercad.com
Join a class

code for Biomedical Engineering

PS5LEQXD4
www.tinkercad.com

Join a class

code for Computer Engineering

LVJ9V5KMU
•www.tinkercad.com
Join a class

Code for MECHATRONICS


UL4R5G2N4
Deconstructing Arduino Code
// C++ code
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(LED_BUILTIN, LOW);
delay(1000); // Wait for 1000 millisecond(s)
}
Deconstructing Blink Statements
Void setup()

• The void setup() is the first function to be executed and it is executed


only once.

• It usually contains statements that set the pin modes on the Arduino to
OUTPUT and INPUT, example:

pinMode (12, OUTPUT);


pinMode(11, INPUT);

Or to start the serial monitor example: serial.


pinMode(LED_BUILTIN, OUTPUT);
• You may be wondering now why we had to do this in the first

place, since we have mentioned that LEDs are outputs.

• This is because the build-in LED is connected to a specific digital

input/output port, pin 13. When using any digital pin in a program,

we need to declare it as input or output.


Functions
• We will now take a step back, and look at the first line of code.
void setup() {

pinMode(LED_BUILTIN, OUTPUT);
}
We see that the

pinMode statement is included in a structure like this:


void setup() {
..........
}
These structures are called functions. In an Arduino sketch, there are the two basic
sections: the setup() function and the loop() function.
• Whatever is inside setup() happens once in the
beginning of the program execution,

• followed by loop() which repeats over and over.


loop()
• First, let's take a look at what statements are inside the loop():

digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)


delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second

This is essentially the part of the program that describes blinking. We see that blinking is
actually turning a LED on, waiting for a while, turning it off, waiting for a while again and then
repeating from the top.
Let's take the statements one by one:

digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)

In an Arduino sketch, write means to set a value.


digitalWrite() will set a value of HIGH or LOW.

For the digital output pins of the Arduino, HIGH and LOW means turning them
ON and OFF.

Notice that the way we use digitalWrite() looks similar to pinMode() that we saw
earlier.
• delay(1000); // wait for a second

• The delay() will pause the program, preventing the Arduino from executing
the next command.

• The number in the parentheses is the amount of time it will wait in


milliseconds.

• 1000 msec = 1 sec

• The next statement is very similar to the first digitalWrite() in the program,
however this time it sets the pin to LOW, turning the LED OFF.
Blink a LED, the Arduino 'hello world'.

• Try the following exercises:

• Go to the Arduino IDE and change the delay


• Make the LED go ON for 1min and OFF for 3secs.
• Make the LED go ON for 2mins and OFF for 5 Secs.
Breadboards
• Breadboards are used to make
• Quick non-permanent connections between electronic components
• They are covered with tiny socket holes connected in rows
Has 4 sections
2 inner sections with short horizontal rows
2 outer sections with long
What is C++?

• C++ is a cross-platform language that can be used to create high-


performance applications.

• C++ was developed by Bjarne Stroustrup, as an extension to the C


language.

• C++ gives programmers a high level of control over system resources and
memory.

• The language was updated 4 major times in 2011, 2014, 2017, and 2020 to
C++11, C++14, C++17, C++20.
Why Use C++
• C++ is one of the world's most popular programming languages.

• C++ can be found in today's operating systems, Graphical User Interfaces,


and embedded systems.

• C++ is an object-oriented programming language which gives a clear


structure to programs and allows code to be reused, lowering
development costs.

• C++ is portable and can be used to develop applications that can be


adapted to multiple platforms.
• As C++ is close to C, C# and Java, it makes it easy for programmers to switch
to C++ or vice versa.

• Difference between C and C++


• C++ was developed as an extension of C, and both languages have almost
the same syntax.

• The main difference between C and C++ is that C++ support classes and
objects, while C does not.

You might also like