Вы находитесь на странице: 1из 46

LINE FOLLOWING ROBOT

INTRODUCTION:
This chapter introduces a line following robot, For many people robot is a machine that imitates a humanlike the androids in Star Wars, Terminator and Star Trek: The Next Generation. However much these robots capture our imagination, such robots still only inhabit Science Fiction. People still haven't been able to give a robot enough 'common sense' to reliably interact with a dynamic world. The type of robots that you will encounter most frequently are robots that do work that is too dangerous, boring, onerous, or just plain nasty. Most of the robots in the world are of this type. They can be found in auto, medical, manufacturing and space industries. In fact, there are over a million of these type of robots working for us today. Some robots like the Mars Rover Sojourner and the upcoming Mars Exploration Rover, or the underwater robot Caribou help us learn about places that are too dangerous for us to go. What exactly is a robot? As strange as it might seem, there really is no standard definition for a robot. However, there are some essential characteristics that a robot must have and this might help you to decide what is and what not a robot is. It will also help you to decide what features you will need to build into a machine before it can count as a robot. A robot has these essential characteristics: Sensing: First of all your robot would have to be able to sense its surroundings. It would dothis in ways that are not unsimilar to the way that you sense your surroundings. Givingyour robot sensors: light sensors (eyes), touch and pressure sensors (hands), chemicalsensors (nose), hearing and sonar sensors (ears), and taste sensors (tongue) will give your robot awareness of its environment. Movement: A robot needs to be able to move around its environment.Whether rolling onwheels, walking on legs or propelling by thrusters a robot needs to be able to move. To count as a robot the whole robot moves, either like the Sojourner or just parts of the robot moves, like the Canada Arm. Energy: A robot needs to be able to power itself. A robot might be solar p o w e r e d , electrically powered, battery powered. The way your robot gets its energy will depend on what your robot needs to do. Intelligence: A r o b o t n e e d s s o m e k i n d o f " s m a r t s . " Th i s i s w h e r e p r o g r a m m i n g e n t e r s t h e pictures. A programmer is the person who gives the robot its 'smarts.' The robot will have to have some way to receive the program so that it knows what it is to do. ECE Dept. SCCE 1

LINE FOLLOWING ROBOT


So what is a robot? Well it is a system that contains sensors, control systems, manipulators, power s u p p l i e s a n d s o f t w a r e a l l w o r k i n g t o g e t h e r t o p e r f o r m a t a s k . D e s i g n i n g , b u i l d i n g , programming and testing a robot is a combination of physics, mechanical engineering, electrical engineering, structural engineering, mathematics and computing. In some cases biology, medicine, chemistry might also be involved. A study of robotics means that students are actively engaged with all of these disciplines in a deeply problem-posing problem solving environment. What is a line follower? Line follower is a machine that can follow a path. The path can be visible like a black line on a white surface (or vice-versa) or it can be invisible like a magnetic field. Why build a line follower? Sensing a line and maneuvering the robot to stay on course, while c o n s t a n t l y correcting wrong moves using feedback mechanism forms a simple yet effective closed loop system. As a programmer you get an opportunity to teach the robot how to follow the line thus giving it a human-like property of responding to stimuli. Practical applications of a line follower: Automated cars running on roads with embedded magnets; guidance system for industrial robots moving on shop floor etc

ECE Dept. SCCE

LINE FOLLOWING ROBOT


CHAPTER 1 PRODUCT DESCRIPTION 1.1 AVR DEVOLOPMENT BOARD 107010 :
Includes Atmels ATmega16 Microcontroller with 16kb flash memory working at 16MIPS or ATmega8535 Microcontroller with 8kb flash memory working at 16MIPS. Compatible with all AVR 40 pin micro controllers. On-board LCD interface (it can also be used for any other general purpose application). On-board Motor Driver for connecting 4 DC motors or 2 Stepper motors Onboard servo interface On-board regulated power supply. PC interface through UART. On-board Buzzer. 16 MHz external crystal. Exposed all 32 I/O pins. Exposed 8 channel I/O pins for ADC and sensors with 5V/1A power supply. Exposed 8 channel I/O pins for servo and sensors with dual power supply. Five tact switches for external input and reset. Four test surface mounted LEDs for status and debugging purpose. Two supply indicator LEDs. Dual power supply through DC source (6V to 16V) or USB powered. On board USB programmer. Dual or single power supply option. Exposed ISP pins for programming.

ECE Dept. SCCE

LINE FOLLOWING ROBOT

CHAPTER 2 PARTS DESCRIPTION 2.1 MICROCONTROLLER:


It is a micro computer chip which stores our programs executes them and takes necessary action. The chip used hear is Atmels popular AVR micro controller. The ATmega8535 is a low-power CMOS 8-bit microcontroller based on the AVR enhanced RISC architecture. By executing instructions in a single clock cycle, the ATmega8535 achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed.

Figure 2.1:Atmega8535 Features: High-performance, Low-power AVR 8-bit Microcontroller Advanced RISC Architecture 130 Powerful Instructions Most Single Clock Cycle Execution 32 x 8 General Purpose Working Registers ECE Dept. SCCE 4

LINE FOLLOWING ROBOT


Fully Static Operation Up to 16 MIPS Throughput at 16 MHz On-chip 2-cycle Multiplier Nonvolatile Program and Data Memories 8K Bytes of In-System Self-Programmable Flash Endurance: 10,000 Write/Erase Cycles Optional Boot Code Section with Independent Lock Bits In-System Programming by On-chip Boot Program True Read-While-Write Operation 512 Bytes EEPROM Endurance: 100,000 Write/Erase Cycles 512 Bytes Internal SRAM Programming Lock for Software Security Peripheral Features Two 8-bit Timer/Counters with Separate Prescalers and Compare Modes One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode Real Time Counter with Separate Oscillator Four PWM Channels 8-channel, 10-bit ADC 8 Single-ended Channels 7 Differential Channels for TQFP Package Only 2 Differential Channels with Programmable Gain at 1x, 10x, or 200x for TQFP Package Only Byte-oriented Two-wire Serial Interface Programmable Serial USART Master/Slave SPI Serial Interface Programmable Watchdog Timer with Separate On-chip Oscillator On-chip Analog Comparator Special Microcontroller Features Power-on Reset and Programmable Brown-out Detection Internal Calibrated RC Oscillator External and Internal Interrupt Sources Six Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, Standby and Extended Standby I/O and Packages 32 Programmable I/O Lines 40-pin PDIP, 44-lead TQFP, 44-lead PLCC, and 44-pad QFN/MLF Operating Voltages 2.7 - 5.5V for ATmega8535L 4.5 - 5.5V for ATmega8535 Speed Grades ECE Dept. SCCE 5

LINE FOLLOWING ROBOT


0 - 8 MHz for ATmega8535L 0 - 16 MHz for ATmega8535

ECE Dept. SCCE

LINE FOLLOWING ROBOT

Figure 2.2:Block diagram Pin Descriptions:


ECE Dept. SCCE 7

LINE FOLLOWING ROBOT


VCC GND Port A (PA7..PA0) Digital supply voltage. Ground. Port A serves as the analog inputs to the A/D Converter. Port A also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used.Port pins can provide internal pull-up resistors. The Port A outputbuffers have symmetrical drive characteristics with both high sink and source capability.When pins PA0 to PA7 are used as inputs and are externally pulle low,they will source current if the internal pull-up resistors are activated. The Port A pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port B is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running.Port B also serves the functions of various special features of the ATmega8535. Port C is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port D is an 8-bit bi-directional I/O port with internal pull-up resistors. The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running.Port D also serves the functions of various special features of the ATmega8535. Reset input. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not 8

Port B (PB7..PB0)

Port C (PC7..PC0)

Port D (PD7..PD0)

RESET

ECE Dept. SCCE

LINE FOLLOWING ROBOT


running. XTAL1 XTAL2 AVCC Input to the inverting Oscillator amplifier and input to the internal clock operating circuit. Output from the inverting Oscillator amplifier. AVCC is the supply voltage pin for Port A and the A/D Converter. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter. AREF is the analog reference pin for the A/D Converter.

AREF

AVR ATmega8535 Memories: This section describes the different memories in the ATmega8535. The AVR architecture has two main memory spaces, the Data Memory and the Program Memory space. In addition, the ATmega8535 features an EEPROM Memory for data storage. All three memory spaces are linear and regular. In-System Reprogrammable Flash Program Memory: The ATmega8535 contains 8K bytes On-chip In-System Reprogrammable Flash memory for program storage. Since all AVR instructions are 16 or 32 bits wide, the Flash is organized as 4K x 16. For software security, the Flash Program memory space is divided into two sections, Boot Program section and Application Program section.

Figure 2.3:Flash program memory

ECE Dept. SCCE

LINE FOLLOWING ROBOT


SRAM Data Memory: The 608 Data Memory locations address the Register File, the I/O Memory, and the internal data SRAM. The first 96 locations address the Register File and I/O Memory, and the next 512 locations address the internal data SRAM. The five different addressing modes for the data memory cover: Direct, Indirect with Displacement, Indirect, Indirect with Pre-decrement, and Indirect with Post-increment. In the Register File, registers R26 to R31 feature the indirect addressing pointer registers.The direct addressing reaches the entire data space. The Indirect with Displacement mode reaches 63 address locations from the base address given by the Y- or Z-register. When using register indirect addressing modes with automatic pre decrement and post increment, the address registers X, Y, and Z are decremented or incremented. The 32 general purpose working registers, 64 I/O Registers, and the 512 bytes of internal data SRAM in the ATmega8535 are all accessible through all these addressing modes.

Figure 2.4: Data memory ECE Dept. SCCE 10

LINE FOLLOWING ROBOT

Data Memory Access Times This section describes the general access timing concepts for internal memory access. The internal data SRAM access is performed in two clk CPU cycles as follows

Figure 2.5: On-chip Data SRAM Access Cycles


EEPROM Data Memory The ATmega8535 contains 512 bytes of data EEPROM memory. It is organized as a separate data space, in which single bytes can be read and written. The EEPROM has an endurance of at least 100,000 write/erase cycles. The access between the EEPROM and the CPU is described in the following, specifying the EEPROM Address Registers, the EEPROM Data Register, and the EEPROM Control Register.

2.2 1117 VOLTAGE REGULATOR :


Thhee AMS1117 series of adjustable and fixed voltage regulators are designed to provide 1A output current and to operate down to 1V input-to-output differential. The dropout voltage of the device is guaranteed maximum 1.3V at maximum output current, decreasing at lower load currents.On-chip trimming adjusts the reference voltage to 1%. Current limit is also trimmed, minimizing the stress under overload conditions on both the regulator and power source circuitry.The AMS1117 devices are pin compatible with other three-terminal SCSI regulators and are offered in the low profile surface mount SOT-223 package, in the 8L SOIC package and in the TO-252 (DPAK) plastic package.
FEATURES

Three Terminal Adjustable or Fixed Voltages. 1.5V, 1.8V, 2.5V, 2.85V, 3.3V and 5.0V. Output Current of 1A. 11

ECE Dept. SCCE

LINE FOLLOWING ROBOT


Operates Down to 1V Dropout. Line Regulation: 0.2% Max. Load Regulation: 0.4% Max. SOT-223, TO-252 and SO-8 package available.

Figure 2.6:Voltage regulator


PIN CONNECTIONS: 3 PIN FIXED/ADJUSTABLE VERSION. 1- Ground/Adjust 2- VOUT 3- VIN

ECE Dept. SCCE

12

LINE FOLLOWING ROBOT

ABSOLUTE MAXIMUM RATINGS: Power Dissipation Internally limited Input Voltage Operating Junction Temperature Range Control Section Power Transistor Storage temperature Soldering information Lead Temperature Thermal Resistance SO-8 package TO-252 package SOT-223 package 15V -40C to 125C -40C to 150C - 65C to +150C (10 sec) 300C JA= 160C/W JA= 80C/W JA= 90C/W

Output Voltage The AMS1117 series develops a 1.25V reference voltage between the output and the adjust terminal. Placing a resistor between these two terminals causes a constant current to flow through R1 and down through R2 to set the overall output voltage. This current is normally the specified minimum load current of 10mA. Because IADJ is very small and constant it represents a small error and it can usually be ignored.

ECE Dept. SCCE

13

LINE FOLLOWING ROBOT


Figure 2.7: Basic adjustale regulator

ECE Dept. SCCE

14

LINE FOLLOWING ROBOT

ECE Dept. SCCE

15

LINE FOLLOWING ROBOT


Figure 2.8: Typical performance characteristics PACKAGE DIMENSIONS:

ECE Dept. SCCE

16

LINE FOLLOWING ROBOT

ECE Dept. SCCE

17

LINE FOLLOWING ROBOT

Figure 2.9:package dimensions

2.3MAX232 IC:
The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply TIA/EIA-232-F voltage levels from a single 5-V supply. Each receiver converts TIA/EIA-232-F inputs to 5-V TTL/CMOS levels.These receivers have a typical threshold of 1.3 V, a typical hysteresis of 0.5 V, and can accept 30-V inputs.Each driver converts TTL/CMOS input levels into TIA/EIA-232-F levels. The driver, receiver, and voltage-generator functions are available as cells in the Texas Instruments.

Figure 2.10:MAX232 IC ECE Dept. SCCE 18

LINE FOLLOWING ROBOT


FEATURES:
Meets or Exceeds TIA/EIA-232-F and ITU Recommendation V.28 Operates From a Single 5-V Power Supply with 1.0-_F Charge-Pump Capacitors Operates Up To 120 kbit/s Two Drivers and Two Receivers 30-V Input Levels Low Supply Current . . . 8 mA Typical ESD Protection Exceeds JESD 222000-V Human-Body Model (A114-A) Upgrade With Improved ESD (15-kV HBM) and 0.1-_F Charge-Pump Capacitors is Available With the MAX202

Figure 2.11:logic diagram


ECE Dept. SCCE 19

LINE FOLLOWING ROBOT

Absolute maximum ratings over operating free-air temperature range: Input supply voltage range, VCC Positive output supply voltage range, VS+ Negative output supply voltage range, VS Input voltage range, VI: Driver Receiver Output voltage range, VO: T1OUT, T2OUT R1OUT, R2OUT Short-circuit duration: T1OUT, T2OUT Package thermal impedance, JA: D package DW package N package NS package Operating virtual junction temperature, TJ Storage temperature range, Tstg 0.3 V to 6 V VCC 0.3 V to 15 V 0.3 V to 15 V 0.3 V to VCC + 0.3 V 30 V VS 0.3 V to VS+ + 0.3 V 0.3 V to VCC + 0.3 V Unlimited 73C/W 57C/W 67C/W 64C/W 150C 65C to 150C

Table 2.1:Recommended operating conditions PARAMETER MEASUREMENT INFORMATION:

ECE Dept. SCCE

20

LINE FOLLOWING ROBOT

Figure 2.12: PARAMETER MEASUREMENT INFORMATION


NOTES: A. The pulse generator has the following characteristics: ZO = 50 , duty cycle 50%. B. CL includes probe and jig capacitance. C. All diodes are 1N3064 or equivalent.
Receiver Test Circuit and Waveforms for tPHL and tPLH Measurements

Figure 2.13: Receiver Test Circuit and Waveforms for tPHL and tPLH Measurements
NOTES: A. The pulse generator has the following characteristics: ZO = 50 , duty cycle 50%. B. CL includes probe and jig capacitance.
Driver Test Circuit and Waveforms for tPHL and tPLH Measurements (5- s Input)

ECE Dept. SCCE

21

LINE FOLLOWING ROBOT

Figure 2.14: Driver Test Circuit and Waveforms for tPHL and tPLH Measurements (5-s Input)
NOTE A: The pulse generator has the following characteristics: ZO = 50 , duty cycle 50%.

APPLICATION INFORMATION:

Figure 2.15: APPLICATION INFORMATION


Typical Operating Circuit NOTES: A. Resistor values shown are nominal. B. Nonpolarized ceramic capacitors are acceptable. If polarized tantalum or electrolytic

ECE Dept. SCCE

22

LINE FOLLOWING ROBOT


capacitors are used, they should be connected as shown. In addition to the 1-F capacitors shown, the MAX202 can operate with 0.1-F capacitors.

2.4 L293NE MOTOR DRIVER IC:


The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36V. The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications. All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudoDarlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an enable input is high, the associated drivers are enabled, and their outputs are active and in phase with their inputs. When the enable input is low, those drivers are disabled, and their outputs are off and in the high-impedance state. With the proper data inputs, each pair of drivers forms a full-H (or bridge)reversible drive suitable for solenoid or motor applications. On the L293, external high-speed output clamp diodes should be used for inductive transient suppression.A VCC1 terminal, separate from VCC2, is provided for the logic inputs to minimize device power dissipation.The L293and L293D are characterized for operation from 0C to 70C.

ECE Dept. SCCE

23

LINE FOLLOWING ROBOT

FIGURE 2.16:L293NE

BLOCK DIAGRAM:

Figure 2.17:Block diagram

ECE Dept. SCCE

24

LINE FOLLOWING ROBOT

Figure 2.18:schematics of inputs and outputs PARAMETER MEASUREMENT INFORMATION:

NOTES: A. CL includes probe and jig capacitance. B. The pulse generator has the following characteristics: tr 10 ns, tf 10 ns, tw = 10 s, PRR = 5 kHz, ZO = 50 .

Figure 2.19: Test Circuit and Voltage Waveforms ECE Dept. SCCE 25

LINE FOLLOWING ROBOT

Figure 2.20:Application information Absolute maximum ratings over operating free-air temperature range: Supply voltage, VCC1 Output supply voltage, VCC2 Input voltage, VI ECE Dept. SCCE 26 36 V 36 V 7V

LINE FOLLOWING ROBOT


Output voltage range, VO Peak output current, IO (nonrepetitive, t 5 ms): L293 Peak output current, IO (nonrepetitive, t 100 s): L293D Continuous output current, IO: L293 Continuous output current, IO: L293D Package thermal impedance, JA ,DWP package N package. NE package Maximum junction temperature, TJ Storage temperature range, Tstg 3 V to VCC2 + 3 V 2 A 1.2 A 1 A 600 mA TBDC/W 67C/W TBDC/W 150C 65C to 150C

Figure 2.21:Application information ECE Dept. SCCE 27

LINE FOLLOWING ROBOT


2.5 SWITCHES:
Four tact switches along with a Reset switch are present on the board in order to provide an external input to the board. The switches are connected in the following manner: S1 - PortA4 S2 - PortA5 S3 - PortA6 S4 - PortA7

Figure 2.22:Switches Detail Specification: Series NO. TS66H 1.Rating: 50mA 12VDC 2.Contact Resistance : 50m max(initial) 3.Insulation Resistance: 100M(minDC 250V) 4.Dielectric Strength : AC250V(50/60Hz for 1minute) 5.Electrically Life:50,000cycles ECE Dept. SCCE 28

LINE FOLLOWING ROBOT


6.Environment temperature: -25c-70c 7.Operating Force: 180/250(20gf) RST (Reset switch): The Reset switch is basically used to reset a running program right to the beginning it is same as the reset switch of a PC. MOTEN (Motor Enable Switch): It is basically a toggle switch which toggles the enables or disables of the motor drivers by setting the switch in either ON or OFF mode. POWER (Power On Switch): It is basically a toggle switch used to provide power supply to the main board. The power can be supplied either by a battery power supply (through LS) or can be USB powered. Thus, the POWER switch can be made to toggle between MP (Main Power) or UP (USB Power). PTOG (Power Toggle Switch): It is basically a toggle switch which toggles the power for the devices connected to PORTB either to use the internal power supply (5V) of the main board (by setting the switch in 5V mode) or to use any other external power source connected in DS for the high power applications like servo motors (by setting the switch in EXT mode). PROG (Programming Switch): It is also a toggle switch for programming the microcontroller using on board USB programmer. For programming mode it should be ON then RESET button should be pressed. For normal operation it should be off.

2.6 POWER SUPLLY:


LS (Logic Supply): It consist of two pins one is +ve and another is ve. A battery or a AC adaptor can be connected here to provide power suply to the mother board it provides regulated power supply to all the peripherials present in the mother board and also to the external periphrials connected to the motherboard through a voltage regulator. The DC voltage provided to this terminal should be lies in between 6 to 16 volt. To use the supply connected in LS pin the power switch should be toggled towards MP (Main power).

ECE Dept. SCCE

29

LINE FOLLOWING ROBOT


Figure 2.23:logic supply DS (Driving Supply): It consist of two pins one is +ve and another is ve.It is basically use to provide a separate high current power supply to the Motors. For operating DC motors you may provide here a Power supply of 5 to 40 volt. For operating a servo motor you may suppose to provise any suitable power supply as per the requirement of your motors (mostly servos works at 4.5 to 6 volt). Power from this pins are directly goes to the driving supply of the motor driver and to the supply pins of PortB if PTOG switch is toggled towards EXT.

Figure 2.24:Driving supply J1 (Jumper 1): It is a simple jumper which can be use to use a sinle power supply for DS and LS. If you put here a jumper then you have to provide supply only on DC or LS and your board will get both the power supply.

Figure 2.25:Jumper USB socket: It is basically used for USB communication with the PC. It also provides necessary logic supply to the motherboard. In order to use the USB supply the POWER switch should be toggled towards UP (USB power). When using the USB power some prequtions should be taken such as any heavy load should not be connected to the board directly and Dont use the J1.

ECE Dept. SCCE

30

LINE FOLLOWING ROBOT

2.8. LEDs :

Active high: RED LED1 PORTC4 RED LED2 PORTC5 RED LED3 PORTC6 RED LED4 PORTC7 GREEN LS - Logic Power ON indicator GREEN DS - Driver Power ON indicator Features: 2.2mm x 1.4mm, 1.3mm high. Low power consumption. Available on tape and reel. Package : 2000pcs / reel. Moisture sensitivity level : level 3. RoHS compliant. Description: The Hyper Red source color devices are made with Al-GaInP on GaAs substrate Light Emitting Diode.

Figure 2.26:Waveform

ECE Dept. SCCE

31

LINE FOLLOWING ROBOT

Dimensions:

Figure 2.27:Dimensions

2.9. BZ (BUZZER):
It can be easily used to get an audible feedback from the controller. It is connected in an active high mode, i.e., the buzzer beeps when the data given to it is 1. The Buzzer is connected to the pin PORTC3 of the microcontroller. Dimensions:

ECE Dept. SCCE

32

LINE FOLLOWING ROBOT

Figure 2.28:BUZZER

Figure 2.29:WAVEFORM

2.10. ISP (IN-SYSTEM PROGRAMMING) INTERFACE

ECE Dept. SCCE

33

LINE FOLLOWING ROBOT


It is the In-System Programming interface of the main board which can be used to connect any ISP programmer to download the programs in the microcontroller. It can also be used in SPI (Serial Peripheral Interface) communication. The pins provided for ISP are given below: MO- Master Out Slave in PortB5 MI- Master in Slave out PortB6 SCK- Serial clock PortB7 RST- Reset Reset GND- Ground Ground

Features:
Support for All Lattice Programmable Products 1.2V to 5V programming Ideal for design prototyping and debugging Connect to Multiple PC Interfaces USB (v.1.0, v.2.0) PC Parallel Port Easy-to-Use Programming Connectors Versatile flywire, 2 x 5 (.100) or 1 x 8 (.100) connectors 6 feet (2 meters) or more of programming cable length (PC to DUT) Lead-Free/RoHS Compliant Construction

Figure 2.30:ISP

2.11. RS 232 INTERFACE


These is a 3-pin interface that can be used for PC controlled applications, debugging purpose, data communication with PC and for inter board data communication. The port consists of three pins, namely, R - Receiver T - Transmitter G - Ground. ECE Dept. SCCE 34

LINE FOLLOWING ROBOT

Figure 2.31:RS-232

Pin configuration:

Figure 2.32:pin configuration

ECE Dept. SCCE

35

LINE FOLLOWING ROBOT

Figure 2.33:pin configuration

2.12. PA (PORTA)
It is a general purpose I/O port. This port contains eight pins that can be used as digital input, ADC in and digital out put. These pins are in the form, DATA-VCC-GROUND (denoted as D + - respectively on the board). The Data pins are towards the microcontroller. The VCC and Ground pins are provided with a 5V/1A power supply.

Figure 2.34:A PORTS

2.13. PB (PORTB)
It is a general purpose I/O port. This port contains eight pins that can be used as digital input and digital out put. These pins are in the form, DATA-VCC-GROUND (denoted as D + - respectively on the board). The VCC and Ground pins are provided with a 5V/1A power supply or the suply to this pins can also be switched to external supply connected in DS pin through EXT switch.

Figure 2.35:B PORTS ECE Dept. SCCE 36

LINE FOLLOWING ROBOT


2.14. MOTOR DRIVER CONNECTIONS
The motor drivers are used to run the DC motors or stepper motors that may be connected to the board according to the data from the microcontroller. The motor drivers link with micro controller is shown bellow. M0 M1 M2 M3 M4 M5 M6 M7 PortB0 PortB1 PortB2 PortB3 PortD4 PortD5 PortD6 PortD7

Figure 2.36:Motor drivers

2.15. MULTI PURPOSE OPTICAL SENSORS


The word multi-purpose in the name itself signifies that Multi-Purpose Optical Sensors can be used for a number of purposes such as line sensing, obstacle sensing and ECE Dept. SCCE 37

LINE FOLLOWING ROBOT


light sensing. As a result, it is possible to build various robots for different applications using these sensors.

Figure 2.37:Sensors CONSTRUCTION: The sensors are very simple to understand and easy to implement. The major components of these sensors include a High glow Red LED and a Photodiode. The LED emits light when energized; hence acting like an optical transmitter. Whereas the photodiode is capable of detecting light incident on it, thereby acting like an optical receiver. Thus, these sensors work on the principle of light sensing. WORKING: The LED emits high intensity red light when current flows through it. If the emitted light of LED falls on any bright surface it is reflected back to the photo diode. Photo diode is a device which is able to detect the light intensity and convert it to a corresponding electric current. Other devices present in the board read the electric current generated from the photodiode and convert it to a logic voltage level which is either logic-0 or logic-1. Thus, depending on the presence or absence of the surface, logic data is developed by the light sensor

APPLICATIONS
The MPOs can be used for a number of applications, some of which have been mentioned below: OBSTACLE SENSOR: In order to use this sensor as an Obstacle sensor mount the optical sensor on side of your robot facing them horizontally with the ground surface. Take care that your sensor is affected by any other bright light source which may affect the photodiode. Place any obstacle in front of your sensor (it is better if the obstacle is of white or any other light color). When your sensor detects the ECE Dept. SCCE 38

LINE FOLLOWING ROBOT


obstacle it will send a data of logic-0 through the data pin and when the obstacle is absent, it will send a data of logic-1 through the data pin. LINE SENSOR: In order to use this sensor as Line sensor, take a white chart paper and draw a black line on it (with water color preferably) or take a black chart paper and draw a white line on it. Place the sensor perpendicular to the ground level facing the ground and maintain a clearance of near about 1 to 2 centimeter between the sensor and the ground. When the sensor passes over a black surface it will send a data of logic-1 on data pin and when it passes over a white surface it will send a logic-0 on data pin. Thus, a sensor or two maybe able to follow a line while detecting any turn or curve along the line with a change in the logic data sent to the data pin. LIGHT SENSOR: This sensor can also be used to detect any other source of light. In order to use this sensor to detect a light source, it is required to cover the high glow red LED so that it may detect the light due to reflection. If light falls on it, it will send a data of logic-0 on data pin and when less light falls on it, it will sends a logic-1 on data pin.

CONFIGURATION: In the Multi Purpose Optical Sensor, a 3-pin male connector or a berg strip is present. The three pins of this berg strip are D (Data), + (positive 5 V supply), - (ground). Supply to the sensor is provided by the logic supply that may be present on the mother board. In order to connect this sensor to the mother board you need a 3-band connector cable. Connect one side of the connector cable to the sensor, check the convention of D, + and -, and then connect the other side of the sensor cable to the motherboard by following the same convention of D, + and -.

ECE Dept. SCCE

39

LINE FOLLOWING ROBOT

Figure 2.38:MPOS SENSORS

2.15 DC GEAR MOTORS


Specifications Dc plastic gear motor: 1.Voltage:3-12V 2.Speed:10-250RPM 3.Stall Toque:6kg.cm 4.Low noise, low current

Table 2.2:specifications Dc plastic motor

ECE Dept. SCCE

40

LINE FOLLOWING ROBOT

Figure 2.39:motors

Dimensions:

Figure 2.40:dimensions ECE Dept. SCCE 41

LINE FOLLOWING ROBOT


CH APTER 3 PROGRAMMING PROCESS
WinAVR is a suite of executable, open source software development tools for the Atmels AVR series of RISC microcontrollers hosted on the Windows platform. It includes the GNU GCC compiler for C and C++.

3.1 CREATING MAKE FILE:


Steps for creating make file: 1. Open the make file and edit it as mentioned bellow: 2. Make file ENABLE EDITING OF MAKE FILE 3. Make file MCU type ATmega ATMEGA8535 4. Manual change F_CPU = 16000000 (change it as for your crystal frequency) 5. Make fileOUTPUT FORMAT(IHEX) 6. Make fileOPTIMIZATION LEVELS 7. Make fileDEBUG FORMATAVR EXTCOFF 8. Make fileC STANDARD LEVELGNU99 9. Make filePROGRAMMERPONYSER 10. Make filePORTCOM1 11. Make fileDISABLE EDITING 12. Save the make file in your folder without changing its name.

ECE Dept. SCCE

42

LINE FOLLOWING ROBOT


Figure 3.1:Make file

3.2 HOW TO WRITE A PROGRAME:


Steps for writing a code using WinAVR: 1 1. Open the Programmers Notepad and write your code. 2 2. Create a new folder and save your code in that folder with extension name .c 1 3. Now open the programmers notepad. 2 4.To compile your code and to generate hex file (Tools make all). 3 5.To upload your code into your UC (Tools program).

ECE Dept. SCCE

43

LINE FOLLOWING ROBOT

Figure 3.2:programmers note pad

3.3 DEBUGGING THE PROGRAME


You can debug the program into you uc by using avr programmer.This programmer can easily used with Technophilias programmer software easily. The advantages of it are. Easy graphics user interface Not necessary to browse the hex code again and again You can open multiple windows at a time with different hex file ECE Dept. SCCE 44

LINE FOLLOWING ROBOT


It stores previously browsed hex file You can access most of the features of the controller by entering in to the terminal mode

Figure 3.3:Avr programmer To load the code click on browse select the hex file click on program.

ECE Dept. SCCE

45

LINE FOLLOWING ROBOT

ECE Dept.

46

SCCE

Вам также может понравиться