Anda di halaman 1dari 35

B.

TECH PROJECT SYNOPSIS


ON

Field programmable low cost PLC


Submitted to

Uttar Pradesh Technical University


in partial fulfillment of the requirement for award of the degree of

BACHELOR OF TECHNOLOGY
in

ELECTRONICS & TELECOMMUNICATION

By AVANI MITTAL (0410133025) MAYANK JAIN (0410133041) SAFAL JAIN (0410133095)

CERTIFICATE
To whom it may concern

This is to certify that the work which is being presented in the project synopsis titled Field programmable low cost PLC in partial fulfillment for the award of the degree of B.Tech and submitted to the department of Electronics and Telecommunication Engineering, COER, is an authentic record of the work carried out by ABHISHEK BANSAL, ASHISH GUPTA, AVANI MITTAL, MAYANK JAIN, SAFAL JAIN and SAHIL JAIN, during the academic session 2007-2008. The matter presented in this report has not been submitted by the candidates for the award of any other degree.

Dr. Priyanka (Senior Lecturer Department & Project Guide) Coordinator) E.T. Deptt.

Mr. B.D.Patel (Head of

& Project

E.T. Deptt.

TABLE OF CONTENTS
INTRODUCTION

PLATFORM USED

AIM OF THE PROJECT

BLOCK DIAGRAM

WORKING OF THE PROJECT

ADVANTAGES

REFERENCE

INTRODUCTION

A programmable logic controller (PLC) or programmable controller is a digital computer used for automation of electromechanical processes, such as control of machinery on factory assembly lines, amusement rides, or lighting fixtures. PLCs are used in many industries and machines. Unlike general-purpose computers, the PLC is designed for multiple inputs and output arrangements, extended temperature ranges, immunity to electrical noise, and resistance to vibration and impact. Programs to control machine operation are typically stored in battery-backed or non-volatile memory. A PLC is an example of a real time system since output results must be produced in response to input conditions within a bounded time, otherwise unintended operation will result. In Industries, generally all plants (machineries) are very expensive. So we cannot bear that a machine is damaged by small or large variations in the optimum parameters on which it is operating. Thus, it is a general practice to maintain power supply voltage, machine temperature & fluid level automatically. Here we are obtaining the work of PLC by using a PIC controller which has inbuilt ADC,So it can sense the input analog signal and generate the digital signal at its output.Here the temperature is measure using temperature sensor and the intensity of light being measure through LDR.

PLATFORM USED

SOFTWARE REQUIREMENTS PIC16F72 is a 28-pin, 8-bit CMOS FLASH microcontroller with A/D converter. SOFTWARE USED INFONICS: Serial Programmer Software Hex file editor MPLAB IDE v7.00: Source code Editor Assembler HARDWARE REQUIREMENTS
1. 2. 3. 4. 5.

Microcontroller PIC16F72 Crystal Oscillator Resistor Capacitor Connectors

6. 7. 8. 9. 10. 11.

Buzzer Functional Numeric Display Transformer Transistor Led Relay

AIM OF THE PROJECT

The aim of the project is to design an electrical project in which successfully we have designed a Field programmable low cost . In Industries, generally all plants (machineries) are very expensive. So we cannot bear that a machine is damaged by small or large variations in the optimum parameters on which it is operating .This project measure the temperature of the machine part and also the intensity of light and maintain it to its operating condition .

BLOCK DIAGRAM

BLOCK DIAGRAM

POWER SUPPLY Lcd display

Temperature sensor

PIC MICROCONTROL LER


Light sensor FOR ALL DECISION

LIGHT INTENSITY CONTROL

RELAY

WORKING OF THE PROJECT

here we have used a temperature sensor and a LDR which will sense the temperature of the machine , and light in the room respectively .on sensing temperature and light it will forward the measured temperature and all other values to the microcontroller which control the entire operation of controlling temperature and light intensity. The microcontroller compare the sensed temperature and light with the reference values which is either maximum or minimum temperature and light of the room and thus control it. If the light intensity decreases then the PIC controller will detect this and turn on the relay which in turn ,Turn ON the bulb for controlling the light intensity.

MICROCONTROLLER UNIT

CRITERIA FOR CHOOSING A MICROCONTROLLER The basic criteria for choosing a microcontroller suitable for the application are: 1) The first and foremost criterion is that it must meet the task at hand efficiently and cost effectively. In analyzing the needs of a microcontroller-based project, it is seen whether an 8- bit, 16-bit or 32-bit microcontroller can best handle the computing needs of the task most effectively. Among the other considerations in this category are: (a) Speed: The highest speed that the microcontroller supports.

(b) Packaging: It may be a 28-pin DIP (dual inline package) or a QFP (quad flat package), or some other packaging format. This is important in terms of space, assembling, and prototyping the end product. (c) Power consumption: This is especially critical for battery-powered products. (d) The number of I/O pins and the timer on the chip. (f) How easy it is to upgrade to higher performance or lower consumption versions. (g) Cost per unit: This is important in terms of the final cost of the product in which a microcontroller is used. 2) The second criterion in choosing a microcontroller is how easy it is to develop products around it. Key considerations include the availability of an assembler, debugger, compiler, technical support. 3) The third criterion in choosing a microcontroller is its ready availability in needed quantities both now and in the future.

4.2.2 DESCRIPTION This powerful (200 nanosecond instruction execution) yet easy-to-program (only 35 single word instructions) CMOS FLASH-based 8-bit microcontroller packs Microchip's powerful PIC architecture into an 28-pin package and is upwards compatible with the PIC16C5X, PIC12CXXX and PIC16C7X devices. The

PIC16F72 features 5 channels of 8-bit Analog-to-Digital (A/D) converter with 2 additional timers, capture/compare/PWM function and the synchronous serial port can be configured as either 3-wire Serial Peripheral Interface (SPI) or the 2-wire Inter-Integrated Circuit (IC) bus. All of these features make it ideal for more advanced level A/D applications in automotive, industrial, appliances and consumer applications. 4.2.3 DEVICE SPECIFICATION

High Performance RISC CPU: Only 35 single word instructions to learn All single cycle instructions except for program branches, which are twocycle Operating speed: DC - 20 MHz clock input DC - 200 ns instruction cycle 2K x 14 words of Program Memory, 128 x 8 bytes of Data Memory (RAM) Pin out compatible to PIC16C72/72A and PIC16F872 Interrupt capability Eight-level deep hardware stack Direct, Indirect and Relative Addressing modes

Peripheral Features: High Sink/Source Current: 25 mA Timer0: 8-bit timer/counter with 8-bit prescaler Timer1: 16-bit timer/counter with prescaler, can be incremented during SLEEP via external crystal/clock Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler Capture, Compare, PWM (CCP) module - Capture is 16-bit, maximum resolution is 12.5 ns - Compare is 16-bit, maximum resolution is 200 ns - PWM maximum resolution is 10-bit 8-bit, 5-channel analog-to-digital converter Synchronous Serial Port (SSP) with SPI (Master/Slave) and I2C (Slave) Brown-out detection circuitry for Brown-out Reset (BOR) CMOS Technology:

Low power, high speed CMOS FLASH technology Fully static design Wide operating voltage range: 2.0V to 5.5V Industrial temperature range Low power consumption: - < 0.6 mA typical @ 3V, 4 MHz - 20 micro A typical @ 3V, 32 kHz - < 1 micro A typical standby current Special Microcontroller Features: 1,000 erase/write cycle FLASH program memory typical Power-on Reset (POR), Power-up Timer (PWRT) and Oscillator Start-up Timer (OST) Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation Programmable code protection Power saving SLEEP mode

Selectable oscillator options In-Circuit Serial Programming (ICSP) via 2 pins

Processor read access to program memory

PIN DIAGRAM OF PIC16F72

Fig 4.8 Pin Diagram of Microcontroller

4.2.5 BLOCK DIAGRAM OF MICROCONTROLLER

Fig 4.9 Block Diagram of Microcontroller

4.2.6 PIN DESCRIPTION: microcontroller Table 4.4 Pin Description

Following table shows the pin description of

4.2.7 ANALOG-TO-DIGITAL CONVERTER (A/D) MODULE

The analog-to-digital (A/D) converter module has five inputs for the PIC16F72. The A/D allows conversion of an analog input signal to a corresponding 8-bit digital number. The output of the sample and hold is the input into the converter, which generates the result via successive approximation. The analog reference voltage is software selectable to either the devices positive supply voltage (VDD) or the voltage level on the RA3/AN3/VREF pin. The A/D converter has a unique feature of being able to operate while the device is in SLEEP mode. To operate in SLEEP, the A/D conversion clock must be derived from the A/Ds internal RC oscillator. The A/D module has three registers: A/D Result Register ADRES A/D Control Register 0 ADCON0 A/D Control Register 1 ADCON1 A device RESET forces all registers to their RESET state. This forces the A/D module to be turned off and any conversion is aborted. The ADCON0 register, shown in Register 10-1, controls the operation of the A/D module. The ADCON1 register, shown in Register 10-2, configures the functions of the port pins. The port pins can be configured as analog inputs (RA3 can also be a voltage reference) or a digital I/O.

4.2.7.1 ANALOG TO DIGITAL CONVERSION REGISTER 0:

Fig 4.10 A to D Reg0 4.2.7.2 ANALOG TO DIGITAL REGISTER1:

Fig 4.11 A to D Reg1

The ADRESS register contains the result of the A/D conversion. When the A/D conversion is complete, the result is loaded into the ADRESS register, the GO/DONE bit (ADCON0<2>) is cleared, and A/D interrupt flag bit ADIF is set. The block diagram of the A/D module is shown. The value in the ADRESS register is not modified for a Power-on Reset. The ADRESS register will contain unknown data after a Power-on Reset. After the A/D module has been configured as desired, the selected channel must be acquired before the conversion is started. The analog input channels must have their corresponding TRIS bits selected as an input. After acquisition time has elapsed, the A/D conversion can be started. The following steps should be followed for doing an

A/D conversion: 1. Configure the A/D module: Configure analog pins/voltage reference and digital I/O (ADCON1) Select A/D input channel (ADCON0) Select A/D conversion clock (ADCON0) Turn on A/D module (ADCON0) 2. Configure A/D interrupt (if desired): Clear ADIF bit Set ADIE bit Set GIE bit 3. Wait the required acquisition time.

4. Start conversion: Set GO/DONE bit (ADCON0) 5. Wait for A/D conversion to complete, by either: Polling for the GO/DONE bit to be cleared OR Waiting for the A/D interrupt 6. Read A/D Result register (ADRES), clear bit ADIF if required. 7. For next conversion, go to step 1 or step 2 as required. The A/D conversion time per bit is defined as TAD. A minimum wait of 2 TAD is required before the next acquisition starts.

4.2.8 INSTRUCTION SET SUMMARY Each PIC16F72 instruction is a 14-bit word divided into an OPCODE that specifies the instruction type and one or more operands that further specify the

operation of the instruction. The PIC16F72 instruction set summary in Table below lists byte-oriented, bit-oriented, and literal and control operations. Table below shows the opcode field descriptions. For byte-oriented instructions, f represents a file register designator and d represents a destination designator. The file register designator specifies which file register is to be used by the instruction. The destination designator specifies where the result of the operation is to be placed. If d is zero, the result is placed in the W register. If d is one, the result is placed in the file register specified in the instruction. For bit-oriented instructions, b represents a bit field designator which selects the number of the bit affected by the operation, while f represents the number of the file in which the bit is located. For literal and control operations, k represents an eight or eleven-bit constant or literal value. The instruction set is highly orthogonal and is grouped into three basic categories: Byte-oriented operations Bit-oriented operations Literal and control operations All instructions are executed within one single instruction cycle, unless a conditional test is true or the program counter is changed as a result of an instruction. In this case, the execution takes two instruction cycles, with the second cycle executed as a NOP. One instruction cycle consists of four oscillator periods. Thus, for an oscillator frequency of 4 MHz, the normal instruction execution time is 1 If a conditional test is true, or the program counter is changed as a result s. of an instruction, the instruction execution time is 2S

4.2.8.1 GENERAL FORMAT FOR INSTRUCTIONS

Fig 4.12 General format

2.8.2 INSTRUCTION SET

BIBLIOGRAPHY
Mehta V.K., Principles of Electronics S.Chand & Co. Ltd., New Delhi

Intel Microcontroller and Features Tata Mc Graw Hill Publishing Ltd., New Delhi

Boylstead Robert & Nasceslsky Louis Electronic Devices & Circuit Theory Prentice Hall of India Private Ltd., New Delhi Millman Jacob & Halkias C. Christos Integrated Electronics Tata Mc Graw Hill Publishing Ltd., New Delhi

WEB SITES

www.microtutorials.com www.datasheets.com www.archives.com

www.nationalsemiconductors.com www.atmel.com www.seimens.com www.fairchildsemiconductors.com

Anda mungkin juga menyukai