Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Android SCADA

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 122

Abstract- This work describes a condition based reporting technique

of a multi-machine System using GSM technology. In this present


approach, a dedicated microcontroller based hardware unit (DHU)
has been developed to continuously measure the parameters of the
machines viz. voltage, current, speed etc. to monitor the running
condition of each machine in a plant. In a multi-machine monitoring
system each machine is connected with one such DHU, which are
also connected to a Global System for Mobile Communication
(GSM) modem. The preliminary level of fault or abnormality in
operation of each machine is diagnosed by the respective DHU and
the fault or abnormalities details are reported to the pre-assigned
operator through an SMS service. In extreme case, the provision of
machine shut down by a return SMS is also provided. A proto-type
lab model is set up and is working satisfactorily.

Introduction

The term SCADA stands for Supervisory Control And Data Acquisition. A SCADA system is a

common process automation system which is used to gather data from sensors and instruments

located at remote sites and to transmit and display this data at a central site for either control or

monitoring purposes. The collected data is usually viewed on one or more SCADA Host computers

located at the central or master site.

A real world SCADA system can monitor and control hundreds to hundreds of thousands of I/O
points. A typical Water SCADA application would be to monitor water levels at various water sources

like reservoirs and tanks and when the water level exceeds a preset threshold, activate the system

of pumps to move water to tanks with low tank levels.

Common analog signals that SCADA systems monitor and control are levels, temperatures,

pressures, flow rate and motor speed. Typical digital signals to monitor and control are level

switches, pressure switches, generator status, relays & motors.

There is typically another layer of equipment between the remote sensors and instruments

and the central computer. This intermediate equipment exists on the remote side and connects to

the sensors and field instruments. Sensors typically have digital or analog I/O and these signals are

not in a form that can be easily communicated over long distances. The intermediate equipment is

used to digitize then packetize the sensor signals so that they can be digitally transmitted via an

industrial communications protocol over long distances to the central site.

This project is focused on the control of power using SCADA system. Here, the load has been

controlled using SCADA in the PC. The hardware part has been controlled by the microcontroller.

The microcontroller have used here in this project is PIC16F877A. the communication between the

microcontroller and the system is achieved with the help of MAX232 chip.
A PIC microcontroller is a processor with built in memory and RAM and you

can use it to control your projects (or build projects around it). So it saves you

building a circuit that has separate external RAM,ROM and peripheral chips.

Pin Diagram;
PIC microcontrollers Includes.
 EEPROM.

 Timers.

 Analogue

comparators.

 UART.

* Frequency counter - using the internal timers and reporting through UART

(RS232) or output to LCD.

* Capacitance meter - analogue comparator oscillator.

* Event timer - using internal timers.

* Event data logger -capturing analogue data using an internal ADC and using

the internal EEPROM for storing data (using an external I2C for high data

storage capacity.

* Servo controller (Control through UART) - using the internal PWM module
or using a software created PWM.

The PIC Micro is one of the most popular microcontrollers and in case you

were wondering the difference between a microprocessor and a microcontroller

is that a microcontroller has an internal bus with in built memory and

peripherals.

In fact the 8 pin (DIL) version of the 12F675 has an amazing number of internal

peripherals. These are:

 Two timers.

 One 10bit ADC with 4 selectable inputs.

 An internal oscillator (or you can use an external crystal).

 An analogue comparator.

 1024 words of program memory.

 64 Bytes of RAM.

 128 Bytes of EEPROM memory.

 External interrupt (as well as interrupts from internal peripherals).

 External crystal can go up to 20MHz.

 ICSP : PIC standard programming interface.


And all of these work from within an 8 pin DIL package!

In the mid-range devices the memory space ranges from 1k to 8k (18F parts

have more) - this does not sound like a lot but the processor has an efficient

instruction set and you can make useful projects even with 1k e.g. LM35

temperature sensing project that reports data to the serial port easily fits within

1k.

Features

In fact a PIC microcontroller is an amazingly powerful fully featured processor

with internal RAM, EEROM FLASH memory and peripherals. One of the

smallest ones occupies the space of a 555 timer but has a 10bit ADC, 1k of

memory, 2 timers, high current I/O ports a comparator a watch dog timer... I

could go on as there is more!

Programming

One of the most useful features of a PIC microcontroller is that you can re-

program them as they use flash memory (if you choose a part with an F in the

part number e.g. 12F675 not 12C509). You can also use the ICSP serial

interface built into each PIC Microcontroller for programming and even do
programming while it's still plugged into the circuit!

You can either program a PIC microcontroller using assembler or a high level

language and I recommend using a high level language such as C as it is much

easier to use (after an initial learning curve). Once you have learned the high

level language you are not forced to use the same processor e.g. you could go to

an AVR or Dallas microcontroller and still use the same high level language.

Input / Output - I/O

A PIC Microcontroller can control outputs and react to inputs e.g. you could

drive a relay or read input buttons.

With the larger devices it's possible to drive LCDs or seven segment displays

with very few control lines as all the work is done inside the PIC Micro.

Comparing a frequency counter to discrete web designs you'll find two or three

chips for the microcontroller design and ten or more for a discrete design. So

using them saves prototype design effort as you can use built in peripherals to

take care of lots of the circuit operation.


Many now have a built in ADC so you can read analogue signal levels so you

don't need to add an external devices e.g. you can read an LM35 temperature

sensor directly with no interface logic.

Peripherals

The PIC microcontroller has many built in peripherals and this can make using

them quite daunting at first which is why I have made this introductory page

with a summary of each major peripheral block.

At the end is a short summary of the main devices used in projects shown on

this site.

The best way to start is to learn about the main features of a chip and then begin

to use each peripheral in a project. I think learning by doing is the best way.

PIC

microcontr PIC microcontroller

oller feature description

Feature
Flash Re-programmable program

memory storage.

Memory storage for


RAM
variables.

Long term stable memory :

Electrically Erasable
EEPROM
Programmable Read

Only Memory.

High current Input/Output

I/O ports ports (with pin direction

change).

Timers/
Typically 3.
Counters

Built in RS232 protocol

USART (only needs level translator

chip).

Capture/Compare/PWM
CCP
module.

SSP I2C and SPI Interfaces.

Comparator An analogue comparator and


internal voltage reference.

Analogue to digital
ADC
converter.

Parallel Slave Port (for 8 bit


PSP
microprocessor systems).

LCD LCD interface.

Special ICSP,WDT,BOR,POR,PWR

features T,OST,SLEEP

Simple programming using

ICSP In Circuit Serial

Programming.

Flash memory

This is the program storage area and gives you the most important benefit for

using a PIC microcontroller - You program the device many times. Since when

does anyone get a program right first time ?

Devices used in projects on this site can be re-programmed up to 100,000 times


(probably more) as they use Flash memory - these have the letter F in the part

name. You can get cheaper (OTP) devices but these are One-Time-

Programmable; once programmed you can't program it again!

ICSP

In Circuit Serial Programming (ICSP) is the next most important benefit.

Instead of transferring your chip from the programmer to the development

board you just leave it in the board. By arranging the programming connections

to your circuit correctly you won't need to remove the chip!

You can re-program the device while it's still in the circuit so once your

programmer is setup you can leave it on the bench and test your programs

without moving the chip around and it makes the whole process much easier.

I/O Ports

Input / Output ports let you communicate with the outside world so you can

control leds, LCDs or just about anything with the right interface. You can also

set them as inputs to gather information.

Pin direction

Most PIC microcontroller pins can be set as an input or and output and this can
be done on the fly e.g. for a dallas 1 wire system a pin can be written to

generate data and read at a later stage. The TRIS register controls the I/O

direction and setting a bit in this register to zero sets the pin as output while

setting it as one sets the pin as input.

This allows you to use a pin for multiple operations e.g. the Real Time clock

project uses RA0, the first pin of PORTA, to output data to a seven segment

display and at a later point in the program read the analogue value as an input.

Current

The PIC I/O ports are high current ports capable of directly driving LEDs (up to

25ma output current) - the total current allowed usually ~200mA this is often

for the whole chip (or specified for several ports combined together).

Timer / Counters

Each PIC microcontroller has up to three timers that you can either use as a

timer or a counter (Timer 1 & 2) or a baud clock (Timer 2).

Timer 0

The original timer: Timer 0 was the first timer developed and you can find it in
all the earliest devices e.g. 16F84 up to the most current e,g, 16F877A.

It is an 8 bit timer with an 8 bit prescaler that can be driven from an internal

(Fosc/4) or external clock. It generates an interrupt on overflow when the count

goes from 255 to zero.

Timer 0 always synchronizes the input clock (when using external clock).

Note: You can read and write timer 0 but you can not read the prescaler.

Note: The prescaler changes its effect depending on whether it is a timer

prescaler or a watch dog prescaler - so the same prescaler setting may prescale

by 2 or by 1 depending on its use!

Timer 1

This is a 16 bit timer that generates an overflow interrupt when it goes from

65535 to zero. It has an 8 bit programmable prescaler and you can drive it

from the internal clock (Fosc/4) or an external pin.

To eliminate false triggering it also has an optional input synchronizer for


external pin input.

This timer can be used in sleep mode and will generate a wakeup interrupt on

overflow.

Timer 1 is also read by the CCP module to capture an event time.

Note: Using this timer in sleep mode will use more current.

In addition it can be used to drive a low power watch crystal. This is something

that sounds good but I don't recommend you do it as watch crystals are

extremely difficult to drive correctly. You should only use it if you are going to

make a pcb and follow all the guidelines in making it noise free. I used a

DS1307 in the Real Time clock project which drives the crystal directly but

even this is difficult to get operating accurately.

Timer 2

This is an 8 bit timer with an 8 bit prescaler and an 8 bit postscaler. It takes its

input only from the internal oscillator (Fosc/4).

This timer is used for the timebase of a PWM when PWM is active and it can
be software selected by the SSP module as a baud clock.

It also has a period register that allows easy control of the period. When timer 2

reaches the PR2 register value then it resets. This saves having to check the

timer value in software and then reset the timer and since it is done in hardware

the operation is much faster - so you can generate fast clocks with periods that

are multiples of the main clock.

USART

The USART is a useful module and saves having to code up a software version

so it saves valuable program memory. You can find more information on

RS232 here and how to make it work. Look here for pin outs.

All you need to interface it to a PC serial port is a MAX232 chip (or

equivalent).

Note: An equivalent MAX232 chip is the SP202ECP that has the same pinout

as the MAX232 but lets you use 100nF capacitors - so you don't need the large

1uF caps.

Baud Rates
You have to be careful using the baud rates as they depend on the main clock in

use and normal oscillator values in general do not fit very well with 'real' baud

rates.

There is a table of baud rates in microchip data sheet DS33023A which

indicates the expected percentage error for a specific clock rate and in general

the higher the main clock the lower the error.

You sometimes have to play around with the register settings to get a better fit

with your clock rate and the baud rate you want. An example is for an 8MHz

clock - if you use BRGH=1 and an 8MHz clock (see the 16F88 datasheet) you

get accurate baud rates up to 38.4kbaud. You have to force this to work e.g. in

mikroC the built in USART routines use BRGH=0 so at 8MHz the baud rate is

only accurate to 9.6kbaud.

If you want a super-accurate baud rate the best way is to use a clock crystal that

ends up giving you that baud rate i.e. work back through the baud rate equations

to find the crystal you need.

CCP

The Capture/Compare/PWM module has three modes of operation:


 Capture - Capture the time of an event.

 Compare - Generate an output when Timer 1 reaches a value.

 PWM - Pulse Width Modulation.

Capture

Capture mode is used to capture the value of Timer 1 when a signal at the CCP

pin goes high (or low depending on how the CCP is set up). The CCP can

accurately capture the arrival time of a signal at the CCP pin so it can be used

for pulse time measurement.

Compare

Compare mode is used to generate an output when Timer 1 reaches a value you

put into CCPR1. One special event trigger mode lets you start the ADC when

the compare mode triggers.

PWM

PWM gives you one Pulse Width Modulation output with 10 bit resolution and

with no software overhead - once started it operates all by itself unless you want

to change the duty cycle.


It uses Timer 2 to define its operation using Timer 2 period register to define

the frequency of the PWM.

Note: The duty cycle is not a percentage it is the number of periods of the PWM

clock that the output is high!

SSP

The Synchronous Serial Port lets you communicate with devices that use either

the SPI (Serial Peripheral Interface) or I2C (Inter IC communication) protocols.

Note that for full Master mode I2C operation you need to choose a PIC device

that has the MSSP device (Master Synchronous Serial Port).

SPI and I2C are shared so you can only use one at a time (or you could use the

I2C bit banged routines in the Real Time Clock project to have both at the same

time).

You can find a project that uses I2C here and you can find more information on

I2C here.

Comparator and comparator voltage reference


The comparator is module that has two analogue comparators which can be set

up in one of 8 different ways. Either digital or analogue inputs can be compared

to reference voltages.

In one mode an internally generated voltage reference is used as an input to

both comparators and in the same mode multiplexing lets you monitor up to

four different input pins.

You can even send the output of the comparator to a pin so that it is used

independently from the microcontroller e.g. in a circuit where you need a

comparator you don't need an extra chip!

The analogue level must be between Vdd and Vss as protection diodes won't

allow anything else.

The module will generate an interrupt if the comparator output changes.

You can use it in sleep mode and the interrupt will wake it up.

The source impedance of the analogue signal must be smaller than 10k.
ADC

The single 10 bit Analogue to Digital Converter can have up to 8 inputs for a

device multiplexed from input pins.

The ADC can be used during sleep but you have to use the RC clock mode. One

benefit of this is that there will be no digital switching noise so you will get

better conversion accuracy.

For the 16F877A you can not just choose to use an analogue input if you feel

the need as there are only a specific and limited number of ways that the

analogue input pins can be enabled. It is best to start with AN0 and add more

as necessary - see the datasheet for which analogue inputs can be enabled e.g. if

you started a design using only AN5 you would find that you may have to

enable a few more analogue inputs as well!

The 16F675 can measure 4 analogue input pins!

PSP

The Parallel Slave Port lets you to connect the PIC microcontroller directly into

a microprocessor system. It provides an 8 bit read/write data bus and RD (read)


WR (write) and CS (chip select) inputs - all active low.

This will let you add a PIC microcontroller to a system so that the PIC

microcontroller can be treated as a memory mapped peripheral. It will let the

microcontroller behave just as though it was another microprocessor building

block e.g. some memory or ram but in this case you have full control over

exactly what the building block is i.e. you can re-program the PIC

microcontroller to do just about anything.

This provides an easy route to adding a PIC microcontroller to an 8 bit system

that already exists.

LCD

The LCD interface lets you directly interface to an LCD saving you having to

use an LCD module such as the HD44780. I have not used this feature as it is

another commercial requirement where removing a chip (HD44780) saves

money in a production run. I think it is capable of driving a graphic LCD.

Special Features

ICSP In Circuit Serial click here (jumps to


Programming ICSP section).

WD This is a software error


Watch dog timer
T protector.

This detects if the power

BOR Brown Out reset supply dips slightly and

resets the device if so.

This starts

POR Power on reset microcontroller initializa

tion.

PW A time delay to let Vdd


PoWeR up Time
RT rise.

Oscillator start up Wait for 1024 cycles


OST
timer after PWRT.

PIC
SLE
microcontroller Enter low power mode.
EP
sleep mode

WDT

If your software goes haywire then this timer resets the processor. To stop the

reset the well behaved software must periodically issue the CLRWDT
instruction to stop a resert. The WDT runs using its own oscillator. It runs

during sleep and shares Timer 0 prescaler.

POR

Power On Reset starts PIC microcontroller initialization when it detects a rising

edge on MCLR.

PWRT

If you enable this then 72ms after a POR the PIC microcontroller is started.

OST

Oscillator Startup Timer delays for 1024 oscillator cycles after PWRT (if

PWRT is enabled) ensuring that the oscillator has started and is stable. It is

automatic and only used for crystal oscillator modes and is active after POR or

wake from sleep.

SLEEP

Sleep mode (or low power consumption mode) is entered by executing the

'SLEEP' command. The device can wake from sleep caused by an external

reset, Watch Dog Timer timeout, INT pin RB port change or peripheral
interrupt.

Project device overview

This site mainly uses three PIC devices out of the hundreds of different chips

that microchip produces. This does not sound like a lot but you can use the

devices in almost any project and they have so many built in peripherals that

you can make hundreds of projects with them.

The other microchip devices are all useful in different situations - perhaps they

have more memory or different peripherals - this is useful if you want to tailor

your designs to the system you build - but probably more useful in a

commercial environment where every cent counts in a production run.

All three devices are extremely powerful and the main difference is that they

have different numbers of pins and memory size.

Note: There are differences in using the devices i.e. there are some registers that

are different but in the generally you can interchange them - this is made easier

using a high level language.


The devices used in this site are:

PIC PIC PIC

microcontroll microcontro microcontrolle

er Device ller No. Pins r Flash

memory

WORDS

12F675 8 1k

16F88 18 4k

16F877A 40 8k

Note : When looking at the microchip site the memory size is kwords - ignore

kbytes - you need the kword size as this is what each instruction occupies - the

kbyte size is for comparison to other types of micros (probably). But the

microcontroller data bus is 8 bits wide so it is an 8 bit microcontroller (different

program memory and data memory due to using Harvard architecture).

(Note: that all of them have the letter F in - this means it is a Flash re-

programmable part - don't go and buy a part with O in as its OTP -

programmable only once! - only do that if you are really really sure it's the final
design).
PIC Microcontroller Flash Memory size

You may think that 1k or even 8k is so tiny that it won't be useful but each PIC

microcontroller uses RISC (Reduced Instruction Set Computing) which simply

means that it has a cleverly arranged instruction set that only has a few

instructions. The mid range parts have 35 instructions.

If you use the high level language as recommended in this site then you won't

need to be too aware of the instruction set it just means you can do a lot with a

small amount of memory. Most of the projects on this site although they are

fully working projects fit within 2k words!

Note: If you need more memory you can always move to the 18F series of PIC

microcontrollers. Another option is to add an I2C serial eprom.

PIC microcontroller RAM and EEPROM size

The PIC microcontroller RAM size is also important as it stores all your

variables and intermediate data.

Note: You can usually alter the program to use less RAM by choosing the right
variable sizes or changing how your program works

For example don't use floating point alter it to use a different variable type e.g.

you can use long integers with fixed point operation to avoid floating point.

PIC microcontroller EEROM : Electrically Erasable ROM is used to store

data that must be saved between power up and power down.

This area is readable and writable and has a much longer life than the main

program store i.e. it has been designed for more frequent use.
Liquid Crystal Displays:

A. Introduction:

An LCD is a small low cost display. It is easy to interface with a micro-controller

because of an embedded controller(the black blob on the back of the board).This

controller is standard across many displays which means many micro-controllers

have libraries that make displaying messages as easy as a single line of code.
LCDs with a small number of segments, such as those used in digital watches and

pocket calculators, have individual electrical contacts for each segment. An

external dedicated circuit supplies an electric charge to control each segment. This

display structure is unwieldy for more than a few display elements.

Small monochrome displays such as those found in personal organizers, or older

laptop screens have a passive-matrix structure employing super-twisted pneumatic

(STN) or double-layer STN (DSTN) technology—the latter of which addresses a

color-shifting problem with the former—and color-STN (CSTN)—wherein color is

added by using an internal filter. Each row or column of the display has a single

electrical circuit. The pixels are addressed one at a time by row and column

addresses. This type of display is called passive-matrix addressed because the

pixel must retain its state between refreshes without the benefit of a steady

electrical charge. As the number of pixels (and, correspondingly, columns and

rows) increases, this type of display becomes less feasible. Very slow response

times and poor contrast are typical of passive-matrix addressed LCDs.

High-resolution color displays such as modern LCD computer monitors and

televisions use an active matrix structure. A matrix of thin-film transistors (TFTs)

is added to the polarizing and color filters. Each pixel has its own dedicated

transistor, allowing each column line to access one pixel. When a row line is
activated, all of the column lines are connected to a row of pixels and the correct

voltage is driven onto all of the column lines.

Features:

1. Built-in controller (KS 0066 or Equivalent)

2. + 5V power supply (Also available for + 3V)

3. 1/16 duty cycle

4. B/L to be driven by pin 1, pin 2 or pin 15, pin 16 or A.K

(LED) ,Optional for + 3V power supply

5. Intelligent, with built-in Hitachi HD44780 compatible LCD controller and RAM

providing simple interfacing


6.61 x 15.8 mm viewing area

7.5 x 7 dot matrix format for 2.96 x 5.56 mm characters, plus cursor line

8. Can display 224 different symbols

9. Low power consumption (1 mA typical)

10. Powerful command set and user-produced characters

11. TTL and CMOS compatible

12. Connector for standard 0.1-pitch pin headers


Mechanical Specifications
Pin Configurations:
Circuit Connections

Programming:

Algorithm to send data to LCD:

1.Make R/W low

2.Make RS=0 ;if data byte is command .RS=1 ;if data byte is data (ASCII value)
3.Place data byte on data register

4.Pulse E (HIGH to LOW)

5.Repeat the steps to send another data byte

LCD Initialization:

This is the pit fall for beginners. Proper working of LCD depend on the how the

LCD is initialized. We have to send few command bytes to initialize the LCD.

Simple steps to initialize the LCD

1.Specify function set:

Send 38H for 8-bit,double line and 5x7 dot character format.

2.Display On-Off control:

Send 0FH for display and blink cursor on.

3.Entry mode set:

Send 06H for cursor in increment position and shift is invisible.

4. Clear display:

Send 01H to clear display and return cursor to home position.


LCD COMMANDS AND CODES:

1 Clear display screen

2 Return Home

4 Decrement cursor (shift cursor to left)

5 Increment cursor (shift cursor to right)

6 shift display right


7 shift display left

8 Display off, cursor off

A Display off, cursor on

C Display on, cursor off

E Display on, cursor blinking

F Display on, cursor blinking

10 Shift cursor position to left

14 Shift cursor position to right

18 Shift the entire display to the left

1C Shift the entire display to the right

80 Force cursor to the beginning of 1st line

C0 Force cursor to the beginning of 2nd line

38 2 lines and 5 x 7 matrix.


Interfacing LCD with the Microcontroller
Detection 2 Return Home

Circuit Explanation

The LCD we have used in this project is HD1234. This is an alphanumeric type of

LCD with 16 pins. Of which Pins 7 to 14 are used as data pins, through which an

8-bit data can be input to the LCD. These Pins are connected to the Port 0 of Micro

controller. There are 3 control pins RS (Pin-4), RW (Pin-5) and EN (Pin-6). The

RS pin is connected to the 28th Pin of micro controller. The RW pin is usually
grounded. The Enable pin is connected to 27 th Pin. The LCD has two Rows and 16

Columns. The LCD is powered up with 5V supply connected to Pins 1(Gnd) and

2(Vcc). The Pin 3 is connected to Vcc through a Potentiometer. The potentiometer

is used to adjust the contrast level.

LCD

LCD

4 Decrement cursor (shift cursor to left)

5 Increment cursor (shift cursor to right)

6 shift display right

7 shift display left

8 Display off, cursor off

A Display off, cursor on

C Display on, cursor off


CURRENT TRANSFORMERS

Current transformers are used so that ammeters and the current coils of other

instruments and relays need not be connected directly to high voltage lines. In

other words, these instruments and relays are insulated from high voltages.

CT's also step down the current in a known ratio. The use of CT means that

relatively small and accurate instruments, relays and control devices of

standardized design can be used in circuits.

The CT has separate primary and secondary windings. The primary winding

which consists of few turns of heavy wire, wound on a laminated iron core is

connected in series with one of the line wires. The secondary winding consists

of a greater number of turns of a smaller size of wire. The primary and

secondary windings are wound on the same core.

The current rating of the primary winding of a CT is 100 A. The primary

winding has three turns and the secondary winding has 60 turns. The

secondary winding has the standard current rating of 5A;therefore the ratio
between the primary and secondary current is 100/5 or 20/1.The primary

current is 20 times greater than the secondary current. Since the secondary

winding has 60 turns and the primary winding has 3 turns, the secondary

winding has 20 times as many turns as the primary winding. For a CT, then the

ratio of primary to secondary currents is inversely proportional to the ratio of

primary to secondary turns.

In figure CT is used to step down current in a 3300V, single phase circuit. The

CT is rated at 100 to 5 A and the ratio of current step down is 20 to 1.In other

words, there are 20 A in the primary winding for each ampere in the secondary

winding. If the ammeter at the secondary indicates 4A,the actual current in the

primary is 20 times this value i.e80 A.

The CT in the figure has polarity markings in that the two high voltage

primary leads are marked H1 and H2 and the secondary leads are marked X1

and X2.When H1 is instantaneously positive, X1 is positive at the same

moment. Some CT manufacturers mark only the H1 and X1 leads. When

connecting the CT's in circuits ;the H1 lead is connected to the line lead

feeding from the source while the H2 lead is connected directly to the

ammeter. Note that one of the secondary leads is grounded as a safety

precaution to eliminate high voltage hazards.


Design

Current transformers used in metering equipment for three-phase 400 ampere

electricity supply

Like any other transformer, a current transformer has a primary winding, a

magnetic core, and a secondary winding. The alternating current flowing in the
primary produces a magnetic field in the core, which then induces a current in the

secondary winding circuit. A primary objective of current transformer design is to

ensure that the primary and secondary circuits are efficiently coupled, so that the

secondary current bears an accurate relationship to the primary current.

The most common design of CT consists of a length of wire wrapped many times

around a silicon steel ring passed over the circuit being measured. The CT's

primary circuit therefore consists of a single 'turn' of conductor, with a secondary

of many tens or hundreds of turns. The primary winding may be a permanent part

of the current transformer, with a heavy copper bar to carry current through the

magnetic core. Window-type current transformers are also common, which can

have circuit cables run through the middle of an opening in the core to provide a

single-turn primary winding. When conductors passing through a CT are not

centered in the circular (or oval) opening, slight inaccuracies may occur.

Shapes and sizes can vary depending on the end user or switchgear manufacturer.

Typical examples of low voltage single ratio metering current transformers are

either ring type or plastic moulded case. High-voltage current transformers are

mounted on porcelain bushings to insulate them from ground. Some CT

configurations slip around the bushing of a high-voltage transformer or circuit

breaker, which automatically centers the conductor inside the CT window.


The primary circuit is largely unaffected by the insertion of the CT. The rated

secondary current is commonly standardized at 1 or 5 amperes. For example, a

4000:5 CT would provide an output current of 5 amperes when the primary was

passing 4000 amperes. The secondary winding can be single ratio or multi ratio,

with five taps being common for multi ratio CTs. The load, or burden, of the CT

should be of low resistance. If the voltage time integral area is higher than the

core's design rating, the core goes into saturation towards the end of each cycle,

distorting the waveform and affecting accuracy.

Usage

Current transformers are used extensively for measuring current and monitoring

the operation of the power grid. Along with voltage leads, revenue-grade CTs drive

the electrical utility's watt-hour meter on virtually every building with three-phase

service and single-phase services greater than 100 amps.

The CT is typically described by its current ratio from primary to secondary. Often,

multiple CTs are installed as a "stack" for various uses. For example, protection

devices and revenue metering may use separate CTs to provide isolation between

metering and protection circuits, and allows current transformers with different

characteristics (accuracy, overload performance) to be used for the devices.


Safety precautions

Care must be taken that the secondary of a current transformer is not disconnected

from its load while current is flowing in the primary, as the transformer secondary

will attempt to continue driving current across the effectively infinite impedance.

This will produce a high voltage across the open secondary (into the range of

several kilovolts in some cases), which may cause arcing.

Accuracy

The accuracy of a CT is directly related to a number of factors including:

 Burden

 Burden class/saturation class

 Rating factor

 Load

 External electromagnetic fields

 Temperature and

 Physical configuration.

 The selected tap, for multi-ratio CTs

For the IEC standard, accuracy classes for various types of measurement are set

out in IEC 60044-1, Classes 0.1, 0.2s, 0.2, 0.5, 0.5s, 1, and 3. The class designation
is an approximate measure of the CT's accuracy. The ratio (primary to secondary

current) error of a Class 1 CT is 1% at rated current; the ratio error of a Class 0.5

CT is 0.5% or less. Errors in phase are also important especially in power

measuring circuits, and each class has an allowable maximum phase error for a

specified load impedance. Current transformers used for protective relaying also

have accuracy requirements at overload currents in excess of the normal rating to

ensure accurate performance of relays during system faults.

Burden

The load, or burden, in a CT metering circuit is the (largely resistive) impedance

presented to its secondary winding. Typical burden ratings for IEC CTs are 1.5

VA, 3 VA, 5 VA, 10 VA, 15 VA, 20 VA, 30 VA, 45 VA & 60 VA. As for

ANSI/IEEE burden ratings are B-0.1, B-0.2, B-0.5, B-1.0, B-2.0 and B-4.0. This

means a CT with a burden rating of B-0.2 can tolerate up to 0.2 Ω of impedance in

the metering circuit before its output current is no longer a fixed ratio to the

primary current. Items that contribute to the burden of a current measurement

circuit are switch-blocks, meters and intermediate conductors. The most common

source of excess burden in a current measurement circuit is the conductor between

the meter and the CT. Often, substation meters are located significant distances

from the meter cabinets and the excessive length of small gauge conductor creates
a large resistance. This problem can be solved by using CT with 1 ampere

secondaries which will produce less voltage drop between a CT and its metering

devices.

Knee-point voltage

The knee-point voltage of a current transformer is the magnitude of the secondary

voltage after which the output current ceases to follow linearly the input current.

This means that the one-to-one or proportional relationship between the input and

output is no longer within declared accuracy. In testing, if a voltage is applied

across the secondary terminals the magnetizing current will increase in proportion

to the applied voltage, up until the knee point. The knee point is defined as the

point at which an increase of applied voltage of 10% results in an increase in

magnetizing current of 50%. From the knee point upwards, the magnetizing current

increases abruptly even with small increments in voltage across the secondary

terminals. The knee-point voltage is less applicable for metering current

transformers as their accuracy is generally much tighter but constrained within a

very small bandwidth of the current transformer rating, typically 1.2 to 1.5 times

rated current. However, the concept of knee point voltage is very pertinent to
protection current transformers, since they are necessarily exposed to currents of

20 or 30 times rated current during faults.[1]

Rating factor

Rating factor viqar is a factor by which the nominal full load current of a CT can

be multiplied to determine its absolute maximum measurable primary current.

Conversely, the minimum primary current a CT can accurately measure is "light

load," or 10% of the nominal current (there are, however, special CTs designed to

measure accurately currents as small as 2% of the nominal current). The rating

factor of a CT is largely dependent upon ambient temperature. Most CTs have

rating factors for 35 degrees Celsius and 55 degrees Celsius. It is important to be

mindful of ambient temperatures and resultant rating factors when CTs are

installed inside pad-mounted transformers or poorly ventilated mechanical rooms.

Recently, manufacturers have been moving towards lower nominal primary

currents with greater rating factors. This is made possible by the development of

more efficient ferrites and their corresponding hysteresis curves.

Special designs
Specially constructed wideband current transformers are also used (usually with an

oscilloscope) to measure waveforms of high frequency or pulsed currents within

pulsed power systems. One type of specially constructed wideband transformer

provides a voltage output that is proportional to the measured current. Another type

(called a Rogowski coil) requires an external integrator in order to provide a

voltage output that is proportional to the measured current. Unlike CTs used for

power circuitry, wideband CTs are rated in output volts per ampere of primary

current. CT RATIO

POWER SUPPLY UNIT

As we all know any invention of latest technology cannot be activated

without the source of power. So it this fast moving world we deliberately need a

proper power source which will be apt for a particular requirement. All the

electronic components starting from diode to Intel IC’s only work with a DC

supply ranging from _+5v to _+12. we are utilizing for the same, the most cheapest

and commonly available energy source of 230v-50Hz and stepping down ,

rectifying, filtering and regulating the voltage. This will be dealt briefly in the

forth-coming sections.
STEP DOWN TRANSFORMER

When AC is applied to the primary winding of the power transformer it can

either be stepped down or up depending on the value of DC needed. In our circuit

the transformer of 230v/15-0-15v is used to perform the step down operation

where a 230V AC appears as 15V AC across the secondary winding . One

alteration of input causes the top of the transformer to be positive and the bottom

negative. The next alteration will temporarily cause the reverse. The current rating

of the transformer used in our project is 2A. Apart from stepping down AC

voltages, it gives isolation between the power source and power supply circuitries.

RECTIFIER UNIT
In the power supply unit, rectification is normally achieved using a solid

state diode. Diode has the property that will let the electron flow easily in one

direction at proper biasing condition . As AC is applied to the diode, electrons only

flow when the anode and cathode is negative. Reversing the polarity of voltage

will not permit electron flow.

A commonly used circuit for supplying large amounts of DC power is the

bridge rectifier. A bridge rectifier of four diodes (4*IN4007) are used to achieve

full wave rectification. Two diodes will conduct during the negative cycle and the

other two will conduct during the positive half cycle. The DC voltage appearing

across the output terminals of the bridge rectifier will be somewhat lass than 90%

of the applied rms value. Normally one alteration of the input voltage will reverse

the polarities. Opposite ends of the transformer will therefore always be 180 deg

out of phase with each other.

For a positive cycle, two diodes are connected to the positive voltage at the

top winding and only one diode conducts . At the same time one of the other two

diodes conducts for the negative voltage that is applied from the bottom winding

due to the forward bias for that diode. In this circuit due to positive half cycleD1 &

D2 will conduct to give 10.8v pulsating DC. The DC output has a ripple frequency
of 100Hz. Since each altercation produces a resulting output pulse, frequency =

2*50 Hz. The output obtained is not a pure DC and therefore filtration has to be

done.

FILTERING UNIT

Filter circuits which is usually a capacitor acting as a surge arrester always follow

the rectifier unit. This capacitor is also called as a decoupling capacitor or a

bypassing capacitor, is used not only to ‘short’ the ripple with frequency of 120Hz

to ground but also to leave the frequency of the DC to appear at the output. A load

resistor R1 is connected so that a reference to the ground is maintained . C1R1 is


for bypassing ripples. C2R2 is used as a low pass filter, i.e. it passes only low

frequency signals and bypasses high frequency signals. The load resistor should be

1% to 2.5% of the load.

1000f/25v : for the reduction of ripples from the pulsating.

10f/25v : for maintaining the stability of the voltage at the load side.

O,1f : for bypassing the high frequency disturbances.

VOLTAGE REGULATORS

The voltage regulators play an important role in any power supply unit. The

primary purpose of a regulator is to aid the rectifier and filter circuit in providing a

constant DC voltage to the device. Power supplies without regulators have an

inherent problem of changing DC voltage values due to variations in the load or

due to fluctuations in the AC liner voltage. With a regulator connected to the DC

output, the voltage can be maintained within a close tolerant region of the desired

output. IC7812 and 7912 is used in this project for providing +12v and –12v DC

supply.
Many simple DC power supplies regulate the voltage using a shunt regulator

such as a zener diode , avalanche breakdown diode , or voltage regulator tube .

Each of these devices begins conducting at a specified voltage and will

conduct as much current as required to hold its terminal voltage to that

specified voltage. The power supply is designed to only supply a maximum

amount of current that is within the safe operarating capability of the shunt

regulating device (commonly, by using a series resistor). In shunt regulators,

the voltage reference is also the regulating device.

If the stabiliser must provide more power, the shunt regulator output is only

used to provide the standard voltage reference for the electronic device, known

as the voltage stabiliser . The voltage stabiliser is the electronic device, able to

deliver much larger currents on demand.


Specifications:

Resistors R1 and R2 maintain line load regulation.


At the secondary side of the transformer,

Applied voltage = 15v

Conducting drop across the diodes = 2*0.6

= 1.2v

without capacitor:

Vavg = (15-1.2)v = 13.8c pulsating DC

Frequency = 100Hz

With capacitor:

V=Vavg *1.414(formfactor)= 19.51v

Frequency =50Hz
With 7812 voltage regulator :

V0= +12v

With 7912 voltage regulator :

V0= -12v

LM34/LM35 Precision Monolithic Temperature Sensors:

INTRODUCTION:

Most commonly-used electrical temperature sensors are difficult to apply. For

example, thermocouples have low output levels and require cold junction

compensation. Thermistors are nonlinear. In addition, the outputs of these sensors

are not linearly proportional to any temperature scale. Early monolithic sensors,

such as the LM3911, LM134 and LM135, overcame many of these difficulties, but

their outputs are related to the Kelvin temperature scale rather than
the more popular Celsius and Fahrenheit scales. Fortunately, in 1983 two I.C.'s, the

LM34 Precision Fahrenheit Temperature Sensor and the LM35 Precision Celsius

Temperature Sensor, were introduced. This application note will discuss the LM34,

but with the proper scaling factors can easily be adapted to the LM35. The LM34

has an output of 10 mV/0F with a typical nonlinearity of only g0.35 0F over a b50 to

a3000F temperature range, and is accurate to within g0.4 0F typically at room

temperature (770F). The LM34's low output impedance and linear output

characteristic make interfacing with readout or control circuitry easy. An inherent

strength of the LM34 over other currently available temperature sensors is that it is

not as susceptible to large errors in its output from low level leakage currents. For

instance, many monolithic temperature sensors have an output of only 1 mA/ 0K.

This leads to a 10K error for only 1 m-Ampere of leakage current. On the other

hand, the LM34 may be operated as a current mode device providing 20 mA/ 0F of

output current. The same 1 mA of leakage current will cause an error in the

LM34's output of only 0.050F (or 0.030K after scaling). Low cost and high

accuracy are maintained by performing trimming and calibration procedures at the

wafer level. The device may be operated with either single or dual supplies. With

less than 70 mA of current drain, the LM34 has very little self-heating (less than

0.20F in still air), and comes in a TO-46 metal can package, a SO-8 small outline

package and a TO-92 plastic package.


CIRCUIT OPERATION:

Since the two circuits are very similar, only the LM34 Fahrenheit temperature

sensor will be discussed in greater detail. The circuit operates as follows:

Transistor Q1 has 10 times the emitter area of transistor Q2, and therefore,

one-tenth the current density. From Figure 4 , it is seen that the difference in the

current densities of Q1 and Q2 will develop a voltage which is proportional to

absolute temperature across resistor R1. At 770F this voltage will be 60 mV. As in

the Kelvin temperature sensor, an amplifier, A1, is used to insure that this is the

case by servoing the base of transistor Q1 to a voltage level, VPTAT, of DVBE c

n. The value of n will be trimmed during calibration of the device to give the

correct output for any temperature.


For purposes of discussion, suppose that a value of VPTAT equal to 1.59V will

give a correct output of 770 mV at 770F. Then n will be equal to VPTAT/DVBE or

1.59V/60 mV e 26.5, and VPTAT will have a temperature coefficient (temp-co) of:

Subtracting two diode drops of 581 mV (at 77 0F) with tempcos of b2.35

mV/0C each, will result in a voltage of 428 mV with a tempco of 10 mV/§C at the

non-inverting input of amplifier A2. As shown, amplifier A2 has a gain of 1.8

which provides the necessary conversion to 770 mV at 77F (25C). A further

example would be if the temperature were 32§F (0 0C), then the voltage at the input

of A2 would be 428 mV±(10 mV/§C) (25§C) e 0.178, which would give VOUT e

(0.178) (1.8) e 320 mV Ð the correct value for this temperature.


Proximity sensor

A proximity sensor is a sensor able to detect the presence of nearby objects

without any physical contact. A proximity sensor often emits an electromagnetic or

electrostatic field, or a beam of electromagnetic radiation (infrared, for instance),

and looks for changes in the field or return signal. The object being sensed is often

referred to as the proximity sensor's target. Different proximity sensor targets

demand different sensors. For example, a capacitive or photoelectric sensor might

be suitable for a plastic target; an inductive proximity sensor requires a metal

target.

The maximum distance that this sensor can detect is defined "nominal range".

Some sensors have adjustments of the nominal range or means to report a

graduated detection distance.

Proximity sensors can have a high reliability and long functional life because of the

absence of mechanical parts and lack of physical contact between sensor and the

sensed object.

IEC 60947-5-2 defines the technical details of proximity sensors.

A proximity sensor adjusted to a very short range is often used as a touch switch.
Contents

[hide]

 1 Dealing with output from a proximity sensor

 2 Types of sensors

 3 Applications

 4 See Also

 5 External Links

Dealing with output from a proximity sensor

Conditioning the output of a proximity sensor is frequently difficult. Proximity

sensor designers must confront linearity, hysteresis, excitation voltage instability,

and voltage offset.

Types of sensors

 Capacitive

 Magnetic

 Inductive

 Photocell (reflective)

 Laser rangefinder
 Sonar (typically active or passive)

 Radar

 Doppler effect (effect not a sensor)

 Passive thermal infrared

 Passive optical (such as charge-coupled devices)

 Reflection of ionising radiation

Applications

 Car bumpers that sense distance to nearby cars for parking

 Ground proximity warning system for aviation safety

 Sheet break sensing in paper machine.


The magnetic proximity switch circuit, in principle, consists of a reed switch at its

heart. When a magnet is brought in the vicinity of the sensor (reed switch), it

operates and controls the rest of the switching circuit. In place of the reed switch,

one may, as well, use a general-purpose electromagnetic reed relay (by making use

of the reed switch contacts) as the sensor, if required. These tiny reed relays are

easily available as they are widely used in telecom products. The reed switch or

relay to be used with this circuit should be the ‘normally open’ type.

When a magnet is brought/placed in the vicinity of the sensor element for a

moment, the contacts of the reed switch close to trigger timer IC1 wired in

monostable mode. As a consequence its output at pin 3 goes high for a short

duration and supplies clock to the clock input (pin 3) of IC2 (CD4013—dual

D-type flip-flop). LED D2 is used as a response indicator.

This CMOS IC2 consists of two independent flip-flops though here only one is

used. Note that the flip-flop is wired in toggle mode with data input (pin 5)

connected to the Q (pin 2) output. On receipt of clock pulse, the Q output changes

from low to high state and due to this the relay driver transistor T1 gets forward-

biased. As a result the relay RL1 is energized


Special application inductive proximity sensors provide functions that are needed

to meet the requirements for unique applications. These sensors include:

 Relay output sensors

 Extended operational temperature sensors

 Analog output sensors

 Slot or ring housing sensors

 Speed monitoring sensors

 Explosion proof sensors

 Broken filling quill detection sensors

 High pressure sensors


Relay

A relay is an electrical switch that opens and closes under control of another

electrical circuit. In the original form, the switch is operated by an

electromagnet to open or close one or many sets of contacts. Because a relay is

able to control an output circuit of higher power than the input circuit, it can be

considered, in a broad sense, to be a form of electrical amplifier .

These contacts can be either Normally Open (NO), Normally Closed (NC),

or change-over contacts.

 Normally-open contacts connect the circuit when the relay is activated;

the circuit is disconnected when the relay is inactive. It is also called

Form A contact or "make" contact. Form A contact is ideal for

applications that require to switch a high-current power source from a

remote device.

 Normally-closed contacts disconnect the circuit when the relay is

activated; the circuit is connected when the relay is inactive. It is also

called Form B contact or "break" contact. Form B contact is ideal for

applications that require the circuit to remain closed until the relay is

activated.
 Change-over contacts control two circuits: one normally-open contact

and one normally-closed contact. It is also called Form C contact.

Operation

When a current flows through the coil, the resulting magnetic field attracts an

armature that is mechanically linked to a moving contact. The movement either

makes or breaks a connection with a fixed contact. When the current is

switched off, the armature is usually returned by a spring to its resting

position. Latching relays exist that require operation of a second coil to reset

the contact position.

By analogy with the functions of the original electromagnetic device, a solid-

state relay operates a thyristor or other solid-state switching device with a

transformer or light-emitting diode to trigger it.


An electric current through a conductor will produce a magnetic field at right

angles to the direction of electron flow. If that conductor is wrapped into a coil

shape, the magnetic field produced will be oriented along the length of the coil.

The greater the current, the greater the strength of the magnetic field, all other

factors being equal:

Inductors react against changes in current because of the energy stored in this

magnetic field. When we construct a transformer from two inductor coils around a

common iron core, we use this field to transfer energy from one coil to the other.

However, there are simpler and more direct uses for electromagnetic fields than the

applications we've seen with inductors and transformers. The magnetic field

produced by a coil of current-carrying wire can be used to exert a mechanical force

on any magnetic object, just as we can use a permanent magnet to attract magnetic

objects, except that this magnet (formed by the coil) can be turned on or off by

switching the current on or off through the coil.


If we place a magnetic object near such a coil for the purpose of making that object

move when we energize the coil with electric current, we have what is called a

solenoid. The movable magnetic object is called an armature, and most armatures

can be moved with either direct current (DC) or alternating current (AC)

energizing the coil. The polarity of the magnetic field is irrelevant for the purpose

of attracting an iron armature. Solenoids can be used to electrically open door

latches, open or shut valves, move robotic limbs, and even actuate electric switch

mechanisms. However, if a solenoid is used to actuate a set of switch contacts, we

have a device so useful it deserves its own name: the relay.

Relays are extremely useful when we have a need to control a large amount of

current and/or voltage with a small electrical signal. The relay coil which produces

the magnetic field may only consume fractions of a watt of power, while the

contacts closed or opened by that magnetic field may be able to conduct hundreds

of times that amount of power to a load. In effect, a relay acts as a binary (on or

off) amplifier.

Just as with transistors, the relay's ability to control one electrical signal with

another finds application in the construction of logic functions. This topic will be

covered in greater detail in another lesson. For now, the relay's "amplifying" ability

will be explored.
In the above schematic, the relay's coil is energized by the low-voltage (12 VDC)

source, while the single-pole, single-throw (SPST) contact interrupts the high-

voltage (480 VAC) circuit. It is quite likely that the current required to energize the

relay coil will be hundreds of times less than the current rating of the contact.

Typical relay coil currents are well below 1 amp, while typical contact ratings for

industrial relays are at least 10 amps.

One relay coil/armature assembly may be used to actuate more than one set of

contacts. Those contacts may be normally-open, normally-closed, or any

combination of the two. As with switches, the "normal" state of a relay's contacts is

that state when the coil is de-energized, just as you would find the relay sitting on a

shelf, not connected to any circuit.

Relay contacts may be open-air pads of metal alloy, mercury tubes, or even

magnetic reeds, just as with other types of switches. The choice of contacts in a
relay depends on the same factors which dictate contact choice in other types of

switches. Open-air contacts are the best for high-current applications, but their

tendency to corrode and spark may cause problems in some industrial

environments. Mercury and reed contacts are sparkless and won't corrode, but they

tend to be limited in current-carrying capacity.

Types of relay
A solid state relay, which has no moving parts

 A latching relay is mechanically arranged so that the armature can rest

in either of two positions. There are two coils that pull the armature in

opposite directions, so the relay can be switched to one position or the

other and then left in that state indefinitely. This type of relay has the

advantage that it consumes power only for an instant, while it is being

switched, and it retains its last setting across a power outage. Some

common relays may be wired to electrically latch, which offers no power

saving but does ensure that the relay returns to a known state during and

after a power outage.

 A reed relay has two, usually normally open, contacts inside a vacuum

or inert gas filled glass tube. This protects the contacts against

atmospheric corrosion . The two contacts are closed by magnetism from a

coil around the glass tube, or a permanent magnet moved towards it. See

also: reed switch .


 A mercury wetted relay is a form of reed relay in which the contacts

are wetted with mercury . Such relays are used to switch low-voltage

signals (one volt or less), or for high-speed counting and timing

applications where the mercury eliminated contact bounce. Mercury

wetted relays are position-sensitive and must be mounted vertically to

work properly. Because of the toxicity and expense of liquid mercury,

these relays are rarely specified for new equipment. See also mercury

switch.

 A machine tool relay is a type standardized for industrial control of

machine tools, transfer machines, and other seqential control. They are

characterized by a large number of contacts (sometimes extendable in

the field) which are easily converted from normally-open to normally-

closed status, easily replaceable coils, and a form factor that allows

compactly installing many relays in a control panel. Although such

relays once were the backbone of automation in such industries as

automobile assembly, the programmable logic controller mostly

displaced the machine tool relay from sequential control applications.

 A contactor is a very heavy-duty relay used for switching electric

motors and lighting loads. Such devices are often used for motor starters,
and may be built up with overload protection devices attached. The

overload sensing devices are a form of heat operated relay where a coil

heats a bi-metal strip to open contacts, or where a solder pot melts,

releasing a spring to operate contacts.

 A Buchholz relay is a safety device sensing the accumulation of gas in

large oil-filled transformers , which will alarm on slow accumulation of

gas or shut down the transformer if gas is produced rapidly in the

transformer oil.

 A Solid State Relay (SSR) is a solid state electronic component that

provides a similar function to an electromechanical relay but does not

have any moving components, increasing long-term reliability.


Applications

Relays are used:

 to control a high-voltage circuit with a low-voltage signal, as in some

types of modems,

 to control a high-current circuit with a low-current signal, as in the

starter solenoid of an automobile ,

 to detect and isolate faults on transmission and distribution lines by

opening and closing circuit breakers (protection relays),

 to isolate the controlling circuit from the controlled circuit when the two

are at different potentials, for example when controlling a mains-

powered device from a low-voltage switch. The latter is often applied to

control office lighting as the low voltage wires are easily installed in

partitions, which may be often moved as needs change. They may also

be controlled by room occupancy detectors in an effort to conserve

energy,

 to perform logic functions. For example, the boolean AND function is

realised by connecting relay contacts in series, the OR function by

connecting contacts in parallel. Due to the failure modes of a relay

compared with a semiconductor, they are widely used in safety critical


logic, such as the control panels of radioactive waste handling

machinery.

 as oscillators, also called vibrators. The coil is wired in series with the

normally-closed contacts. When a current is passed through the relay

coil, the relay operates and opens the contacts that carry the supply

current. This stops the current and causes the contacts to close again.

The cycle repeats continuously, causing the relay to open and close

rapidly. Vibrators are used to generate pulsed current.

 to generate sound. A vibrator, described above, creates a buzzing sound

because of the rapid oscillation of the armature. This is the basis of the

electric bell , which consists of a vibrator with a hammer attached to the

armature so it can repeatedly strike a bell.

 to perform time delay functions. Relays can be used to act as an

mechanical time delay device by controling the release time by using the

effect of residual magnetism by means of a inserting copper disk

between the armature and moving blade assembly.


Relay application considerations

A large relay with two coils and many sets of contacts, used in an old

telephone switching system.

Selection of an appropriate relay for a particular application requires

evaluation of many different factors:

 Number and type of contacts - normally open, normally closed,

changeover (double-throw)

 Rating of contacts - small relays switch a few amperes, large contactors

are rated for up to 3000 amperes, alternating or direct current

 Voltage rating of contacts - typical control relays rated 300 VAC or 600

VAC, automotive types to 50 VDC, special high-voltage relays to about

15,000 V

 Coil voltage - machine-tool relays usually 24 VAC or 120 VAC, relays

for switchgear may have 125 V or 250 VDC coils, "sensitive" relays

operate on a few milliamperes


 Package/enclosure - open, touch-safe, double-voltage for isolation

between circuits, explosion proof, outdoor, oil-splashresistant

 Mounting - sockets, rail mount, panel mount, through-panel mount,

enclosure for mounting on walls or equipment

 Switching time - where high speed is required

 "Dry" contacts - when switching very low level signals, special contact

materials may be needed such as gold-plated contacts

 Contact protection - suppress arcing in very inductive circuits

 Coil protection - suppress the surge voltage produced when switching

the coil current.

 Isolation between coil circuit and contacts

 Aerospace or radiation-resistant testing, special quality assurance

 Accessories such as timers, auxiliary contacts, pilot lamps, test buttons

 Regulatory approvals

 Stray magnetic linkage between coils of adjacent relays on a printed

circuit board.

Protection relay
A protection relay is a complex electromechanical apparatus, often with more

than one coil, designed to calculate operating conditions on an electrical circuit

and trip circuit breakers when a fault was found. Unlike switching type relays

with fixed and usually ill-defined operating voltage thresholds and operating

times, protection relays had well-established, selectable, time/current (or other

operating parameter) curves. Such relays were very elaborate, using arrays of

induction disks, shaded-pole magnets, operating and restraint coils, solenoid-

type operators, telephone-relay style contacts, and phase-shifting networks to

allow the relay to respond to such conditions as over-current, over-voltage,

reverse power flow, over- and under- frequency, and even distance relays that

would trip for faults up to a certain distance away from a substation but not

beyond that point. An important transmission line or generator unit would have

had cubicles dedicated to protection, with a score of individual

electromechanical devices.

Design and theory of these protective devices is an important part of the

education of a electrical engineer who specializes in power systems. Today

these devices are nearly entirely replaced (in new designs) with

microprocessor-based instruments (numerical relays) that emulate their

electromechanical ancestors with great precision and convenience in

application. By combining several functions in one case, numerical relays also


save capital cost and maintenance cost over electromechanical relays.

However, due to their very long life span, tens of thousands of these "silent

sentinels" are still protecting transmission lines and electrical apparatus all

over the world.

Reed relay and reed switches

ULN2003 is a high voltage and high current Darlington array IC. It contains seven

open collector darlington pairs with common emitters. A darlington pair is an

arrangement of two bipolar transistors.

ULN2003 belongs to the family of ULN200X series of ICs. Different versions of

this family interface to different logic families. ULN2003 is for 5V TTL, CMOS

logic devices. These ICs are used when driving a wide range of loads and are used

as relay drivers, display drivers, line drivers etc. ULN2003 is also commonly used

while driving Stepper Motors. Refer Stepper Motor interfacing using ULN2003.
Each channel or darlington pair in ULN2003 is rated at 500mA and can withstand

peak current of 600mA. The inputs and outputs are provided opposite to each other

in the pin layout. Each driver also contains a suppression diode to dissipate voltage

spikes while driving inductive loads. The schematic for each driver is given below:
Pin Description:

Pin
Function Name
No

1 Input for 1st channel Input 1

2 Input for 2nd channel Input 2

3 Input for 3rd channel Input 3

4 Input for 4th channel Input 4

5 Input for 5th channel Input 5

6 Input for 6th channel Input 6

7 Input for 7th channel Input 7

8 Ground (0V) Ground

9 Common free wheeling diodes Common

10 Output for 7th channel Output 7

11 Output for 6th channel Output 6

12 Output for 5th channel Output 5

13 Output for 4th channel Output 4


14 Output for 3rd channel Output 3

15 Output for 2nd channel Output 2

16 Output for 1st channel Output 1

HIGH VOLTAGE AND HIGH CURRENT DARLINGTON TRANSISTOR

ARRAY

DESCRIPTION

The ULN2003 is a monolithic high voltage and high current Darlington transistor

arrays. It consists of seven NPN darlington pairs that features high-voltage outputs

with common-cathode clamp diode for switching inductive loads. The collector-

current rating of a single darlington pair is 500mA. The darlington pairs may be

parrlleled for higher current capability. Applications include relay drivers, hammer

drivers, lamp drivers, display drivers(LED gas discharge),line drivers, and logic

buffers. The ULN2003 has a 2.7kW series base resistor for each darlington pair for

operation directly with TTL or 5V CMOS devices.

FEATURES
* 500mA rated collector current(Single output)

* High-voltage outputs: 50V

* Inputs compatibale with various types of logic.

* Relay driver application


ANDROID

Android is an operating system based on the Linux kernel,[12] and designed

primarily for touchscreen mobile devices such as smartphones and tablet

computers. Initially developed by Android, Inc., which Google backed financially

and later bought in 2005,[13] Android was unveiled in 2007 along with the founding

of the Open Handset Alliance—a consortium of hardware, software, and

telecommunication companies devoted to advancing open standards for mobile

devices.[14] The first publicly available smartphone running Android, the HTC

Dream, was released on October 22, 2008.[15]

The user interface of Android is based on direct manipulation, using touch inputs

that loosely correspond to real-world actions, like swiping, tapping, pinching and

reverse pinching to manipulate on-screen objects. Internal hardware such

as accelerometers, gyroscopes and proximity sensors are used by some applications

to respond to additional user actions, for example adjusting the screen from portrait

to landscape depending on how the device is oriented. Android allows users to

customize their home screens with shortcuts to applications and widgets, which

allow users to display live content, such as emails and weather information,
directly on the home screen. Applications can further send notifications to the user

to inform them of relevant information, such as new emails and text messages.

Android's source code is released by Google under the Apache License;[12] this

permissive licensing allows the software to be freely modified and distributed by

device manufacturers, wireless carriers and enthusiast developers. Most Android

devices ship with a combination of open source and proprietary software.[3] As of

July 2013, Android has the largest number of applications ("apps"), available for

download in Google Play store which has had over 1 million apps published, and

over 50 billion downloads.[16] A developer survey conducted in April–May 2013

found that Android is the most used platform among developers: it is used by 71%

of the mobile developers population.[17]

Android is popular with technology companies which require a ready-made, low-

cost and customizable operating system for high-tech devices.[18]Despite being

primarily designed for phones and tablets, it also has been used in

televisions, games consoles, digital cameras and other electronics. Android's open

nature has encouraged a large community of developers and enthusiasts to use the

open-source code as a foundation for community-driven projects, which add new

features for advanced users[19] or bring Android to devices which were officially

released running other operating systems.


As of May 2012, Android became the most popular mobile OS, having the largest

installed base, and is a market leader in most countries[20] including the United

States; there it has had the highest installed base of mobile phones for years. [21] In

the third quarter of 2013, Android's share of the global smartphone shipment

market—led by Samsung products—was 81.3%, the highest ever.[22][23][24] In most

markets Android-powered phones are the most popular comprising more than half

of the overall smartphone sales, including the United States market starting with

the September–November 2013 period.[25] The operating system's success has made

it a target for patent litigation as part of the so-called "smartphone wars" between

technology companies.[26][27] As of September 2013, one billion Android devices

have been activated.[28]

Contents

[hide]

History

See also: Android version history

Android, Inc. was founded in Palo Alto, California in October 2003 by Andy

Rubin (co-founder of Danger),[29] Rich Miner (co-founder of Wildfire

Communications, Inc.),[30] Nick Sears[31] (once VP at T-Mobile), and Chris White

(headed design and interface development at WebTV)[13] to develop, in Rubin's


words "smarter mobile devices that are more aware of its owner's location and

preferences".[13] The early intentions of the company were to develop an advanced

operating system for digital cameras, when it was realised that the market for the

devices was not large enough, and diverted their efforts to producing a smartphone

operating system to rival those of Symbian and Windows Mobile.[32] Despite the

past accomplishments of the founders and early employees, Android Inc. operated

secretly, revealing only that it was working on software for mobile phones.[13] That

same year, Rubin ran out of money. Steve Perlman, a close friend of Rubin,

brought him $10,000 in cash in an envelope and refused a stake in the company.[33]

Google acquired Android Inc. on August 17, 2005; key employees of Android Inc.,

including Rubin, Miner and White, stayed at the company after the acquisition.
[13]
Not much was known about Android Inc. at the time, but many assumed that

Google was planning to enter the mobile phone market with this move.[13] At

Google, the team led by Rubin developed a mobile device platform powered by

the Linux kernel. Google marketed the platform to handset makers and carriers on

the promise of providing a flexible, upgradable system. Google had lined up a

series of hardware component and software partners and signaled to carriers that it

was open to various degrees of cooperation on their part.[34][35][36]

Speculation about Google's intention to enter the mobile communications market

continued to build through December 2006.[37] The unveiling of the iPhone,


a touchscreen-based phone by Apple, on January 9, 2007 had a disruptive effect on

the development of Android. At the time, a prototype device codenamed "Sooner"

had a closer resemblance to a BlackBerry phone, with no touchscreen, and a

physical, QWERTY keyboard. Work immediately began on re-engineering the OS

and its prototypes to combine traits of their own designs with an overall experience

designed to compete with the iPhone.[38][39] In September

2007, InformationWeek covered an Evalueserve study reporting that Google had

filed several patent applications in the area of mobile telephony. [40][41]

Eric Schmidt, Andy Rubin and Hugo Barra at a press conference for the Google's

Nexus 7 tablet.

On November 5, 2007, the Open Handset Alliance, a consortium of technology

companies including Google, device manufacturers such

as HTC,Sony and Samsung, wireless carriers such as Sprint Nextel and T-Mobile,

and chipset makers such as Qualcomm and Texas Instruments, unveiled itself, with

a goal to develop open standards for mobile devices.[14] That day, Android was
unveiled as its first product, a mobile deviceplatform built on the Linux

kernel version 2.6.[14] The first commercially available smartphone running

Android was the HTC Dream, released on October 22, 2008.[15]

In 2010, Google launched its Nexus series of devices – a line of smartphones and

tablets running the Android operating system, and built by a manufacturing

partner. HTC collaborated with Google to release the first Nexus smartphone,
[42]
the Nexus One. The series has since been updated with newer devices, such as

the Nexus 5 phone and Nexus 7 tablet, made by LG and Asus respectively. Google

releases the Nexus phones and tablets to act as their flagship Android devices,

demonstrating Android's latest software and hardware features. On March 13,

2013, it was announced by Larry Page in a blog post that Andy Rubin had moved

from the Android division to take on new projects at Google.[43] He was replaced

by Sundar Pichai, who also continues his role as the head of Google's Chrome

division,[44] which develops Chrome OS.

Since 2008, Android has seen numerous updates which have incrementally

improved the operating system, adding new features and fixing bugs in previous

releases. Each major release is named in alphabetical order after a dessert or sugary

treat; for example, version 1.5 Cupcake was followed by 1.6 Donut. The latest

released version is 4.4.2 KitKat, which was released on December 9, 2013.[5][45][46]


Features

See also: List of features in Android

Interface

Notifications are accessed by sliding from the top of the display; individual

notifications can be dismissed by sliding them away, and may contain additional

functions (such as on the "missed call" notification seen here).

Android's user interface is based on direct manipulation,[47] using touch inputs that

loosely correspond to real-world actions, like swiping, tapping, pinching and

reverse pinching to manipulate on-screen objects.[47] The response to user input is


designed to be immediate and provides a fluid touch interface, often using the

vibration capabilities of the device to provide haptic feedback to the user. Internal

hardware such as accelerometers,gyroscopes and proximity sensors[48] are used by

some applications to respond to additional user actions, for example adjusting the

screen from portrait to landscape depending on how the device is oriented, or

allowing the user to steer a vehicle in a racing game by rotating the device,

simulating control of a steering wheel.[49]

Android devices boot to the homescreen, the primary navigation and information

point on the device, which is similar to the desktop found on PCs. Android

homescreens are typically made up of app icons and widgets; app icons launch the

associated app, whereas widgets display live, auto-updating content such as the

weather forecast, the user's email inbox, or a news ticker directly on the

homescreen.[50] A homescreen may be made up of several pages that the user can

swipe back and forth between, though Android's homescreen interface is heavily

customisable, allowing the user to adjust the look and feel of the device to their

tastes.[51] Third-party apps available on Google Play and other app stores can

extensively re-theme the homescreen, and even mimic the look of other operating

systems, such as Windows Phone.[52] Most manufacturers, and some wireless

carriers, customise the look and feel of their Android devices to differentiate

themselves from their competitors.[53]


Present along the top of the screen is a status bar, showing information about the

device and its connectivity. This status bar can be "pulled" down to reveal a

notification screen where apps display important information or updates, such as a

newly received email or SMS text, in a way that does not immediately interrupt or

inconvenience the user.[54] Notifications are persistent until read (by tapping, which

opens the relevant app) or dismissed by sliding it off the screen. Beginning on

Android 4.1, "expanded notifications" can display expanded details or additional

functionality; for instance, a music player can display playback controls, and a

"missed call" notification provides buttons for calling back or sending the caller an

SMS message.[55]

Android provides the ability to run applications which change the default launcher

and hence the appearance and externally visible behaviour of Android. These

appearance changes include a multi-page dock or no dock, and many more changes

to fundamental features of the user interface.[56]

Applications

See also: Android software development and Google Play

Android has a growing selection of third party applications, which can be acquired

by users either through an app store such as Google Play or theAmazon Appstore,

or by downloading and installing the application's APK file from a third-party site.
[57]
The Play Store application allows users to browse, download and update apps

published by Google and third-party developers, and is pre-installed on devices

that comply with Google's compatibility requirements.[58] The app filters the list of

available applications to those that are compatible with the user's device, and

developers may restrict their applications to particular carriers or countries for

business reasons.[59] Purchases of unwanted applications can be refunded within 15

minutes of the time of download,[60] and some carriers offer direct carrier billing for

Google Play application purchases, where the cost of the application is added to

the user's monthly bill.[61]

As of July 2013, there are more than one million applications available for Android

in the Play Store.[62] As of May 2013, 48 billion apps have been installed from the

Google Play store.[63]

Applications ("apps"), that extend the functionality of devices, are developed

primarily in the Java programming language[64] language using the Android

software development kit (SDK). The SDK includes a comprehensive set of

development tools,[65] including a debugger, software libraries, a

handset emulator based on QEMU, documentation, sample code, and tutorials. The

officially supported integrated development environment (IDE) is Eclipse using the

Android Development Tools (ADT) plugin. Other development tools are available,

including a Native Development Kit for applications or extensions in C or C+


+, Google App Inventor, a visual environment for novice programmers, and

various cross platform mobile web applications frameworks.

It was announced in January 2014 that Chrome HTML5 web applications should

become available, using a compatibility layer from the open source Apache

Cordova framework to allow such applications to be wrapped in a native

application shell, enabling their distribution over Google Play.[66]

In order to work around limitations on reaching Google services due to Internet

censorship in the People's Republic of China, Android devices sold in the PRC are

generally customized to use state approved services instead.[67]

Memory management

Since Android devices are usually battery-powered, Android is designed to manage

memory (RAM) to keep power consumption at a minimum, in contrast to desktop

operating systems which generally assume they are connected to unlimited mains

electricity. When an Android app is no longer in use, the system will automatically

suspend it in memory – while the app is still technically "open", suspended apps

consume no resources (e.g. battery power or processing power) and sit idly in the

background until needed again. This has the dual benefit of increasing the general

responsiveness of Android devices, since apps don't need to be closed and


reopened from scratch each time, but also ensuring background apps do not

consume power needlessly.[68][69]

Android manages the apps stored in memory automatically: when memory is low,

the system will begin killing apps and processes that have been inactive for a

while, in reverse order since they were last used (i.e. oldest first). This process is

designed to be invisible to the user, such that users do not need to manage memory

or the killing of apps themselves.[70][71] However, confusion over Android memory

management has resulted in third-party task killers becoming popular on

the Google Play store; these third-party task killers are generally regarded as doing

more harm than good.[72]

Hardware

See also: Android hardware requirements

The main hardware platform for Android is the 32-bit ARMv7 architecture.

The Android-x86 project provides support for the x86 architecture,[7] and Google

TV uses a special x86 version of Android. In 2012, Intel processors began to

appear on more mainstream Android platforms, such as phones.[73] In

2013, Freescale announced support for Android on its i.MX processor, specifically

the i.MX5X and i.MX6X series.[74]


As of November 2013, current versions of Android recommend at least 512 MB of

RAM[75] (with 340 MB as a requirement[76]), and require a 32-

bit ARMv7, MIPS or x86 architecture processor (latter two through unofficial

ports),[7][77] together with an OpenGL ES 2.0 compatible graphics processing

unit (GPU).[78] Android supports OpenGL ES 1.1, 2.0 and 3.0. Some applications

explicitly require certain version of the OpenGL ES, thus suitable GPU hardware is

required to run such applications.[78]

Android devices incorporate many optional hardware components, including still

or video cameras, GPS, hardware orientation sensors, dedicated gaming

controls, accelerometers, gyroscopes, barometers, magnetometers, proximity

sensors, pressure sensors, thermometers and touchscreens. Some hardware

components are not required, but became standard in certain classes of devices,

such as smartphones, and additional requirements apply if they are present. Some

other hardware was initially required, but those requirements have been relaxed or

eliminated altogether. For example, as Android was developed initially as a phone

OS, hardware such as microphones were required, while over time the phone

function became optional.[59] Android used to require an autofocus camera, which

was relaxed to a fixed-focus camera[59] if it is even present at all, since the camera

was dropped as a requirement entirely when Android started to be used onset-top

boxes.
Development

Android green figure, next to its original packaging.

Android is developed in private by Google until the latest changes and updates are

ready to be released, at which point the source code is made available publicly.
[79]
This source code will only run without modification on select devices, usually

the Nexus series of devices. The source code is, in turn, adapted by OEMs to run

on their hardware.[80] Android's source code does not contain the often

proprietary device drivers that are needed for certain hardware components.[81]

The green Android logo was designed for Google in 2007 by graphic designer Irina

Blok. The design team was tasked with a project to create a universally identifiable

icon with the specific inclusion of a robot in the final design. After numerous

design developments based on science-fiction and space movies, the team

eventually sought inspiration from the human symbol on restroom doors and

modified the figure into a robot shape. As Android is open-sourced, it was agreed
that the logo should be likewise, and since its launch the green logo has been

reinterpreted into countless variations on the original design.[82]

MPLAB IDE

MPLAB Integrated Development Environment (IDE) is a free, integrated toolset


for the development of embedded applications employing Microchip's PIC® and
dsPIC® microcontrollers. MPLAB IDE runs as a 32-bit application on MS Windows®,
is easy to use and includes a host of free software components for fast application
development and super-charged debugging. MPLAB IDE also serves as a single,
unified graphical user interface for additional Microchip and third party software
and hardware development tools. Moving between tools is a snap, and upgrading
from the free software simulator to hardware debug and programming tools is
done in a flash because MPLAB IDE has the same user interface for all tools.
MPLAB IDE features include:

FLEXIBLE CUSTOMIZABLE PROGRAMMER'S TEXT EDITOR:

Fully integrated debugging with right mouse click menus for breakpoints, trace
and editor functions
Tabbed editor option or separate source windows
Recordable macros
Context sensitive color highlighting for assembly, C and BASIC code readability
Mouse over variable to instantly evaluate the contents of variables and registers
Set breakpoints and trace points directly in editor to instantly make changes and
evaluate their effects
Graphical project manager
Version control support for MS Source Safe, CVS, PVCS, Subversion

FREE COMPONENTS:

Programmer’s text editor


MPLAB SIM, high speed software simulator for PIC and dsPIC devices with
peripheral simulation, complex stimulus injection and register logging
Full featured debugger
MPASM™ and MPLINK for PIC MCUs and dsPIC DSC devices
HI-TECH C PRO for PIC10/12/16 MCU Families running in lite mode
CCS PCB C Compiler
Labcenter Electronic’s Proteus VSM spice simulator
Many Powerful Plug-Ins including
○ AN851 Bootloader programmer
○ AN901 BLDC Motor Control Interface
○ AN908 ACIM Tuning Interface
○ KeeLoq support

SIMPLE, POWERFUL SOURCE LEVEL DEBUGGING:

Auto alignment of breakpoints after source code modification


Mouse-over variable inspection
Drag and drop variables to watch windows
Watch variables, structures and arrays
Mixed source code/disassembly view
Stack symbolic return label display
Automatic single-step "animate" feature
Pass counts and break on PIC18F, PIC24 and dsPIC file register R/W for MPLAB
ICD 2
Step-Out-Of function
Custom hot keys
Powerful simulator stimulus generator
Trace to source correlation to compare real time data collected with original
source code and comments

BUILT IN SUPPORT FOR HARDWARE AND ADD-ON COMPONENTS:

MPLAB C Compilers (free student editions available for download)


MPLAB REAL ICE™ in-circuit emulator
MPLAB ICD 2 and MPLAB ICD 3 in-circuit debuggers and engineering
programmers for selected Flash devices
PICkit 2 and PICkit 3 Debug Express economy debug/programmers
PICSTART Plus development programmer
MPLAB PM3 device programmer
Third Party tools, including HI-TECH, IAR, Byte Craft, B. Knudsen, CCS, Micrium,
microEngineering Labs, Labcenter, MATLAB, Segger
A host of low cost starter boards, demonstration and evaluation kits
CCS COMPILER

The PCB, PCM, and PCH are separate compilers. PCB is for 12-bit opcodes, PCM
is for 14-bit opcodes, and PCH is for 16-bit opcode PIC® microcontrollers. Due to
many similarities, all three compilers are covered in this reference manual.

Features and limitations that apply to only specific microcontrollers are indicated
within. These compilers are specifically designed to meet the unique needs of the
PIC® microcontroller. This allows developers to quickly design applications
software in a more readable, high-level language.

When compared to a more traditional C compiler, PCB, PCM, and PCH have some
limitations. As an example of the limitations, function recursion is not allowed.
This is due to the fact that the PIC® has no stack to push variables onto, and also
because of the way the compilers optimize the code. The compilers can efficiently
implement normal C constructs, input/output operations, and bit twiddling
operations. All normal C data types are supported along with pointers to constant
arrays, fixed point decimal, and arrays of bits.
File Formats

The compiler can output 8-bet hex, 16-bit hex, and binary files. Three listing
formats are available:

1) Standard format resembles the Microchip tools, and may be required by


other Third-Party tools.

2) Simple format is generated by compiler and is easier to read.

3) Symbolic format uses names versus addresses for registers. The debug
files may be output as Microchip .COD file, Advanced Transdata .MAP file,
expanded .COD file for CCS debugging or MPLAB 7.xx .COF file. All file
formats and extensions may be selected via Options File Associations option
in Windows IDE.

.C This is the source file containing user C source code.

.H These are standard or custom header files used to define pins, register,
register bits, functions and preprocessor directives.

.PJT This is the project file which contains information related to the project.

.LST This is the listing file which shows each C source line and the associated
assembly code generated for that line.

.SYM This is the symbol map which shows each register location and what
program variables are stored in each location.
.STA The statistics file shows the RAM, ROM, and STACK usage. It provides
information on the source codes structural and textual complexities using
Halstead and McCabe metrics.

.TRE The tree file shows the call tree. it details each function and what
functions it calls along with the ROM and RAM usage for each function.

.HEX The compiler generates standard HEX files that are compatible with all
programmers.

.COF This is a binary containing machine code and debugging information.

.COD This is a binary file containing debug information.

.RTF The output of the Documentation Generator is exported in a Rich Text


File format which can be viewed using the RTF editor or wordpad.

.RVF The Rich View Format is used by the RTF Editor within the IDE to view the
Rich Text File.

.DGR The .DGR file is the output of the flowchart maker.

.ESYM This file is generated for the IDE users. The file contains Identifiers and
Comment information. This data can be used for automatic
documentation generation and for the IDE helpers.
.OSY This file is generated when the compiler is set to export a relocatable
M object file. This file contains a list of symbols for that object.

PIC KIT 2
The PICkit™ 2 Development Programmer/Debugger is a low-cost development
tool with an easy to use interface for programming and debugging Microchip’s
Flash families of microcontrollers. The full featured Windows ® programming
interface supports baseline (PIC10F, PIC12F5xx, PIC16F5xx), midrange (PIC12F6xx,
PIC16F), PIC18F, PIC24, dsPIC30, dsPIC33, and PIC32 families of 8-bit, 16-bit, and
32-bit microcontrollers, and many Microchip Serial EEPROM products.

With Microchip’s powerful MPLAB Integrated Development Environment (IDE)


the PICkit™ 2 enables in-circuit debugging on most PIC® microcontrollers. In-
Circuit-Debugging runs, halts and single steps the program while the PIC
microcontroller is embedded in the application. When halted at a breakpoint, the
file registers can be examined and modified.

The PICkit 2 — introduced in May 2005 — replaced the PICkit 1. The most
notable difference between the two is that the PICkit 2 has a separate
programmer/debugger unit which plugs into the board carrying the chip to be
programmed, whereas the PICkit 1 was a single unit. This makes it possible to use
the programmer with a custom circuit board via an In Circuit Serial Programming
(ICSP) header. This feature is not intended [3] for so-called "production"
programming, however the PICkit 2 uses an internal PIC18F2550 with FullSpeed
USB. The latest PICkit 2 firmware allows the user to program and debug most of
the 8 and 16 bit PICmicro and dsPIC members of the Microchip product line.

The PICkit 2 is open to the public, including its hardware schematic, firmware
source code (in C language) and application programs (in C# language). End users
and third parties can easily modify both the hardware and software for enhanced
features. e.g. GNU/Linux version of PICKit 2 application software, DOS style
CMD support, etc.The PICkit 2 has a programmer-to-go (PTG) feature, which can
download the hex file and programming instructions into on-board memory (128K
byte I2C EEPROM or 256K byte I2C EEPROM), so that no PC is required at the
end application.

The Microchip version of PICkit 2 has a standard 128K byte memory. 256K byte
memory can be achieved by modifying the hardware or from third
party.Additionally, a 500 kHz three-channel logic analyser and a UART tool are
built into the PICKit 2. These features are missing from the PICkit 3.Since release
of V2.61, PICkit 2 PC software now support maximum 4M bytes of memory for
programmer-to-go feature. This modification makes the PICKit 2 support 8x more
memory than the PICKit 3. This enhancement has been contributed by Au Group
Electronics and the PICkit 2 firmware is also reported to be submitted to Microchip
PICkit 2 team in the middle of March 2009. Hopefully this enhancement will be
integrated into future firmware releases too
Circuit diagram
Circuit explanation
PIC16F877A:

PIC16F877A is a 40 Pin DIP pack IC with 33 I/O pins. Out of which 8 pins can be used either as Digital I/O
pins or Analog Input pins. The micro controller is having 5 ports Port A, Port B, Port C, Port D and Port E.
Here Port A consists of 6Pins and can be used as Analog Pins and Digital Pins, in the same way Port E
consists of 3Pins all of them can either be used as Analog Pins or Digital Pins. The Port pins of Port D are
connected to LCD pins. RD4 to RD7 as data pins and RD0 to RD2 as control pins. The Pins of Port B are
connected to relay drivers, which in turn drives the relays. The Pins 13 and 14 are connected to
Oscillators. This Oscillator provides required clock reference for the PIC micro controller. Either Pins 11
and 12 or 31 and 32 can be used as power supply pins. Pins 25 and 26 of Port C are used for serial Port
communications; these pins are interfaced with MAX232 for PC based communications. Pins 37,38,39
and 40 are used for In-Circuit Debugger Operations, with which the hex code is downloaded to the Chip.
Pin 33 is used as external Interrupt Pin. Pin 1 is used as Reset Pin. This Pin is connected to Vcc through a
resistor.

LCD_PIC:

The LCD we have used in this project is HD1234. This is an alphanumeric type of
LCD with 16 pins. Of which Pins 7 to 14 are used as data pins, through which an
8-bit data can be input to the LCD. These Pins are connected to the Port 0 of Micro
controller. There are 3 control pins RS (Pin-4), RW (Pin-5) and EN (Pin-6). The
RS pin is connected to the 28th Pin of micro controller. The RW pin is usually
grounded. The Enable pin is connected to 27 th Pin. The LCD has two Rows and 16
Columns. The LCD is powered up with 5V supply connected to Pins 1(Gnd) and
2(Vcc). The Pin 3 is connected to Vcc through a Potentiometer. The potentiometer
is used to adjust the contrast level. Here in our project we use the PIC controller in
4-bit mode. Here only 4 data pins are connected and are used as Data Port.

MAX 232:

The MAX232 family of line drivers/receivers is intended for all EIA/TIA-232E and V.28/V.24
communications interfaces, particularly applications where ±12V is not available. The Max-232
can simultaneously be interfaced with two channels. This is a 16-pin DIP pack IC. Here five
10uF capacitors are connected to the IC for level conversions. The Pin 10 from the micro
controller is connected to pin 25 of the Max-232. The Pin 14 of Max-232 is connected to Pin 26
of the micro controller. Pins 25 and 26 are connected to the PC’s Serial Port. The connection
between the micro controller and the PC is a Null Modem configuration. (Only Tx, Rx and
Ground pins are interfaced).

POWER SUPPLY:
When AC is applied to the primary winding of the power transformer it can either be stepped
down or up depending on the value of DC needed. In our circuit the transformer of 230v/15-0-
15v is used to perform the step down operation where a 230V AC appears as 15V AC across the
secondary winding. In the power supply unit, rectification is normally achieved using a solid-
state diode. Diode has the property that will let the electron flow easily in one direction at proper
biasing condition. As AC is applied to the diode, electrons only flow when the anode and
cathode is negative. Reversing the polarity of voltage will not permit electron flow.A commonly
used circuit for supplying large amounts of DC power is the bridge rectifier. A bridge rectifier of
four diodes (4*IN4007) is used to achieve full wave rectification. Two diodes will conduct
during the negative cycle and the other two will conduct during the positive half cycle. The DC
voltage appearing across the output terminals of the bridge rectifier will be somewhat less than
90% of the applied RMS value. Filter circuits, which is usually capacitor acting as a surge
arrester always follow the rectifier unit. This capacitor is also called as a decoupling capacitor or
a bypassing capacitor, is used not only to ‘short’ the ripple with frequency of 120Hz to ground
but also to leave the frequency of the DC to appear at the output. The voltage regulators play an
important role in any power supply unit. The primary purpose of a regulator is to aid the rectifier
and filter circuit in providing a constant DC voltage to the device. Power supplies without
regulators have an inherent problem of changing DC voltage values due to variations in the load
or due to fluctuations in the AC liner voltage. With a regulator connected to the DC output, the
voltage can be maintained within a close tolerant region of the desired output. IC7812 and 7805
are used in this project for providing +12v and +5v DC supply.
Conclusion:

The project “project title” has been completed successfully and the output
results are verified. The results are in line with the expected output. The project
has been checked with both software and hardware testing tools. In this work
“I/O devices” are chosen are proved to be more appropriate for the intended
application. The project is having enough avenues for future enhancement. The
project is a prototype model that fulfills all the logical requirements. The project
with minimal improvements can be directly applicable for real time applications.
Thus the project contributes a significant step forward in the field of “Project
Domain”, and further paves a road path towards faster development s in the
same field. The project is further adaptive towards continuous performance and
peripheral up gradations. This work can be applied to variety of industrial and
commercial applications.

You might also like