Your SlideShare is downloading. ×
  • Like
Obstacle Detctor Robot report
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Obstacle Detctor Robot report

  • 20,420 views
Published

report on obstacle detector robot

report on obstacle detector robot

Published in Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • CAN YOU PLZ MAIL ME THE COMPLETE CIRCUIT DIAGRAM PLZ.....
    HIMANSHUVAISHNAV0@GMAIL.COM
    Are you sure you want to
    Your message goes here
No Downloads

Views

Total Views
20,420
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
733
Comments
1
Likes
5

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. IR OBSTACLE DETECTOR WITH VACCUM CLEANER ROBOTProject Report Submitted in Partial Fulfillment of the Requirement for The Award of Degree of Bachelor of Engineering in Electronics and Communication Engineering of Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal (MP) By Harish Bhute (0178ec091030) Mukesh Kumar Sharma (0178ec091048) Nikita Kaushal (0178ec091055) Department of Electronics and Communication Engineering Jai Narain College of Technology & Science, Bhopal June – 2012 i
  • 2. DECLARATION We, Harish Bhute , Mukesh Kumar Sharma, and Nikita Kaushal thestudents of Bachelor of Engineering (Electronics and CommunicationEngineering), Jai Narain College of Technology and Science, Bhopal herebydeclare that the work presented in this Minor Project is an authentic record of ourown and has been carried out taking care of Engineering Ethics under theguidance of Prof. Amit Sawaskade.Harish Bhute (0178ec091030) ………………………Mukesh Kumar Sharma (0178ec091048) ………………………Nikita Kaushal (0178ec091055) ……………………… ii
  • 3. CERTIFICATE This is to certify that the work embodied in this Minor Project entitled “IRObstacle Detector With Vacuum Cleaner” has been satisfactorily completed bythe students of final year, Mr. Harish Bhute, Mr. Mukesh Kumar Sharma, andMiss. Nikita Kaushal. The work was carried out satisfactorily under thesupervision and guidance of the undersigned in the Department of Electronics andCommunication Engineering, Jai Narain College of Technology and Science,Bhopal for the partial fulfillment of the requirement of degree of Bachelor ofEngineering during the Academic year 2011-2012. Prof. Amit Sawaskade Professor and Project Guide, Electronics and Communication Department ApprovedProf. Ashok Agrawal Dr. B D ShuklaHead of Department Director iii
  • 4. ACKNOWLEDGEMENT This gives us a great pleasure to express our deep sense of gratitude to ourproject supervisor Prof. Amit Sawaskade, Associate Professor of Electronics andCommunication Engineering for guidance, suggestion, support, help andconstructive criticisms throughout the period of project work. Without his ableguidance it would not have been possible to complete the project in time. We are greatly indebted to Prof. Ashok Agrawal, Head, Department ofElectronics and Communication Engineering for his keen interest in this work andtime to time guidance, encouragement and providing required facilities forcompleting the project work. We are grateful to Dr. Meghna Dubey, Principal,JNCTS for his guidance and critical comments which improved the quality ofthis report. Thanks are due to Dr. B D Shukla, Director, JNCTS for providingnecessary help and time to time necessary guidance in completion of this task. Then other faculty members, friends, etc, may be added accordingly in theacknowledgement to which the students want to acknowledge for their help andguidance in the project. Harish Bhute (0178ec091030) Mukesh Kumar Sharma (0178ec091048) Nikita Kaushal (0178ec091055) iv
  • 5. CONTENTSDECLARATION … iiCERTIFICATE … iiiACKNOWLWEDGEMENTS … iv1. INTRODUCTION … 012. REWVIEW OF LITERATURE … 052.1 Construction … 07 2.1.1 Hardware Unit … 07 2.1.2 Software Unit … 132.2 Basic Parts Of Project …29 2.2.1 Sensors … 29 2.2.2 Microcontroller … 29 2.2.3 Driver … 30 2.2.4 Motors … 30 2.2.5 Blower … 312.3 Problem Faced In Making Project … 312.4 Testing … 322.5 Applications … 332.6 Future Scope By Improvement … 333. COMPONENTS … 343.1 Microcontroller ATMEGA8L … 353.2 IC L293D … 363.3 IC LM324N … 373.4 IC 7805 … 383.5 Resistor … 383.6 IR LED … 393.7 Photodiode … 404. RESULTS … 415. REFERENCES ... 426. APPENDICES … 436.1 Datasheet … 436.2 Program …48
  • 6. LIST OF FIGURSFigure 2.1 Block Diagram of Project ... 06Figure 2.2 IR Sensor circuit ... 10Figure 2.3 Controller Circuit ... 12Figure 2.4 PCB layout of sensor …18Figure 2.5 PCB of Controller Circuit ... 19Figure 2.6 Final PCB Layout ... 20Figure 3.1 Microcontroller ATMEGA8L ... 35Figure 3.2 IC L293D ... 36Figure 3.3 IC LM324N … 37Figure 3.4 IC 7805 … 38Figure 3.5 Resistor … 39Figure 3.6 IR LED … 39Figure 3.7 Photodiode … 40Figure 6.1 ATMEGA8L Pin Diagram … 45Figure 6.2 IC 7805 Pin Diagram … 46Figure 6.3 IC LM324N Pin Diagram … 47Figure 6.4 IC 293 Pin Diagram … 48
  • 7. 1. INTRODUCTION Robotics is part of Today’s communication. In today’s worldROBOTICS is fast growing and interesting field. It is simplest way for latesttechnology modification. Now a day’s communication is part of advancement oftechnology, so we decided to work on robotics field, and design something whichwill make human life simpler in day today aspect. Thus we are supporting thiscause. Robotics is the branch of technology that deals with the design,construction, operation, structural disposition, manufacture and application ofrobots and computer systems for their control, sensory feedback, and informationprocessing. Obstacle detection and avoidance robots are intelligent robots whichcan perform desired tasks in unstructured environments by finding andovercoming obstacles in their way without continuous human guidance. In robotics, obstacle avoidance is the task of satisfying some controlobjective subject to non-intersection or non-collision position constraints.Normally obstacle avoidance is considered to be distinct from path planning inthat one is usually implemented as a reactive control law while the other involvesthe pre-computation of an obstacle-free path which a controller will then guide arobot along. A practical real-time system for passive obstacle detection andavoidance is presented. Robot Sensors are essential components in creating autonomousrobots as they are the only means for a robot to detect information about itselfand its environment. As little as one sensor is needed by a robot, thoughincreasing the number and variety of sensors tends to increase the robot’s abilityto get a more thorough understanding of the world around it. There are a wide variety of sensors available which are capable ofmeasuring almost anything, from environmental conditions (distance, light,sound, temperature) to angular and linear acceleration, forces and distances. The 01
  • 8. first sensor often incorporated into a mobile robot is a distance sensor, which isusually in the form of an infrared or ultrasonic sensor. In both cases, a pulse (oflight or sound) is sent and its reflection is timed to get a sense of distance. Usuallythese values are sent to the controller many times each second. Robot Shop offers a wide variety of sensors applicable to almost anyrobotics project. If you are looking for a distance sensor, we offer them in avariety of configurations and optimal distances to suit almost any budget. If youare looking for a more professional solution for measuring distances, take a lookat our selection of scanning laser rangefinders, which are able to scan over >180degrees (and less than 1 degree of accuracy) in well under 1 second.IR Pair isused as sensor to detect the presence of objects. IR LED is used for detectingobjects. In this project mainly when ever robot senses any obstacleautomatically diverts its position to left or right and follows the path. Robotconsists of two motors, which control the side pair wheels of each and help inmoving forward and backward direction. Robot senses the object with help ofobstacle sensor. IR pair is used for detecting the obstacle. The two basic parts forworking with IR are the emitter and the detector. The emitter is typically an LEDthat emits near-infrared light. Infrared (IR) light is electromagnetic radiation with a wavelengthlonger than that of visible light, measured from the nominal edge of visible redlight at 0.74 micrometers (µm), and extending conventionally to 300 µm. Thesewavelengths correspond to a frequency range of approximately 1 to 400 THz, andinclude most of the thermal radiation emitted by objects near room temperature.Microscopically, IR light is typically emitted or absorbed by molecules when theychange their rotational-vibration movements. Infrared light is used in industrial, scientific, and medical applications.Night-vision devices using infrared illumination allow people or animals to beobserved without the observer being detected. In astronomy, imaging at infraredwavelengths allows observation of objects obscured by interstellar dust. Infrared 02
  • 9. Imaging cameras are used to detect heat loss in insulated systems, observechanging blood flow in the skin, and overheating of electrical apparatus. IR LED IR detectors are specially filtered for Infrared lighted are notgood at detecting visible light. On the other hand, photocells are good at detectingyellow/green visible light, not well at IR light. IR detectors have a demodulator inside that looks for modulated IR at38 KHz. Just shining an IR LED won’t be detected, it has to be PWM blinking at38KHz. Photocells do not have any sort of demodulator and can detect anyfrequency (including DC) within the response speed of the photocell (which isabout 1KHz). IR detectors are digital out - either they detect 38KHz IR signaland output low (0V) or they do not detect any and output high (5V). Photocellsact like resistors, the resistance changes depending on how much light they areexposed to. A photodiode is a type of photo detector capable of converting lightinto either current or voltage, depending upon the mode of operation. Thecommon, traditional solar cell used to generate electric solar power is a large areaphotodiode. Photodiodes are similar to regular semiconductor diodes except thatthey may be either exposed (to detect vacuum UV or X-rays) or packaged with awindow or optical fiber connection to allow light to reach the sensitive part of thedevice. Many diodes designed for use specifically as a photodiode use a PINjunction rather than a p-n junction, to increase the speed of response. Aphotodiode is designed to operate in reverse bias. In this project we develop arobot such that it will be moving according to path assigned to it if at all there isany obstacle in between then the robot stops and change its direction. This sort ofproject is very much useful in the industries where the automated supervision isrequired. This project is basic stage of any automatic robot. This robot hassufficient intelligence to cover the maximum area of provided space. It has ainfrared sensor which are used to sense the obstacles coming in between the pathof robot. It will move in a particular direction and avoid the obstacle which iscoming in its path. 03
  • 10. A robot obstacle detection system comprising: a robot housing whichnavigates with respect to a surface; a sensor subsystem having a definedrelationship with respect to the housing and aimed at the surface for detecting thesurface, the sensor subsystem including: an optical emitter which emits a directedbeam having a defined field of emission, and a photon detector having a definedfield of view which intersects the field of emission of the emitter at a finiteregion; and a circuit in communication with the detector for redirecting the robotwhen the surface does not occupy the region to avoid obstacles. Obstacle sensors are nothing but the IR pair. As the transmitter parttravel IR rays from to receiver here also transmitter send the data receiver butthese IR pair are places beside each other. So whenever an obstacle senor got aobstacle in between its way the IR rays reflects in a certain angle. As they areplaced side by each. We have used two D.C motors to give motion to the robot. Theconstruction of the robot circuit is easy and small .The electronics parts used inthe robot circuits are easily available and cheap too. Here we are also adding an application of cleaning to this obstacledetecting robot that is by adding a electrical device known as blower. This blowerhave a fan with attach motor which work as vacuum cleaner and this robotbecause of this application can be sent to any where to clean a particular place orarea the motor used here is D.C motor. Blowers for ventilation and for industrial processes that need an airflow. Fan systems are essential to keep manufacturing processes working andconsist of a fan, an electric motor, a drive system, ducts or piping, flow controldevices, and air conditioning equipment (filters, cooling coils, heat exchangers,etc.). Fans, blowers and compressors are differentiated by the method usedto move the air, and by the system pressure they must operate against. Blowerscan achieve much higher pressures than fans, as high as 1.20 kg/cm2. They arealso used to produce negative pressures for industrial vacuum systems. 04
  • 11. 2. REVIEW OF LITERATURES This robot has sufficient intelligence to cover the maximum area ofprovided space. It has an infrared sensor which is used to sense the obstaclescoming in between the path of robot. It will move in a particular direction andavoid the obstacle which is coming in its path. It uses IR (Infra Red) sensors and two IR transmitting circuitry. Whenthe obstacle comes in path of robot IR beam is reflected from the obstacle thensensor gives zero voltage to µc. This zero voltage is detected then µc decides toavoid the obstacle by taking left or right turn. If the sensor gives +5v to µc thatmeans there is no obstacle present in its path so it goes straight until any obstacleis detected. The two IR transmitter circuits are fitted on front and left side ofrobot. The two IR sensors are placed near to transmitters’ IR LEDs. Theconnections can be given from main circuit to sensors using simple twisted paircables. Two motors namely right motor and left motor are connected to driver IC(L293D). L293D is interface with µc. Micro-controller sends logic 0 & logic 1 asper the programming to driver IC which moves motors forward or reversedirection. Now let us see all the things in our project. 05
  • 12. Figure 2.1: Block Diagram of Project
  • 13. 062.1 ConstructionThe project is combination of different units as follows: 1. Hardware 2. Software2.1.1 Hardware UnitThe hardware part includes the structure of robot that is Electronics andCommunication structure, PCB (printed circuit board), blower, and battery. In thisunit all the connections are being made along with the PCB now let us see in briefhow it can be done.2.1.1.1 Electronics and Communication ConnectionIn Electronics and Communication connection wheel is connected to base verytightly to avoid errors in the system. Connection of blower is made with lowerpart of base and battery is connected in upper portion of base for power supply tothe system which is very important battery used here is of 6v battery, blower of+5V to +9V. And along with wheel electrical motors are connected with basehaving r.p.m of 100 rpm.2.1.1.2 PCB Connection A printed circuit board, or PCB, is used to Electronics and Communicationlysupport and electrically connect electronic components using conductivepathways, tracks or signal traces etched from copper sheets laminated onto a non-conductive substrate.
  • 14. The PCB is printed circuit board having circuit made with cooperlayer on the plate there are various steps to design a PCB for that the basic thingrequired is circuit. So, the circuits required for the system are: 072.1.1.2.1 IR Sensor CircuitAn infrared sensor is an electronic device that emits and/or detects infraredradiation in order to sense some aspect of its surroundings. Infrared sensors canmeasure the heat of an object, as well as detect motion. Many of these types ofsensors only measure infrared radiation, rather than emitting it, and thus areknown as passive infrared (PIR) sensors. All objects emit some form of thermal radiation, usually in the infraredspectrum. This radiation is invisible to our eyes, but can be detected by aninfrared sensor that accepts and interprets it. In a typical infrared sensor like amotion detector, radiation enters the front and reaches the sensor itself at thecenter of the device. This part may be composed of more than one individualsensor, each of them being made from piezoelectric materials, whether natural orartificial. IR Sensor includes photodiode and IR LED which play the role ofreceiver and transmitter respectively.2.1.1.2.1.1 IR LEDAn IR LED, also known as IR transmitter, is a special purpose LED that transmitsinfrared rays in the range of 760 nm wavelength. Such LEDs are usually made ofgallium arsenide or aluminum gallium arsenide. They, along with IR receivers,are commonly used as sensors. The appearance is same as a common LED. Since the human eyecannot see the infrared radiations, it is not possible for a person to identifywhether the IR LED is working or not, unlike a common LED. To overcome thisproblem, the camera on a cell phone can be used. The camera can show us the IRrays being emanated from the IR LED in a circuit.
  • 15. 082.1.1.2.1.2 PhotodiodeA photodiode is a type of photo detector capable of converting light into eithercurrent or voltage, depending upon the mode of operation. The common,traditional solar cell used to generate electric solar power is a large areaphotodiode. It is use to sense the reflected IR rays which reflect due to presence ofobstacle and due to it robot change its path. This sensor uses IR (Infra Red) sensors and two IR transmittingcircuitry. When the obstacle comes in path of robot IR beam is reflected from theobstacle then sensor gives zero voltage to µc. This zero voltage is detected thenµc decides to avoid the obstacle by taking left or right turn. If the sensor gives+5v to µc that means there is no obstacle present in its path so it goes straightuntil any obstacle is detected. The sensor circuit is shown in figure 2.2. It uses IR (Infra Red) sensors and two IR transmitting circuitry.When the obstacle comes in path of robot IR beam is reflected from the obstaclethen sensor gives zero voltage to µc. This zero voltage is detected then µc decidesto avoid the obstacle by taking left or right turn. If the sensor gives +5v to µc thatmeans there is no obstacle present in its path so it goes straight until any obstacleis detected. The two IR transmitter circuits are fitted on front and left side ofrobot. The two IR sensors are placed near to transmitters’ IR LEDs. Theconnections can be given from main circuit to sensors using simple twisted paircables.
  • 16. 09Figure 2.2: IR Sensor circuit
  • 17. 10After having the circuit it is easy to design PCB. Circuit is traced in PCB by usingdifferent software here we have used PCB Express software to design layout thenit is etched and further the component are soled in it.2.1.1.2.2 Controller CircuitA microcontroller (sometimes abbreviated µC, uC or MCU) is a small computeron a single integrated circuit containing a processor core, memory, andprogrammable input/output peripherals. Microcontrollers are used in automatically controlled products anddevices, such as automobile engine control systems, implantable medical devices,remote controls, office machines, appliances, power tools, toys and otherembedded systems. By reducing the size and cost compared to a design that uses aseparate microprocessor, memory, and input/output devices, microcontrollersmake it economical to digitally control even more devices and processes. Mixedsignal microcontrollers are common, integrating analog components needed tocontrol non-digital electronic systems. Here we are giving code to Microcontroller according to those codesour robot move; these codes are created by programming logic in Keil softwareand latter burn in microcontroller by flash magic software. These codes controlthe motor by the logic of 0 and by logic 1 and through this direction of robot iscontrol. But for the purpose of providing this logic to motor we use an IC thatis L293D Having 16 pin it get input by output of microcontroller this make robotan intelligent or autonomous robot this IC also amplifies the current and provideto motor .
  • 18. 11Figure 2.3: Controller Circuit
  • 19. 12After having the circuit it is easy to design PCB. Circuit is traced in PCB by usingdifferent software here we have used PCBExpress software to design layout thenit is etched and further the component are solded in it. Now when all the PCBs are connected according to required conditionand the electro-Electronics and Communication structure is ready still the systemwill not work without software unit.Let us discuss the software unit.2.1.2 Software UnitComputer software or just software is a collection of computer programs andrelated data that provides the instructions for telling a computer what to do andhow to do it. Software refers to one or more computer programs and data held inthe storage of the computer for some purposes. In other words, software is a set ofprograms, procedures, algorithms and its documentation concerned with theoperation of a data processing system. Program software performs the function ofthe program it implements, either by directly providing instructions to thecomputer hardware or by serving as input to another piece of software. The term was coined to contrast to the old term hardware (meaningphysical devices). In contrast to hardware, software "cannot be touched".Software is also sometimes used in a more narrow sense, meaning applicationsoftware only. Sometimes the term includes data that has not traditionally beenassociated with computers, such as film, tapes, and records. Here we are using various software to design our project we requiredsoftware for designing PCB layout, microcontroller programming, burning ofmicrocontroller.Let us see different software unit in our project: Here first let us see how to design a PCB over which we are usingthese software so following steps we are using to design a PCB:
  • 20. 1. Choose a method to use for creating the PCB. Your choice will usually bebased on the availability of materials needed by the method, the technical 13Difficulty level of the method or the quality of PCB you desire to obtain. Heres abrief summary of the diff- availability of many materials such as the etchant andit is somewhat slow. The quality of PCB obtained varies according to thematerials you use but generally, it is a good method for simple to intermediatelevels of complexity circuits. Circuits involving more close wiring and tiny wiresusually use other methods.3. UV etching method: this method requires more expensive materials that mightnot be available everywhere. However, the steps are simple; it requires less safetymeasures and can produce finer and more complicated circuit layouts.4. Mechanical etching/routing method: this method requires special machines thatwill mechanically etch away unnecessary copper from the board or route emptyseparators between wires. It can be expensive if you intend to buy one of thosemachines and usually leasing them requires the availability of a workshop nearby.However, this method is good if you need to create many copies of the circuit andalso can produce fine PCBs.5. Laser etching method: this is usually used by large production companies, butcan be found on some universities. The concept is similar to mechanical etchingbut LASER beams are used to etch the board. It is usually hard to access suchmachines, but if your local university is one of the lucky ones having suchmachine, you can use their facilities if they allow it.2.1.2.1. Create the PCB Layout of your circuit : This is usually done by converting your circuits schematic diagraminto a PCB layout using PCB layout software. There are many open sourcesoftware packages for PCB layout creation and design, some are listed here togive you a head-start:1. PCB2. Liquid PCB
  • 21. 3. Shortcut 142 . Make sure you gathered all the materials needed by the method of yourchoosing.3. Draw the circuit layout on the copper coated board. This is only applicable inthe first two methods. More details can be found on the detail section of yourmethod of choice.4 . Etch the board. Look for the details sections for how to etch the board. Thisprocess removes any unnecessary copper from the board leaving only wiring ofthe final circuit.5 . Drill mounts points. Drilling machines used for that are usually custommachines designed specifically for this purpose. However, with some adjustmentsa usual drilling machine will do the job at home.6 . Mount and solder the electronic components on board.2.1.2.2 Acid etching method specific steps1 . Choose your etching acid. Ferric chloride is a common choice for an etchant.However, you can use Ammonium Per sulfate crystals or other chemicalsolutions. No matter what choice for the chemical etchant, it will always be adangerous material, so besides following the general safety precautions mentionedin this article, you should also read and follow any additional safety instructionsthat come with the etchant.2 . Draw the PCB layout. For acid etching, you need to draw the circuitry usingan etchant resistant material. Special markers can be found easily for this specificpurpose if you intend to do the drawing by hand (not appropriate for medium tolarge circuits). Laser printers ink is the most commonly used material however.The steps to use laser printers for drawing the circuit layout are as follows:1 . Print the PCB layout on a glossy paper. You should ensure the circuit ismirrored before doing that (most PCB layout programs have this as an optionwhen printing). This only works using a laser printer.2 . Put the glossy side, with the printing on it, facing the copper.
  • 22. 3 . Iron the paper using an ordinary clothes iron. The amount of time this willtake depends on the type of paper and ink used. 154 . Immerse the board and paper in hot water for a few minutes (up to 10minutes).5 . Remove the paper. If certain areas seem particularly difficult to peel off, youcan try soaking a bit more. If everything went well, you will have a copper boardwith your PCB pads and signal lines traced out in black toner.6. Prepare the acid etchant. Depending on the acid etch that you choose, theremight be additional instructions. For example, some crystallized acids requirebeing dissolved in hot water, but other etchants are ready to use.7 . Submerge the board in the acid.8 . Make sure to stir every 3-5 minutes.9. Take the board out and wash it when all unnecessary copper is etched awayfrom the board.10. Remove the insulating drawing material used. There are special solventsavailable for almost all types of insulating drawing material used in drawing PCBlayouts. However, if you dont have access to any of these materials, you canalways use a sand paper (a fine one).2.1.2.3 Ultra-Violet etching method specific steps1. Draw the PCB layout on the special copper coated board.2. Cover the board with a transparent sheet (optional)3. Put the board in the UV etching machine/chamber4. Turn on the UV machine for the specified amount of time depending on thespecification of the board and machine.2.1.2.3 PCB Express For designing of PCB layout we are using this software with the helpof tools embedded in it designing of PCB became very easy. Firstly circuit is
  • 23. drawn in PCB Express software and of it only upper layer that is copper layer ischosen to provide proper connectivity in circuit. Hence we get two PCB layout ofsensor and controller both 16Figure 2.3 shows PCB layout of IR sensor, figure 2.4 shows PCB layout ofcontroller circuit.Steps to design PCB are:1. Fire up Express SCH.2. You will see a ‘Welcome to Express PCB …..’ screen. You may go throughthe quick start guide, but if you are reading this, that won’t be necessary Click‘Ok’.3. We’ll first need to place some components. Say we want to make a VoltageRegulator circuit.4. Click on the ‘component and symbol manager’ that is. the button to which Ihave shown an arrow pointing5. You’ll see the above window. Click Find–> Then key in ‘lm7805′. Onceyou find it , select it and click —>Insert into schematic.6. Now to connect the components together , click on ‘Place a wire’ . Click onceon an end of one component, then another time on an end of another componentto connect the them together. Use ‘Insert corner in a wire’ option (directly below‘Place wire’ ) to bend the wire into a neater right angle. It doesn’t really matterwhether you do this or not.7. Please note than ground , Vcc etc. will be found in list.
  • 24. 17Figure 2.4: PCB layout of sensor
  • 25. 18Figure 2.5: PCB of Controller Circuit
  • 26. 19Figure 2.6: Final PCB Layout
  • 27. 202.1.2.4 Keil Software Keil was founded in 1982 by Günter und Reinhard Keil, initially as aGerman GbR. In April 1985 the company was converted to Keil Elektronik GmbH tomarket add-on products for the development tools provided by many of the siliconvendors. Keil implemented the first C compiler designed from the ground-up specificallyfor the 8051 microcontroller. Keil provides a broad range of development tools like ANSI Ccompiler, macro assemblers, debuggers and simulators, linkers, IDE, librarymanagers, real-time operating systems and evaluation boards for 8051. Keilprovides IDE for 8051 programming & is very easy to use. When starting a newproject, simply select the microcontroller you use from the Device Database andthe µVision IDE sets all Compiler, Assembler, Linker, and Memory options. It’sdevice database is large which supports many ICs of the 8051 family. A HEX filecan be created with the help of Keil which is required for burning onto chip. It hasa powerful debugging tool which detects most of the errors in the program.1. Here we are writing codes in Keil software creating .asm file that is assemblyfile and then use these codes further in microcontroller.1. Open the Project menu and choose New Project.2. Enter the name of the project you are creating. Enter the name usb.prj andpressOK. usb.prj will be entered under File name. The window is used to add various files to your project. These includeASCII files, C and assembly source, and macros. The list is quite extensive and isfound in the Translator window if any files are present in the project. Note thiswindow is blanked out at this time. This window is accessible at any, time byselecting Project/Edit Project and you may easily edit your file list. Note that anyassembler files must be last in this list. If they are not, changes made to them maynot be reflected in the final object file. When creating a new project in thismanner no source files are yet available. Therefore, select save to close this
  • 28. window. Your project usb.prj will be active. Click on Project and confirm usb.prjis visible. 212.1.2.5 CREATING A NEW SOURCE CODE FILEThe pathname for this file (example.c) is c:c51evalexamplestutorialexample.c.Type this program inif you do not have this directory: This tutorial needs example.c in c:c51evalbin.1) Do this step if you do not have the source. Open the File menu and chooseNew to go to the µVision integrated editor. Use the editor to type in example.c .When you have entered the file, do a save as to the c:c51evalbin directory. Thefilename should be example.c . This will keep things easy to follow.2) If you have the source code as a file, choose Open and get example.c in theusual fashion. Source code. This sample program uses a number of simple Csource lines to demonstrate the Keil tool set. 3) Open the File menu and choose Save as. Save this file in the indicateddirectory. This tutorial uses the directory: c:c51evalbin and the filenameexample.c. Normally your project and source code would be in a directory of yourchoosing.4) At this point you have created a project called usb.prj and a C source filecalled example.c. The next step is to build your project. This includes compiling,assembling, linking and locating and creating the hex file. The hex file would beprogrammed into an EPROM and is not used here.2.1.2.6 BUILDING THE PROJECT1) Open the Project menu and choose Edit Project. This is where you add variousfiles to your project. Note there are no files in the project yet.2) Choose Add. This is where you add the files to your project.3) Select the file: example.c and press Enter.
  • 29. 4) Choose Add then Close. Example.c will be listed in the Source Files window.5) Make sure Include in Link/Lib is checked.6) Choose Save. 22With the tool configured, you are ready to run the compiler and linker using theMake utility.1. Click on the “Build All” icon (it has three arrows pointing downwards) or openOptions and selectMake.• If the program specified (example.c) has any errors; they will appear on thescreen. Use the editor to correct the error(s) in the source code and save the file.You can double-click on the error of interest and µVision will take you to theoffending line in the source code. You can edit this line and rebuild the project byrepeating this section: beginning at step 1.• If there are no errors, the code is assembled and linked with the executable codeready to be downloaded to the board. The Project Status window will state “MakeSuccessful - HEX File Created” if everything is working properly. Continue to thenext section. The following files in the directory bin are associated with thisproject:• example.c original source file - needed for debugging purposes.• example.bak a backup file produced by µVision.• example.lst a listing file of the source example.• example.obj a relocatable object file. Needs to be linked.• usb.prj the Project File. Note that the output code assumes the name of theproject file.• usb.m51 map file.• usb.hex Intel Hex File Created by the Object to Hex Converter oh51.exe.• usb absolute object file with debugging information (if so set in the compileroption)
  • 30. This file is the input for the Keil simulator dScope and emulators. Thisfile is created by the linker. 232.1.2.7 Flash Magic SoftwareThis software is use to burn microcontroller, through interfacing kit connectingcables are connected to computer, it connect computer and the unit ofmicrocontroller and when we use this software it transfer the codes from keilsoftware to transfer to microcontroller and on bases of those codes our robotworks. Flash Magic is a PC tool for programming flash basedmicrocontrollers from NXP using a serial or Ethernet protocol while in the targethardware. It has some excellent features like changeable baud rate, erase all flashbefore programming, setting security bits etc. The HEX file created with the helpof keil was selected through it for programming the microcontroller.2.1.2.8 Code Vision Area Compiler • Enhanced the code optimizer • Added support for the AVR Studio 5.1 and Atmel Studio 6 debuggers inthe Settings|Debugger menu. Details about using CodeVisionAVR with thesedebuggers are available in the Help topics:- CodeVisionAVR IDE|Tools|The AVR Studio Debugger- CodeVisionAVR C Compiler Reference|Using the AVR Studio 4.19 Debugger- CodeVisionAVR C Compiler Reference|Using the AVR Studio 5.1 and AtmelStudio 6 Debuggersand in the chapters: 2.4.1, 3.21 and 3.22 of the CodeVisionAVR User Manual. • Added support for the SSD1963 color TFT graphic controller (Advancedlicense required)
  • 31. • Improved the speed of the SSD1289 graphic LCD library (Advancedlicense required)• Added functions memory address and size list to the .map file• Renamed the adc member of GLCDINIT_t structure to reverse_x in theheader files for the SED1530, SPLC501C, ST7735 graphic LCD controllers. 24• Renamed the seg_rev member of GLCDINIT_t structure to reverse_x inthe header file glcd_uc1701.h for the UC1701 graphic LCD controller• Renamed the adc_rev132_x0 member of GLCDINIT_t structure torev132_x0 in the header files for the SED1530, SPLC501C, ST7735, UC1701graphic LCD controllers• Added the reverse_y member to the GLCDINIT_t structure in the headerfiles for the SED1530, SPLC501C, ST7735, UC1701 graphic LCD controllers• Added the reverse_x member to the GLCDINIT_t structure for theSSD1289 TFT controller. Replaced the gate_scan member with reverse_y.• Added transparency support for color images in graphics.h (documentedin the Help and User Manual)• Improved the delay_us function (delay.h) so that short delays can beobtained even for low clock frequencies. Added a warning if the clock frequencyis too low and the desired delay cant be obtained.• Added the SCAN (XMEGA ADC channel scan register) member to theADC_CH_t structure in the xmstruct.h header file• Fixed: the strlcpy and strlcpyf functions (string.h) should copy maximumn-1 characters.CodeWizardAVR• Fixed: the CodeWizardAVR for XMEGA devices signaled that notenabled EBI /CS0../CS3 signals should be configured as outputs• LCD Vision• Added support for the SDD1963 color TFT graphic controller
  • 32. • Added scrollbars to LCD preview if the image doesnt fit in the dockingpanel• Added the possibility to select opaque or transparent background whenpasting during image editing• Fixed: Image inverting was functional only for text inserting mode• Fixed: Large font characters didnt fit in the preview window 25• Chip Programmer• Added programming support for Atmel JTAGICE 3 (requires AVR Studio5.1 or Atmel Studio 6 to be installed).• Fixed: incorrect FLASH page size for ATmega16U4 and ATmega32U4chips, which lead to programming failure when using parallel port, STK500 andAVR910 programmers.V2.05.6 Commercial ReleaseCompiler• Enhanced the expression optimizer for cases when ANSI char to intpromotion is enabled in the project configuration• Improved generated code when passing a struct/union with size 1, 2 or 4as function argument• Added support for ATxmega64A3U, ATxmega128A3U,ATxmega192A3U, ATxmega256A3U, ATxmega256A3BU, ATxmega16A4U,ATxmega32A4U, ATxmega64A4U, ATxmega128A4U chips• Added support for the UltraChip UC1701 graphic LCD controller• Added in glcd_st7565.h, glcd_sed1530.h and glcd_spl501.h theadc_rev132_x0 member to the GLCDINIT_t structure, for displays that usereversed RAM column address driver (ADC=1) and the pixel with x=0 isconnected to column driver #132
  • 33. • Added 102x64 display support for the ST7565 graphic LCD controller • Modified ff.lib so that LFN support can be enabled from ff.h • Modified sdcard.lib and the Project|Configure|C Compiler|Libraries|MMC/SD/SD HC Cardmenu to allow SD card sockets without a /CD signal to be used • Added the sdcard_present function in sdcard.h to check if a card isinserted, when the /CD card socket signal is not used 26 • Changed the declaration of the twi_init function from twix.h tovoid twi_init(TWI_t *module,bool ext_driver_intf,unsigned char sda_hold) inorder to be compatible with the ATxmega64A3U, ATxmega128A3U,ATxmega192A3U, ATxmega256A3U, ATxmega256A3BU, ATxmega16A4U,ATxmega32A4U, ATxmega64A4U, ATxmega128A4U chips • Improved the twi_init function (twi.h) for better handling recovery after abus conflict • Modified the snprintf, vsnprintf functions (stdio.h) so that they will returnthe number of characters that would have been output, had the buffer been bigenough (as required by C99). Previous versions returned the number of characterseffectivelly written in the buffer (limited by the buffersize) • Fixed: RAM access code was generated when passing a struct/unionlocated in FLASH or EEPROM as function argument • Fixed: bug in glcd_sed1520.lib that produced a compilation error forXmega chips • Added missing TWI registers bit definitions in the mega32u4_bit.h headerfile CodeWizardAVR • Modified to generate the functions for external memory access, forgraphic LCDs, only if the Use Image Storage in External Memory option isenabled
  • 34. • Removed the TWIE peripheral for theATxmega256D3/192D3/128D3/64D3 chips, according to the errata from thelatest Atmel datasheet• Fixed: for XMega chips the peripheral clock frequency (not the systemclock frequency as is incorrectly specified in the current Atmel XMEGA AManual Rev. 8077H-AVR-12/09) will be used for setting the value of the TWIbaud rate register 27• Fixed: for XMega chips, in certain situations when using the differentialinput mode, the ADC positive and negative input selections were reset to 0, whenswitching the settings display between ADCA and ADCB• Fixed: for the ATtiny2313/4313 chips, when the Timer 0 OC0B outputwas used, no checks were performed if PORTD bit 5 was configured as output• LCD Vision• Added support for creating, editing and converting graphic images• Chip Programmer• Fixed: chip signature for ATmega328• Fixed: the WDP and WDWP Xmega fuse bits state was not correctlysaved in the project file, when the option to program the chip after build wasenabled• Fixed: improper BODACT fuse programming for Xmega A chips, becauseof a mistake in Atmel XMEGA A Manual• Fixed: the Xmega D chips dont have the JTAGEN fuse. The JTAGUIDfuse bits were replaced with USERID fuse bits.2.1.2.9 Algorithm
  • 35. The algorithms used in this robot are as follows:1) Start2) Initialize the input port & output port. Set the bit of port pin 1.03) Read data from port 1.4) Check the bit on pin P1.0.5) If bit is present move motors in forward direction. Else go to step 6.6) If bit is not present on pin P1.0, then stop right motor & move left motor inforward direction until we get bit on pin p1.0.7) Again go to step 3.8) Stop. 282.2 Basic Parts Of Project So, now we may say that there are following main parts are there usedin our projects those are:2.2.1 Sensors A sensor (also called detector) is a converter that measures a physicalquantity and converts it into a signal which can be read by an observer or by an(today mostly electronic) instrument. Sensors are used in everyday objects such as touch-sensitive elevatorbuttons (tactile sensor) and lamps which dim or brighten by touching the base.There are also innumerable applications for sensors of which most people arenever aware. Applications include cars, machines, aerospace, medicine ,manufacturing and robotics. The IR Transmitter block mainly used to generate IR signal. It usestimer IC555 in astable multivibrator mode to generate square wave which havecontinuous pulses of 50% duty cycle of frequency 38 KHz. This transmitter is soarranged that the IR rays are focused on the sensor.2.2.2 Microcontroller
  • 36. This is the most important block of the system. Microcontroller is thedecision making logical device which has its own memory, I/O ports, CPU andClock circuit embedded on a single chip. A microcontroller (sometimes abbreviated µC, uC or MCU) is a smallcomputer on a single integrated circuit containing a processor core, memory, andprogrammable input/output peripherals. Program memory in the form of NOR flash orOTP ROM is also often included on chip, as well as a typically small amount of RAM.Microcontrollers are designed for embedded applications, in contrast to themicroprocessors used in personal computers or other general purpose applications. 29 Microcontrollers are used in automatically controlled products anddevices, such as automobile engine control systems, implantable medical devices,remote controls, office machines, appliances, power tools, toys and otherembedded systems. By reducing the size and cost compared to a design that uses a separatemicroprocessor, memory, and input/output devices, microcontrollers make iteconomical to digitally control even more devices and processes. Mixed signalmicrocontrollers are common, integrating analog components needed to controlnon-digital electronic systems2.2.3 DriverL293D is used as driver IC. Motors are connected to this IC. According toprogram in µc it drives the left and right motor. L293D is a dual H-bridge motordriver integrated circuit (IC). Motor drivers act as current amplifiers since theytake a low-current control signal and provide a higher-current signal. This highercurrent signal is used to drive the motors. L293D contains two inbuilt H-bridge driver circuits. In its commonmode of operation, two DC motors can be driven simultaneously, both in forwardand reverse direction. The motor operations of two motors can be controlled byinput logic at pins 2 & 7 and 10 & 15. Input logic 00 or 11 will stop the
  • 37. corresponding motor. Logic 01 and 10 will rotate it in clockwise andanticlockwise directions, respectively. Enable pins 1 and 9 (corresponding to the two motors) must be highfor motors to start operating. When an enable input is high, the associated drivergets enabled. As a result, the outputs become active and work in phase with theirinputs. Similarly, when the enable input is low, that driver is disabled, and theiroutputs are off and in the high-impedance state.2.2.4 MotorsAn electric motor is an electromechanical device that converts electrical energyinto mechanical energy. 30 Most electric motors operate through the interaction of magnetic fieldsand current-carrying conductors to generate force. The reverse process, producing electrical energy from mechanicalenergy, is done by generators such as an alternator or a dynamo; some electricmotors can also be used as generators, for example, a traction motor on a vehiclemay perform both tasks. Electric motors and generators are commonly referred toas electric machines.2.2.5 BlowerBlowers for ventilation and for industrial processes that need an air flow. Fansystems are essential to keep manufacturing processes working and consist of afan, an electric motor, a drive system, ducts or piping, flow control devices, andair conditioning equipment (filters, cooling coils, heat exchangers, etc.). Fans, blowers and compressors are differentiated by the method usedto move the air, and by the system pressure they must operate against. Blowerscan achieve much higher pressures than fans, as high as 1.20 kg/cm2. They arealso used to produce negative pressures for industrial vacuum systems.2.3 Problem Faced In Making Project
  • 38. Although the concept & design of the project seemed perfect, there weresome problems faced while actual implementation:2.3.1 Proving Proper Power to different circuitSolution: taking high precaution in designing of circuit.2.3.2 Availability of BurnerSolution: as burner kit is not easily available, so we have design & implement hardwarefor burn the IC. 312.4 Testing There is always necessary to check the work for that here we haveimplemented various test for following:2.4.1 Continuity test First of all we checked the PCB that all the tracks are as per the designof PCB and showing continuity with the help of multimeter and PCB layout.2.4.2 Short circuit test Then we checked the PCB for any unwanted short circuits with thehelp of multimeter and PCB layout.2.4.3 Soldering In the next step, we soldered the required components. And thenchecked that there are no any unwanted shorts occurred due to soldering withoutputting ICs and keeping power supply off.2.4.4 Power supply test In the next step, we put power supply on and checked whetherrequired voltage is appearing at the required voltage is appearing at the required
  • 39. points i.e.+Vcc and GND at the respective points. We took care of not connectingICs in the circuit while performing this test.2.4.5 Microcontroller test For testing the microcontroller, we wrote the square wave generationprogram for generating square wave on each port pin. Then we fed the program inmicrocontroller and checked the output with the help of CRO by connecting themicrocontroller in the circuit. We took care of not connecting any other IC in thecircuit. 322.5 ApplicationsThere are following application of IR obstacle detecting robot1) This logic has been specially designed for vacuum cleaner. By using heavyrating motors, strong mechanical structure and using highly sensitive obstaclesensors, it efficiently works as vacuum cleaner.2) Just by making small changes in software this system can be used for avoidingconcealed paths. This robot can effectively sense the obstacles and find outcorrect path.3) With proper programming we can use it as a weight lifter.4) In Mines.2.6 Future Scope By ImprovementThe future uses of IR obstacle detector are as follows:2.6.1 Adding a Camera:
  • 40. If the current project is interfaced with a camera (e.g. a Webcam) robotcan be driven beyond line-of-sight & range becomes practically unlimited asnetworks have a very large range.2.6.2 Use as a fire fighting robot: By adding temperature sensor, water tank and making some changes inprogramming we can use this robot as fire fighting robot. 33 3. COMPONENTSAn electronic component is a basic electronic element that is available in adiscrete form (a discrete device or discrete component) that has two or moreelectrical terminals (or leads). These leads connect, usually soldered to a printedcircuit board, to create an electronic circuit (a discrete circuit) with a particularfunction (for example an amplifier, radio receiver, or oscillator). Basic electroniccomponents may be packaged discretely, as arrays or networks of likecomponents, or integrated inside of packages such as semiconductor integratedcircuits, hybrid integrated circuits, or thick film devices. The following list ofelectronic components focuses on the discrete version of these components,treating such packages as components in their own right.So the components used in our project are:1. Microcontroller ATMEGA8L2. IC 293D3. IC LM324N4. IC 7805
  • 41. 5. Potentiometer 20k6. Resistor 1k ohm7. IR LED8. Photo diode9. Battery10. Soldering wireLet us discuss all components in brief 343.1. Microcontroller ATMEGA8LThe ATmega8 is a low-power CMOS 8-bit microcontroller based on the AVRRISC architecture. By executing powerful instructions in a single clock cycle, theATmega8 achieves throughputs approaching 1 MIPS per MHz, allowing thesystem designer to optimize power consumption versus processing speed. Fig 3.1 Microcontroller ATMEGA8L
  • 42. ATMEGA8L Features:High-performance, Low-power AVR® 8-bit Microcontroller Advanced RISCArchitecture – 130 Powerful Instructions – Most Single-clock Cycle Execution – 32 x 8 General Purpose Working Registers – Fully Static OperationNonvolatile Program and Data Memories – 8K Bytes of In-System Self-Programmable FlashIn-System Programming by On-chip Boot ProgramSpecial Microcontroller Features – Power-on Reset and Programmable Brown-out Detection – Internal Calibrated RC Oscillator – External and Internal Interrupt Sources 35I/O and Packages – 23 Programmable I/O Lines – 28-lead PDIP, 32-lead TQFP, and 32-pad MLFOperating Voltages 2.7 - 5.5V (ATmega8L)3.2 IC L293DL293D is a dual H-bridge motor driver integrated circuit (IC). Motor drivers actas current amplifiers since they take a low-current control signal and provide ahigher-current signal. This higher current signal is used to drive the motors.
  • 43. Fig 3.2 IC L293DL293D contains two inbuilt H-bridge driver circuits. In its common mode ofoperation, two DC motors can be driven simultaneously, both in forward andreverse direction. The motor operations of two motors can be controlled byinput logic at pins 2 & 7 and 10 & 15. Input logic 00 or 11 will stop thecorresponding motor. Logic 01 and 10 will rotate it in clockwise andanticlockwise directions, respectively. Enable pins 1 and 9 (corresponding to 36the two motors) must be high for motors to start operating. When an enableinput is high, the associated driver gets enabled. As a result, the outputs become active and work in phase withtheir inputs. Similarly, when the enable input is low, that driver is disabled, andtheir outputs are off and in the high-impedance state.3.3 IC LM324NLM324 is a 14pin IC consisting of four independent operational amplifiers (op-amps) compensated in a single package. Op-amps are high gain electronic voltageamplifier with differential input and, usually, a single-ended output. The output
  • 44. voltage is many times higher than the voltage difference between input terminalsof an op-amp. Fig 3.3 IC LM324N These op-amps are operated by a single power supply LM324 and needfor a dual supply is eliminated. They can be used as amplifiers, comparators,oscillators, rectifiers etc. The conventional op-amp applications can be moreeasily implemented with LM324. 373.4 IC 7805Fixed voltage Positive and Negative regulator ICs are used in circuits to giveprecise regulated voltage.78 XX series regulator IC can handle maximum 1ampere current. The Regulator ICs require minimum 1.5 higher input voltage thantheir voltage rating. For example 7805 IC requires minimum 6.5 volts to give 5volt output. Here are some circuit designs of IC 7805 to monitor the outputvoltage.
  • 45. Fig 3.4 IC 78053.5 ResistorA resistor is a passive two-terminal electrical component that implementselectrical resistance as a circuit element. The current through a resistor is in directproportion to the voltage across the resistors terminals. Thus, the ratio of thevoltage applied across a resistors terminals to the intensity of current through thecircuit is called resistance. V= IR where I is the current through the conductor in units of amperes, V isthe potential difference measured across the conductor in units of volts, and R isthe resistance of the conductor in units of ohms. More specifically, Ohms lawstates that the R in this relation is constant, independent of the current. 38 Resistors are common elements of electrical networks and electroniccircuits and are ubiquitous in electronic equipment. Practical resistors can bemade of various compounds and films, as well as resistance wire (wire made of ahigh-resistivity alloy, such as nickel-chrome). Resistors are also implementedwithin integrated circuits, particularly analog devices, and can also be integratedinto hybrid and printed circuits.
  • 46. Fig 3.5 RESISTOR3.6 IR LEDAn IR LED, also known as IR transmitter, is a special purpose LED that transmitsinfrared rays in the range of 760 nm wavelength. Such LEDs are usually made ofgallium arsenide or aluminum gallium arsenide. They, along with IR receivers,are commonly used as sensors. Fig 3.6 IR LED 39 The appearance is same as a common LED. Since the human eyecannot see the infrared radiations, it is not possible for a person to identifywhether the IR LED is working or not, unlike a common LED. To overcome thisproblem, the camera on a cell phone can be used. The camera can show us the IRrays being emanated from the IR LED in a circuit.
  • 47. 3.7 Photodiode A photodiode is a type of photo detector capable of converting lightinto either current or voltage, depending upon the mode of operation. Thecommon, traditional solar cell used to generate electric solar power is a large areaphotodiode. Fig 3.7 PhotodiodePhotodiodes are similar to regular semiconductor diodes except that they may beeither exposed (to detect vacuum UV or X-rays) or packaged with a window oroptical fiber connection to allow light to reach the sensitive part of the device.Many diodes designed for use specifically as a photodiode use a PIN junctionrather than a p-n junction, to increase the speed of response. A photodiode isdesigned to operate it. 40 4. RESULTSThus, we believe that our project will be beneficial for various purposes & henceour efforts will be fruitful . So, we made a successfully obstacle detector robothaving application of vacuum cleaner which have ability to move freely anywhere
  • 48. and along with it, it have ability to create its own path and it avoid obstacle byartificial intelligence provided by programming in microcontroller to performaction and IR sensor to sense the obstacle, it also clean the area where it movewith vacuum cleaner which is its application. 41 5. REFERENCES 1. "Atmel’s Self-Programming Flash Microcontrollers" by Odd Jostein Svendsli 2003 2. http://www.semico.com 3. Heath, Steve (2003). Embedded systems design. EDN series for design engineers (2 ed.). Newnes. pp. 11–12. ISBN 9780750655460.
  • 49. 4. Easy Way to build a microcontroller project 5. Robert Edwards (1987). "Optimizing the Zilog Z8 Forth Microcontroller for Rapid Prototyping". p. 3. 6. www.infineon.com/mcu 42 6. APPENDICES6.1 Datasheet6.1.1 ATMEGA8L6.1.2 IC 78056.1.3 IC LM324N6.1.4 IC 293D
  • 50. 6.1.1 ATMEGA8L1. Introduction• High-performance, Low-power Atmel®AVR® 8-bit Microcontroller• Advanced RISC Architecture– 130 Powerful Instructions – Most Single-clock Cycle Execution– 32 × 8 General Purpose Working Registers– Fully Static Operation– Up to 16MIPS Throughput at 16MHz– On-chip 2-cycle Multiplier• High Endurance Non-volatile Memory segments– 8Kbytes of In-System Self-programmable Flash program memory– 512Bytes EEPROM– 1Kbyte Internal SRAM– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM– Data retention: 20 years at 85°C/100 years at 25°C– Optional Boot Code Section with Independent Lock Bits2. In-System Programming by On-chip Boot Program3. True 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, andCapture 432. Mode– Real Time Counter with Separate Oscillator– Three PWM Channels– 8-channel ADC in TQFP and QFN/MLF package3. Eight Channels 10-bit Accuracy– 6-channel ADC in PDIP package
  • 51. 4. Six 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,and5. Standby• I/O and Packages– 23 Programmable I/O Lines– 28-lead PDIP, 32-lead TQFP, and 32-pad QFN/MLF• Operating Voltages– 2.7V - 5.5V (ATmega8L)– 4.5V - 5.5V (ATmega8)• Speed Grades– 0 - 8MHz (ATmega8L)– 0 - 16MHz (ATmega8)• Power Consumption at 4Mhz, 3V, 25°C– Active: 3.6mA– Idle Mode: 1.0mA 446. 8-bit7. with 8KBytes8. In-System9. Programmable10. Flash
  • 52. Fig 6.1 ATMEGA8L PIN DIAGRAM6.1.2 IC 78051. Internal Thermal Overload Protection.2. Internal Short Circuit Current Limiting.3. Output Current up to 1.5A.4. Satisfies IEC-65 Specification. (International Electronical Commission).5. Package is TO 45
  • 53. Fig 6.2 IC 7805 PIN DIAGRAM6.1.3 IC LM324N• Internally frequency-compensated for unity gain• Large DC voltage gain: 100dB• Wide bandwidth (unity gain): 1MHz (temperature-compensated)• Wide power supply range Single supply: 3VDC to 30VDC or dualSupplies: ±1.5VDC to ±15VDC• Very low supply current drain: essentially independent of supplyVoltage (1mW/op amp at +5VDC)• Low input biasing current: 45nADC (temperature-compensated)• Low input offset voltage: 2mVDC and offset current: 5nADC• Differential input voltage range equal to the power supply voltage• Large output voltage: 0VDC to VCC-1.5VDC swing 46
  • 54. Fig 6.3 LM324N PIN DIAGRAM6.1.4 IC 293D• Terminations: 100 % matte tin, standard, tin/lead available• Compliant terminations• Molded case available in six case codes• Compatible with “High Volume” automatic pick and place equipment• Optical character recognition qualified• Meets IEC specification QC300801/US0001 andEIA535BAAC mechanical and performance requirements• Compliant to RoHS Directive 2002/95/EC• Moisture sensitivity level 1 47
  • 55. Fig 6.4 IC 293 PIN DIAGRAM6.2 Program#include <mega8.h>#include <delay.h>// Declare your global variables herevoid main(void){// Declare your local variables here// Input/Output Ports initialization// Port B initialization// Func7=In Func6=In Func5=In Func4=Out Func3=Out Func2=Out Func1=OutFunc0=In// State7=T State6=T State5=T State4=0 State3=0 State2=0 State1=0 State0=PPORTB=0x01;DDRB=0x1E;// Port C initialization// Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In// State6=T State5=T State4=T State3=T State2=T State1=T State0=TPORTC=0x00;DDRC=0x00; 48
  • 56. // Port D initialization// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=InFunc0=In// State7=T State6=T State5=T State4=T State3=T State2=T State1=P State0=PPORTD=0x03;DDRD=0x00;// Timer/Counter 0 initialization// Clock source: System Clock// Clock value: Timer 0 StoppedTCCR0=0x00;TCNT0=0x00;// Timer/Counter 1 initialization// Clock source: System Clock// Clock value: Timer 1 Stopped// Mode: Normal top=FFFFh// OC1A output: Discon.// OC1B output: Discon.// Noise Canceler: Off// Input Capture on Falling Edge// Timer 1 Overflow Interrupt: Off// Input Capture Interrupt: Off// Compare A Match Interrupt: Off// Compare B Match Interrupt: OffTCCR1A=0x00;TCCR1B=0x00;TCNT1H=0x00;TCNT1L=0x00;ICR1H=0x00;ICR1L=0x00;OCR1AH=0x00;OCR1AL=0x00;OCR1BH=0x00;OCR1BL=0x00;// Timer/Counter 2 initialization// Clock source: System Clock// Clock value: Timer 2 Stopped// Mode: Normal top=FFh// OC2 output: DisconnectedASSR=0x00;TCCR2=0x00;TCNT2=0x00;OCR2=0x00;// External Interrupt(s) initialization// INT0: Off 49// INT1: Off
  • 57. MCUCR=0x00;// Timer(s)/Counter(s) Interrupt(s) initializationTIMSK=0x00;// Analog Comparator initialization// Analog Comparator: Off// Analog Comparator Input Capture by Timer/Counter 1: OffACSR=0x80;SFIOR=0x00;while (1){if(PIND.0==1){PORTB.1=1,PORTB.2=0,PORTB.3=1,PORTB.4=0;delay_ms(100);}else{PORTB.1=0,PORTB.2=0,PORTB.3=0,PORTB.4=0;delay_ms(400);PORTB.1=0,PORTB.2=1,PORTB.3=0,PORTB.4=1;delay_ms(300);PORTB.1=0,PORTB.2=1,PORTB.3=1,PORTB.4=0;delay_ms(400);} }}Chip type : ATmega8LProgram type : ApplicationClock frequency : 1.000000 MHzMemory model : SmallExternal SRAM size :0Data Stack size : 256 50