Arduino PPT On May 15
Arduino PPT On May 15
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
3. Memory
• 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
• 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:
Example
• include <Servo.h>
• const int motor = 9;
• Preparation{
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
• Function, and
• Control
Function
• Digital
digitalRead (pin)
Reads the value from a specified pin, either HIGH or LOW
if (condition)
{action a}
else
{action b}
This will execute action a if condition is TRUE, else action b is executed
Qty Part
1 LED
1 Resistor [150Ω]
CODES
int led = 3; // LED connected to digital pin 13