+ All Categories
Home > Documents > Robotics Project 1

Robotics Project 1

Date post: 04-Apr-2018
Category:
Upload: hemant-k-nyk
View: 216 times
Download: 0 times
Share this document with a friend

of 17

Transcript
  • 7/31/2019 Robotics Project 1

    1/17

    REPORT OFINDUSTRIALTRAINING@NEXTSAPIENSRobotics Workshop Batch:25th-29th July,2009

    Report submitted by:Rajsmita ChowdhuryAssam Engineering CollegeGuwahati-13,Assam.22/8/2009

  • 7/31/2019 Robotics Project 1

    2/17

    I would like to thank the entire team of NextSapiens for organizing such aninnovative workshop which enabled us toexpose ourselves to the world of robotics.I would specially like to thank the facultymembers for their dedication andsupport.

    Thanking You

  • 7/31/2019 Robotics Project 1

    3/17

    OBJECTIVE

    To make a line follower robot using

    Atmega-16 microcontroller.

  • 7/31/2019 Robotics Project 1

    4/17

    COMPONENTS USED

    ATMEGA-16MICROCONTROLLER

    3 COLOUR SENSORS

    DC MOTORS ,CASTOR ,2WHEELS, METAL CHASIS,NUTS,BOLTS AND SCREWS

    CONNECTORS

    ISP PROGRAMMER

    ADAPTOR

  • 7/31/2019 Robotics Project 1

    5/17

    FIGURE SHOWING THECOMPONENTS USED

  • 7/31/2019 Robotics Project 1

    6/17

    The Atmega16 is an 8-bit Microcontroller. 8-bit means theArithmetic and Logic Unit of the controller can handle 8-bitdata at a time. The figure shows the pin layout of Atmega16.It has four I/O ports: Port A, B, C and D each of which can

    be configured as either input or output. Note the numberingof the pins. The numbering starts from left side of the notchgoes till the bottom, then again continues from the right sidebottom and continues upwards up till the right side of thenotch. Pins PA0-PA7 indicates Port A, PB0-PB7 indicatePort B and so on. The ports are Byte-addressable as wellas Bit-addressable. There are two pins for providingpower supply: VCC & AVCC. Both of them have to beconnected to a constant +5V DC supply. There are two pinsproviding Ground. Both of them have to be connected to the0V of the supply. AREF is the reference voltage for theAnalog to Digital Converter. The external crystal oscillatorhas to be connected to XTAL1 and XTAL2. The RESET pinis used to reset the Microcontroller. It is active-low andhence to provide reset the pin has to be taken to 0V.

  • 7/31/2019 Robotics Project 1

    7/17

  • 7/31/2019 Robotics Project 1

    8/17

    ASSEMBLAGE OF THE

    COMPONENTS

    The robot is made by assembling thecomponents as shown in the figures below.

    Figure 1

  • 7/31/2019 Robotics Project 1

    9/17

    Figure 2

    Figure 3

  • 7/31/2019 Robotics Project 1

    10/17

    PROBLEMDESCRIPTION

    To make a self-calibrating line follower robotwhich will be following a black track with thehelp of 3 colour sensors.The robot will be made to self-calibrate onblack and white surfaces where they will takesthe respective colour values.The sensors are placed in such a way that theydistinguish between the black and whitesurfaces and follow the black line accordingly.

  • 7/31/2019 Robotics Project 1

    11/17

    $regfile instructs the compiler to use the specifiedregister file. The register file holds the informationabout the chip such as the internal registers.$crystal defines the clock speed at which themicrocontroller will run.

    Config statement is used to configure the various hardware devices and other features of microcontroller.

    Here we define lcd with config.We write config lcd=16*2,whrere 16 is the no of characters entered in a line and 2 is the no of lines.

    Config lcdpin configures the pin of the microcontroller.

    ADC defines the running mode.

    Prescaler is a numeric constant for the clock divider.

    Reference is the additional reference options. its valuemay off, avcc or internal.

    Timer 1 is a 16bit counter.

    Pwm stands for pulse width modulation. It can be 8,9 or10.

  • 7/31/2019 Robotics Project 1

    12/17

    Prescale is the timer connected to the system clock inthis case.

    Compare a pwm refers to pwm compare mode .

    To define a variable in bascom we use dim as variabletype.eg: DIM R as Integer.

    R stores the input.

    Cls clears the lcd screen.

    Case select statement is applied. when the conditionsatisfies it will execute.

    Start adc to start device.

    Pwm1.a and pwm1.b represents the speed of the twomotors.

    Portd.3 and portd.6 are for the direction of the twomotors. 0&1 are the values for clock & anticlock rotation

    Wires of the motor 1 will be inserted into first 2 pins of molex connector with motor1 from left side & similarlyfor motor in the next 2 pins of the connector.

  • 7/31/2019 Robotics Project 1

    13/17

  • 7/31/2019 Robotics Project 1

    14/17

    $regfile = "m16def.dat"$crystal = 4000000Config Lcd = 16 * 2Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 =Portb.6 , Db7 = Portb.7 , E = Portb.3 , Rs = Portb.2Config Adc = Single , Prescaler = Auto , Reference = AvccConfig Timer1 = Pwm , Pwm = 8 , Prescale = 1 , Compare A

    Pwm = Clear Down , Compare B Pwm = Clear DownDim L As Integer , C As Integer , R As IntegerDim Lw As Integer , Lb As Integer , Lm As Integer , Cw AsInteger , Cb As Integer , Cm As Integer , Rw As Integer , RbAs Integer , Rm As IntegerStart AdcClsStart Timer1Lcd "calibrate white surface"LowerlineLcd "place the robot on white"Waitms 10000ClsLcd "configuring"Lw = Getadc(0)

    Cw = Getadc(2)Rw = Getadc(1)Waitms 1000ClsLcd "calibrate black surface"

  • 7/31/2019 Robotics Project 1

    15/17

  • 7/31/2019 Robotics Project 1

    16/17

    Pwm1a = 135Portd.3 = 0Pwm1b = 200

    Portd.6 = 0LowerlineLcd "right"Elseif L < Lm And C < Cm And R > Rm ThenPwm1a = 135Portd.3 = 0Pwm1b = 200Portd.6 = 0LowerlineLcd "right"Elseif L > Lm And C < Cm And R < Rm ThenPwm1a = 200Portd.3 = 0Pwm1b = 150Portd.6 = 0

    LowerlineLcd "left"Elseif L > Lm And C > Cm And R < Rm ThenPwm1a = 200Portd.3 = 0Pwm1b = 150Portd.6 = 0LowerlineLcd "left"Loop

    End

  • 7/31/2019 Robotics Project 1

    17/17

    THANK YOU


Recommended