SlideShare une entreprise Scribd logo
1  sur  67
How to make a line follower
Introduction
            What is a line follower?
• Line follower is a robot that can follow a
  path. The path can be visible like a black
  line on a white surface (or vice-versa).




               (c) Copyright, roboVITics club 2012   2
Hardware Components
•   IR Sensors
•   DC Geared Motors
•   Robot Chasis
•   Microcontroller development board
•   Atmega 8 Microcontroller
•   USB Programmer


                (c) Copyright, roboVITics club 2012   3
IR Sensor




(c) Copyright, roboVITics club 2012   4
Block Diagram
                             Every sensor has three
                             terminals
              VCC            •VCC – to power up the
                             sensor
                             •GND – to provide a
                             fixed negative
                             reference
 Physical
Parameters
             Sensor    OUTPU •OUTPUT – analog
                         T   output of the sensor



             GND
                       (c) Copyright, roboVITics club 2012   5
Working
• IR sensor works on the principle of emitting IR
  rays and receiving the reflected ray by a receiver
  (Photo Diode)




                  (c) Copyright, roboVITics club 2012   6
IR Sensor circuit




  (c) Copyright, roboVITics club 2012   7
Types of resistor
• Fixed type resistor




• Variable type resistor




               (c) Copyright, roboVITics club 2012   8
LM358
• The LM358 IC consists of two
  independent operational amplifiers which
  were designed specifically to operate from
  a single power supply over a wide range
  of voltages.
• It have two op-amp
• Single power supply


              (c) Copyright, roboVITics club 2012   9
LM358 IC




(c) Copyright, roboVITics club 2012   10
Internal circuit




 (c) Copyright, roboVITics club 2012   11
DC geared motors
                      • Motors having external
                        gear arrangement
                        attached with motor.
                      • It has a gearbox that
                        increases torque and
                        decreases speed.
                      • Most commonly used in
                        robotics as they are
                        having considerable
                        torque.


   (c) Copyright, roboVITics club 2012           12
DC Motors
• Motors which works on dc
  current and gives a
  rotating motion as an
  output.
• In robotics applications,
  they are preferred over
  AC motors as the motor
  and the complete circuit
  require same kind of
  supply i.e. DC supply.


                  (c) Copyright, roboVITics club 2012   13
Chasis
• Provides a base
  to the robot.
• Wheels, sensors
  and controller
  board are
  attached to it.



             (c) Copyright, roboVITics club 2012   14
IC’s
• L293D
• LM358
• IC 7805(voltage controlled)




              (c) Copyright, roboVITics club 2012   15
IC 7805
• It is a voltage regulator integrated circuit.
• It designed to automatically maintain a
  constant voltage level




                 (c) Copyright, roboVITics club 2012   16
Features
•   Output current range up to 1A
•   Output voltage 5V
•   Input voltage range up to 12V
•   Short circuit protection




                (c) Copyright, roboVITics club 2012   17
Transistor
• Transistor are of two types:
     1-> n-p-n
      A straight switch

   2-> p-n-p
     A inverted switch


               (c) Copyright, roboVITics club 2012   18
n-p-n as a switch
• When base of n-p-n is connected with
  logic high voltage then it short circuit
  emitter and collector (SWITCH ON).
• When base of n-p-n is connected with
  logic low voltage then it open circuit both
  emitter and collector (SWITCH OFF).



                (c) Copyright, roboVITics club 2012   19
Circuit diagram to show a switching
                          VCC


                                                       Logic   transisto   Motor
                                                               r

                                                       0       off         stop
                                                       1       on          run
       Logic 1
         or        RB
      Logic 0


                              M




                                   GND
                 (c) Copyright, roboVITics club 2012                              20
p-n-p as an inverted switch
• When base of p-n-p is connected with
  logic high voltage then it open circuit
  emitter and collector (SWITCH OFF).
• When base of p-n-p is connected with
  logic low voltage then it short circuit both
  emitter and collector (SWITCH ON).



                (c) Copyright, roboVITics club 2012   21
Controlling Motor Using H-Bridge

• Switches settings for
  rotation:
    S1&S4:      ON    and
     S2&S3: OFF (for one
     direction).
    S2&S3:      ON    and
     S1&S4: OFF (for other
     direction).
• S1-S2: ON or S3&S4: ON
   (can be used to stop the
  motor).
                   (c) Copyright, roboVITics club 2012   22
H-Bridge Operation

A   B        o/p
0   0        Stop
0   1     Clock wise
1   0    Counter clock
             wise
1   1        Stop




              (c) Copyright, roboVITics club 2012   23
L293D IC

  EN1                  EN1            Vcc




                       12V            EN2

  12V




(c) Copyright, roboVITics club 2012         24
Conti….
• L293D is a dual H-Bridge motor driver.
• So with one IC we can interface two DC motors
  which can be controlled in both clockwise and
  counter clockwise direction
• If you have motor with fix direction of motion
  then you can make use of all the four I/Os to
  connect up to four DC motors.
• L293D has output current of 600mA.
• Moreover for protection of circuit from back
  EMF output diodes are included within the IC.


                (c) Copyright, roboVITics club 2012   25
Dual H-Bridge Motor Driver IC: L293D

Features:
  • Capable of driving 2
    motors at a time in
    clockwise and anti-
    clockwise direction
    separately.
  • Works as an interface
    for controlling motors
    using lower voltage
    (5V) and running
    motors on higher
    voltage.
                   (c) Copyright, roboVITics club 2012   26
Interface motor with IC L293D

     EN1                        VCC




     12V                       EN2



           (c) Copyright, roboVITics club 2012   27
What is a Microcontroller?

 A microcontroller (sometimes abbreviated µC
  or MCU) is a small computer on a single IC
  containing a processor core, memory, and
  programmable input/output peripherals.

 It is a decision making device used widely in
  embedded systems and all intelligent
  devices.
                (c) Copyright, roboVITics club 2012   28
Difference between Microcontroller
         and Microprocessor

 Microcontroller has I/O ports, Memory,
  timers etc all integrated on chip itself

 In Microprocessors, I/O ports, memory,
 timer etc are to be connected externally

                (c) Copyright, roboVITics club 2012   29
Microcontrollers                   Microprocessors
• Full fledged PC!               • Separated units
• ROM, RAM, Flash,               • Higher resources
  CPU, ALU, on-chip              • MCU – (everything in
  peripherals                      point 2)
• Lower resources



              (c) Copyright, roboVITics club 2012         30
Typical MCU based solution




Microwave Oven




                 (c) Copyright, roboVITics club 2012   31
MCU Ports
• Ports contains pins of
  the MCU
• Can be turned ON or
  OFF by the program
  – ON = 1 (in TTL 5V)
  – OFF = 0 (in TTL 0V)
• Input mode – values can
  be read
  – Above threshold = ON
  – Below threshold =
    OFF



                 (c) Copyright, roboVITics club 2012   32
AVR ATmega8 Microcontroller




        (c) Copyright, roboVITics club 2012   33
How AVR ATmega8 got its
             name?
 It was developed by Atmel Corporation

 AVR implies it belongs to AVR family.

 ‘8’ in Atmega8 means this microcontroller
  has 8Kb of flash memory


              (c) Copyright, roboVITics club 2012   34
TYPES OF PACKAGES

 28-lead PDIP (Plastic Dual In-line
  Package)

 32-lead TQFP (Thin Quad film Package)



               (c) Copyright, roboVITics club 2012   35
How ATmega8 PDIP Package looks
            like?




         (c) Copyright, roboVITics club 2012   36
How ATmega8 TQFP Package looks
            like?




         (c) Copyright, roboVITics club 2012   37
Pinout of ATmega8




   (c) Copyright, roboVITics club 2012   38
PORT B(PB7-PB0)
 It is a 8-bit bi-directional I/O port.
 It can be used either as a input port or as
  output port ( direction must be specified in
  programming).




               (c) Copyright, roboVITics club 2012   39
PORT C(PC6-PC0)
 It is a 7-bit bi-directional I/O port.
 It can be used either as a input port or as
  output port ( direction must be specified in
  programming).




               (c) Copyright, roboVITics club 2012   40
PORTD(PD7-PD0)
 It is a 8-bit bi-directional I/O port.
 It can be used either as a input port or as
  output port ( direction must be specified in
  programming).




               (c) Copyright, roboVITics club 2012   41
Microcontroller development board
• Used to interface
  motors, sensors and
  various other
  devices with
  microcontroller.
• Components like
  resistors, capacitors,
  power supply are
  attached to the
  microcontroller via
  development board
  for its working.

                     (c) Copyright, roboVITics club 2012   42
USB Programmer
• Used to burn code
  from laptop to
  memory of
  microcontroller.




             (c) Copyright, roboVITics club 2012   43
Two sensor line follower




 Left     Right      Directi         Left       Right
Sensor   Sensor        on           Motor       Motor
  0        0         Forwar          +12V       +12V
                       d
  0        1 Copyright, roboVITics club 2012
           (c)
                         Left            -12V   +12V    44
(c) Copyright, roboVITics club 2012   45
(c) Copyright, roboVITics club 2012   46
(c) Copyright, roboVITics club 2012   47
(c) Copyright, roboVITics club 2012   48
Getting Started
Selecting Hardware                Selecting Software
• PC / Mac                      • OS – Windows / Mac
• In-System                       OS / Linux
  Programmer (ISP)              • “Free” Compiler
• Target Board (MCU             • “Free” Programmer
  Dev Board)                      Software
• Lastly, a MCU!!


             (c) Copyright, roboVITics club 2012       49
Softwares needed
• AVR Studio – for programming
• Compiler – for compiling the code
• eXtreme Burner or avrloader – for buring
  code generated to microcontroller.




              (c) Copyright, roboVITics club 2012   50
Step 1




(c) Copyright, roboVITics club 2012   51
Step 2




(c) Copyright, roboVITics club 2012   52
Datasheet
• Manufacturer gives information regarding the
  product to its users
• Data given is in detail
• Features, Technical Specs, Design, Register
  Summary, Expected Usage, Troubleshooting,
  Pin details, etc.
• Best source of info!!
• All electronic components have a datasheet for
  them
• Google them out!!
                 (c) Copyright, roboVITics club 2012   53
Pin Configurations




Atmega8   (c) Copyright, roboVITics club 2012   Atmega16/32   54
AVR Studio
• Most popular C compiler for AVR
• Its official!
• Unlike other compilers/emulators, its totally
  free
• The code written will be common to all AVR
  mcu’s
• AVR Studio 4 has been used
• AVR Studio 5 beta and AVR Studio 6 has
  been released

               (c) Copyright, roboVITics club 2012   55
INTRODUCTION TO EMBEDDED SYSTEM
               AND
           EMBEDDED C




          (c) Copyright, roboVITics club 2012   56
What is Embedded C?
• Embedded C is nothing but a subset of C
  language which is compatible with certain
  microcontrollers.
• Some features are added using header files like
  <avr/io.h>, <util/delay.h>.
• scanf() and printf() are removed as the inputs
  are scanned from the sensors and outputs are
  given to the ports.
• Control structures remain the same like if-
  statement, for loop, do-while etc.
                 (c) Copyright, roboVITics club 2012   57
Development process of Embedded C
                 projects
• Write C programs in AVR Studio IDE(Integrated
  Development Environment)
• Compile them into a .hex file using the AVR-GCC
  compiler (which integrates into AVR Studio)
• Simulate the target AVR program and debug the code
  within AVR Studio
• Program the actual chip using the USBasp device, which
  is attached to our target board with a special 6-pin cable
• Once programmed, the chip runs the program in your
  circuit

                    (c) Copyright, roboVITics club 2012   58
Registers to Communicate with I/O
                Ports
 To communicate with the ports of
  Atmega8, we use three registers:
 PINx
 PORTx
 DDRx

Where x would be either B,C or D.
              (c) Copyright, roboVITics club 2012   59
DDRx Register
 It stands for Data Direction Register.
 It is used to define Port as Input or Output.
 In order to make Port as Input Port:
  DDRx=0x00 (In Hexadecimal)
   DDRx=0b00000000(In Binary)
 In order to make Port as output Port:
  DDRx=0xFF (In Hexadecimal)
   DDRx=0b11111111(In Binary)
               (c) Copyright, roboVITics club 2012
                                             60
PORTx Register
 If DDRx=0xFF(Output port)
 Writing logic 1 to PORTx will make output
  high i.e 5v for that particular pin.

 Writing 0 to PORTx will make output low
  i.e 0v for that particular pin.


               (c) Copyright, roboVITics club 2012   61
Continued..
 If DDRx=Ox00(Input port):
 If corresponding PORTx bit is set to 1,
  Internal pull up resistors are enabled i.e if
  we do not connect this pin to anything it
  still reads as 1.
 If corresponding PORTx bit is set to 0,
  internal pull up resistors are disabled i.e
  the pin will enter a high impedance state
  and will become unpredictable.

                (c) Copyright, roboVITics club 2012   62
PINx Register

 It reads data from the port pins.
 If any/all bits of DDRx is set to 0(input)for
  a particular pin, we can read data from
  PINx
 If any/all bits of DDRx is set to 1(output),
  then reading PINx register gives the same
  data which has been output on that
  particular pin.
                (c) Copyright, roboVITics club 2012   63
For Details, visit


             maxEmbedded.com
               A guide to robotics and embedded electronics
                          AVR Guide and Tutorials
Basics of Microcontrollers, Sensors, Timers, ADC, Serial Communication, etc




                       (c) Copyright, roboVITics club 2012                    65
maxEmbedded blog




   (c) Copyright, roboVITics club 2012   66
Online Stores
•   store.extremeelectronics.co.in
•   nex-robotics.com
•   embeddedmarket.com
•   rhydolabz.com
•   thinklabs.in
•   sparkfun.com



                 (c) Copyright, roboVITics club 2012   67
Suggestions and Doubts are welcome
           That’s all for today
                             Thank you




24 hour helpline
9566758862

P.S. Its not toll-free!                               For more info, visit Mayank’s blog
                                                                   maxEmbedded. com
                      (c) Copyright, roboVITics club 2012        © maxEmbedded68    2012

Contenu connexe

Tendances

Line Following Robot using Arduino UNO
Line Following Robot using Arduino UNOLine Following Robot using Arduino UNO
Line Following Robot using Arduino UNOViswanadh Ivaturi
 
Arduino obstacle avoidance robot
Arduino obstacle avoidance robotArduino obstacle avoidance robot
Arduino obstacle avoidance robotSteven Radigan
 
Line Following Robot Using Arduino
Line Following Robot Using ArduinoLine Following Robot Using Arduino
Line Following Robot Using ArduinoSamuel Manoj Palani
 
Line follower robot
Line follower robotLine follower robot
Line follower robotANU_110
 
Line Following Robot
Line Following RobotLine Following Robot
Line Following RobotSelf-employed
 
Final report on line follower
Final report on line followerFinal report on line follower
Final report on line followerPriya Hada
 
Line follower Robot using PID algorithm
Line follower Robot using PID algorithmLine follower Robot using PID algorithm
Line follower Robot using PID algorithmIfaz Ahmed Aflan
 
BLUETOOTH CONTROL ROBOT WITH ANDROID APPLICATION
BLUETOOTH CONTROL ROBOT WITH ANDROID APPLICATIONBLUETOOTH CONTROL ROBOT WITH ANDROID APPLICATION
BLUETOOTH CONTROL ROBOT WITH ANDROID APPLICATIONVarun Divekar
 
Autonomous maze solving robot (1/2)
Autonomous maze solving robot (1/2)Autonomous maze solving robot (1/2)
Autonomous maze solving robot (1/2)Musfiqur Rahman
 
Report - Line Following Robot
Report - Line Following RobotReport - Line Following Robot
Report - Line Following RobotDivay Khatri
 
Obstacle avoiding Robot
Obstacle avoiding RobotObstacle avoiding Robot
Obstacle avoiding RobotRasheed Khan
 
line following robot
line following robotline following robot
line following robotRehnaz Razvi
 
line following robot ppt
line following robot pptline following robot ppt
line following robot pptSuchit Moon
 
Speed Control of DC Motor
Speed Control of DC MotorSpeed Control of DC Motor
Speed Control of DC MotorMafaz Ahmed
 
line following robot
line following robotline following robot
line following robotRehnaz Razvi
 
Obstacle Avoidance Robot Summer training Presentation
Obstacle Avoidance Robot Summer training Presentation Obstacle Avoidance Robot Summer training Presentation
Obstacle Avoidance Robot Summer training Presentation Wasi Abbas
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERAnkita Jaiswal
 

Tendances (20)

Line Following Robot using Arduino UNO
Line Following Robot using Arduino UNOLine Following Robot using Arduino UNO
Line Following Robot using Arduino UNO
 
Arduino obstacle avoidance robot
Arduino obstacle avoidance robotArduino obstacle avoidance robot
Arduino obstacle avoidance robot
 
Line Following Robot Using Arduino
Line Following Robot Using ArduinoLine Following Robot Using Arduino
Line Following Robot Using Arduino
 
Line follower robot
Line follower robotLine follower robot
Line follower robot
 
Line Following Robot
Line Following RobotLine Following Robot
Line Following Robot
 
Final report on line follower
Final report on line followerFinal report on line follower
Final report on line follower
 
Line follower robot
Line follower robotLine follower robot
Line follower robot
 
Line follower Robot using PID algorithm
Line follower Robot using PID algorithmLine follower Robot using PID algorithm
Line follower Robot using PID algorithm
 
BLUETOOTH CONTROL ROBOT WITH ANDROID APPLICATION
BLUETOOTH CONTROL ROBOT WITH ANDROID APPLICATIONBLUETOOTH CONTROL ROBOT WITH ANDROID APPLICATION
BLUETOOTH CONTROL ROBOT WITH ANDROID APPLICATION
 
Autonomous maze solving robot (1/2)
Autonomous maze solving robot (1/2)Autonomous maze solving robot (1/2)
Autonomous maze solving robot (1/2)
 
Report - Line Following Robot
Report - Line Following RobotReport - Line Following Robot
Report - Line Following Robot
 
Obstacle avoiding Robot
Obstacle avoiding RobotObstacle avoiding Robot
Obstacle avoiding Robot
 
line following robot
line following robotline following robot
line following robot
 
line following robot ppt
line following robot pptline following robot ppt
line following robot ppt
 
Speed Control of DC Motor
Speed Control of DC MotorSpeed Control of DC Motor
Speed Control of DC Motor
 
line following robot
line following robotline following robot
line following robot
 
Robotic 6DOF ARM
Robotic 6DOF ARMRobotic 6DOF ARM
Robotic 6DOF ARM
 
Obstacle Avoidance Robot Summer training Presentation
Obstacle Avoidance Robot Summer training Presentation Obstacle Avoidance Robot Summer training Presentation
Obstacle Avoidance Robot Summer training Presentation
 
INTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLERINTRODUCTION TO MICROCONTROLLER
INTRODUCTION TO MICROCONTROLLER
 
Line Follower Final Report
Line Follower Final ReportLine Follower Final Report
Line Follower Final Report
 

En vedette

Line following robot - Mini project
Line following robot - Mini projectLine following robot - Mini project
Line following robot - Mini projectAmit Upadhye
 
Đồ án thiết kế robot dò đường
Đồ án thiết kế robot dò đườngĐồ án thiết kế robot dò đường
Đồ án thiết kế robot dò đườngKiều Tú
 
Line follower(theory + coding + videos)
Line follower(theory + coding + videos)Line follower(theory + coding + videos)
Line follower(theory + coding + videos)Yash Patel
 
visible light follower robot by nagaraju.m
visible light follower robot by nagaraju.mvisible light follower robot by nagaraju.m
visible light follower robot by nagaraju.mNagaraju Medara
 
How to make a Line Follower Robot
How to make a Line Follower RobotHow to make a Line Follower Robot
How to make a Line Follower RobotHassan Raza
 
Motor driver IC L293D
Motor driver IC L293DMotor driver IC L293D
Motor driver IC L293DAmit kumar
 
(Reading Group) First Results in Detecting and Avoiding Frontal Obstacles fro...
(Reading Group) First Results in Detecting and Avoiding Frontal Obstacles fro...(Reading Group) First Results in Detecting and Avoiding Frontal Obstacles fro...
(Reading Group) First Results in Detecting and Avoiding Frontal Obstacles fro...Mohamed Elawady
 
Project Sparsh
Project SparshProject Sparsh
Project SparshSourav Roy
 

En vedette (13)

Line following robot - Mini project
Line following robot - Mini projectLine following robot - Mini project
Line following robot - Mini project
 
Đồ án thiết kế robot dò đường
Đồ án thiết kế robot dò đườngĐồ án thiết kế robot dò đường
Đồ án thiết kế robot dò đường
 
Line follower(theory + coding + videos)
Line follower(theory + coding + videos)Line follower(theory + coding + videos)
Line follower(theory + coding + videos)
 
visible light follower robot by nagaraju.m
visible light follower robot by nagaraju.mvisible light follower robot by nagaraju.m
visible light follower robot by nagaraju.m
 
How to make a Line Follower Robot
How to make a Line Follower RobotHow to make a Line Follower Robot
How to make a Line Follower Robot
 
Pid control for line follwoers
Pid control for line follwoersPid control for line follwoers
Pid control for line follwoers
 
L293D
L293DL293D
L293D
 
Motor driver IC L293D
Motor driver IC L293DMotor driver IC L293D
Motor driver IC L293D
 
Motor driver
Motor driverMotor driver
Motor driver
 
My minor project
My minor projectMy minor project
My minor project
 
(Reading Group) First Results in Detecting and Avoiding Frontal Obstacles fro...
(Reading Group) First Results in Detecting and Avoiding Frontal Obstacles fro...(Reading Group) First Results in Detecting and Avoiding Frontal Obstacles fro...
(Reading Group) First Results in Detecting and Avoiding Frontal Obstacles fro...
 
Autonomous Line Follower
Autonomous Line FollowerAutonomous Line Follower
Autonomous Line Follower
 
Project Sparsh
Project SparshProject Sparsh
Project Sparsh
 

Similaire à How to make a Line Follower Robot

Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerRup Chowdhury
 
Implement Servo Motor Drive
Implement Servo Motor DriveImplement Servo Motor Drive
Implement Servo Motor DriveAalok Shah
 
Minor project report on
Minor project report on Minor project report on
Minor project report on Arindam Paul
 
Wireless Gesture Controlled Tank Toy- Transmitter
Wireless Gesture Controlled Tank Toy- TransmitterWireless Gesture Controlled Tank Toy- Transmitter
Wireless Gesture Controlled Tank Toy- TransmitterNeeraj Purohit
 
Automatic Power Factor Correction Using Arduino Uno
Automatic Power Factor Correction Using Arduino UnoAutomatic Power Factor Correction Using Arduino Uno
Automatic Power Factor Correction Using Arduino UnoVineetKumar508
 
LINE FOLLOWER ROBOT
LINE FOLLOWER ROBOTLINE FOLLOWER ROBOT
LINE FOLLOWER ROBOTrehaan ukaye
 
Biratnagar Robotics Club, Nepal
Biratnagar Robotics Club, NepalBiratnagar Robotics Club, Nepal
Biratnagar Robotics Club, NepalSarwar Alam Ansari
 
Microprocessor Week 10: Applications
Microprocessor Week 10: ApplicationsMicroprocessor Week 10: Applications
Microprocessor Week 10: ApplicationsArkhom Jodtang
 
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...moiz89
 
BLDC Motor Speed Control with RPM Display and PWM
BLDC Motor Speed Control with RPM Display and PWMBLDC Motor Speed Control with RPM Display and PWM
BLDC Motor Speed Control with RPM Display and PWMEdgefxkits & Solutions
 
AVR_Course_Day6 external hardware interrupts and analogue to digital converter
AVR_Course_Day6 external hardware  interrupts and analogue to digital converterAVR_Course_Day6 external hardware  interrupts and analogue to digital converter
AVR_Course_Day6 external hardware interrupts and analogue to digital converterMohamed Ali
 

Similaire à How to make a Line Follower Robot (20)

Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
embedded system bye Sj
embedded system bye Sjembedded system bye Sj
embedded system bye Sj
 
Obstacle avoiding robot(Lab report)
Obstacle  avoiding  robot(Lab report)Obstacle  avoiding  robot(Lab report)
Obstacle avoiding robot(Lab report)
 
Implement Servo Motor Drive
Implement Servo Motor DriveImplement Servo Motor Drive
Implement Servo Motor Drive
 
Minor project report on
Minor project report on Minor project report on
Minor project report on
 
Wireless Gesture Controlled Tank Toy- Transmitter
Wireless Gesture Controlled Tank Toy- TransmitterWireless Gesture Controlled Tank Toy- Transmitter
Wireless Gesture Controlled Tank Toy- Transmitter
 
Badal sharma
Badal sharmaBadal sharma
Badal sharma
 
embedded system
embedded systemembedded system
embedded system
 
Automatic Power Factor Correction Using Arduino Uno
Automatic Power Factor Correction Using Arduino UnoAutomatic Power Factor Correction Using Arduino Uno
Automatic Power Factor Correction Using Arduino Uno
 
Metal Detector Robotic Vehicle
Metal Detector Robotic VehicleMetal Detector Robotic Vehicle
Metal Detector Robotic Vehicle
 
LINE FOLLOWER ROBOT
LINE FOLLOWER ROBOTLINE FOLLOWER ROBOT
LINE FOLLOWER ROBOT
 
00899a 2
00899a 200899a 2
00899a 2
 
00899a 2
00899a 200899a 2
00899a 2
 
Biratnagar Robotics Club, Nepal
Biratnagar Robotics Club, NepalBiratnagar Robotics Club, Nepal
Biratnagar Robotics Club, Nepal
 
Microprocessor Week 10: Applications
Microprocessor Week 10: ApplicationsMicroprocessor Week 10: Applications
Microprocessor Week 10: Applications
 
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...
MICROPROCESSOR BASED SUN TRACKING SOLAR PANEL SYSTEM TO MAXIMIZE ENERGY GENER...
 
BLDC Motor Speed Control with RPM Display and PWM
BLDC Motor Speed Control with RPM Display and PWMBLDC Motor Speed Control with RPM Display and PWM
BLDC Motor Speed Control with RPM Display and PWM
 
Ppt
PptPpt
Ppt
 
AVR_Course_Day6 external hardware interrupts and analogue to digital converter
AVR_Course_Day6 external hardware  interrupts and analogue to digital converterAVR_Course_Day6 external hardware  interrupts and analogue to digital converter
AVR_Course_Day6 external hardware interrupts and analogue to digital converter
 

Plus de roboVITics club

RoboCV Module 5: Contours using OpenCV
RoboCV Module 5: Contours using OpenCVRoboCV Module 5: Contours using OpenCV
RoboCV Module 5: Contours using OpenCVroboVITics club
 
RoboCV Module 4: Image Processing Techniques using OpenCV
RoboCV Module 4: Image Processing Techniques using OpenCVRoboCV Module 4: Image Processing Techniques using OpenCV
RoboCV Module 4: Image Processing Techniques using OpenCVroboVITics club
 
RoboCV Module 3: Delving Deeper into OpenCV
RoboCV Module 3: Delving Deeper into OpenCVRoboCV Module 3: Delving Deeper into OpenCV
RoboCV Module 3: Delving Deeper into OpenCVroboVITics club
 
RoboCV Module 2: Introduction to OpenCV and MATLAB
RoboCV Module 2: Introduction to OpenCV and MATLABRoboCV Module 2: Introduction to OpenCV and MATLAB
RoboCV Module 2: Introduction to OpenCV and MATLABroboVITics club
 
RoboCV Module 1: Introduction to Machine Vision
RoboCV Module 1: Introduction to Machine VisionRoboCV Module 1: Introduction to Machine Vision
RoboCV Module 1: Introduction to Machine VisionroboVITics club
 
RoboCV - Demo Session Slides
RoboCV - Demo Session SlidesRoboCV - Demo Session Slides
RoboCV - Demo Session SlidesroboVITics club
 
ROBO-SUMO Event Details v1.2
ROBO-SUMO Event Details v1.2ROBO-SUMO Event Details v1.2
ROBO-SUMO Event Details v1.2roboVITics club
 
VIT-EDC Problem Statement v1.2
VIT-EDC Problem Statement v1.2VIT-EDC Problem Statement v1.2
VIT-EDC Problem Statement v1.2roboVITics club
 

Plus de roboVITics club (8)

RoboCV Module 5: Contours using OpenCV
RoboCV Module 5: Contours using OpenCVRoboCV Module 5: Contours using OpenCV
RoboCV Module 5: Contours using OpenCV
 
RoboCV Module 4: Image Processing Techniques using OpenCV
RoboCV Module 4: Image Processing Techniques using OpenCVRoboCV Module 4: Image Processing Techniques using OpenCV
RoboCV Module 4: Image Processing Techniques using OpenCV
 
RoboCV Module 3: Delving Deeper into OpenCV
RoboCV Module 3: Delving Deeper into OpenCVRoboCV Module 3: Delving Deeper into OpenCV
RoboCV Module 3: Delving Deeper into OpenCV
 
RoboCV Module 2: Introduction to OpenCV and MATLAB
RoboCV Module 2: Introduction to OpenCV and MATLABRoboCV Module 2: Introduction to OpenCV and MATLAB
RoboCV Module 2: Introduction to OpenCV and MATLAB
 
RoboCV Module 1: Introduction to Machine Vision
RoboCV Module 1: Introduction to Machine VisionRoboCV Module 1: Introduction to Machine Vision
RoboCV Module 1: Introduction to Machine Vision
 
RoboCV - Demo Session Slides
RoboCV - Demo Session SlidesRoboCV - Demo Session Slides
RoboCV - Demo Session Slides
 
ROBO-SUMO Event Details v1.2
ROBO-SUMO Event Details v1.2ROBO-SUMO Event Details v1.2
ROBO-SUMO Event Details v1.2
 
VIT-EDC Problem Statement v1.2
VIT-EDC Problem Statement v1.2VIT-EDC Problem Statement v1.2
VIT-EDC Problem Statement v1.2
 

Dernier

HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsMichael W. Hawkins
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in managementchhavia330
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLSeo
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Dave Litwiller
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Lviv Startup Club
 
Unlocking the Secrets of Affiliate Marketing.pdf
Unlocking the Secrets of Affiliate Marketing.pdfUnlocking the Secrets of Affiliate Marketing.pdf
Unlocking the Secrets of Affiliate Marketing.pdfOnline Income Engine
 
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
Keppel Ltd. 1Q 2024 Business Update  Presentation SlidesKeppel Ltd. 1Q 2024 Business Update  Presentation Slides
Keppel Ltd. 1Q 2024 Business Update Presentation SlidesKeppelCorporation
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Servicediscovermytutordmt
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdfRenandantas16
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsP&CO
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear RegressionRavindra Nath Shukla
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfPaul Menig
 
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130  Available With RoomVIP Kolkata Call Girl Howrah 👉 8250192130  Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Roomdivyansh0kumar0
 
Best Basmati Rice Manufacturers in India
Best Basmati Rice Manufacturers in IndiaBest Basmati Rice Manufacturers in India
Best Basmati Rice Manufacturers in IndiaShree Krishna Exports
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsApsara Of India
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Roland Driesen
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...anilsa9823
 

Dernier (20)

HONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael HawkinsHONOR Veterans Event Keynote by Michael Hawkins
HONOR Veterans Event Keynote by Michael Hawkins
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in management
 
Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517
Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517
Nepali Escort Girl Kakori \ 9548273370 Indian Call Girls Service Lucknow ₹,9517
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
Enhancing and Restoring Safety & Quality Cultures - Dave Litwiller - May 2024...
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
Yaroslav Rozhankivskyy: Три складові і три передумови максимальної продуктивн...
 
Unlocking the Secrets of Affiliate Marketing.pdf
Unlocking the Secrets of Affiliate Marketing.pdfUnlocking the Secrets of Affiliate Marketing.pdf
Unlocking the Secrets of Affiliate Marketing.pdf
 
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
Keppel Ltd. 1Q 2024 Business Update  Presentation SlidesKeppel Ltd. 1Q 2024 Business Update  Presentation Slides
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Service
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
Regression analysis: Simple Linear Regression Multiple Linear Regression
Regression analysis:  Simple Linear Regression Multiple Linear RegressionRegression analysis:  Simple Linear Regression Multiple Linear Regression
Regression analysis: Simple Linear Regression Multiple Linear Regression
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdf
 
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130  Available With RoomVIP Kolkata Call Girl Howrah 👉 8250192130  Available With Room
VIP Kolkata Call Girl Howrah 👉 8250192130 Available With Room
 
Forklift Operations: Safety through Cartoons
Forklift Operations: Safety through CartoonsForklift Operations: Safety through Cartoons
Forklift Operations: Safety through Cartoons
 
Best Basmati Rice Manufacturers in India
Best Basmati Rice Manufacturers in IndiaBest Basmati Rice Manufacturers in India
Best Basmati Rice Manufacturers in India
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
 
Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...Ensure the security of your HCL environment by applying the Zero Trust princi...
Ensure the security of your HCL environment by applying the Zero Trust princi...
 
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
Lucknow 💋 Escorts in Lucknow - 450+ Call Girl Cash Payment 8923113531 Neha Th...
 

How to make a Line Follower Robot

  • 1. How to make a line follower
  • 2. Introduction What is a line follower? • Line follower is a robot that can follow a path. The path can be visible like a black line on a white surface (or vice-versa). (c) Copyright, roboVITics club 2012 2
  • 3. Hardware Components • IR Sensors • DC Geared Motors • Robot Chasis • Microcontroller development board • Atmega 8 Microcontroller • USB Programmer (c) Copyright, roboVITics club 2012 3
  • 4. IR Sensor (c) Copyright, roboVITics club 2012 4
  • 5. Block Diagram Every sensor has three terminals VCC •VCC – to power up the sensor •GND – to provide a fixed negative reference Physical Parameters Sensor OUTPU •OUTPUT – analog T output of the sensor GND (c) Copyright, roboVITics club 2012 5
  • 6. Working • IR sensor works on the principle of emitting IR rays and receiving the reflected ray by a receiver (Photo Diode) (c) Copyright, roboVITics club 2012 6
  • 7. IR Sensor circuit (c) Copyright, roboVITics club 2012 7
  • 8. Types of resistor • Fixed type resistor • Variable type resistor (c) Copyright, roboVITics club 2012 8
  • 9. LM358 • The LM358 IC consists of two independent operational amplifiers which were designed specifically to operate from a single power supply over a wide range of voltages. • It have two op-amp • Single power supply (c) Copyright, roboVITics club 2012 9
  • 10. LM358 IC (c) Copyright, roboVITics club 2012 10
  • 11. Internal circuit (c) Copyright, roboVITics club 2012 11
  • 12. DC geared motors • Motors having external gear arrangement attached with motor. • It has a gearbox that increases torque and decreases speed. • Most commonly used in robotics as they are having considerable torque. (c) Copyright, roboVITics club 2012 12
  • 13. DC Motors • Motors which works on dc current and gives a rotating motion as an output. • In robotics applications, they are preferred over AC motors as the motor and the complete circuit require same kind of supply i.e. DC supply. (c) Copyright, roboVITics club 2012 13
  • 14. Chasis • Provides a base to the robot. • Wheels, sensors and controller board are attached to it. (c) Copyright, roboVITics club 2012 14
  • 15. IC’s • L293D • LM358 • IC 7805(voltage controlled) (c) Copyright, roboVITics club 2012 15
  • 16. IC 7805 • It is a voltage regulator integrated circuit. • It designed to automatically maintain a constant voltage level (c) Copyright, roboVITics club 2012 16
  • 17. Features • Output current range up to 1A • Output voltage 5V • Input voltage range up to 12V • Short circuit protection (c) Copyright, roboVITics club 2012 17
  • 18. Transistor • Transistor are of two types: 1-> n-p-n A straight switch 2-> p-n-p A inverted switch (c) Copyright, roboVITics club 2012 18
  • 19. n-p-n as a switch • When base of n-p-n is connected with logic high voltage then it short circuit emitter and collector (SWITCH ON). • When base of n-p-n is connected with logic low voltage then it open circuit both emitter and collector (SWITCH OFF). (c) Copyright, roboVITics club 2012 19
  • 20. Circuit diagram to show a switching VCC Logic transisto Motor r 0 off stop 1 on run Logic 1 or RB Logic 0 M GND (c) Copyright, roboVITics club 2012 20
  • 21. p-n-p as an inverted switch • When base of p-n-p is connected with logic high voltage then it open circuit emitter and collector (SWITCH OFF). • When base of p-n-p is connected with logic low voltage then it short circuit both emitter and collector (SWITCH ON). (c) Copyright, roboVITics club 2012 21
  • 22. Controlling Motor Using H-Bridge • Switches settings for rotation:  S1&S4: ON and S2&S3: OFF (for one direction).  S2&S3: ON and S1&S4: OFF (for other direction). • S1-S2: ON or S3&S4: ON (can be used to stop the motor). (c) Copyright, roboVITics club 2012 22
  • 23. H-Bridge Operation A B o/p 0 0 Stop 0 1 Clock wise 1 0 Counter clock wise 1 1 Stop (c) Copyright, roboVITics club 2012 23
  • 24. L293D IC EN1 EN1 Vcc 12V EN2 12V (c) Copyright, roboVITics club 2012 24
  • 25. Conti…. • L293D is a dual H-Bridge motor driver. • So with one IC we can interface two DC motors which can be controlled in both clockwise and counter clockwise direction • If you have motor with fix direction of motion then you can make use of all the four I/Os to connect up to four DC motors. • L293D has output current of 600mA. • Moreover for protection of circuit from back EMF output diodes are included within the IC. (c) Copyright, roboVITics club 2012 25
  • 26. Dual H-Bridge Motor Driver IC: L293D Features: • Capable of driving 2 motors at a time in clockwise and anti- clockwise direction separately. • Works as an interface for controlling motors using lower voltage (5V) and running motors on higher voltage. (c) Copyright, roboVITics club 2012 26
  • 27. Interface motor with IC L293D EN1 VCC 12V EN2 (c) Copyright, roboVITics club 2012 27
  • 28. What is a Microcontroller?  A microcontroller (sometimes abbreviated µC or MCU) is a small computer on a single IC containing a processor core, memory, and programmable input/output peripherals.  It is a decision making device used widely in embedded systems and all intelligent devices. (c) Copyright, roboVITics club 2012 28
  • 29. Difference between Microcontroller and Microprocessor  Microcontroller has I/O ports, Memory, timers etc all integrated on chip itself  In Microprocessors, I/O ports, memory, timer etc are to be connected externally (c) Copyright, roboVITics club 2012 29
  • 30. Microcontrollers Microprocessors • Full fledged PC! • Separated units • ROM, RAM, Flash, • Higher resources CPU, ALU, on-chip • MCU – (everything in peripherals point 2) • Lower resources (c) Copyright, roboVITics club 2012 30
  • 31. Typical MCU based solution Microwave Oven (c) Copyright, roboVITics club 2012 31
  • 32. MCU Ports • Ports contains pins of the MCU • Can be turned ON or OFF by the program – ON = 1 (in TTL 5V) – OFF = 0 (in TTL 0V) • Input mode – values can be read – Above threshold = ON – Below threshold = OFF (c) Copyright, roboVITics club 2012 32
  • 33. AVR ATmega8 Microcontroller (c) Copyright, roboVITics club 2012 33
  • 34. How AVR ATmega8 got its name?  It was developed by Atmel Corporation  AVR implies it belongs to AVR family.  ‘8’ in Atmega8 means this microcontroller has 8Kb of flash memory (c) Copyright, roboVITics club 2012 34
  • 35. TYPES OF PACKAGES  28-lead PDIP (Plastic Dual In-line Package)  32-lead TQFP (Thin Quad film Package) (c) Copyright, roboVITics club 2012 35
  • 36. How ATmega8 PDIP Package looks like? (c) Copyright, roboVITics club 2012 36
  • 37. How ATmega8 TQFP Package looks like? (c) Copyright, roboVITics club 2012 37
  • 38. Pinout of ATmega8 (c) Copyright, roboVITics club 2012 38
  • 39. PORT B(PB7-PB0)  It is a 8-bit bi-directional I/O port.  It can be used either as a input port or as output port ( direction must be specified in programming). (c) Copyright, roboVITics club 2012 39
  • 40. PORT C(PC6-PC0)  It is a 7-bit bi-directional I/O port.  It can be used either as a input port or as output port ( direction must be specified in programming). (c) Copyright, roboVITics club 2012 40
  • 41. PORTD(PD7-PD0)  It is a 8-bit bi-directional I/O port.  It can be used either as a input port or as output port ( direction must be specified in programming). (c) Copyright, roboVITics club 2012 41
  • 42. Microcontroller development board • Used to interface motors, sensors and various other devices with microcontroller. • Components like resistors, capacitors, power supply are attached to the microcontroller via development board for its working. (c) Copyright, roboVITics club 2012 42
  • 43. USB Programmer • Used to burn code from laptop to memory of microcontroller. (c) Copyright, roboVITics club 2012 43
  • 44. Two sensor line follower Left Right Directi Left Right Sensor Sensor on Motor Motor 0 0 Forwar +12V +12V d 0 1 Copyright, roboVITics club 2012 (c) Left -12V +12V 44
  • 49. Getting Started Selecting Hardware Selecting Software • PC / Mac • OS – Windows / Mac • In-System OS / Linux Programmer (ISP) • “Free” Compiler • Target Board (MCU • “Free” Programmer Dev Board) Software • Lastly, a MCU!! (c) Copyright, roboVITics club 2012 49
  • 50. Softwares needed • AVR Studio – for programming • Compiler – for compiling the code • eXtreme Burner or avrloader – for buring code generated to microcontroller. (c) Copyright, roboVITics club 2012 50
  • 51. Step 1 (c) Copyright, roboVITics club 2012 51
  • 52. Step 2 (c) Copyright, roboVITics club 2012 52
  • 53. Datasheet • Manufacturer gives information regarding the product to its users • Data given is in detail • Features, Technical Specs, Design, Register Summary, Expected Usage, Troubleshooting, Pin details, etc. • Best source of info!! • All electronic components have a datasheet for them • Google them out!! (c) Copyright, roboVITics club 2012 53
  • 54. Pin Configurations Atmega8 (c) Copyright, roboVITics club 2012 Atmega16/32 54
  • 55. AVR Studio • Most popular C compiler for AVR • Its official! • Unlike other compilers/emulators, its totally free • The code written will be common to all AVR mcu’s • AVR Studio 4 has been used • AVR Studio 5 beta and AVR Studio 6 has been released (c) Copyright, roboVITics club 2012 55
  • 56. INTRODUCTION TO EMBEDDED SYSTEM AND EMBEDDED C (c) Copyright, roboVITics club 2012 56
  • 57. What is Embedded C? • Embedded C is nothing but a subset of C language which is compatible with certain microcontrollers. • Some features are added using header files like <avr/io.h>, <util/delay.h>. • scanf() and printf() are removed as the inputs are scanned from the sensors and outputs are given to the ports. • Control structures remain the same like if- statement, for loop, do-while etc. (c) Copyright, roboVITics club 2012 57
  • 58. Development process of Embedded C projects • Write C programs in AVR Studio IDE(Integrated Development Environment) • Compile them into a .hex file using the AVR-GCC compiler (which integrates into AVR Studio) • Simulate the target AVR program and debug the code within AVR Studio • Program the actual chip using the USBasp device, which is attached to our target board with a special 6-pin cable • Once programmed, the chip runs the program in your circuit (c) Copyright, roboVITics club 2012 58
  • 59. Registers to Communicate with I/O Ports  To communicate with the ports of Atmega8, we use three registers:  PINx  PORTx  DDRx Where x would be either B,C or D. (c) Copyright, roboVITics club 2012 59
  • 60. DDRx Register  It stands for Data Direction Register.  It is used to define Port as Input or Output.  In order to make Port as Input Port: DDRx=0x00 (In Hexadecimal) DDRx=0b00000000(In Binary)  In order to make Port as output Port: DDRx=0xFF (In Hexadecimal) DDRx=0b11111111(In Binary) (c) Copyright, roboVITics club 2012 60
  • 61. PORTx Register  If DDRx=0xFF(Output port)  Writing logic 1 to PORTx will make output high i.e 5v for that particular pin.  Writing 0 to PORTx will make output low i.e 0v for that particular pin. (c) Copyright, roboVITics club 2012 61
  • 62. Continued..  If DDRx=Ox00(Input port):  If corresponding PORTx bit is set to 1, Internal pull up resistors are enabled i.e if we do not connect this pin to anything it still reads as 1.  If corresponding PORTx bit is set to 0, internal pull up resistors are disabled i.e the pin will enter a high impedance state and will become unpredictable. (c) Copyright, roboVITics club 2012 62
  • 63. PINx Register  It reads data from the port pins.  If any/all bits of DDRx is set to 0(input)for a particular pin, we can read data from PINx  If any/all bits of DDRx is set to 1(output), then reading PINx register gives the same data which has been output on that particular pin. (c) Copyright, roboVITics club 2012 63
  • 64. For Details, visit maxEmbedded.com A guide to robotics and embedded electronics AVR Guide and Tutorials Basics of Microcontrollers, Sensors, Timers, ADC, Serial Communication, etc (c) Copyright, roboVITics club 2012 65
  • 65. maxEmbedded blog (c) Copyright, roboVITics club 2012 66
  • 66. Online Stores • store.extremeelectronics.co.in • nex-robotics.com • embeddedmarket.com • rhydolabz.com • thinklabs.in • sparkfun.com (c) Copyright, roboVITics club 2012 67
  • 67. Suggestions and Doubts are welcome That’s all for today Thank you 24 hour helpline 9566758862 P.S. Its not toll-free! For more info, visit Mayank’s blog maxEmbedded. com (c) Copyright, roboVITics club 2012 © maxEmbedded68 2012

Notes de l'éditeur

  1. (c) Copyright, Mayank Prasad, 2012
  2. (c) Copyright, Mayank Prasad, 2012