Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

final year major project

6,796 views

Published on

Published in: Education, Technology, Business
  • Be the first to comment

final year major project

  1. 1. A PROJECT REPORT ON “AUTONOMOUS ROBOT WITH ARM” Submitted in Fulfillment for the Award of Bachelor of Technology Degree Of Rajasthan Technical University, KOTA 2008-12Submitted to: Submitted by:MD. ASIF IQBAL PREM RANJAN (EE/08/19)Assistant Professor RAJ SINGH REPASWAL (EE/08/20)Department of Electrical Engineering SAUMYA GARG (EE/08/27)PCE, Jaipur 4th Year, EE, PCE DEPARTMENT OF ELECTRICAL ENGINEERING POORNIMA COLLEGE OF ENGINEERING ISI-6, RIICO INSTITUTIONAL AREA SITAPURA, JAIPUR-302022 (RAJASTHAN)
  2. 2. DEPARTMENT OF ELECTRICAL ENGINEERING POORNIMA COLLEGE OF ENGINEERING JAIPUR - 302022 CERTIFICATEThis is to certify that the seminar report entitled “AUTONOMOUS ROBOT WITH ARM” is submittedby PREM RANJAN (EE/08/19), RAJ SINGH REPASWAL (EE/08/20) & SAUMYA GARG (EE/08/27),Students of IV Year, VIII semester in fulfillment of the degree of Bachelor of Technology inElectrical Engineering of Rajasthan Technical University, Kota during the academic year 2011-12.The report has been found satisfactory and is approved for submission.MD. ASIF IQBAL MR. HARBEER SINGH MR. SHIVRAJ SHARMA DR. R. P. RAJORIYAProject Guide Project Coordinator HOD, EE department Campus Director (PCE)
  3. 3. PREFACE Today the world swiftly changing, there are multiple challenges faced by us. Surly it isthe knowledge through technology, which makes us to overcome them. The project report, which is an integral part of four years engineering program provides aplatform to all the student to augment their technical study revelation. It is the time, which iseffectively used by students to enhance their interaction with technical atmosphere. The project is obligatory as per university course outline. This project is based on workdone and theory gained during analysis of the topic. The report basically introduces working ofproject in detail. In this project we worked in the development of an Autonomous Robot with Arm whichcan move in any direction and pick up and put down things. It is capable of many capabilitieslike it is fully remote controlled and can pick objects of 50 grams approximately. It can take theobject, hold it and put it anywhere of its reach, even to some height. It only works on 220V A.C.supply. We have been fortunate to get a chance for making the seminar under guidance of Md.Asif Iqbal, Assistant Professor, Department of Electrical Engineering. We hope, this report will make the learning of the facts are warding experience and willhave away for future study. This report is true to best of my knowledge. PREM RANJAN RAJ SINGH REPASWAL SAUMYA GARG PCE/EE/iii
  4. 4. ACKNOWLEDGEMENTWe take this opportunity to express our deep sense of gratitude and respect towards our projectguide Md. Asif Iqbal, Assistant Professor, Department of Electrical Engineering. We arevery much indebted to him for his generosity, expertise and guidance; we have received fromhim while working on this project and throughout our studies. Without his support and timelyguidance, the completion of our project would have seemed a farfetched dream. In this respectwe find ourselves lucky to have him as our guide. He has guided us not only with the subjectmatter, but also taught us the proper style and techniques of working. We are grateful to our respected Dr. R. P. Rajoria (Campus Director), Dr. OmPrakash Sharma (Principal), Mr. Shivraj Sharma (HOD, EE Dept.) and Mr. Harbeer Singh(Project Coordinators) and all the staff members of Department of Electrical Engineering fortheir constant encouragement and all those who helped us directly or indirectly in our endeavor. PREM RANJAN RAJ SINGH REPASWAL SAUMYA GARG PCE/EE/iv
  5. 5. CONTENTSCERITFICATE ……iiPREFACE ……iiiACKNOWLEDGEMENT ……ivCONTENTS ……vFIGURE INDEX ……viiiABSTRACT ……ixCHAPTERS1. Introduction 1 1.1 Embedded System 1 1.2 Variety of Embedded Systems 2 1.3 Microcontrollers 4 1.4 Embedded Design of Microcontroller 5 1.4.1 Interrupts 6 1.4.2 Programs 6 1.4.3 Other Microcontroller Features 72. Autonomous Robot with Arm 9 2.1 Aims 9 2.2 Objectives 9 2.3 Project Restrictions 9 2.4 Individual Task 10 2.4.1 IR Transmitter 10 2.4.2 IR Receiver 12 2.4.3 Signal Processing 13 2.4.4 Robot Movement 14 PCE/EE/v
  6. 6. 2.4.4.1 Straight – Forward 14 2.4.4.2 Straight – Backwards 15 2.4.4.3 Point Turn – Right 15 2.4.4.4 Point Turn – Left 16 2.4.4.5 Swing Turn - Forward Right 16 2.4.4.6 Swing Turn - Backward Right 16 2.4.4.7 Swing Turn - Forward Left 17 2.4.4.8 Swing Turn - Backward Left 17 2.4.5 Arm Movement 18 2.4.6 Power Supply 18 2.4.7 Body/Chassis 19 2.4.8 Motor Control 203. Circuit Diagram 21 3.1 Microcontroller ATmega8 22 3.1.1 Pin Configuration 22 3.1.2 Features 24 3.2 Motor Driver IC L293D 26 3.3 Crystal Oscillator 27 3.4 7805 Voltage Regulator IC 28 3.5 Stepper Motor 29 3.6 Infra-red Remote 31 3.7 Power Supply 32 3.7.1 Transformer 33 3.7.2 Bridge rectifier 34 3.7.3 Smoothing 35 PCE/EE/vi
  7. 7. 3.8 Resistors 37 3.9 Condensers/Capacitors 37 3.10 Inductors 38 3.11 Diodes 38 3.12 Transistors 39 3.13 ICs (Integrated Circuits) 39 3. 14 Microprocessors (MPUs) 394. Coding 415. Conclusion 486. References 49 PCE/EE/vii
  8. 8. FIGURE INDEXFigure 2.1: IR Transmitter 11Figure 2.2: IR Receiver 12Figure 2.3: Straight – Forward 15Figure 2.4: Straight – Backwards 15Figure 2.5: Point Turn – Right 15Figure 2.6: Point Turn – Left 16Figure 2.7: Swing Turn - Forward Right 16Figure 2.8: Swing Turn - Backward Right 17Figure 2.9: Swing Turn - Forward Left 17Figure 2.10: Swing Turn - Backward Left 17Figure 2.11: Arm Movement 18Figure 2.12: Chassis 19Figure 3.1: Circuit Diagram 21Figure 3.2: Pin Configuration 22Figure 3.3: Block Diagram of Microcontroller ATmega8 23Figure 3.4:- Motor Driver IC L293D pin diagram 26Figure 3.5:- Block Diagram of L293D 27Figure 3.6:- 7805 Voltage Regulator IC 29Figure 3.7:- Stepper Motor 30Figure 3.8: Remote 31Figure 3.9: Circuit Diagram of regulated power Supply 32Figure 3.10: Bridge rectifier 35Figure 3.11: Output: full-wave varying DC 35Figure 3.12: Smoothing 36 PCE/EE/viii
  9. 9. ABSTRACT In this project we worked in the development of an Autonomous Robot with Arm whichcan move in any direction and pick up and put down things. It is capable of many capabilitieslike it is fully remote controlled and can pick objects of 50 grams approximately. It can take theobject, hold it and put it anywhere of its reach, even to some height. It only works on 220V A.C.supply. When we press a button on remote, it sends a signal to our robot circuitry where ourreceiver will decode it and sends the signal to the IC. It makes the various functioning motorsmove and thus the whole robot moves accordingly. We used microcontroller for its coding,various precise movement control and various peripheral devices for the support of this robot. PREM RANJAN RAJ SINGH REPASWAL SAUMYA GARG PCE/EE/viii
  10. 10. Chapter 1 INTRODUCTION1.1 Embedded System An embedded system is a computer system designed to do one or a fewdedicated and/or specific functions often with real-time computing constraints. It isembedded as part of a complete device often including hardware and mechanical parts.By contrast, a general-purpose computer, such as a personal computer (PC), is designedto be flexible and to meet a wide range of end-user needs. Embedded systems controlmany devices in common use today. Embedded systems contain processing cores that are typically eithermicrocontrollers or digital signal processors (DSP). The key characteristic, however, isbeing dedicated to handle a particular task. They may require very powerful processorsand extensive communication, for example air traffic control systems may usefully beviewed as embedded, even though they involve mainframe computers and dedicatedregional and national networks between airports and radar sites (each radar probablyincludes one or more embedded systems of its own). Since the embedded system is dedicated to specific tasks, design engineers canoptimize it to reduce the size and cost of the product and increase the reliability andperformance. Some embedded systems are mass-produced, benefiting from economies ofscale. Physically, embedded systems range from portable devices such as digitalwatches and MP3 players, to large stationary installations like traffic lights, factory PCE/EE/1
  11. 11. controllers, or the systems controlling nuclear power plants. Complexity varies from low,with a single microcontroller chip, to very high with multiple units, peripherals andnetworks mounted inside a large chassis or enclosure. In general, "embedded system" is not a strictly definable term, as most systemshave some element of extensibility or programmability. For example, handheldcomputers share some elements with embedded systems such as the operating systemsand microprocessors that power them, but they allow different applications to be loadedand peripherals to be connected. Moreover, even systems that do not exposeprogrammability as a primary feature generally need to support software updates. On acontinuum from "general purpose" to "embedded", large application systems will havesubcomponents at most points even if the system as a whole is "designed to perform oneor a few dedicated functions", and is thus appropriate to call "embedded".1.2 Variety of Embedded Systems Embedded systems span all aspects of modern life and there are many examplesof their use. Telecommunications systems employ numerous embedded systemsfrom telephone switches for the network to mobile phones at the end-user. Computernetworking uses dedicated routers and network bridges to route data. Consumer electronics include personal digital assistants (PDAs), mp3 players,mobile phones, videogame consoles, digital cameras, DVD players, GPS receivers,and printers. Many household appliances, such as microwave ovens, washingmachines and dishwashers, are including embedded systems to provide flexibility, PCE/EE/2
  12. 12. efficiency and features. Advanced HVAC systems use networked thermostats to moreaccurately and efficiently control temperature that can change by time of dayand season. Home automation uses wired- and wireless-networking that can be used tocontrol lights, climate, security, audio/visual, surveillance, etc., all of which useembedded devices for sensing and controlling. Transportation systems from flight to automobiles increasingly use embeddedsystems. New airplanes contain advanced avionics such as inertial guidancesystems and GPS receivers that also have considerable safety requirements. Variouselectric motors — brushless DC motors, induction motors and DC motors — are usingelectric/electronic motor controllers. Automobiles, electric vehicles, and hybridvehicles are increasingly using embedded systems to maximize efficiency and reducepollution. Other automotive safety systems include anti-lock brakingsystem (ABS), Electronic Stability Control (ESC/ESP), traction control (TCS) andautomatic four-wheel drive. Medical equipment is continuing to advance with more embedded systemsfor vital signs monitoring, electronic stethoscopes for amplifying sounds, andvarious medical imaging(PET, SPECT, CT, MRI) for non-invasive internal inspections. Embedded systems are especially suited for use in transportation, fire safety,safety and security, medical applications and life critical systems as these systems can beisolated from hacking and thus be more reliable. For fire safety, the systems can bedesigned to have greater ability to handle higher temperatures and continue to operate. Indealing with security, the embedded systems can be self-sufficient and be able to dealwith cut electrical and communication systems. PCE/EE/3
  13. 13. In addition to commonly described embedded systems based on small computers,new class of miniature wireless devices called motes are quickly gaining popularity as thefield of wireless sensor networking rises. Wireless sensor networking, WSN, makes useof miniaturization made possible by advanced IC design to couple full wirelesssubsystems to sophisticated sensors, enabling people and companies to measure a myriadof things in the physical world and act on this information through IT monitoring andcontrol systems. These motes are completely self-contained, and will typically run off abattery source for many years before the batteries need to be changed or charged.1.3 Microcontrollers A microcontroller (sometimes abbreviated µC, uC or MCU) is a small computeron a single integrated circuit containing a processor core, memory, andprogrammable input/output peripherals. Program memory in the form of NORflash or OTP ROM is also often included on chip, as well as a typically small amountof RAM. Microcontrollers are designed for embedded applications, in contrast tothe microprocessors used in personal computers or other general purpose applications. Microcontrollers are used in automatically controlled products and devices, suchas automobile engine control systems, implantable medical devices, remote controls,office machines, appliances, power tools, toys and other embedded systems. By reducingthe size and cost compared to a design that uses a separate microprocessor, memory, andinput/output devices, microcontrollers make it economical to digitally control even moredevices and processes. Mixed signal microcontrollers are common, integrating analogcomponents needed to control non-digital electronic systems. PCE/EE/4
  14. 14. Some microcontrollers may use four-bit words and operate at clockrate frequencies as low as 4 kHz, for low power consumption (milliwatts or microwatts).They will generally have the ability to retain functionality while waiting for an event suchas a button press or other interrupt; power consumption while sleeping (CPU clock andmost peripherals off) may be just Nano watts, making many of them well suited for longlasting battery applications. Other microcontrollers may serve performance-critical roles,where they may need to act more like a digital signal processor (DSP), with higher clockspeeds and power consumption.1.4 Embedded Design of Microcontroller A microcontroller can be considered a self-contained system with a processor,memory and peripherals and can be used as an embedded system.[1] The majority ofmicrocontrollers in use today are embedded in other machinery, such as automobiles,telephones, appliances, and peripherals for computer systems. These are called embeddedsystems. While some embedded systems are very sophisticated, many have minimalrequirements for memory and program length, with no operating system, and lowsoftware complexity. Typical input and output devices includeswitches, relays, solenoids, LEDs, small or custom LCD displays, radio frequencydevices, and sensors for data such as temperature, humidity, light level etc. Embeddedsystems usually have no keyboard, screen, disks, printers, or other recognizable I/Odevices of a personal computer, and may lack human interaction devices of any kind. PCE/EE/5
  15. 15. 1.4.1 Interrupts Microcontrollers must provide real time (predictable, though not necessarily fast)response to events in the embedded system they are controlling. When certain eventsoccur, an interrupt system can signal the processor to suspend processing the currentinstruction sequence and to begin an interrupt service routine (ISR, or "interrupthandler"). The ISR will perform any processing required based on the source of theinterrupt before returning to the original instruction sequence. Possible interrupt sourcesare device dependent, and often include events such as an internal timer overflow,completing an analog to digital conversion, a logic level change on an input such as froma button being pressed, and data received on a communication link. Where powerconsumption is important as in battery operated devices, interrupts may also wake amicrocontroller from a low power sleep state where the processor is halted until requiredto do something by a peripheral event.1.4.2 Programs Microcontroller programs must fit in the available on-chip program memory,since it would be costly to provide a system with external, expandable, memory.Compilers and assemblers are used to convert high-level language and assemblerlanguage codes into a compact machine code for storage in the microcontrollers memory.Depending on the device, the program memory may be permanent, read-only memorythat can only be programmed at the factory, or program memory may be field-alterableflash or erasable read-only memory. PCE/EE/6
  16. 16. 1.4.3 Other microcontroller features Microcontrollers usually contain from several to dozens of general purposeinput/output pins (GPIO). GPIO pins are software configurable to either an input or anoutput state. When GPIO pins are configured to an input state, they are often used to readsensors or external signals. Configured to the output state, GPIO pins can drive externaldevices such as LEDs or motors. Many embedded systems need to read sensors that produce analog signals. This isthe purpose of the analog-to-digital converter (ADC). Since processors are built tointerpret and process digital data, i.e. 1s and 0s, they are not able to do anything with theanalog signals that may be sent to it by a device. So the analog to digital converter is usedto convert the incoming data into a form that the processor can recognize. A less commonfeature on some microcontrollers is a digital-to-analog converter (DAC) that allows theprocessor to output analog signals or voltage levels. In addition to the converters, many embedded microprocessors include a varietyof timers as well. One of the most common types of timers is the Programmable IntervalTimer (PIT). A PIT may either count down from some value to zero, or up to the capacityof the count register, overflowing to zero. Once it reaches zero, it sends an interrupt to theprocessor indicating that it has finished counting. This is useful for devices such asthermostats, which periodically test the temperature around them to see if they need toturn the air conditioner on, the heater on, etc. PCE/EE/7
  17. 17. Time Processing Unit (TPU) is a sophisticated timer. In addition to countingdown, the TPU can detect input events, generate output events, and perform other usefuloperations. A dedicated Pulse Width Modulation (PWM) block makes it possible for the CPUto control power converters, resistive loads, motors, etc., without using lots of CPUresources in tight timer loops. PCE/EE/8
  18. 18. Chapter 2 AUTONOMOUS ROBOT WITH ARM2.1 Aims The aim of this module was to work as a group to design and construct anautonomous robot with arm. We will be aiming to improve our knowledge of robotics as well as electroniccircuit design and construction. We will be working as a group, and thus should improve our skills of workingtogether to achieve goals.2.2 Objectives Construct an autonomous robot with arm: • That controlled with an infra-red remote. • Which can move in any direction. • Can lift any object of small weight (maxi. Capacity 50 gm.). • Put the objects to another place. • Rotate its arm at single place.2.3 Project Restrictions: • It should be robust and should have long life. PCE/EE/9
  19. 19. • Must be no larger than 20x20x20cm in dimensions. • Must be made within a budget of rupees 5000.2.4 Individual Task • IR Transmitter • IR Receiver. • Signal Processing • Robot Movement • Arm Movement • Power Supply • Body/Chassis. • Motor Control.2.4.1 IR Transmitter By blinking an infrared LED, the signal becomes more unique and therefore morediscernible from other light sources. Even as intensity varies based on lighting, angle anddistance, the constant rate of blinking can be relied upon for recognition. The rate of blinking should be sufficiently fast so that the signal can be quicklyrecognized as being ―on‖. Since it takes a few blinks to detect the signal, delivering a PCE/EE/10
  20. 20. message with a slow blink would be very time consuming. But, the rate of blinkingshouldn’t be so fast that expensive high-speed electronics are necessary. If the device relies on a signal rates already in use, inexpensive and reliable mass-produced parts will be available. It turns out that a popular consumer device, the remotecontrol, provides the robot hobbyist just that opportunity. A common rate for remotecontrol infrared transmissions is between 35 and 40 kHz (35,000 and 40,000 blinks persecond), and that’s exactly what this project is designed to generate. Figure 2.1:- IR Transmitter PCE/EE/11
  21. 21. 2.4.2 IR Receiver Figure 2.2:- IR Receiver IR detectors are little microchips with a photocell that are tuned to listen toinfrared light. They are almost always used for remote control detection - every TV andDVD player has one of these in the front to listen for the IR signal from the clicker.Inside the remote control is a matching IR LED, which emits IR pulses to tell the TV toturn on, off or change channels. IR light is not visible to the human eye, which means ittakes a little more work to test a setup. IR detectors are specially filtered for Infrared light, they are not good at detectingvisible light. On the other hand, photocells are good at detecting yellow/green visiblelight, not good at IR light PCE/EE/12
  22. 22. IR detectors have a demodulator inside that looks for modulated IR at 38 KHz.Just shining an IR LED won’t be detected, it has to be PWM blinking at 38KHz.Photocells do not have any sort of demodulator and can detect any frequency (includingDC) within the response speed of the photocell (which is about 1KHz) IR detectors are digital out - either they detect 38KHz IR signal and output low(0V) or they do not detect any and output high (5V). Photocells act like resistors, theresistance changes depending on how much light they are exposed.2.4.3 Signal Processing Typically microcontroller programs must fit in the available on-chip programmemory, since it would be costly to provide a system with external, expandable, memory.Compilers and assemblers are used to convert high-level language and assemblerlanguage codes into a compact machine code for storage in the microcontrollers memory.Depending on the device, the program memory may be permanent, read-only memorythat can only be programmed at the factory, or program memory may be field-alterableflash or erasable read-only memory. Manufacturers have often produced special versions of their microcontrollers inorder to help the hardware and software development of the target system. Originallythese included EPROM versions that have a "window" on the top of the device throughwhich program memory can be erased by ultraviolet light, ready for reprogramming aftera programming ("burn") and test cycle. Since 1998, EPROM versions are rare and havebeen replaced by EEPROM and flash, which are easier to use (can be erasedelectronically) and cheaper to manufacture. PCE/EE/13
  23. 23. Other versions may be available where the ROM is accessed as an external devicerather than as internal memory, however these are becoming increasingly rare due to thewidespread availability of cheap microcontroller programmers. The use of field-programmable devices on a microcontroller may allow fieldupdate of the firmware or permit late factory revisions to products that have beenassembled but not yet shipped. Programmable memory also reduces the lead timerequired for deployment of a new product. Where hundreds of thousands of identical devices are required, using partsprogrammed at the time of manufacture can be an economical option. These "maskprogrammed" parts have the program laid down in the same way as the logic of the chip,at the same time. A customizable microcontroller incorporates a block of digital logic that can bepersonalized in order to provide additional processing capability, peripherals andinterfaces that are adapted to the requirements of the application. For example, theAT91CAP from Atmel has a block of logic that can be customized during manufactureraccording to user requirements.2.4.4 Robot Movement2.4.4.1 Straight – Forward:- Both wheels rotate at the same speed, but the right wheel rotates forward and the leftwheel rotates backward, so the robot turns to its left around its center. This makes a sharp turn inplace. PCE/EE/14
  24. 24. Figure 2.3: - Straight – Forward2.4.4.2 Straight – Backwards:- Both wheels rotate forward at the same speed and the robot moves straightbackward. Figure 2.4: - Straight – Backwards2.4.4.3 Point Turn – Right:- Both wheels rotate at the same speed, but the left wheel rotates forward and theright wheel rotates backward, so the robot turns to its right around its center. This makesa sharp turn in place. Figure 2.5:- Point Turn – Right PCE/EE/15
  25. 25. 2.4.4.4 Point Turn – Left:- Both wheels rotate at the same speed, but the right wheel rotates forward and theleft wheel rotates backward, so the robot turns to its left around its center. This makes asharp turn in place. Figure 2.6:- Point Turn – Left2.4.4.5 Swing Turn - Forward Right:- The left wheel rotates forward and the right wheel does not move, so the robotpivots around the right wheel as it turns forward. This makes a wider turn. Figure 2.7:- Swing Turn - Forward Right2.4.4.6 Swing Turn - Backward Right:-The right wheel rotates backward and the left wheel does not move, so the robot pivotsaround the left wheel as it turns backward. This makes a wider turn. PCE/EE/16
  26. 26. Figure 2.8:- Swing Turn - Backward Right2.4.4.7 Swing Turn - Forward Left:- The right wheel rotates forward and the left wheel does not move, so the robotpivots around the left wheel as it turns forward. This makes a wider turn. Figure 2.9:- Swing Turn - Forward Left2.4.4.8 Swing Turn - Backward Left:- The left wheel rotates backward and the right wheel does not move, so the robotpivots around the left wheel as it turns backward. This makes a wider turn. Figure 2.10:- Swing Turn - Backward Left PCE/EE/17
  27. 27. 2.4.5 Arm Movement The degrees of freedom, or DOF, are a very important term to understand. Eachdegree of freedom is a joint on the arm, a place where it can bend or rotate or translate.We can typically identify the number of degrees of freedom by the number of actuatorson the robot arm. Now this is very important - when building a robot arm we want as fewdegrees of freedom allowed for our application, Because each degree requires a motor,often an encoder, and exponentially complicated algorithms and cost. Figure 2.11:- Arm Movement2.4.6 Power SupplyThis is a circuit which supplies the necessary voltages to all the circuits and systems onthe vehicle. The power source will be a 9V PP3 Battery. The 2 volt ―rails‖ initiallyplanned are 9V – to drive the motors, and 5V to drive the low power and logic circuitry.The Battery is low soon. So, we use a transformer and diode rectifier circuit. PCE/EE/18
  28. 28. 2.4.7 Body/Chassis Part # Description 1 The base of the robot, also the main PCB. 2 Front skid 3 Free Wheel, shaped as a pulley 4 Plastic pulley 5 Battery holder 6 Pipe clamp use to hold the motors 7 Ni-Cd 7.2V battery pack 8 1200 rpm 6V motor Figure 2.12:- Chassis It is clear that the drive train of this robot is differential type, meaning the tworear wheels are responsible of moving the robot forward and backward, but are also usedto turn the robot in any required direction depending the difference of speed between theright and left wheels. PCE/EE/19
  29. 29. The first thing that need some explanation is the fact that there are only 2 wheels,Well, while not being the best thing to do, a caster wheel can sometimes be replaced witha skid, when the robot weight and size are not important, and when the robot is designedfor indoor environment, where the robot can move on relatively smooth surfaces, wherefriction won’t be a serious problem.2.4.8 Motor Control The motor control circuit controls the speed of each motor therefore steering itaround the line. It is done by motor controller IC L293D. PCE/EE/20
  30. 30. Chapter 3 CIRCUIT DIAGRAMFigure 3.1 Circuit Diagram PCE/EE/21
  31. 31. 3.1 Microcontroller ATmega8 The ATmega8 is a low-power CMOS 8-bit microcontroller basedon the AVR RISC architecture. By executing powerful instructions in asingle clock cycle, the ATmega8 achieves throughputs approaching 1 MIPSper MHz, allowing the system designed to optimize power consumptionversus processing speed.3.1.1 Pin Configuration: Figure 3.2: Pin Configuration PCE/EE/22
  32. 32. Figure 3.3: Block Diagram of Microcontroller ATmega8 PCE/EE/23
  33. 33. 3.1.2 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 – Fully Static Operation – Up to 16 MIPS Throughput at 16 MHz – On-chip 2-cycle Multiplier• High Endurance Non-volatile Memory segments – 8K Bytes of In-System Self-programmable Flash program memory – 512 Bytes EEPROM – 1K Byte Internal SRAM – Write/Erase Cycles: 10,000 Flash/100,000 EEPROM – Data retention: 20 years at 85°C/100 years at 25°C(1) – Optional Boot Code Section with Independent Lock BitsIn-System Programming by On-chip Boot ProgramTrue Read-While-Write Operation – Programming Lock for Software Security• Peripheral Features – Two 8-bit Timer/Counters with Separate Prescaler, one Compare Mode – One 16-bit Timer/Counter with Separate Prescaler, Compare Mode, and Capture Mode PCE/EE/24
  34. 34. – Real Time Counter with Separate Oscillator – Three PWM Channels – 8-channel ADC in TQFP and QFN/MLF packageEight Channels 10-bit Accuracy – 6-channel ADC in PDIP packageSix Channels 10-bit Accuracy – 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 – Five Sleep Modes: Idle, ADC Noise Reduction, Power-save, Power-down, and Standby• I/O and Packages – 23 Programmable I/O Lines – 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF• Operating Voltages – 2.7 - 5.5V (ATmega8L) – 4.5 - 5.5V (ATmega8) PCE/EE/25
  35. 35. • Speed Grades – 0 - 8 MHz (ATmega8L) – 0 - 16 MHz (ATmega8)• Power Consumption at 4 Mhz, 3V, 25°C – Active: 3.6 mA – Idle Mode: 1.0 mA – Power-down Mode: 0.5 μA3.2 Motor Driver IC L293D Figure 3.4:- Motor Driver IC L293D pin diagram The Device is a monolithic integrated high voltage, high current four channeldriver designed to accept standard DTL or TTL logic levels and drive inductive loads(such as relays solenoids, DC and stepping motors) and switching power transistors. PCE/EE/26
  36. 36. To simplify use as two bridges each pair of channels is equipped with an enable input. Aseparate supply input is provided for the logic, allowing operation at a lower voltage andinternal clamp diodes are included. This device is suitable for use in switching applications at frequencies up to 5kHz. The L293D is assembled in a 16 lead plastic package which has 4 center pinsconnected together and used for heat sinking The L293DD is assembled in a 20 leadsurface mount which has 8 center pins connected together and used for heat sinking. Figure 3.5:- Block Diagram of L293D PCE/EE/27
  37. 37. 3.3 Crystal Oscillator A crystal oscillator is an electronic oscillator circuit that uses themechanical resonance of a vibrating crystal of piezoelectric material to create anelectrical signal with a very precise frequency. This frequency is commonly used to keeptrack of time (as in quartz wristwatches), to provide a stable clocksignal for digital integrated circuits, and to stabilize frequencies for radiotransmitters and receivers. The most common type of piezoelectric resonator used isthe quartz crystal, so oscillator circuits designed around them became known as "crystaloscillators." Quartz crystals are manufactured for frequencies from a few tens of kilohertz totens of megahertz. More than two billion (2×109) crystals are manufactured annually.Most are used for consumer devices such as wristwatches, clocks, radios, computers,and cellphones. Quartz crystals are also found inside test and measurement equipment,such as counters, signal generators, and oscilloscopes.3.4 7805 Voltage Regulator IC 7805 is a voltage regulator integrated circuit. It is a member of 78xx series offixed linear voltage regulator ICs. The voltage source in a circuit may have fluctuationsand would not give the fixed voltage output. The voltage regulator IC maintains theoutput voltage at a constant value. The xx in 78xx indicates the fixed output voltage it isdesigned to provide. 7805 provides +5V regulated power supply. Capacitors of suitablevalues can be connected at input and output pins depending upon the respective voltagelevels. PCE/EE/28
  38. 38. Figure 3.6:- 7805 Voltage Regulator IC3.5 Stepper Motor A stepper motor (or step motor) is a brushless DC electric motor that divides afull rotation into a number of equal steps. The motors position can then be commandedto move and hold at one of these steps without any feedback sensor (an open-loopcontroller), as long as the motor is carefully sized to the application. The stepper motor is an electromagnetic device that converts digital pulses intomechanical shaft rotation. Advantages of step motors are low cost, high reliability, hightorque at low speeds and a simple, rugged construction that operates in almost anyenvironment. The main disadvantages in using a stepper motor is the resonance effectoften exhibited at low speeds and decreasing torque with increasing speed. PCE/EE/29
  39. 39. Figure 3.7:- Stepper Motor PCE/EE/30
  40. 40. 3.6 Infra-red Remote A remote control is a component of an electronics device, most commonly atelevision set, DVD player and home theater systems originally used for operating thetelevision device wirelessly from a short line-of-sight distance. Remote control hascontinually evolved and advanced over recent years to include Bluetooth connectivity,motion sensor enabled capabilities and voice control. The main remote control technology used in the home is infrared. The signalbetween a remote control handset and the device it is controlling are infrared pulses,which are invisible to the human eye. The transmitter in the remote control handset sendsout a pulse of infrared light when a button is pressed on the handset. A transmitter isoften a light emitting diode (LED) which is built into the pointing end of the remotecontrol handset. The infrared light pulse represents a binary code that corresponds to acertain command, such as (power on). The receiver passes the code to a microprocessor,which decodes it and carries out the command. Figure 3.8: Remote PCE/EE/31
  41. 41. 3.7 Power Supply There are many types of power supply. Most are designed to convert high voltageAC mains electricity to a suitable low voltage supply for electronics circuits and otherdevices. A power supply can by broken down into a series of blocks, each of whichperforms a particular function.For example a 5V regulated supply:Each of the blocks is described in more detail below:-  Transformer - steps down high voltage AC mains to low voltage AC.  Rectifier - converts AC to DC, but the DC output is varying.  Smoothing - smooth the DC from varying greatly to a small ripple.  Regulator - eliminates ripple by setting DC output to a fixed voltage. Figure 3.9: Circuit Diagram of regulated power Supply PCE/EE/32
  42. 42. 3.7.1 Transformer Transformers convert AC electricity from one voltage to another with little loss ofpower. Transformers work only with AC and this is one of the reasons why mainselectricity is AC. Step-up transformers increase voltage, step-down transformers reduce voltage. Mostpower supplies use a step-down transformer to reduce the dangerously high mainsvoltage (230V in UK) to a safer low voltage. The input coil is called the primary and the output coil is called the secondary. Thereis no electrical connection between the two coils, instead they are linked by an alternatingmagnetic field created in the soft-iron core of the transformer. The two lines in the middleof the circuit symbol represent the core. Transformers waste very little power so the power out is (almost) equal to the powerin. Note that as voltage is stepped down current is stepped up. The ratio of the number of turns on each coil, called the turns ratio, determines theratio of the voltages. A step-down transformer has a large number of turns on its primary(input) coil which is connected to the high voltage mains supply, and a small number ofturns on its secondary (output) coil to give a low output voltage. Vp Np power out = power in turns ratio = = and Vs Ns Vs × Is = Vp × IpVp = primary (input) voltage Vs = secondary (output) voltageNp = number of turns on primary Ns = number of turns on secondarycoil coilIp = primary (input) current Is = secondary (output) currentRectifier PCE/EE/33
  43. 43. There are several ways of connecting diodes to make a rectifier toconvert AC to DC. The bridge rectifier is the most important and it producesfull-wave varying DC. A full-wave rectifier can also be made from just twodiodes if a center-tap transformer is used, but this method is rarely used nowthat diodes are cheaper. A single diode can be used as a rectifier but it only usesthe positive (+) parts of the AC wave to produce half-wave varying DC.3.7.2 Bridge rectifier A bridge rectifier can be made using four individual diodes, but it is alsoavailable in special packages containing the four diodes required. It is called afull-wave rectifier because it uses all the AC wave (both positive and negativesections). 1.4V is used up in the bridge rectifier because each diode uses 0.7Vwhen conducting and there are always two diodes conducting, as shown in thediagram below. Bridge rectifiers are rated by the maximum current they canpass and the maximum reverse voltage they can withstand (this must be at leastthree times the supply RMS voltage so the rectifier can withstand the peakvoltages). Please see the Diodes page for more details, including pictures ofbridge rectifiers. PCE/EE/34
  44. 44. Figure 3.10 Bridge rectifier Alternate pairs of diodes conduct, changing over the connections so thealternating directions of AC are converted to the one direction of DC Figure 3.11: Output: full-wave varying DC (using all the AC wave)3.7.3 Smoothing Smoothing is performed by a large value electrolytic capacitor connected acrossthe DC supply to act as a reservoir, supplying current to the output when the varying DCvoltage from the rectifier is falling. The diagram shows the unsmoothed varying DC PCE/EE/35
  45. 45. (dotted line) and the smoothed DC (solid line). The capacitor charges quickly near thepeak of the varying DC, and then discharges as it supplies current to the output. Figure 3.12: Smoothing Note that smoothing significantly increases the average DC voltage to almost thepeak value (1.4 × RMS value). For example 6V RMS AC is rectified to full wave DC ofabout 4.6V RMS (1.4V is lost in the bridge rectifier), with smoothing this increases toalmost the peak value giving 1.4 × 4.6 = 6.4V smooth DC. Smoothing is not perfect due to the capacitor voltage falling a little as itdischarges, giving a small ripple voltage. For many circuits a ripple which is 10% of thesupply voltage is satisfactory and the equation below gives the required value for thesmoothing capacitor. A larger capacitor will give fewer ripples. The capacitor value mustbe doubled when smoothing half-wave DC. 5 × IoSmoothing capacitor for 10% ripple, C = Vs × fIo = output current from the supplyVs = supply voltage (peak value of unsmoothed DC)f = frequency of the AC supply (50Hz in UK) PCE/EE/36
  46. 46. 3.8 Resistors This is the most common component in electronics. It is used mainlyto control current and voltage within the circuit. We can identify a simpleresistor by its simple cigar shape with a wire lead coming out of each end. Ituses a system of color coded bands to identify the value of the component(measured in Ohms) A surface mount resistor is in fact mere millimeters insize but performs the same function as its bigger brother, the simple resistor.A potentiometer is a variable resistor. It lets you vary the resistance with adial or sliding control in order to alter current or voltage on the fly. This isopposed to the ―fixed‖ simple resistors.3.9 Condensers/Capacitors Capacitors, or "caps", vary in size and shape - from a small surfacemount model up to a huge electric motor cap the size of a paint can. Itstorages electrical energy in the form of electrostatic charge. The size of acapacitor generally determines how much charge it can store. A smallsurface mount or ceramic cap will only hold a minuscule charge. Acylindrical electrolytic cap will store a much larger charge. Some of thelarge electrolytic caps can store enough charge to kill a person. Anothertype, called Tantalum Capacitors, store a larger charge in a smaller package. PCE/EE/37
  47. 47. 3.10 Inductors We remember from science class that adding electrical current to acoil of wire produces a magnetic field around itself. This is how the inductorworks. It is charged with a magnetic field and when that field collapses itproduces current in the opposite direction. Inductors are used in AlternatingCurrent circuits to oppose changes in the existing current. Most inductorscan be identified by the ―coil" appearance. Others actually look like aresistor but are usually green in color.3.11 Diodes Diodes are basically a one-way valve for electrical current. They let itflow in one direction (from positive to negative) and not in the otherdirection. This is used to perform rectification or conversion of AC currentto DC by clipping off the negative portion of a AC waveform. The diodeterminals are cathode and anode and the arrow inside the diode symbolpoints towards the cathode, indicating current flow in that direction when thediode is forward biased and conducting current. Most diodes are similar inappearance to a resistor and will have a painted line on one end showing thedirection or flow (white side is negative). If the negative side is on thenegative end of the circuit, current will flow. If the negative is on thepositive side of the circuit no current will flow. PCE/EE/38
  48. 48. 3.12 Transistors The transistor performs two basic functions. 1) It acts as a switchturning current on and off. 2) It acts as a amplifier. This makes an outputsignal that is a magnified version of the input signal. Transistors come in several sizes depending on their application. Itcan be a big power transistor such as is used in power amplifiers in yourstereo, down to a surface mount (SMT) and even down to .5 microns wide(I.E.: Mucho Small!) such as in a microprocessor or Integrated Circuit.3.13 ICs (Integrated Circuits) Integrated Circuits, or ICs, are complex circuits inside one simplepackage. Silicon and metals are used to simulate resistors, capacitors,transistors, etc. It is a space saving miracle. These components come in awide variety of packages and sizes. You can tell them by their "monolithicshape" that has a ton of "pins" coming out of them. Their applications are asvaried as their packages. It can be a simple timer, to a complex logic circuit,or even a microcontroller (microprocessor with a few added functions) witherasable memory built inside.3. 14 Microprocessors (MPUs) Microprocessors and other large scale ICs are very complex ICs. Attheir core is the transistor which provides the logic for computers, cars, TVs PCE/EE/39
  49. 49. and just about everything else electronic. Packages are becoming smallerand smaller as companies are learning new tricks to make the transistorsever tinier. PCE/EE/40
  50. 50. Chapter 4 CODING; ---------==========----------==========---------=========---------; Autonomous Robot with Arm; ---------==========----------==========---------=========---------DSEG ; This is internal data memoryORG 20H ; Bit adressable memoryFLAGS: DS 1CONTROL BIT FLAGS.0 ; toggles with every new keystrokeNEW BIT FLAGS.1 ; Bit set when a new command has been receivedCOMMAND: DS 1 ; Received command byteSUBAD: DS 1 ; Device subaddressTOGGLE: DS 1 ;Toggle every bitANS: DS 1 ;ADDR: DS 1STACK: DS 1 ; Stack begins hereCSEG ; Code begins here;---------==========----------==========---------=========--------- PCE/EE/41
  51. 51. ; PROCESSOR INTERRUPT AND RESET VECTORS;---------==========----------==========---------=========--------- ORG 00H ; Reset JMP MAIN ORG 0003H ; External Interrupt0 JMP RECEIVE; ---------==========----------==========---------=========---------; Interrupt 0 routine; ---------==========----------==========---------=========---------RECEIVE: cpl p3.7 MOV 2,#255 ; Time Loop (3/4 bit time) DJNZ 2,$ ; Waste Time to sync second bit MOV 2,#255 ; Time Loop (3/4 bit time) Djnz 2,$ ; Waste Time to sync second bit Mov 2,#145 ; Time Loop (3/4 bit time) Djnz 2,$ ; Waste Time to sync second bit PCE/EE/42
  52. 52. clr a mov r6,#07h AJMP ASZZXC1: MOV A,SUBAD CJNE A,#00H,ANSS AJMP ASZASZ: MOV A,ADDR ANL A,#20H MOV TOGGLE,A CJNE A,ANS,ANSS AJMP WARANSS: JMP ANS1WAR:;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! MOV A,COMMAND;------------------------------------------- PCE/EE/43
  53. 53. MOV R0,A XRL A,#01H JNZ CH1 CPL OP1 AJMP GOCH1: MOV A,R0 XRL A,#02H JNZ CH2 CPL OP2 AJMP GOCH2: MOV A,R0 XRL A,#03H JNZ CH3 CPL OP3 AJMP GOCH3: MOV A,R0 XRL A,#04H PCE/EE/44
  54. 54. JNZ CH4 CPL OP4 AJMP GOCH4: MOV A,R0 XRL A,#05H JNZ CH5 CPL OP5 AJMP GOCH5: MOV A,R0 XRL A,#06H JNZ CH6 CPL OP6 AJMP GOCH6: MOV A,R0 XRL A,#0CH JNZ go MOV OUTPUT,#0FFH PCE/EE/45
  55. 55. AJMP GOGO:;*********************************************************** MOV ANS,TOGGLE MOV A,ANS CPL ACC.5 MOV ANS,A SETB NEW ; Set flag to indicate the new command;################################################################ANS1: RETI; ---------==========----------==========---------=========---------; Main routine. Program execution starts here.; ---------==========----------==========---------=========---------MAIN: MOV SP,#60H PCE/EE/46
  56. 56. MOV OUTPUT,#0FFH SETB EX0 ; Enable external Interrupt0 CLR IT0 ; triggered by a high to low transition SETB EA MOV ANS,#00H ;clear temp toggle bit CLR NEWLOO: JNB NEW,LOO CLR NEW AJMP LOO END PCE/EE/47
  57. 57. Chapter 5 CONCLUSIONFrom the construction of this prototype, we can arrive at several conclusions for the finalPrototype:  The robot can move in any direction.  It is fully controlled by remote.  It can pick up light objects from a place and put them to another place.  It can also put objects to a height and put down them from the height also.  It takes power supply of 220V, 1-phase A.C.  It can pick a maximum weight of 50 grams. PCE/EE/48
  58. 58. Chapter 6 REFERENCES http://www.kpsec.freeuk.com/powersup.htm http://en.wikipedia.org/wiki/Microcontroller http://en.wikipedia.org/wiki/Embedded_system www.ieee.com www.NASAexplores.com www.robotics.com http://en.wikipedia.org/wiki/Stepper_motor http://www.societyofrobots.com/robot_arm_tutorial.shtml http://www.robotc.net/support/nxt/MindstormsWebHelp/index.htm#page=robot_algebra/ robot_movements/Robot%20Movements.htm PCE/EE/49

×