1.Drowsy Driver Detection and Alerts (1)

March 17, 2018 | Author: Polyster | Category: Transformer, Rectifier, Microcontroller, Embedded System, Battery (Electricity)


Comments



Description

AProject Report On PREVENTION OF VEHICLE ACCIDENT USING EYE BLINK SENSOR Submitted on Partial Fulfilment of the Requirement for the Award of B.Tech In B.TECH ELECTRONIC AND COMMUNICATION ENGINEERING SUBMITTED BY S.HEMANTH REDDY (117Y1A0451) R.PHANINDHAR GOUD (117Y1A0439) M.ARUN REDDY (117Y1A0431) Under the guidance of Mrs.LAKSHMI KALA,M.TECH Assistant Professor, Dept. Of ECE Marri Laxman Reddy Institute of Technology & Management (Approved by AICTE, New Delhi & Affiliated to JNTU-Hyderabad) Dundigal, Ranga Reddy District, Hyderabad-500055 Marri Laxman Reddy Institute of Technology & Management (Approved by AICTE ,New Delhi & Affiliated to JNTU-Hyderabad) Dundigal, Ranga Reddy District, Hyderabad-500055 CERTIFICATE This is to certify that the project entitled “PREVENTION OF VEHICLE ACCIDENT USING EYE BLINK SENSOR” Being submitted by S.HEMANTHREDDY (117Y1A0451) ,R.PHANINDHAR GOUD (117Y1A0439),M.ARUN REDDY(117Y1A0431) in partial fulfilment of the requirements for the award of B.Tech Electronic and communication Engineering From Marri Laxman Reddy Institute of Technology & Management During the course, training his performance has been found satisfactory. Internal Guide External Examiner (HOD, ECE Dept.) ACKNOWLEDGEMENT I express my gratitude to my institution at “Marri Laxman Reddy Institute of Technology & Management, Dundigal” and our beloved principal “Mr.K.Venkateswara Reddy” for providing us means of attaining our most cherished goals. I would like to thank “Mr.K.N.BHUSHAN”, Head of the Department of “B.Tech in Electronics & Communication Engineering” for providing an opportunity to carry out this project along with his guidance, and moral support throughout my project work. I feel glad to say that my Internal guide “Mrs.LAKSHMI KALA” supported me a lot in completing my project successfully. I am thankful for his moral support and constant encouragement I am extremely thankful to all my departmental staff members for the extreme help throughout my project. I am thankful to department non-teaching staff for their constant help and made my task easier. S.HEMANTH REDDY (117Y1A0451) R.PHANINDHAR GOUD (117Y1A0439) M.ARUN REDDY (117Y1A0431) with the help of embedded C instructions. alcohol sensor technology. The main aim of this project is to alert the vehicle driver to avoid accidents when the driver was detected drowsy or by using Eye blink sensor. As this project uses the Eye blink sensor. so that the vehicle driver and owner gets alerts as the vehicle speed is reduced and alerts through buzzer alarm system. The controller is interfaced with Buzzer. This project makes use of a micro controller.ABSTRACT PREVENTION OF VEHICLE ACCIDENT USING EYE BLINK SENSOR Now a day's every system is automated in order to face new challenges. Due to this demand every field prefers automated control systems. reliability and accurate. which is programmed. and DC Motor . Especially in the field of electronics automated systems are giving good performance. This Microcontroller is capable of communicating with input and output modules. The Eye blink sensor provides the information to the Microcontroller (on board computer). In the present days Automated systems have less manual operations. The system uses eye blink sensor and reduces the vehicle speed and alerts through buzzer alarm system. This project is designed around a microcontroller which forms the control unit of the project. flexibility. . 3. CHAPTER 1: INTRODUCTION 1.…………………...INDEX TOPICS  Certificates………………………………………………………………………………………  Acknowledgement………………………………………………………………………….2 Need of embedded systems………………………………………………………………………………….1 Introduction to embedded systems………………………………………………………………………… 2.1 Introduction with block diagram…………………………………………………………………………… 3.....…...………………………………………………………… ..4 LED indicator………………….2 Microcontroller……………………………………………………………………………………………….……………………………………….... 2..2 Project overview…………………………………………………………………………………………….3 Explanation of embedded systems………………………………………………………………………….3 Thesis………………………………………………………………………………………………………… CHAPTER 2: EMBEDDED SYSTEMS 2.1 Introduction of the project ………………………………………………………………………………… 1.5 Eye blink sensor………………..3 Regulated power supply…………………………………………………………………………………….……………………………….. 3. 3... 2.4 Applications of embedded systems………………………………………………………………………… CHAPTER 3: HARDWARE DESCRIPTION 3... 1.. ………………….2 PIC C Compiler……………………………………………………………………………………………….3. CHAPTER 5: PROJECT DESCRIPTION CHAPTER 6: SOURCE CODE CHAPTER 7:ADVANTAGES.6 DC motor…………………………………………………………………………………. CHAPTER 4: SOFTWARE DESCRIPTION 4. DISADVANTAGES AND APPLICATIONS CHAPTER 8: RESULTS. FUTURE PROSPECTS REFERENCES . 3..7 Buzzer……………………………………………………………………………………………………….1 Express PCB………………………………………………………………………………………………… 4. CONCLUSION. Ease in understanding the working module. The Eye blink sensor provides the information to the Microcontroller (on board computer). and DC Motor.CHAPTER 1: INTRODUCTION 1. so that the vehicle driver and owner gets alerts as the vehicle speed is reduced and alerts through buzzer alarm system. Can be easily monitored. flexibility. The system uses eye blink sensor and reduces the vehicle speed and alerts through buzzer alarm system. with the help of embedded C instructions. Especially in the field of electronics automated systems are giving good performance. This project makes use of a micro controller. In the present days Automated systems have less manual operations. alcohol sensor technology. Low power consumption Project Overview: An embedded system is a combination of software and hardware to perform a dedicated task. reliability and accurate. Some of the main devices used in embedded products are Microprocessors and Microcontrollers. This Microcontroller is capable of communicating with input and output modules. As this project uses the Eye blink sensor. 4.1 Introduction: Now a day's every system is automated in order to face new challenges. which is programmed. This project is designed around a microcontroller which forms the control unit of the project. Features: 1. Easy to operate. Due to this demand every field prefers automated control systems. The main aim of this project is to alert the vehicle driver to avoid accidents when the driver was detected drowsy or by using Eye blink sensor. 3. The controller is interfaced with Buzzer. . 2. interfaces the data with various devices. Buzzer. process it and give the output. Chapter 4 Presents the software description. Buzzer. 1.Microprocessors are commonly referred to as general purpose processors as they simply accept the inputs. controls the data and thus finally gives the result. and its applications are discussed. a microcontroller not only accepts the data as inputs but also manipulates it. It explains the about what is embedded systems. In the project overview a brief introduction of eye blink sensor. Chapter 2 Presents the topic embedded systems. and DC motors with driver are considered. explanation of it along with its applications. In contrast. Buzzer. The organization of the thesis is explained here with: Chapter 1 Presents introduction to the overall thesis and the overview of the project. In the same chapter the explanation of microcontrollers. Chapter 6 Presents the advantages. It explains the implementation of the project using PIC C Compiler software. Chapter 5 Presents the project description along with eye blink sensor. conclusion and future scope of the project. disadvantages and applications of the project. DC motors. DC motors. Chapter 7 Presents the results. power supplies.3 Thesis: The thesis explains the implementation of “Eye blink detection with buzzer alerts and Vehicle (DC Motor) Control System” using PIC16F877A microcontroller. . The project “ Eye blink detection with buzzer alerts and Vehicle (DC Motor) Control System” using PIC16F877A microcontroller is an exclusive project which is used to detect the drowsiness detection and alerts through buzzer alarm alerts. interfacing to microcontroller. need for embedded systems. Chapter 3 Presents the hardware description. It deals with the block diagram of the project and explains the purpose of each block. DC motors with driver. eye blink sensor. peripherals and networks mounted inside a large chassis or enclosure. For example. The key characteristic. to large stationary installations like traffic lights. or the systems controlling nuclear power plants. but they allow different applications to be loaded and peripherals to be connected.1. as most systems have some element of extensibility or programmability. handheld computers share some elements with embedded systems such as the operating systems and microprocessors which power them. It is embedded as part of a complete device often including hardware and mechanical parts. however.CHAPTER 2: EMBEDDED SYSTEMS 2. air traffic control systems may usefully be viewed as embedded. In general. benefiting from economies of scale. . Embedded systems are controlled by one or more main processing cores that are typically either microcontrollers or digital signal processors (DSP). Embedded systems control many devices in common use today. such as a personal computer (PC). Moreover.1 Embedded Systems: An embedded system is a computer system designed to perform one or a few dedicated functions often with real-time computing constraints. factory controllers. For example. is designed to be flexible and to meet a wide range of end-user needs. On a continuum from "general purpose" to "embedded". large application systems will have subcomponents at most points even if the system as a whole is "designed to perform one or a few dedicated functions". with a single microcontroller chip. which may require very powerful processors. (Each radar probably includes one or more embedded systems of its own. Some embedded systems are mass-produced. Physically embedded systems range from portable devices such as digital watches and MP3 players. to very high with multiple units. By contrast. "embedded system" is not a strictly definable term. Complexity varies from low. even systems which don't expose programmability as a primary feature generally need to support software updates.) Since the embedded system is dedicated to specific tasks. a general-purpose computer. A modern example of embedded system is shown in fig: 2. even though they involve mainframe computers and dedicated regional and national networks between airports and radar sites. is being dedicated to handle a particular task. design engineers can optimize it to reduce the size and cost of the product and increase the reliability and performance. and is thus appropriate to call "embedded". Fig 2. One of the first recognizably modern embedded systems was the Apollo Guidance Computer. while at the same time battling a need for efficiency not seen in most PC applications. via solid state devices. but were far too large and expensive for most kinds of tasks performed by embedded computers of today. 2. The hardware for the system is usually chosen to make the device as cheap as possible. Hiring a programmer for an extra month is cheap in comparison. This means the programmer must make do with slow processors and low memory.1:A modern example of embedded system Labeled parts include microprocessor (4).1 History: In the earliest years of computers in the 1930–40s. programming for an embedded system is like programming PC 15 years ago. Below is a list of issues specific to the embedded field.Embedded systems programming is not like normal PC programming. the concept of programmable controllers evolved from traditional electromechanical sequencers.1. to the use of computer technology. Over time however. Spending an extra dollar a unit in order to make things easier to program can cost millions. RAM (6). flash memory (7). developed by Charles Stark Draper at the MIT . computers were sometimes dedicated to a single task. In many ways. Luckily. you will frequently sacrifice processor time for memory.1. 2. unlike the PC world where 1 instruction set rules. the Apollo guidance computer was considered the riskiest item in the Apollo project as it employed the then newly developed monolithic integrated circuits to reduce the size and weight. Memory is also an issue. embedded systems frequently have the cheapest processors that can do the job. at some point you will almost always find a compiler bug of some sort. people doing embedded programming quickly become masters at using serial IO channels and error message style debugging. the D-17 was replaced with a new computer that was the first high-volume use of integrated circuits. you can't always run a debugger on it. and the Unix world where there's only 3 or 4 major ones.1. As a result. That means their algorithms must be memory efficient (unlike in PC programs. An early mass-produced embedded system was the Autonetics D-17 guidance computer for the Minuteman missile. and optimize only when necessary. this won't happen too often.Instrumentation Laboratory. For the same cost savings reasons. due to the same reason debuggers don't work well.use reasonably efficient algorithms to start. This means your programs need to be written as efficiently as possible. Debugging tools are another issue. This means that the tools are more expensive. issues like memory cache misses that never matter in PC programming can hurt you. When the Minuteman II went into production in 1966. Of course. On a major embedded project. Special hardware such as JTAG ports can overcome this issue in part. At the project's inception. embedded systems usually have the least memory they can get away with. released in 1961. However. It was built from transistor logic and had a hard disk for main memory. Since you can't always run general programs on your embedded processor. There's also a large number of embedded architectures. 2. This makes fixing your program difficult. normal profilers won't work well. and less developed. When dealing with large data sets. It also means that they're lowering featured. permanent equipment damage can occur.2 Tools: Embedded development makes up a small fraction of total programming. rather than the . if you stop on a breakpoint when your system is controlling real world hardware (such as a motor).3 Resources: To save costs. and must be able to respond to them in real time. using the simple shell provided by the embedded operating system (e. Producing a custom-made chip to handle a particular task or set of tasks costs far more time and money. . 2. there is a major difference between a computer and an embedded system. It also means you can't afford to leak memory. microcontrollers. This is made even more difficult by the lack of resources available. So when implementing a new form of control.2 Need For Embedded Systems: The uses of embedded systems are virtually limitless. 2. hardware such as microprocessors.reverse). These resources either need to be emulated in software. most embedded processors do not have hardware FPUs (Floating-Point Processing Unit). and FPGA chips have become much cheaper. Embedded applications generally use deterministic memory techniques and avoid the default "new" and "malloc" functions. so that "writing your own software" becomes a very trivial task indeed. and to be able to put off/skip low priority tasks such as UI in favor of high priority tasks like hardware control. or avoided altogether. Other resources programmers expect may not even exist. The main elements that make embedded systems unique are its reliability and ease in debugging.g. From an implementation viewpoint. Failure to do so could cause inaccuracy in measurements. From simplest to most sophisticate they can be roughly grouped into the following areas:  Interactive resident debugging. depending on the facilities available.4 Real Time Issues: Embedded systems frequently control hardware. Embedded systems are often required to provide Real-Time response. it's wiser to just buy the generic chip and write your own custom software for it. or even damage hardware such as motors. Almost all embedded systems need to be able to prioritize some tasks over others. For example.1. Forth and Basic)  External debugging using logging or serial port output to trace operation using either a monitor in flash or using a debug server like the Remedy Debugger which even works for heterogeneous multi core systems.2. 2. Many embedded computers even come with extensive libraries. because every day new products are introduced to the market that utilizes embedded computers in novel ways. so that leaks can be found and eliminated more easily.1 Debugging: Embedded debugging may be performed at different levels. In recent years. Because an embedded system is often composed of a wide variety of elements. 2. This allows the operation of the microprocessor to be controlled externally. or it is too inaccessible to repair. navigational beacons. In such a case. "Limp modes" are less tolerable. bore-hole systems. the programmer can typically load and run software through the tools.  A complete emulator provides a simulation of all aspects of the hardware. debugging a software(and microprocessor) centric embedded system is different from debugging an embedded system where most of the processing is performed by peripherals (DSP. view the code running in the processor. switches or buttons are avoided. which requires very lowlevel debugging. and start or stop its operation. Specific reliability issues may include:  The system cannot safely be shut down for repair. and unreliable mechanical moving parts such as disk drives. providing full control over all aspects of the microprocessor. the debugging strategy may vary. Therefore the software is usually developed and tested more carefully than that for personal computers. Examples include aircraft navigation. For instance. engines on single-engine aircraft. . train signals. FPGA. The view of the code may be as assembly code or source-code.  Unless restricted to external debugging. A common problem with multi-core development is the proper synchronization of software execution. for instance. Often backups are selected by an operator. An increasing number of embedded systems today use more than one single processor core.  The system must be kept running for safety reasons. co-processor). An in-circuit debugger (ICD). a hardware device that connects to the microprocessor via a JTAG or Nexus interface. and automobiles. safety-critical chemical factory controls.  An in-circuit emulator replaces the microprocessor with a simulated equivalent.2. with a logic analyzer. allowing all of it to be controlled and modified and allowing debugging on a normal PC. at signal/bus level.2 Reliability: Embedded systems often reside in machines that are expected to run continuously for years without errors and in some cases recover by themselves if an error occurs. the embedded system design may wish to check the data traffic on the busses between the processor cores. undersea cables. Examples include space systems. reactor control systems. but is typically restricted to specific debugging capabilities in the processor. . the software simply has a loop. This means that tasks performed by the system are triggered by different kinds of events. improving reliability. or privileged-level system software.  Simple Control Loop: In this design.3. to recover from errors— both software bugs such as memory leaks. bridge and elevator controls. These kinds of systems are used if event handlers need low latency and the event handlers are short and simple. This may also allow a subsystem to be automatically shut down and restarted on fault detection. sometimes in combination. A variety of techniques are used. or by a serial port controller receiving a byte. each of which manages a part of the hardware or software. automated sales and service. An interrupt could be generated for example by a timer in a predefined frequency. factory controls.  Interrupt Controlled System: Some embedded systems are predominantly interrupting controlled.3 Explanation of Embedded Systems: 2. funds transfer and market making. This encapsulation keeps faults from propagating from one subsystem to another.1 Software Architecture: There are several different types of software architecture in common use. The system will lose large amounts of money when shut down: Telephone switches. The loop calls subroutines. so that a compromised software component cannot interfere with other subsystems. and also soft errors in the hardware:  Watchdog timer that resets the computer unless the software periodically notifies the watchdog  Subsystems with redundant spares that can be switched over to  software "limp modes" that provide partial function  Designing with a Trusted Computing Base (TCB) architecture[6] ensures a highly secure & reliable system environment  An Embedded Hypervisor is able to provide secure encapsulation for any subsystem component.  Immunity Aware Programming 2. Because of these complexities. semaphores or a non-blocking synchronization scheme. except that adding new software is easier. at least for large systems. As any code can potentially damage the data of another task (except in larger systems using an MMU) programs must be carefully designed and tested. This is the level at which the system is generally considered to have an "operating system" kernel. these tasks are executed by the main loop. but this task is not very sensitive to unexpected delays. due to limitations regarding memory size. Sometimes the interrupt handler will add longer tasks to a queue structure. performance. by simply writing a new task. usually called “pause”.  Cooperative Multitasking: A non-preemptive multitasking system is very similar to the simple control loop scheme. “wait”. “nop” (stands for no operation). and each task gets its own environment to “run” in. smaller systems often cannot afford the overhead associated with a generic real time system. “yield”. or adding to the queue-interpreter. it introduces more or less of the complexities of managing multiple tasks running conceptually in parallel.The advantages and disadvantages are very similar to the control loop. allowing the application programmers to concentrate on device functionality rather than operating system services. after the interrupt handler has finished. The programmer defines a series of tasks. When a task is idle. it is common for organizations to buy a real-time operating system. Depending on how much functionality is required. Later. and access to shared data must be controlled by some synchronization strategy. This method brings the system close to a multitasking kernel with discrete processes.Usually these kinds of systems run a simple task in a main loop also.  Primitive Multitasking: In this type of system. such as message queues. etc. and/or battery life. except that the loop is hidden in an API.  Microkernels And Exokernels: . it calls an idle routine. a low-level piece of code switches between tasks or threads based on a timer (connected to an interrupt). Based on performance.  Hard Real-time embedded systems: These embedded systems follow an absolute dead line time period i. In general. process them and produces desired output. and fail when they are slow. User mode processes implement major functions such as file systems. functionality.. The hardware and all the software in the system are available to..A microkernel is a logical step up from a real-time OS.2 Stand Alone Embedded System: These systems takes the input in the form of electrical signals from transducers or commands from human beings such as pressing of a button etc. network interfaces..3. Exokernels communicate efficiently by normal subroutine calls. 2.  Soft Real Time embedded systems: . requirement the embedded systems are divided into three categories: 2.. If this valve is not opened in 30 ms this may cause damage to the entire equipment. air conditioner etc. etc. if the tasking is not done in a particular time period then there is a cause of damage to the entire equipment. processing it and giving output is done in standalone mode.3 Real-time embedded systems: Embedded systems which are used to perform a specific task or operation in a specific time period those systems are called as real-time embedded systems. Eg: consider a system in which we have to open a valve within 30 milliseconds. So in such cases we use embedded systems for doing automatic operations.e. There are two types of real-time embedded systems.. This entire process of taking input.3. and extensible by application programmers. Such embedded systems comes under stand alone embedded systems Eg: microwave oven. The usual arrangement is that the operating system kernel allocates memory and switches the CPU to different threads of execution. microkernels succeed when the task switching and intertask communication is fast. . Eg: Consider a TV remote control system . if the task is not done in a particular time that will not cause damage to the equipment. Eg:  Consider a web camera that is connected to the computer with internet can be used to spread communication like sending pictures.3. to another computer with internet connection throughout anywhere in the world. if the remote control takes a few milliseconds delay it will not cause damage either to the TV or to the remote control. and then you can open the door lock just by clicking the mouse.. it captures the image of a person and sends to the desktop of your computer which is connected to internet.5 Different types of processing units: .2 show the network communications in embedded systems. These systems which will not cause damage when they are not operated at considerable time period those systems comes under soft real-time embedded systems. Fig: 2.3. Fig 2. images. 2..  Consider a web camera that is connected at the door lock.4 Network communication embedded systems: A wide range network interfacing communication is provided by using embedded systems.. This gives an alerting message with image on to the desktop of your computer. videos etc.These embedded systems follow a relative dead line time period i. Whenever a person comes near the door.2: Network communication embedded systems 2.e. camera etc….3: Automatic coffee makes equipment 2.4. analog to digital converters etc...1 Consumer applications: At home we use a number of embedded systems which include microwave oven.4. serial communication. microcontroller.  Microprocessors are more powerful than microcontrollers. input output ports etc. The numbers of external components that are connected to it are very less according to the application.4 APPLICATIONS OF EMBEDDED SYSTEMS: 2. the components such as memory. Fig2. serial communication interfaces.u) can be any one of the following microprocessor. But the microprocessor requires many external components like memory. digital signal processing. so the power consumption is also very high when compared to microcontrollers. They are used in major applications with a number of tasking requirements. vcd players.The central processing unit (c. all these are built on a single chip. hard disk.. remote control.  Digital signal processing is used mainly for the applications that particularly involved with processing of signals 2.p.  Among these Microcontroller is of low cost processor and one of the main advantage of microcontrollers is..2 Office automation: . dvd players. 6: Robot In critical industries where human presence is avoided there we can use robots which are programmed to do a specific operation. humidity .. . printer etc… Fig2.4: Fax machine Fig2..5: Printing machine 2.We use systems like fax machine. In industries we design the embedded systems to perform a specific operation like monitoring temperature. current etc. we can send information to a centralized monitoring station. pressure. Fig2. modem.voltage. Industrial automation: Today a lot of industries are using embedded systems for process control.4. and basing on these monitored levels we do control other devices.3. 7: Computer networking CHAPTER 3: HARDWARE DESCRIPTION .5 Computer networking: Embedded systems are used as bridges routers etc.2. Fig2..4. 1: Block diagram of Automatic Vehicle (DC Motor) Control System based on eye blink sensor with buzzer alerts The main blocks of this project are: 1. Crystal oscillator 3.1 Introduction: In this chapter the block diagram of the project and design aspect of independent modules are considered. Block diagram is shown in fig: 3. Micro controller (16F877A) 2. Regulated power supply (RPS) .1: FIG 3.3. 4. LED Indicator 5. timers and other. ROM.2. or what would later be known as a microcontroller came about. Further increasing of the volume of the package resulted in creation of integrated circuits. RAM and . That is how the first chip containing a microcomputer. A microcontroller has a CPU in addition to a fixed amount of RAM. That was a prerequisite for production of microprocessors. input-output lines. I/O ports and a timer embedded all on a single chip.1 Introduction to Microcontrollers: Circumstances that we find ourselves in today in the field of microcontrollers had their beginnings in the development of technology of integrated circuits. The fixed amount of on-chip ROM. Microcontroller is a programmable device. DC motor with driver 7. Eye blink sensor 6. Microprocessors and microcontrollers are widely used in embedded systems products. Buzzer 3. and the first computers were made by adding external peripherals such as memory.2 Microcontrollers 3. These integrated circuits contained both processor and peripherals.2 Micro controller: Fig: 3. This development has made it possible to store hundreds of thousands of transistors into one chip. Currently they are some of the most popular microcontrollers.2 Description: Introduction to PIC Microcontrollers: PIC stands for Peripheral Interface Controller given by Microchip Technology to identify its single-chip microcontrollers. The microcontroller used in this project is PIC16F877A. When PIC microcontroller MCU was first available from General Instruments in early 1980's. selling over 120 million devices each year. These devices are known as low-end architectures.2.end PIC Architectures: Microchip PIC microcontrollers are available in various types.microchip. The PIC families of microcontrollers are developed by Microchip Technology Inc. 3. These devices have been very successful in 8-bit microcontrollers. pin description of the microcontroller used are discussed in the following sections. The development tools such as assembler and simulator are freely available on the internet at www. They have limited program memory and . the microcontroller consisted of a simple processor executing 12-bit wide instructions with basic I/O functions. The main reason is that Microchip Technology has continuously upgraded the device architecture and added needed peripherals to the microcontroller to suit customers' requirements.number of I/O ports in microcontrollers makes them ideal for many applications in which cost and space are critical. There are basically four families of PIC microcontrollers: PIC12CXXX 12/14-bit program word PIC 16C5X 12-bit program word PIC16CXXX and PIC16FXXX 14-bit program word PIC17CXXX and PIC18CXXX 16-bit program word The features.com Low . it causes PIC to reset. hence malfunction is avoided. Power-on-reset and brown-out reset. Brown-out-reset means when the power supply goes below a specified voltage (say 4V).  Low power crystal  Mid range crystal . 2. C = EPROM. F = Flash. Speed: Harvard Architecture. RISC architecture. PIC microcontroller has four optional clock sources. more number of registers and more data/program memory. RC = Mask ROM Popularity of the PIC microcontrollers is due to the following factors. 1. 1 instruction cycle = 4 clock cycles. 3.are meant for applications requiring simple interface functions and small program & data memories. 4. Some of the low-end device numbers are 12C5XX 16C5X 16C505 Mid range PIC Architectures: Mid range PIC architectures are built by upgrading low-end architectures with more number of peripherals. Some of the mid-range devices are 16C6X 16C7X 16F87X Program memory type is indicated by an alphabet. Instruction set simplicity: The instruction set consists of just 35 instructions (as opposed to 111 instructions for 8051). A watch dog timer (user programmable) resets the processor if the software/program ever malfunctions and deviates from its normal operation. and relative addressing modes  External clock interface .) current sourcing capability per pin.3. Up to 12 independent interrupt sources.  Power-on reset  Watchdog timer  Power saving SLEEP mode  Direct. 9. EPROM/OTP/ROM/Flash memory option. CPU Architecture: The CPU uses Harvard architecture with separate Program and Variable (data) memory interface. 7.Architecture of PIC microcontroller Basically. 6. This facilitates instruction fetch and the operation on data/accessing of variables simultaneously. Powerful output pin control (25 mA (max.3. all PIC microcontrollers offer the following features:  RISC instruction set with around 35 instructions _9 Digital I/O ports  On-chip timer with 8-bit prescaler.) 8.2. 5. High range crystal  RC oscillator (low cost). I/O port expansion capability. Architecture of PIC microcontroller Fig. indirect. Programmable timers and on-chip ADC. max resolution is 200 ns  PWM max.5ns  Compare is 16-bit. max resolution is 12.  Capture. resolution is 10-bit  8-bit 5 channel analog-to-digital converter  Synchronous serial port (SSP) with SPI (Master/Slave) and (Slave) Some devices offer the following additional features:  Analogue input channels  Analogue comparators  Additional timer circuits  EEPROM data memory  Flash EEPROM program memory  External and timer interrupts  In-circuit programming  Internal oscillator  User interface . Compare. PWM (CCP) module  Capture is 16-bit. RAM data memory  EPROM (or OTP) program memory Peripheral features:  High sink/source current 25mA  Timer0: 8-bit timer/counter with 8-bit prescaler can be incremented during sleep via external crystal/clock  Timer2:8-bit timer/counter with 8-bit period register prescaler and post scalar. All the pins of the ports are for interfacing input output devices.2.4.4 Pin Diagram: Fig. It has 5 ports port A.2. Port A: It consists of 6 pins from A0 to A5 Port B: It consists of 8 pins from B0 to B7 Port C: It consists of 8 pins from C0 to C7 Port D: It consists of 8 pins from D0 to D7 Port E: It consists of 3 pins from E0 to E2 . port D.3. port B.PIN DIAGRAM OF PIC16F877 Pic16f877 is a 40 pin microcontroller. port E.3. port C. 14 are used for crystal oscillator to connect to generate a frequency of about 20MHz. the old program will automatically be erased immediately. It cost less than 10 dollar. Pin 1 is MCLR (master clear pin) pin also referred as reset pin. 12 and31.C. A single microcontroller which is very brilliant and useful. The good thing is that single unit can be purchased at that 10 dollar price. Unlike some other Integrated Circuit that must be bought at a minimum order quantity such as 1000 units or 2000 units or else you won’t be able to purchase it. . 32 are used for voltage supply Vdd(+)and Vss(-) PIC 16F877A Specification: RAM 368 bytes EEPROM 256 bytes Flash Program Memory 8k words Operating Frequency DC to 20MHz I/O port Port A. I did not use PIC but I use other type of microcontroller. program and also the price is very cheap. Some said about 10 000 times. During my time of Degree study.D. Also this microcontroller is very easy to be assembled. If you are doing programming and downloading your code into the PIC 20 times a day that means you can do that for 500 days which is more than a year! The erasing time is almost unnoticeable because once new program are loaded into the PIC. One day I can only modify my code and test it for less than 10 times. One unit of PIC16F877A microcontroller can be programmed and erased so many times.B. 10x15 minutes = 150 minutes.The rest of the pins are mandatory pins these should not be used to connect input/output devices. Pin 11. Pin 13. I have to wait for about 15 to 30 minutes to erase the EEPROM before I can load a new program and test the microcontroller.E This is the specification for PIC16F877A from Microchip. port B. The size of program code that can be stored is about 8k words inside PIC16F877A ROM. The 20 MHz crystal oscillator should be connected with about 22pF capacitor.RAM: PIC16F877A already made with 368 bytes of Random Access Memory (RAM) inside it. Using this microcontroller you don’t need to buy any external RAM. By using the free version of the CCS C compiler only 2k words of program can be written and compiled. Data inside RAM is not retained when power supply is turn off. To write 8k words of C program you have to purchase the original CCS C compiler and it cost less than 700 dollar. There are 5 input/output ports on PIC microcontroller namely port A. Using EEPROM is very important because data stored inside EEPROM will be retained when power supply is turn off. Crystal oscillator: The crystal oscillator speed that can be connected to the PIC microcontroller range from DC to 20Mhz. port C. 1 word size is 14 bits. port D and port E. RAM did not store data permanently. EEPROM: 256 bytes of EEPROM are available also inside this microcontroller. Please refer to my circuit schematic. Any temporary variable storage that we wrote in our program will be stored inside the RAM. Serial Number and so on. Using the CCS C compiler normally 20Mhz oscillator will be used and the price is very cheap. Each port has different function. Most of them can be used as I/O port. . This is very useful to store information such as PIN Number. A power supply may include a power distribution system as well as primary or secondary sources of energy such as  Conversion of one form of electrical power to another desired form and voltage.3 REGULATED POWER SUPPLY: 3. such as computers and household electronics.  Solar power. The term is most commonly applied to electrical energy supplies.1 Introduction: Power supply is a supply of electrical power.  Generators or alternators. typically involving converting AC line voltage to a well-regulated lower-voltage DC for electronic devices.  Chemical fuel cells and other forms of energy storage systems. less often to mechanical ones. Low voltage. low power DC power supply units are commonly integrated with the devices they supply. .3. and rarely to others. A device or system that supplies electrical or other types of energy to an output load or group of loads is called a power supply unit or PSU.  Batteries.3. 3.3. .3.3.2 Regulated Power Supply The basic circuit diagram of a regulated power supply (DC O/P) with led connected as load is shown in fig: 3.2 Block Diagram: Fig 3.3. For transforming energy we use transformers.3. Transformers: A transformer is a device that transfers electrical energy from one circuit to another through inductively coupled conductors without changing .Fig 3.3 Circuit diagram of Regulated Power Supply with Led connection The components mainly used in above figure are  230V AC MAINS  TRANSFORMER  BRIDGE RECTIFIER(DIODES)  CAPACITOR  VOLTAGE REGULATOR(IC 7805)  RESISTOR  LED(LIGHT EMITTING DIODE) The detailed explanation of each and every component mentioned above is as follows: Transformation: The process of transforming energy from one device to another is called transformation. 4: Step-Down Transformer The voltage induced in the secondary is determined by the TURNS RATIO.4 shows step-down transformer. and thus a varying magnetic field through the secondary winding.its frequency. as the field moves out or in. Fig 3. This is called MUTUAL INDUCTION and forms the basis of the transformer. With the 50 Hz AC mains supply. the output coil is the SECONDARY WINDING. a voltage is induced in the second coil. this will happen 50 times a second. an electric current will flow in the secondary winding and electrical energy will be transferred from the primary circuit through the transformer to the load. The input coil is called the PRIMARY WINDING. the lines of force move outwards from the coil. If the current is increased. If the current is reduced. If another coil is placed adjacent to the first coil then. This effect is called mutual induction. .3. This varying magnetic field induces a varying electromotive force (EMF) or "voltage" in the secondary winding. As it does this. the lines of force move inwards. A varying current in the first or primary winding creates a varying magnetic flux in the transformer's core. the moving lines of force will "cut" the turns of the second coil. Fig: 3.3. If a load is connected to the secondary. This field is made up from lines of force and has the same shape as a bar magnet. Since the primary would induce power. Transformers to work at higher frequencies have an iron dust core or no core at all. then the turn’s ratio is 10:1. if the secondary has half the primary turns. the power provided by the primary must equal the power taken by a load on the secondary. Another example is if the primary has 5000 turns and the secondary has 500 turns. which has a constantly changing current and moving field. If a 24-watt lamp is connected across a 24 volt secondary. Transformers are sometimes used for IMPEDANCE MATCHING. Some transformers have an electrostatic screen between primary and secondary. To aid magnetic coupling between primary and secondary. or in the other direction. called EDDY CURRENTS. the core is LAMINATED. Step Up transformer: . If the primary voltage is 240 volts then the secondary voltage will be x 10 smaller = 24 volts. This is to prevent some types of interference being fed from the equipment down into the mains supply. the coils are wound on a metal CORE.For example. This means that it is made up from metal sheets insulated from each other. Note that the transformer only works on AC. into this core. Assuming a perfect transformer. DC has a steady current and therefore a steady field and there would be no induction. then the primary must supply 24 watts. We can use the transformers as step up or step down. the secondary will have half the primary voltage. Battery power supply: A battery is a type of linear power supply that offers benefits that traditional line-operated power supplies lack: mobility. A battery consists of multiple electrochemical cells connected to provide the voltage desired. During the discharge of a carbon-zinc . 6. a layer of electrolyte paste. 3.5: Hi-Watt 9V Battery The most commonly used dry-cell battery is the carbon-zinc dry cell battery. The most common dry-cell batteries have one of the following voltages: 1. 22.3. and secondary winding is having less number of turns because of that it accepts less number of flux. and releases less amount of voltage.5 shows Hi-Watt 9V battery Fig 3.5. and a zinc plate alternately until the desired total voltage is achieved. portability and reliability.In case of step up transformer. Fig: 3. Primary winding induces more flux than the secondary winding. Dry-cell batteries are made by stacking a carbon plate.5. Because of having more turns secondary winding accepts more energy. 9. Step down transformer: Incase of step down transformer. 45.3. primary windings are every less compared to secondary winding. and 90. and it releases more voltage at the output side. They can be stored both charged and uncharged. This battery is rechargeable.6 shows pencil battery of 1. The nickel-cadmium batteries have many benefits.06-2. making the voltage constant over the span of the batteries long service life. When fully charged.3.5V. This battery cell is completely sealed and rechargeable. These actions establish a voltage of approximately 1. the lead is converted to lead sulfate and the sulfuric acid is converted to water. Fig 3. The lead-acid storage battery may be used. and magnesium dioxide is reduced at the carbon electrode. When the battery is charging. They have a long service life.5V RECTIFICATION: The process of converting an alternating current to a pulsating direct current is called as rectification. it consists of lead and lead/dioxide electrodes which are immersed in sulfuric acid. and the ability to be recharged. . this type of battery has a 2. Fig: 3. The electrolyte is not involved in the electrode reaction.battery. constant voltage. high current availabilities. nickel oxide is oxidized to its higher oxidation state and cadmium oxide is reduced. During the charging process. the zinc metal is converted to a zinc salt in the electrolyte. the lead sulfate is converted back to lead and lead dioxide A nickel-cadmium battery has become more popular in recent years. For rectification purpose we use rectifiers.6: Pencil Battery of 1. During discharge.5 V.14 V potential (A 12 volt car battery uses 6 cells in series).3. Rectifiers: A rectifier is an electrical device that converts alternating current (AC) to direct current (DC), a process known as rectification. Rectifiers have many uses including as components of power supplies and as detectors of radio signals. Rectifiers may be made of solid-state diodes, vacuum tube diodes, mercury arc valves, and other components. A device that it can perform the opposite function (converting DC to AC) is known as an inverter. When only one diode is used to rectify AC (by blocking the negative or positive portion of the waveform), the difference between the term diode and the term rectifier is merely one of usage, i.e., the term rectifier describes a diode that is being used to convert AC to DC. Almost all rectifiers comprise a number of diodes in a specific arrangement for more efficiently converting AC to DC than is possible with only one diode. Before the development of silicon semiconductor rectifiers, vacuum tube diodes and copper (I) oxide or selenium rectifier stacks were used. Bridge full wave rectifier: The Bridge rectifier circuit is shown in fig:3.8, which converts an ac voltage to dc voltage using both half cycles of the input ac voltage. The Bridge rectifier circuit is shown in the figure. The circuit has four diodes connected to form a bridge. The ac input voltage is applied to the diagonally opposite ends of the bridge. The load resistance is connected between the other two ends of the bridge. For the positive half cycle of the input ac voltage, diodes D1 and D3 conduct, whereas diodes D2 and D4 remain in the OFF state. The conducting diodes will be in series with the load resistance R L and hence the load current flows through RL. For the negative half cycle of the input ac voltage, diodes D2 and D4 conduct whereas, D1 and D3 remain OFF. The conducting diodes D2 and D4 will be in series with the load resistance R L and hence the current flows through R L in the same direction as in the previous half cycle. Thus a bi-directional wave is converted into a unidirectional wave. Input output Fig 3.3.7: Bridge rectifier: a full-wave rectifier using 4 diodes DB107: Now -a -days Bridge rectifier is available in IC with a number of DB107. In our project we are using an IC in place of bridge rectifier. The picture of DB 107 is shown in fig: 3.3.8. Features:  Good for automation insertion  Surge overload rating - 30 amperes peak  Ideal for printed circuit board  Reliable low cost construction utilizing molded  Glass passivated device  Polarity symbols molded on body  Mounting position: Any  Weight: 1.0 gram Filtration: The process of converting a pulsating direct current to a pure direct current using filters is called as filtration. Filters: Electronic filters are electronic circuits, which perform signalprocessing functions, specifically to remove unwanted frequency components from the signal, to enhance wanted ones. Introduction to Capacitors: The Capacitor or sometimes referred to as a Condenser is a passive device, and one which stores energy in the form of an electrostatic field which produces a potential (static voltage) across its plates. In its basic form a capacitor consists of two parallel conductive plates that are not connected but are electrically separated either by air or by an insulating material called 10 respectively. When a voltage is applied to these plates.9:Construction Of a Capacitor 3.000 = 0.10:Electrolytic Capaticor Units of Capacitance: Microfarad (μF) 1μF = 1/1.3. At this point the capacitor is said to be fully charged and this is illustrated below.000. The construction of capacitor and an electrolytic capacitor are shown in figures 3.000.000000000001 = 10-12 F Fig .3.3.9 and 3.000.000.000 = 0. a current flows charging up the plates with electrons giving one plate a positive charge and the other plate an equal and opposite negative charge this flow of electrons to the plates is known as the Charging Current and continues to flow until the voltage across the plates (and hence the capacitor) is equal to the applied voltage Vcc.the Dielectric.000001 = 10-6 F Nanofarad (nF) 1nF = 1/1.3.000000001 = 10-9 F Pico farad (pF) 1pF = 1/1.000.000 = 0. Fig 3.000. 3. Reverse polarity destroys the regulator almost instantly. These can withstand over-current draw due to short circuits and also over-heating. The LM78XX series of voltage regulators are designed for positive input. Voltage Regulator: A voltage regulator (also called a ‘regulator’) with only three terminals appears to be a simple device. 6V. In both cases. Using a pair of ‘voltage-divider’ resistors can increase the output voltage of a regulator circuit.Regulation: The process of converting a varying voltage to a constant regulated voltage is called as regulation. It is not possible to obtain a voltage lower than the stated rating. For the process of regulation we use voltage regulators. the regulator will cut off before any damage occurs. For applications requiring negative input. Fig: 3. but it is in fact a very complex integrated circuit. . The only way to destroy a regulator is to apply reverse voltage to its input. It converts a varying input voltage into a constant ‘regulated’ output voltage. 12V and 15V. Voltage Regulators are available in a variety of outputs like 5V. You cannot use a 12V regulator to make a 5V power supply. Voltage regulators are very robust. the LM79XX series is used. 9V.11 shows voltage regulator. Practical resistors can be made of various compounds and films. and inductance. the value below which power dissipation limits the maximum permitted current flow. such as nickel/chrome). Less well-known is critical resistance. The primary characteristics of a resistor are the resistance. Critical resistance is determined by the design. and above which the limit is applied voltage. Theory of operation: Ohm's law: The behavior of an ideal resistor is dictated by the relationship specified in Ohm's law: . to dissipate power and it can shape electrical waves when used in combination of other components.3. materials and dimensions of the resistor.11: Voltage Regulator Resistors: A resistor is a two-terminal electronic component that produces a voltage across its terminals that is proportional to the electric current passing through it in accordance with Ohm's law: V = IR Resistors are elements of electrical networks and electronic circuits and are ubiquitous in most electronic equipment.Fig 3. maximum working voltage and the power rating. noise. Basic unit is ohms. as well as resistance wire (wire made of a highresistivity alloy. Other characteristics include temperature coefficient. the tolerance. Resistors can be made to control the flow of current. to work as Voltage dividers. Power dissipation: The power dissipated by a resistor (or the equivalent resistance of a resistor network) is calculated using the following: Fig 3.V = IR Ohm's law states that the voltage (V) across a resistor is proportional to the current (I) through it where the constant of proportionality is the resistance (R). early LED’s emitted low-intensity red light. Introduced as a practical electronic component in 1962.4. but modern versions are available across the visible.3.4. LED: A light-emitting diode (LED) is a semiconductor light source. .3. The internal structure and parts of a led are shown in figures 3. ultraviolet and infrared wavelengths.1 and 3. and are increasingly used for lighting. with very high brightness.4. LED’s are used as indicator lamps in many devices.2 respectively.13: Color Bands In Resistor 3.12: Resistor Fig 3. The LED is based on the semiconductor diode. When a diode is forward biased (switched on). and integrated optical components are used to shape its radiation pattern and assist in reflection. Current LED products for general lighting are more expensive to buy than fluorescent lamp sources of comparable output. They also enjoy use in . releasing energy in the form of photons. improved robustness. faster switching. An LED is usually small in area (less than 1 mm2).4. Amazingly. electrons are able to recombine with holes within the device. However. longer lifetime. This effect is called electroluminescence and the color of the light (corresponding to the energy of the photon) is determined by the energy gap of the semiconductor. the LED has a simple and strong structure. they are relatively expensive and require more precise current and heat management than traditional light sources.4. LED’s present many advantages over incandescent light sources including lower energy consumption.Fig 3.2: Parts of a LED Working: The structure of the LED light is completely different than that of the light bulb. The lightemitting semiconductor material is what determines the LED's color. and greater durability and reliability.1: Inside a LED Fig 3. smaller size. 3: Electrical Symbol & Polarities of LED LED lights have a variety of advantages over other light sources:  High-levels of brightness and intensity  High-efficiency  Low-voltage and current requirements  Low radiated heat  High reliability (resistant to shock and vibration)  No UV Rays  Long source life  Can be easily controlled and programmed Applications of LED fall into three major categories: .4. while their high switching rates are useful in advanced communications technology. Fig 3.3.applications as diverse as replacements for traditional light sources in automotive lighting (particularly indicators) and in traffic signals. The compact size of LED’s has allowed new text and video displays and sensors to be developed. The electrical symbol and polarities of led are shown in fig: 3.4.  Illumination where LED light is reflected from object to give visual response of these objects. This output is give to logic circuit to indicate the alarm. Vin:12V • Vout: 0 to 5V • Iout:75mA • Sensor: IR • Sensitivity adjustment: Potentiometer • Position of iris detected by IR • Blinking of eye is exactly using comparators. Visual signal application where the light goes more or less directly from the LED to the human eye.5 EyeBlink Sensor This Eye Blink sensor is IR based . Location of iris is detected by one IR sensor and output is given to one comparator. If the eye is closed means the output is high otherwise output is low. Senses eye blink using IR sensor.  Generate light for measuring and interacting with processes that do not involve the human visual system. 3. Comparator • Potentiometer • IR sensor . This can be used for project involves controlling accident due to unconscious through Eye blink. comparator and potentiometer. to convey a message or meaning. The Variation Across the eye will vary as per eye blink . . This to know the eye is closing or opening position. So the comparator non inverting input terminal voltage is higher then inverting input. Now the comparator output is GND so the . When interrupt the IR rays between the IR transmitter and receiver. Now the comparator output is in the range of +5V. The comparator is constructed with LM 358 operational amplifier. This voltage is given to microcontroller or PC and led so led will glow. When IR transmitter passes the rays to receiver.Infrared transmitter is one type of LED which emits infrared rays generally called as IR Transmitter. Similarly IR Receiver is used to receive the IR rays transmitted by the IR transmitter. The non inverting input terminal is connected IR receiver. In the comparator circuit the reference voltage is given to inverting input terminal. One important point is both IR transmitter and receiver should be placed straight line to each other. The IR receiver is connected with comparator. the IR receiver is not conducting. The transmitted signal is given to IR transmitter whenever the signal is high. the IR receiver is conducting due to that non inverting input voltage is lower than inverting input. the IR transmitter LED is conducting it passes the IR rays to the receiver. To test sensor . intruder detector etc. This circuit is mainly used to for counting application. These wires are also marked on PCB. The exact functionality depends greatly on the positioning and aiming of the emitter and detector with respect to the eye.output is given to microcontroller or PC. FEATUTRES EYE Instant BLINK output digital indication signal for directly by Connecting LED to microcontroller Compact Size Working Voltage +5V DC APPLICATION Digital Eye Blink monitor for Vehicle Accident prevention & .Suitable for real time driving applications. Black wire is Ground. Next middle wire is Brown which is output and Red wire is positive supply. The eye-blink sensor works by illuminating the eye and eyelid area with infrared light. SPECIFICATION Operating Voltage :+5V Operating Output Eye using DC regulated Current Data Blink Indicated :100mA Level by LED : TTL and Output Level High Pulse sensor Connect regulated DC power supply of 5 Volts. then monitoring the changes in the reflected light using a phototransistor and differentiator circuit. When Eye closed. and you can view the LED blinking on each Eye blink. nother nice approach works by illuminating the eye and/or eyelid area with infrared light. EYE BLINK 5V (High) 0V (Low) → → OUTPUT LED ON When Eye is close. .Put Eye blink sensor glass on the face within 15mm distance. then monitoring the changes in the reflected light using a phototransistor. LED is off & the output is at 0V. LED OFF when Eye is open. The exact functionality depends greatly on the positioning and aiming of the emitter and detector with respect to the eye.The output is active high for Eye close and can be given directly to microcontroller for interfacing applications.you only need power the sensor by connect two wires +5V and GND. You can leave the output wire as it is. in front of it. and vice versa. From the picture you can see the armature is made of coils of wire wrapped around the core. The reverse process.19: DC Motor The DC motor has two basic parts: the rotating part that is called the armature and the stationary part that includes coils of wire called the field coils. The stationary part is also called the stator. Fig 3.6 D.C. and this is where the brushes make electrical contact to bring electrical current from the stationary part to the rotating part of the machine. . producing electrical energy from mechanical energy. Figure shows a picture of a typical DC motor. Figure shows a picture of a DC armature. The termination points are called the commutator. generator or dynamo. Motor: A dc motor uses electrical energy to produce mechanical energy. Many types of electric motors can be run as generators. The input of a DC motor is current/voltage and its output is torque (speed). very typically through the interaction of magnetic fields and currentcarrying conductors. and the core has an extended shaft that rotates on bearings. is accomplished by an alternator. You should also notice that the ends of each coil of wire on the armature are terminated at one end of the armature.3. and Fig shows a picture of a typical stator. Notice that the DC voltage is applied directly to the field winding and the brushes. a field resistor will be added in series with the field to control the motor speed. Figure 12-9 shows an electrical diagram of a simple DC motor. When voltage is applied to the motor. Current also begins to flow through the brushes into a commutator segment and then through an armature coil. In later diagrams. The current flowing in the armature coil sets up a strong magnetic field in the armature. This sets up a strong magnetic field in the field winding. The current continues to flow through the coil back to the brush that is attached to other end of the coil and returns to the DC power source. current begins to flow through the field coil from the negative terminal to the positive terminal. Fig 3.20: Simple electrical diagram of DC motor . The armature and the field are both shown as a coil of wire.Operation: The DC motor you will find in modem industrial applications operates very similarly to the simple DC motor described earlier in this chapter. the commutator segments continually change polarity from positive to negative. The switching action is timed so that the armature will not lock up magnetically with the field.21: Operation of a DC Motor The magnetic field in the armature and field coil causes the armature to begin to rotate. 3. If voltage is applied to the motor again. it will become positive. DC Shunt Motor. Types of DC motors: 1. DC Long Shunt Motor (Compound) . As the armature begins to rotate. the commutator segments will also begin to move under the brushes. In this way. DC Series Motor. The commutator segments and brushes are aligned in such a way that the switch in polarity of the armature coincides with the location of the armature's magnetic field and the field winding's magnetic field. When the voltage is de-energized to the motor. Instead the magnetic fields tend to build on each other and provide additional torque to keep the motor shaft rotating. 2. the magnetic fields in the armature and the field winding will quickly diminish and the armature shaft's speed will begin to drop to zero.Fig 3. As an individual commutator segment moves under the brush connected to positive voltage. Since the commutator segments are connected to the ends of the wires that make up the field winding in the armature. This occurs by the unlike magnetic poles attracting each other and the like magnetic poles repelling each other. it causes the magnetic field in the armature to change polarity continually from north pole to south pole. the magnetic fields will strengthen and the armature will begin to rotate again. and when it moves under a brush connected to negative voltage it will become negative. they produce a strong magnetic field around them. When the armature revolves between the poles. constantly repels the poles. connected to a commutator at the end of the shaft that are in constant touch with carbon brushes. and therefore the back emf reduces. the stronger the magnetic field. The Magnetic Poles are electromagnets. The general idea of a DC Motor is. and the armature which is given power with a commutator. This results in more armature field. The brushes are static. the speed naturally reduces.4. Generally an armature has resistance of less than 1 Ohm. and therefore it results in torque. 1. and therefore rotates. This back emf helps us there. The DC motor has magnetic poles and an armature. which is called back emf. which allows more armatures current to flow. DC Short Shunt Motor (Compound) The rotational energy that you get from any motor is usually the battle between two magnetic fields chasing each other. the magnetic field of the poles induce power in the armature conductors. . the armature will have two separate sets of windings. and when they are energized. and it acts as a resistance for the armature. When an armature is loaded on a DC Shunt Motor. and some electricity is generated in the armature. the stronger the Field Current. to which DC electricity is fed. and the commutator rotate and as the portions of the commutator touching the respective positive or negative polarity brush will energize the respective part of the armature with the respective polarity. The DC Shunt Motor: In a 2 pole DC Motor. It is usually arranged in such a way that the armature and the poles are always repelling. and faster the rotation of the armature. and powering it with heavy voltages of Direct Current could result in immediate short circuits. or it will stop. The DC Series Motor: Fig: Diagram of DC series motor A DC Series Motor has its field coil in series with the armature. .Fig: Diagram of DC shunt motor When a DC Shunt Motor is overloaded. the reduction of the back emf could cause the motor to burn due to heavy current flow thru the armature. The poles and armature are excited separately. if the armature becomes too slow. and parallel. therefore it is called a Shunt Motor. It will either run uncontrollably in full speed. As a result you cannot start a Series DC Motor without any load attached to it. 2. Therefore any amount of power drawn by the armature will be passed thru the field. So these are on Electric Trains and elevators.Fig: Diagram of DC series motor graph representation When the load is increased then its efficiency increases with respect to the load applied. Specifications  DC supply: 4 to 12V  RPM: 300 at 12V  Total length: 46mm  Motor diameter: 36mm  Motor length: 25mm  Brush type: Precious metal  Gear head diameter: 37mm . Better torque as in a series motor. Gearbox is sealed and lubricated with lithium grease and require no maintenance. This gives the best of both series and shunt motors. The gears are fixed on hardened steel spindles polished to a mirror finish. while the possibility to start the motor with no load. Gear head length: 21mm  Output shaft: Centred  Shaft diameter: 6mm  Shaft length: 22mm  Gear assembly: Spur  Motor weight: 105gms We generally use 300RPM Centre Shaft Economy Series DC Motor which is high quality low cost DC geared motor. It has steel gears and pinions to ensure longer life and better wear and tear properties. and torque. The whole assembly is covered with a plastic ring. stall current as a function of voltage. Although motor gives 300 RPM at 12V but motor runs smoothly from 4V to 12V and gives wide range of RPM. Tables below gives fairly good idea of the motor’s performance in terms of RPM and no load current as a function of voltage and stall torque. DC Compound Motor: A compound of Series and Shunt excitation for the fields is done in a Compound DC Motor. The output shaft rotates in a plastic bushing. . 3. The motor is screwed to the gear box from inside. The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4. Both devices are designed to drive inductive loads such as relays. dc and bipolar stepping motors.5 V to 36 V. with drivers 1 .5 V to 36 V.Fig: Diagram of DC compound motor Above is the diagram of a long shunt motor. All inputs are TTL compatible. the shunt coil will be connected after the serial coil. The L293 is designed to provide bidirectional drive currents of up to 1 A at voltages from 4. as well as other high-current/high-voltage loads in positive-supply applications. solenoids. DC Motor Driver: The L293 and L293D are quadruple high-current half-H drivers. A Compound motor can be run as a shunt motor without connecting the serial coil at all but not vice versa. Drivers are enabled in pairs. while in a short shunt. with a Darlington transistor sink and a pseudo-Darlington source. Each output is a complete totem-pole drive circuit. When the enable input is low. is provided for the logic inputs to minimize device power dissipation.22: L293D IC Pin Diagram of L293D motor driver: Fig 3. the associated drivers are enabled and their outputs are active and in phase with their inputs. each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications. external high-speed output clamp diodes should be used for inductive transient suppression.4EN. The L293and L293D are characterized for operation from 0°C to 70°C.2EN and drivers 3 and 4 enabled by 3. separate from VCC2. those drivers are disabled and their outputs are off and in the high-impedance state.and 2 enabled by 1. With the proper data inputs.When an enable input is high.23: L293D pin diagram . Fig 3. On the L293. A VCC1 terminal. 2A Peak output current (non repetitive) per channel Enable facility Over temperature protection Logical “0”input voltage up to 1.24: Internal structure of L293D.Fig 3. Features of L293D:        600mA Output current capability per channel 1.5 v High noise immunity Internal clamp diodes Applications of DC Motors: . etc. Electrical Machines Lab in Colleges. They are used in elevators. voltage between electrodes of a piezoelectric diaphragm causes mechanical distortion due to the piezoelectric effect. the piezoelectric diaphragm bends in the direction Thus. when AC voltage is applied across electrodes. Compound DC Motors are used for this application. the distortion of the piezoelectric element expands in a radial direction.7 Buzzer Basically. and Hard Drives: All these things need motors. Note that if a different power supply is used for the buzzer. For a misshaped piezoelectric element. the sound source of a piezoelectric sound component is a piezoelectric diaphragm. A piezoelectric ceramic plate is attached to a metal plate with adhesives. very miniature motors. Elevators: The best bidirectional motors are DC motors. 4. producing sound waves in the air. . AC motors can never imagine any application in these places. So the more the people get on a train. the 0V rails of each power supply must be connected to provide a common reference. To interface a buzzer the standard transistor interfacing circuit is used. PC Fans. Conversely. Electric Train: A kind of DC motor called the DC Series Motor is used in Electric Trains. Applying D. the bending is repeated. so a DC motor is best suited here. The metal plate bonded to the piezoelectric element does not expand. A piezoelectric diaphragm consists of a piezoelectric ceramic plate which has electrodes on both sides and a metal plate (brass or stainless steel. And the piezoelectric diaphragm bends toward the direction. The DC Series Motors have the property to deliver more power when they are loaded more. CD ROM Drives. Also. you cannot start an engine with a small sized AC motor. Starter Motors in Automobiles: An automobile battery supplies DC.C.1. 5.). 3. 2. with great precision. the more powerful the train becomes. 3. when the piezoelectric element shrinks. as this may cause abnormal oscillation. 8) Carefully install the piezo buzzer so that no obstacle is placed within 15mm from the sound release hole on the front side of the casing. Buzzers also just have one ‘tone’. 7) Do not close the sound emitting hole on the front side of casing. To switch on buzzer -high 1 To switch off buzzer -low 1 Notice (Handling) In Using Self Drive Method 1) When the piezoelectric buzzer is set to produce intermittent sounds. 6) Do not place resistors in series with the power source. sound may be heard continuously even when the self drive circuit is turned ON / OFF at the "X" point shown in Fig. whereas a piezo sounder is able to create sounds of many different tones. Hfe of the transistor and circuit constants are designed to ensure stable oscillation of the piezoelectric sounder.0 to 20Vdc) must be maintained. So there is no need to prepare another circuit to drive the piezoelectric buzzer. 9. 3) Design switching which ensures direct power switching. If a resistor is essential to adjust sound pressure. This is because of the failure of turning off the feedback voltage. 5) Rated voltage (3. Products which can operate with voltage higher than 20Vdc are also available. place a capacitor (about 1μF) in parallel with the piezo buzzer.If a battery is used as the power supply. 4) The self drive circuit is already contained in the piezoelectric buzzer. 2) Build a circuit of the piezoelectric sounder exactly as per the recommended circuit shown in the catalog. it is worth remembering that piezo sounders draw much less current than buzzers. . Fig: Picture of buzzer . Here is the procedure to design in Express PCB and clean up the patterns so they print nicely. few cables.1 Express PCB: Breadboards are great for prototyping equipment as it allows great flexibility to modify a design when needed. It is very easy to use. and survive a shake test. It can be likened to more of a toy then a professional CAD program. It has a poor part library (which we can work around) It cannot import or export files in different formats It cannot be used to make prepare boards for DIY production Express PCB has been used to design many PCBs (some layered and with surface-mount parts. However. Express PCB is a software tool to design PCBs specifically for manufacture by the company Express PCB (no other PCB maker accepts Express PCB files). however the final product of a project. but it does have several limitations.for compilation part  Proteus 7 (Embedded C) – for simulation part 4. .CHAPTER 4: SOFTWARE DESCRIPTION This project is implemented using following software’s:  Express PCB – for designing circuit  PIC C compiler . ideally should have a neat PCB. Express PCB does not have a nice print layout. Print out PCB patterns and use the toner transfer method with an Etch Resistant Pen to make boards. Not only is a proper PCB neater but it is also more durable as there are no cables which can yank loose. 1 Preparing Express PCB for First Use: Express PCB comes with a less then exciting list of parts. When this tool is selected the top toolbar will show . It allows you to move and manipulate parts. At this point start the program and get ready to setup the workspace to suit your style.4. setup the units for “mm” or “in” depending on how you think.1: Tool bar necessary for the interface  The select tool: It is fairly obvious what this does. and extract them into your Express PCB directory. In this menu. 4.1 show the toolbar in which the each button has the following functions: Fig 4. However. Fig: 4. Click View -> Options. crop the PCB to the correct size before starting. So before any project is started head over to Audio logic and grab the additional parts by morsel. and tangent. Typically after positioning of parts and traces. This yellow outline is the dimension of the PCB. in designing a board with a certain size constraint.1. move them to their final position and then crop the PCB to the correct size. The standard color scheme of red and green is generally used but it is not as pleasing as red and blue. ppl.1.2 The Interface: When a project is first started you will be greeted with a yellow outline. and click “see through the top copper layer” at the bottom. 3 Design Considerations: Before starting a project there are several ways to design a PCB and one must be chosen to suit the project’s needs.  The remove a trace button is not very important since the delete key will achieve the same result. and rotate buttons. clicking on a trace will insert a corner which can be moved to route around components and other traces. square holes and surface mount pads.  The place pad: button allows you to place small soldier pads which are useful for board connections or if a part is not in the part library but the part dimensions are available.  The place trace: tool allows you to place a solid trace on the board of varying thicknesses. The top toolbar allows you to select the top or bottom layer to place the trace on.  The Insert Corner in trace: button does exactly what it says.1.  The place component: tool allows you to select a component from the top toolbar and then by clicking in the workspace places that component in the orientation chosen using the buttons next to the component list. 4. Single sided. When this tool is selected.  The zoom to selection tool: does just that. or double sided? .buttons to move traces to the top / bottom copper layer. The components can always be rotated afterwards with the select tool if the orientation is wrong. When this tool is selected the top toolbar will give you a large selection of round holes. If a lot of parts are being used in a small space it may be difficult to make a single sided board without jumper over traces with a cable. audio signals). and similar parts which don’t have axial leads can NOT have traces on top unless boards are plated professionally. care must be taken with stubborn chips such as the TPA6120 amplifier from TI. jumping only to the bottom if a part cannot be soldiered onto the top plane (like a relay). it should be avoided if the signal travelling over the traces is sensitive (e.g.versa. Single sided boards are cheaper to produce and easier to etch. more difficult to etch on a DIY board. A double sided board is more expensive to produce professionally. 4. While there’s technically nothing wrong with this. Some projects like power supplies or amps can benefit from having a solid plane to use for ground. and keeps the ground signal as simple as possible.2 PIC Compiler: . The TPA6120 datasheet specifies not to run a ground plane under the pins or signal traces of this chip as the capacitance generated could effect performance negatively. In power supplies this can reduce noise. but makes the layout of components a lot smaller and easier. Ground-plane or other special purposes for one side When using a double sided board you must consider which traces should be on what side of the board. It should be noted that if a trace is running on the top layer. relays.When making a PCB you have the option of making a single sided board. or a double sided board. and vice. Large capacitors. However. Generally. and in amps it minimizes the distance between parts and their ground connections. put power traces on the top of the board. check with the components to make sure you can get to its pins with a soldering iron. but much harder to design for large projects. PCM. function recursion is not allowed. PIC compiler also supports C language code. After compilation. all three compilers are covered in this reference manual. In PIC. This can be done with the help of simple while (1) or for (. and bit twiddling operations. It’s important that you know C language for microcontroller which is commonly known as Embedded C.PIC compiler is software used where the machine language code is written and compiled. All normal C data types are supported along with pointers to constant arrays. we will have a main function. The compilers can efficiently implement normal C constructs. These compilers are specifically designed to meet the unique needs of the PIC microcontroller. PCM. you do not have any operating system running in there. We have to add header file for controller you are using. As we are going to use PIC Compiler. This is due to the fact that the PIC has no stack to push variables onto. The PCB. So you have to make sure that your program or main file should never exit. Features and limitations that apply to only specific microcontrollers are indicated within. When compared to a more traditional C compiler. hence we also call it PIC C.h> // header file for PIC 16F72// . and PCH is for 16-bit opcode PIC microcontrollers. high-level language. Due to many similarities. This allows developers to quickly design applications software in a more readable. and arrays of bits.. input/output operations. As an example of the limitations. and PCH have some limitations. #include <16F72. fixed point decimal. and also because of the way the compilers optimize the code. PCM is for 14-bitopcodes. writing a C program is not a crisis. In case of embedded C. in which all your application specific work will be defined. If you know assembly. the machine source code is converted into hex code which is to be dumped into the microcontroller for further processing.) loop as they are going to run infinitely. PCB. and PCH are separate compilers. PIC C is not much different from a normal C program. otherwise you will not be able to access registers related to peripherals. PCB is for 12-bit opcodes. schematic diagram and interfacing of PIC16F877A microcontroller with each module is considered.CHAPTER 5: PROJECT DESCRIPTION In this chapter. . Crystal oscillator connected to 13th and 14th pins of micro controller and regulated power supply is also connected to micro controller and LED’s also connected to micro controller through resistors.1: schematic diagram of Eye blink detection and automatic control system with buzzer alerts The above schematic diagram of Eye blink detection and automatic control system with buzzer alerts explains the interfacing section of each component with micro controller and sensor. The detailed explanation of each module interfacing with microcontroller is as follows: .Fig 5. 2: crystal oscillator and reset input interfacing with micro controller .5.2: explains crystal oscillator and reset button which are connected to micro controller. master clear pin or reset input pin is connected to reset button or power-on-reset. The 1st pin of the microcontroller is referred as MCLR ie.2 Interfacing crystal oscillator and reset button with micro controller: Fig 5. Fig 5... the purpose of external crystal oscillator is to speed up the execution part of instructions per cycle and here the crystal oscillator having 20 MHz frequency. The two pins of oscillator are connected to the 13th and 14th pins of micro controller. h> //Microcontroller Used #include <dc_motor. while(1) { eye_blink_sensed = is_eye_blink_sensed(). output_low(PIN_D2). output_high(PIN_D2). delay_ms(500). delay_ms(500). //LED delay_ms(500). output_low(PIN_D3). output_high(PIN_D3).CHAPTER 6: SOURCE CODE Program Code: The program code which is dumped in the microcontroller of our project is shown below. #include <16F877A. output_low(PIN_D2). //Buzzer output_high(PIN_D2). if(blink_sensed == 1) { .h> #include <eyeblink.h> #use delay(clock=20M) // operating Clock frequency void main() { int blink_sensed. //reduce PWM speed by 80% M2_Speed(80). M1_Speed(0). //reduce PWM speed by 50% M2_Speed(50).output_high(PIN_D3). M1_Speed(50). } } } CHAPTER 7: ADVANTAGES AND DISADVANTAGES . //reduce PWM speed by 30% M2_Speed(30). //flasher M1_Speed(80). //reduce PWM speed by 10% delay_ms(2000). //reduce PWM speed by 0% (stop) while(1). M1_Speed(30). //reduce PWM speed by 80% delay_ms(2000). //reduce PWM speed by 30% delay_ms(2000). M1_Speed(10). } while(1). //Buzzer output_high(PIN_D2). //reduce PWM speed by 0% (stop) M2_Speed(0). //reduce PWM speed by 50% delay_ms(2000). //reduce PWM speed by 10% M2_Speed(10). Fast response 4. Simple drive circuit 7. 9. Efficient and low cost design. Stable performance and long life 6. Low power consumption. 2. Usage of eye blink sensor for drowsiness detection 2. This system supports only inside the vehicle. Easily operable. Disadvantages: 1.Advantages: 1. Automatic speed control of vehicle to avoid accidents 3. Interfacing of eye blink sensor with microcontroller is highly sensitive Applications: This system can be implemented in vehicles in real time to avoid accidents CHAPTER 8: RESULTS . Wide detection range 5. 8. This project makes use of a micro controller.8. Thus the project has been successfully designed and tested. 8.1 Result: The project “ Eye blinks Detection and Automatic Vehicle (DC Motor) Control System with buzzer alerts” was designed such that to avoid accidents for drunken people and drowsy people and alerts the through buzzer alarm. The Eye blink sensor provides the information to the Microcontroller (on board computer). with the help of embedded C instructions. As this project uses the Eye blink sensor. The controller is interfaced with Buzzer. so that the vehicle driver and owner gets alerts as the vehicle speed is reduced and alerts through buzzer alarm system. The system uses eye blink sensor and reduces the vehicle speed and alerts through buzzer alarm system. Presence of every module has been reasoned out and placed carefully. The main aim of this project is to alert the vehicle driver to avoid accidents when the driver was detected drowsy or by using Eye blink sensor. . Secondly. This Microcontroller is capable of communicating with input and output modules. alcohol sensor technology. using highly advanced IC’s with the help of growing technology.3 Future Scope: Our project “Eye blink Detection and Automatic Vehicle (DC Motor) Control System with buzzer alerts” is mainly intended to control the vehicle (DC motor) using when on drowsiness of driver was detected. thus contributing to the best working of the unit. the project has been successfully implemented. which is programmed. and DC Motor. 8. This project is designed around a microcontroller which forms the control unit of the project.2 Conclusion: Integrating features of all the hardware components used have been developed in it. Raj kamal –Microcontrollers Architecture. 2.J.microchip. The project can be extended by using GSM modem which can send the SMS alerts o the concerned people when the driver was detected alcoholic and sleepy while driving the vehicle.com 3.L. 4. Interfacing and System Design.howstuffworks. ..wikipedia.com 4. www. Mazidi and Mazidi –Embedded Systems.Jones. Programming. www.Pont.allaboutcircuits.The main drawback of this system is that the vehicle speed can be controlled but not intimated to the people related to the person about the status.com Books referred: 1.com 2. Embedded C –Michael. www. PIC Microcontroller Manual – Microchip. 5. REFERENCES The sites which were used while doing this project: 1. www. PCB Design Tutorial –David. 3.
Copyright © 2024 DOKUMEN.SITE Inc.