0% found this document useful (0 votes)
255 views44 pages

Arduino PPT On May 15

The document discusses robotics and intelligent environments. It describes how robots can automate functions in the home like controlling appliances and providing services to inhabitants. It also discusses various types of robots used for tasks like cleaning, mowing, and assisting the elderly. The document provides a brief history of robotics and covers common robot components like manipulators, mobile robots, and how autonomous robots require capabilities like sensing, control, and adapting to changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
255 views44 pages

Arduino PPT On May 15

The document discusses robotics and intelligent environments. It describes how robots can automate functions in the home like controlling appliances and providing services to inhabitants. It also discusses various types of robots used for tasks like cleaning, mowing, and assisting the elderly. The document provides a brief history of robotics and covers common robot components like manipulators, mobile robots, and how autonomous robots require capabilities like sensing, control, and adapting to changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 44

Robotics

By BENJAMEN L. BANAAG JR.


Motivation
• Intelligent Environments are aimed at
improving the inhabitants’ experience and
task performance
▫ Automate functions in the home
▫ Provide services to the inhabitants
• Decisions coming from the decision maker(s)
in the environment have to be executed.
▫ Decisions require actions to be performed on
devices
▫ Decisions are frequently not elementary device
interactions but rather relatively complex
commands
 Decisions define set points or results that have to be
achieved
 Decisions can require entire tasks to be performed
Automation and Robotics in
Intelligent Environments
 Control of the physical environment
 Automated blinds
 Thermostats and heating ducts
 Automatic doors
 Automatic room partitioning
 Personal service robots
 House cleaning
 Lawn mowing
 Assistance to the elderly and handicapped
 Office assistants
 Security services
Robots
• Robota (Czech) = A worker of forced labor
From Czech playwright Karel Capek's 1921 play “R.U.R”
(“Rossum's Universal Robots”)

• Japanese Industrial Robot Association (JIRA) :


“A device with degrees of freedom that can be
controlled.”
▫ Class 1 : Manual handling device
▫ Class 2 : Fixed sequence robot
▫ Class 3 : Variable sequence robot
▫ Class 4 : Playback robot
▫ Class 5 : Numerical control robot
▫ Class 6 : Intelligent robot
A Brief History of Robotics
• Mechanical Automata
▫ Ancient Greece & Egypt
 Water powered for ceremonies
▫ 14th – 19th century Europe
 Clockwork driven for entertainment
• Motor driven Robots
▫ 1928: First motor driven automata
▫ 1961: Unimate
 First industrial robot
▫ 1967: Shakey
 Autonomous mobile research robot
▫ 1969: Stanford Arm
 Dextrous, electric motor driven robot arm
Robots
 Robot Manipulators

 Mobile Robots
Autonomous Robots
• The control of autonomous robots involves a
number of subtasks
▫ Understanding and modeling of the mechanism
 Kinematics, Dynamics, and Odometry
▫ Reliable control of the actuators
 Closed-loop control
▫ Generation of task-specific motions
 Path planning
▫ Integration of sensors
 Selection and interfacing of various types of sensors
▫ Coping with noise and uncertainty
 Filtering of sensor noise and actuator uncertainty
▫ Creation of flexible control policies
 Control has to deal with new situations
Requirements for Robots in Intelligent
Environments
• Autonomy
▫ Robots have to be capable of achieving task objectives
without human input
▫ Robots have to be able to make and execute their own
decisions based on sensor information
• Intuitive Human-Robot Interfaces
▫ Use of robots in smart homes can not require
extensive user training
▫ Commands to robots should be natural for inhabitants
• Adaptation
▫ Robots have to be able to adjust to changes in the
environment
Robots for Intelligent Environments
• Service Robots
▫ Security guard
▫ Delivery
▫ Cleaning
▫ Mowing
• Assistance Robots
▫ Mobility
▫ Services for elderly and
People with disabilities
ARDUINO
What is Arduino?
• is an open-source microcontroller board based
on the Microchip ATmega328P microcontroller
and developed by Arduino.cc. The board is
equipped with sets of digital and analog
input/output (I/O) pins that may be interfaced
to various expansion boards (shields) and other
circuits.
Arduino Board
1. Power
• the board can be powered via the USB connection or
with an external power supply (range 7V to 12V)
• Vin - supply voltage through this pin or via the power
supply jack when using an external power supply
• GND: ground pins
• 5V: regulated power supply used to power the
components on board
• 3v3: a 3.3V supply voltage
• RESET: bring this line LOW to reset the micro-
controller. Typically used to add a reset button to
shield which block the one on the board
(reset button)
2. Analog Input

• each input provides 10-bits of resolution (ie.


1024 different values). By default they measure
from GND to 5V, mapping values from 0 to
1023 respectively

3. Memory

• 32KB of flash memory for storing code (sketch


of your program)
4. Digital Input/Output

• each pin can be an input or output,


using pinMode( ), digitalWrite( ),
and digitalRead( ) functions
• each pin operates at 5V and can provide or
receive a maximum of 40mA
• PWM: 3, 5, 6, 9, 10, 11 - provide a PWM output
with the analogWrite( )function
• LED13: built-in LED connected to pin 13. When
this pin is HIGH, the LED is on, when this pin is
LOW, it is off
Breadboard
• A breadboard is used to connect components
to form circuits. No *soldering is required
so it is easy to change connections or
replace components.

* Soldering: a technique to join 2 conductive


(metal) contacts in a circuit
Beginner's Electronics
• LED (Light Emitting Diode)
Lights up when current flows
from the (+) anode, longer
lead, to (-) cathode. Requires
resistor to limit the current
• Diode
A device which allows current
to flow in only one direction, and
prevents the flow of current from
the opposite direction
• Tri-colour LED
Similar to 3 LEDs of different
colors wired together. This
is COMMON CATHODE type
and its connected to GND. Note
the positions of the leads and its
corresponding colors

• Resistor
Restricts the amount of current
that flows through it. The color
bands indicate resistance and
tolerance
• LDR (Light Dependent
Resistor) or Photoresistor
Its resistance varies depending
on the amount of light

• Push Button
A switch - makes contact
when the button is
pressed
• Speaker/Piezo Buzzer
Produces sound in response
to an electrical audio signal
input

• LCD (Liquid Crystal


Display)
Displays alphanumeric
characters based in digital
input signal. It can display
16 characters over 2 lines
• IR LED (Infra-red LED)
Similar to LED but the light is
not visible. Infra-red is like
heat, not visible to the naked
eye. The longer lead is (+)
anode
• IR Phototransistor
A transistor which current
depends on the amount of IR
light. The longer lead is the
EMITTER. This component is
tinted black to prevent
interference from visible light
• Potentiometer
A simple knob that provides
a variable resistance, which
we can read into the Arduino
board as an analog value

• DC Motor
A motor in which speed can
be varied by changing the
operating voltage or the
strength of the magnetic
field
• Capacitor
Stores electrical charge - used
in timer circuits to smooth
power fluctuation and to
block direct current (DC)

• Servo Motor
A motor in which the angular
position of the shaft is
determined by the duration
of pulses (PWM signal) to the
control terminal
• Transistor
A device which can behave
either as a switch or an
amplifier. It acts as a switch
or amplify electronic or
electric signals
Colors on Resistors
• Reading colour bands of any resistor is easy.
For most resistors, there are 4 coloured bands.
The 1st & 2nd bands indicate the digits while
the 3rd band indicate # of zeros and the last (4th)
band indicate its tolerance. For simplicity, we
shall ignore the 4th band.
• Example
In the diagram given,
the order of the color
bands is as follows:
1st: Red (2)
2nd: Black (0)
3rd: Black (x1)

Resistor Value: 20Ω
• More Examples
Solve the resistor values of these colored bands:

• brown green brown (150Ω)

• yellow purple brow (470Ω)

• brown black orange


(10kΩ)
Sketch Structure

• The sketch on the Arduino App works on a


simplified C Programming language. It consists
of 3 main parts namely:

• Declaration: declaring your libraries, variables


and data types
• Preparation: Initialise the program once
• Execution: Run the program continuously,
unless otherwise specified
• Declaration

• libraries (e.g. <Servo.h> )


• data types (e.g. int, const int, char)

Example

• include <Servo.h>
• const int motor = 9;
• Preparation{

• begins and ends with { curly brackets }


• pinMode (pin, mode)
• Serial.begin (baud rate)
• lcd.begin (x, y)
• delay ( )
• void loop ()
{
• Example:
• pinMode (motor, OUTPUT); // set pin 9 as an
output
• Serial.begin (9600); // initialises the Serial
Monitor
• lcd.begin (0,0); // initialises the
display at coordinate 0,0
• delay (3000); // pause for 3000ms
(or 3 secs) for looping
•}
• Execution
void loop ()
{

• begins and ends with { curly brackets }


• function command
(e.g. digitalWrite, digitalRead, analogWrite,an
alogRead, tone)
• control command (e.g. if-else, for, while)
• algorithms or calculations
• Serial.print ("...") OR Serial.println ("...")
• lcd.print ("...") OR lcd.println ("...")
• delay ( )
•}
Example:
• void loop ()
{

• digitalWrite (motor, HIGH);


• Serial.print ("Motor is running at full
speed!");
• lcd.print ("Full speed ahead!");
• delay (3000);
Definitions of sketch structure
1. BASIC
setup( )
To initialise variables, pin modes, start using
libraries, etc. This function will only run once, after
each power or rest of the Arduino board

loop( )
Does precisely what its name suggest, and loops
consecutively, allowing your sketch to change and
respond. Comes after creating a setup( ) function
2. Pin State
• INPUT | OUTPUT
Alters the electrical behaviour of the pin. Used with the pinMode( ) command
INPUT: Useful for reading a sensor, or sending in a signal to the Arduino
OUTPUT: Useful to powering LEDs, or sending out a signal to a
component

HIGH | LOW
Writing or Reading a value to a digital pin, with varying behaviours when pin is
declared as an input or an output

a) HIGH (w INPUT)
- read with the digitalRead( ) command
- reports if a voltage of 3V or more is present at pin

b) HIGH (w OUTPUT)
- write with the digitalWrite( ) command
- reports a voltage of 3V or more to a component
• c) LOW (w INPUT)
- reads with the digitalRead( ) command
- report LOW if a voltage of 2V or less is present
at the pin

d) LOW (w OUTPUT)
- writes with the digitalWrite( ) command
- reports a voltage of 0V to sink current e.g. to
light up an LED that is connected in series with a
resistor and +5V.
3. Syntax
• // (single line comment)
Comments are lines in the sketch that are used to inform
yourself or others about the way the program works. They
are ignored by the computer

; (semicolon)
Used to end a statement

{ } (curly braces)
To contain your program lines as a whole part
under setup( ) and loop( )functions. Every time you open a
brace '{', close it at the end '}'
4. Data Types

• int: primary data type of storing


integers. e.g. 3, 24. -25
const int: stores a constant integer
value. e.g. ledPin = 3, tonePin = 5
float: stores values which has a decimal
point. e.g. 3.13, 2.0
char: stores a character value. e.g. 'A', "ABC"
void: is a keyword used only in function
declaration. e.g. void loop()
Useful Commands
• Commands in sketch is very useful and easy to
understand. Here, we shall explore 2 different
categories of commands:

• Function, and
• Control
Function
• Digital

pinMode (pin, mode)


Configure a pin either an INPUT or OUTPUT mode. "pin" is the pin
number between 0 and 19 (digital input/output ranges 0 - 13, while
analog input ranges A0 - A5)

digitalWrite (pin, value)


Once a pin is configured as an OUTPUT, its value can be set
either HIGH(+5V) or LOW (ground)

digitalRead (pin)
Reads the value from a specified pin, either HIGH or LOW

tone (pin, frequency, duration)


Produces an ON/OFF signal (or a note) very much like the PWM signal.
However unlike the PWM signal which repeats itself at a fixed interval,
the interval for tone signal is not fixed.
Note that the frequency is in Hertz (Hz) and duration in millisecond (ms)
• Analog

analogWrite (pin, value)


Pin 3, 5, 6, 9, 10 and 11 support PWM (Pulse Width
Modulation), a kind of rapid ON and OFF signal
that simulates analog signal. At a value of 0, the
signal is completely OFF while a value of 255, the
signal is completely ON
analogRead (pin)
Reads the value from a specified analog INPUT pin.
The value ranges from 0 to 1023, corresponding to
input voltages between 0 to 5V
Control
• if (condition)
{ }
This will execute the codes between the curly brackets if condition is
TRUE

if (condition)
{action a}
else
{action b}
This will execute action a if condition is TRUE, else action b is executed

for (int x = 0; x < 10; x++)


{ }
Used to repeat a block of codes a number of times. In this case x is
initialised with 0, and will be incremented (can be decremented as well
using x--) as long as x < 10. As a result, the block of codes within the
curly brackets will be repeated 10 times
EXERCISE # 1 BLINK
You will write a program to make the LED blink.
Software Discovery: Constants, Digital
Output
Other Discovery: LED

Qty Part
1 LED
1 Resistor [150Ω]
CODES
int led = 3; // LED connected to digital pin 13

void setup() // run once, when the sketch starts


{
pinMode(led, OUTPUT); // sets the digital pin as output
}
void loop() // run over and over again forever
{
digitalWrite(led, HIGH); // turn the LED on
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off delay(1000); // wait
for a second
}

You might also like