rtc based power schedular

57
A PROJECT REPORT ON RTC BASED POWER SCHEDULAR Submitted in partial fulfillment of the requirements For the award of the degree B.TECH In ECE SUBMITTED BY -------------------- (--------------) --------------------- (---------------) --------------------- (---------------) DEPARTMENT OF Mechanical Engg. AFFILIATED TO ___JNTU, Hyderabad________ UNIVERSITY 1

Upload: praveenkodgirwar

Post on 07-Sep-2015

227 views

Category:

Documents


0 download

DESCRIPTION

Real Time Clock based Electrical Load Schedular

TRANSCRIPT

Title of the project

A PROJECT REPORT ON

RTC BASED POWER SCHEDULAR

Submitted in partial fulfillment of the requirements

For the award of the degree

B.TECH

In

ECE

SUBMITTED BY

-------------------- (--------------)

--------------------- (---------------)

--------------------- (---------------)

DEPARTMENT OF Mechanical Engg. AFFILIATED TO ___JNTU, Hyderabad________ UNIVERSITY

CERTIFICATE

This is to certify that the dissertation work entitled RTC BASED POWER SCHEDULAR is the work done by ___________________________________________submitted in partial fulfillment for the award of B.Tech in ECE from______________ College affiliated to _________ University, Hyderabad .

________________ ____________

(Head of the Department, ECE) (Assistant Professor)

EXTERNAL EXAMINER

ACKNOWLEDGEMENT

The satisfaction that accompany the successful completion of any task would be incomplete without mentioning of the people whose constant guidance and encouragement made it possible. We take pleasure in presenting before you, our project, which is result of studied blend of both research and knowledge.

We express our earnest gratitude to our internal guide, Assistant Professor ______________, Department of Electronics & Communication Engg, our project guide, for his constant support, encouragement and guidance. We are grateful for his cooperation and his valuable suggestions.

Finally, we express our gratitude to all other members who are involved either directly or indirectly for the completion of this project.

DECLARATION

We, the undersigned, declare that the project entitled RTC BASED POWER SCHEDULAR , being submitted in partial fulfillment for the award of B.Tech Degree in Electronics & Communication Engg. affiliated to _________ University, is the work carried out by us.

INDEX

Contents Page No.

Abstract

Introduction to Embedded systems

Microcontroller AT89S52.

Hardware Description.

Coding..

Software Description

Conclusion

References.

RTC BASED POWER SCHEDULAR

This project is used for automatic water pump control system using RTC(Real Time Clock). The user can once program the timings according to his requirements and these timings will be stored in the memory of the controller. The microcontroller performs all the operations to store the data in memory.

This system switches on the loads only at preprogrammed timings. As the DS1307 Real Time Clock chip is used, there will be no interruptions for the programmed on/off timings even in power failures if the back up battery is used.

The required time scheduling is programmed in the chip. The 16X2 LCD display is provided to display current time and status of the circuit. DS1307 is interfaced to the microcontroller for real timing performance. The user may even change the preprogrammed timings and set the timings according to his requirements.

SOFTWARE:

1. Keil COMPILER

2. EMBEDDED C CODE

3. ucFlash

HARDWARE:

1. Microcontroller AT89S52.

2. RTC DS1307

3. 16*2 LCD DISPLAY

4. MOC3021 OPTO-COUPLER

5. BT136 TRIAC

6. AC Load ( Bulb)

7. Switchpad

Block Diagram

EMBEDDED SYSEMS

Embedded systems have grown tremendously in recent years, not only in their popularity but also in their complexity. Gadgets are increasingly becoming intelligent and autonomous. Refrigerators, air-conditioners, automobiles, mobile phones etc are some of the common examples of devices with built in intelligence. These devices function based on operating and environmental parameters.

The intelligence of smart devices resides in embedded systems. An embedded system, in general, in co-operates hardware, operating systems, low-level software binding the operating system and peripheral devices, and communication software to enable the device to perform the pre-defined functions. An embedded system performs a single, well-defined task, is tightly constrained, is reactive and computes results in real time.

Let us take a detailed look at these features of embedded systems:

Single functioned: An embedded system executes a specific program repeatedly. For example, a pager is always a pager. In contrast a desktop system executes a variety of programs like spreadsheets, word processors, etc. However there are exceptions where in an embedded systems program is updated with newer program versions. Cell phones are examples of being updated in such a manner.

Tightly constrained: All computing systems have constraints on design metrics but those on embedded systems can be especially tight. A design metric is a measure of an implementations features, such as cost, size performance and power.

Reactive and real time: Many embedded systems must continually react to changes in the systems environment and must compute certain results in real time without delay.

Embedded Hardware

All embedded systems need a microprocessor, and the kinds of microprocessors used in them are quite varied. A list of some of the common microprocessor families is the ZILOG Z8 family, Intel 805/80188/x 86 families, Motorola 68k family and the PowerPC family.

Embedded Software

The software for the embedded systems is called firmware. The firmware will be written in assembly languages for time or resource critical operations or using higher-level languages like C or embedded C. The software will be simulated using micro code simulators for the target processor. Since they are supposed to perform only specific tasks these programs are stored in Read Only Memories (ROMs).

Application areas for embedded systems

Embedded software is present in almost every electronic device you use today. There is embedded software inside your watch, cellular phone, automobile, thermostats, Industrial control equipment and scientific and medical equipment. Defence services use embedded software to guide missiles and detect aircrafts. Communication satellites, medical instruments and deep space probes would have been nearly impossible without these systems. Embedded systems cover such as broad range of products that generalization is difficult.

Here are some broad categories.

Aerospace and Defense Electronics (ADE)

Consumer/Internet applications

Data Communications

Digital imaging

Medical electronic Mobile data infrastructures

Block diagram of Embedded System:

Figure 1.1: Embedded System Block Diagram

Software deals with the languages like ALP, C, and VB etc., and Hardware deals with Processors, Peripherals, and Memory.

Memory: It is used to store data or address.Peripherals: These are the external devices connectedProcessor: It is an IC which is used to perform some task Processors are classified into four types like: 1. Micro Processor (p) 2. Micro controller (c) 3. Digital Signal Processor (DSP) 4. Application Specific Integrated Circuits (ASIC)MICROCONTROLLER

Basically, a microcontroller is a device which integrates a number of the components of a microprocessor system onto a single microchip. So a microcontroller combines onto the same microchip. The following components:

CPU Core

Memory (Both RAM and ROM)

Some Parallel Digital I/Os

The microprocessor is the integration of a number of useful functions into a single IC package. Has the ability to execute a stored set of instructions to carry out user defined tasks; also has ability to access external memory chips to both read and write data from and to the memory.

Essentially, a microcontroller is obtained by integrating the key components of microprocessor, RAM, ROM, and Digital I/O onto the same chip die. Modern microcontrollers also contain a wealth of other modules such as Serial I/O, Timers, and Analogue to Digital Converters. There are a large number of specialized devices with additional modules for specific needs. E.g. CAN controllers.

MICROCONTOLLER (AT89S52)

FEATURES

Compatible with MCS-51 Products

8K Bytes of In-System Programmable (ISP) Flash Memory

4.0V to 5.5V Operating Range

Fully Static Operation: 0 Hz to 33 MHz

256Bytes Internal RAM

32 Programmable I/O Lines

3 16-bit Timer/Counters

Full Duplex UART Serial Channel

Description of microcontroller AT 89s52:

The AT89S52 is a low-power, high-performance CMOS 8-bit micro controller with 8Kbytes of in-system programmable Flash memory. The device is manufactured.

Using Atmels high-density non-volatile memory technology and is compatible with the industry-standard 80C51 micro controller. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable flash one monolithic chip; the Atmel AT89S52 is a powerful micro controller, which provides a highly flexible and cost- effective solution to many embedded control applications.

The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for perationdown to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM timer/counters, serial port, and interrupt system to continue functioning. The Power-down mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.

Pin Description of microcontroller AT89s52

VCC

Supply voltage.

GND

Ground.

Port 0

Port 0 is an 8-bit open drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1sare written to port 0 pins, the pins can be used as high impedance inputs. Port 0 can also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during program verification. External pull-ups are required during program verification.

Port 1

Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 Output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the low-order address

bytes during Flash programming .

Port 2

Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals during Flash programming and verification.

Port 3

Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89S52, as shown in the following table.

Port 3 also receives some control signals for Flash programming and verification.

RST

Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device.

ALE/PROG

Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. with the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the micro controller is in external execution mode.

PSEN

Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.

EA/VPP

External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. A should be strapped to VCC for internal program executions. This pin also receives the 12-voltProgramming enables voltage (VPP) during Flash programming.

XTAL1

Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2

Output from the inverting oscillator amplifier.

Oscillator Characteristics

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz crystal or ceramic resonator may be used. To drive the device from an External clock source, XTAL2 should be left unconnected while XTAL1 is driven, as shown in Figure 2.

HARDWARE DESCRIPTION

POWER SUPPLY

The power supply unit is used to provide a constant 5V of DC supply from a 230V of AC supply. These 5V DC will acts as power to different standard circuits. It mainly consists of follwing blocks.

Block Diagram Of Power Supply

BRIDGE WAVE RECTIFIER

A rectifier is an electrical device that converts alternating current (AC) to direct current (DC), a process known as rectification. The term rectifier describes a diode that is being used to convert AC to DC.

A bridge-wave rectifier converts the whole of the input waveform to one of constant polarity (positive or negative) at its output. Bridge-wave rectifier converts both polarities of the input waveform to DC (direct current), and is more efficient. However, in a circuit with a center tapped transformer (9-0-9) is used.

Bridge Wave Rectifier

For single-phase AC, if the transformer is center-tapped, then two diodes back-to-back(i.e. anodes-to-anode or cathode-to-cathode) can form a full-wave rectifier. Many windings are required on the transformer secondary to obtain the same output voltage.

In this only two diodes are activated at a time i.e. D1 and D3 activate for positive cycle and D2 and D4 activates for negative half cycle. D2 and D4 convert negative cycle to positive cycle as it as negative supply and negative cycle as positive cycle at its output.

VOLTAGE REGULATOR

This is most common voltage regulator that is still used in embedded designs. LM7805 voltage regulator is a linear regulator. With proper heat sink these LM78xx types can handle even more than 1A current. They also have Thermal overload protection, Short circuit protection.

This will connect at the output of rectifier to get constant Dc supply instead of ripple voltages. It mainly consists of 3 pins:

1. Input voltage

2. Ground

3. Output voltage

For some devices we require 12V/9V/4V Dc supply at that time we go for 7812/7809/7804 regulator instead of 7805 regulator. It also have same feature and pins has 7805 regulator except output is of 12V/9V/4V instead of 5V.

The general circuit diagram for total power supply to any embedded device is as shown below.

LIQUID CRYSTAL DISPLAY

A liquid crystal display (LCD) is a thin, flat display device made up of any number of color or monochrome pixels arrayed in front of a light source or reflector. Each pixel consists of a column of liquid crystal molecules suspended between two transparent electrodes, and two polarizing filters, the axes of polarity of which are perpendicular to each other. Without the liquid crystals between them, light passing through one would be blocked by the other. The liquid crystal twists the polarization of light entering one filter to allow it to pass through the other.

For an 8-bit data bus, the display requires a +5V supply plus 11 I/O lines. For a 4-bit data bus it only requires the supply lines plus seven extra lines. When the LCD display is not enabled, data lines are tri-state and they do not interfere with the operation of the microcontroller.

Data can be placed at any location on the LCD. For 162 LCD, the address locations

are:

First line 80 81 82 83 84 85 86 through 8F

Second line C0 C1 C2 C3 C4 C5 C6 through CF

Address locations for a 2x16 line LCD

SIGNALS TO THE LCD

The LCD also requires 3 control lines from the microcontroller:

1) Enable (E)

This line allows access to the display through R/W and RS lines. When this line is low, the LCD is disabled and ignores signals from R/W and RS. When (E) line is high, the LCD checks the state of the two control lines and responds accordingly.

2) Read/Write (R/W)

This line determines the direction of data between the LCD and microcontroller.

When it is low, data is written to the LCD. When it is high, data is read from LCD.

3) Register select (RS)

With the help of this line, the LCD interprets the type of data on data lines. When it is low, an instruction is being written to the LCD. When it is high, a character is being written to LCD.

Logic status on control lines:

E - 0 Access to LCD disabled

- 1 Access to LCD enabled

R/W - 0 Writing data to LCD

- 1 Reading data from LCD

RS - 0 Instruction

- 1 Character

Writing and reading the data from the LCD:

Writing data to the LCD is done in several steps:

1) Set R/W bit to low

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

4) Set E line to high

5) Set E line to low

Read data from data lines (if it is reading):

1) Set R/W bit to high

2) Set RS bit to logic 0 or 1 (instruction or character)

3) Set data to data lines (if it is writing)

4) Set E line to high

5) Set E line to low

PIN DESCRIPTION

Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins

(two pins are extra in both for back-light LED connections).

Basic LCD Interfacing Circuit

Pin Configuration:

Pin Configuration of 16X2 Lcd

Real Time Clock (RTC) DS1307:

The Real Time Clock or RTC is a time keeping, 8 PIN device which counts all time and date accurately and even in the absence of the main power supply.

Many time related projects can be done by this real time clock, like alarm clock, random number generator, timer or stop watch etc.

A crystal of frequency32 .76 8K Hz is connected between X1 and X2 pins .A 3V lithium battery is connected to the Vbat pin which powers the IC when main power is unavailable.

Features:

1. Real-time clock (RTC) counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap-year

2. 56-byte, battery-backed, nonvolatile (NV) RAM for data storage

3. Two-wire serial interface

4. Programmable square wave output signal

5. Automatic power-fail detect and switch circuitry

6. Consumes less than 500nA in battery backup mode with oscillator running

7. Optional industrial temperature range:-40C to +85C

8. Available in 8-pin DIP or SOIC

Pin Configuration:

VCC - Primary Power Supply

X1 X 2 - 32.768 kHz Crystal Connection

VBAT - +3V Battery Input

GND - Ground

SDA - Serial Data

SC - Serial Clock

SQW/OUT - Square Wave/Output Driver

Interfacing Microcontroller and DS1307:

Operation of RTC:

The DS1307 operates as a slave device on the serial bus. Access is obtained by implementing a START condition and providing a device identification code followed by a register address. Subsequent registers can be accessed sequentially until a STOP condition is executed.

When VCC falls below 1.25 x VBAT the device terminates an access in progress and resets the device address counter. Inputs to the device will not be recognized at this time to prevent erroneous data from being written to the device from an out of tolerance system. When VCC falls below VBAT the device switches into a low- current battery backup mode. Upon power-up, the device switches from battery to VCC when VCC is greater than VBAT + 0.2V and recognizes inputs when VCC is greater than 1.25 x VBAT. The block diagram in Figure 1 shows the main elements of the serial RTC.

Pin Description:

Vcc, GND:

DC power is provided to the device on these pins. VCC is the +5V input. When 5V is applied within normal limits, the device is fully accessible and data can be written and read. When a 3V battery is connected to the device and VCC is below 1.25 x VBAT, reads and writes are inhibited. However, the timekeeping function continues unaffected by the lower input voltage. As VCC falls below VBAT the RAM and timekeeper are switched over to the external power supply (nominal 3.0V DC) at VBAT.

VBAT:

Battery input for any standard 3V lithium cell or other energy source. Battery voltage must be held between 2.0V and 3.5V for proper operation. The nominal write protect trip point voltage at which access to the RTC and user RAM is denied is set by the internal circuitry as 1.25 x VBAT nominal. A lithium battery with 48mAhr or greater will back up the DS1307 for more than 10 years in the absence of power at 25C. UL recognized to ensure against reverse charging current when used in conjunction with a lithium battery.

Serial Clock Line (SCL):

SCL is used to synchronize data movement on the serial interface. The SCL input is used to positive edge clock data into each RTC device and negative edge clock data out of each device.

Serial Data (SDA):

The SDA pin is bidirectional for serial data transfer. This pin is open-drain which requires an external pull-up resistor.

SQW/OUT (Square Wave/Output Driver):

When enabled, the SQWE bit set to 1, the SQW/OUT pin outputs one of four square wave frequencies (1Hz, 4 kHz, 8 kHz, 32 kHz). The SQW/OUT pin is open drain and requires an external pull-up resistor. SQW/OUT will operate with either Vcc or Vbat applied.

X1, X2:

These pins are the connections for a standard 32.768 kHz quartz crystal. The internal oscillator circuitry is designed for operation with a crystal having a specified load capacitance (CL) of 12.5pF.

MOC3021

1. Introduction:

Opto-isolators, or Opto-couplers, are made up of a light emitting device, and a light sensitive device, all wrapped up in one package, but with no electrical connection between the two, just a beam of light. The light emitter is nearly always an LED. The light sensitive device may be a photodiode, phototransistor, or more esoteric devices such as thyristors, triacs e.t.c.

2. Opto-isolator parametersCollector-emitter voltage

This is the maximum voltage that can be present from the collector to the emitter of the receiving phototransistor (when it is turned off no light) before it may break-down.

Cree page distance

This is physically how far a spark would have to travel around the outside of the package to get from one side to the other. If the package has contaminants on it, solder flux, or dampness, then a lower-resistance path can be created for noise signals to travel along.

Forward current

This is the current passing through the sending LED. Typically, an Opto-isolator will require about 5Ma to turn the output transistor on.

Forward voltage

This is the voltage that is dropped across the LED when it is turned on. Most normal diodes drop about 0.7v, but with LEDs it is typically 1 2 volts.

Collector dark current

This is the current that can flow through the output phototransistor when it is turned off.

Collector-emitter saturation voltage

When the output transistor is fully turned on (saturated), this is the voltage there will be between the collector and emitter.

Isolation resistance

This is the resistance from a pin in the input side to a pin on the output side. It should be very high.

Response time

The rise and fall times are the times that the output voltage takes to get from zero to maximum. The rise time is very much dependant on the load resistor, since it is this that is pulling the output up. Therefore this value is always quoted with a fixed load resistance. Note however that the value, 100 Ohms, is much less than you are likely to use in practice. This is another of the manufacturers attempts to make the product look better than it is!

Cutoff frequency

This is effectively the highest frequency of square wave that can be sent through the Opto-isolator. It is actually the frequency at which the output voltage is only swinging half the amplitude than at DC levels (-3Db = half). It is therefore linked with the rise and fall times.

Current Transfer Ratio (CTR)

This is the ratio of how much collector current in the output transistor that you get given a certain amount of forward current in the input side LED. It is affected by how close the LED and phototransistor are inside the device, how efficient they both are, and many other factors. In fact it is not a constant but varies wildly with LED forward current.

TRIAC

TRIAC, from Triode for Alternating Current, is a generalized trade name for an electronic component which can conduct current in either direction when it is triggered (turned on), and is formally called a bidirectional triode thyristor or bilateral triode thyristor.

A TRIAC is approximately equivalent to two complementary unilateral thyristors (one is anode triggered and another is cathode triggered SCR) joined in inverse parallel (paralleled but with the polarity reversed) and with their gates connected together. It can be triggered by either a positive or a negative voltage being applied to its gate electrode (with respect to A1, otherwise known as MT1). Once triggered, the device continues to conduct until the current through it drops below a certain threshold value, the holding current, such as at the end of a half-cycle of alternating current (AC) mains power. This makes the TRIAC a very convenient switch for AC circuits, allowing the control of very large power flows with milliampere-scale control currents. In addition, applying a trigger pulse at a controllable point in an AC cycle allows one to control the percentage of current that flows through the TRIAC to the load (phase control).

Application

Low power TRIACs are used in many applications such as light dimmers, speed controls for electric fans and other electric motors, and in the modern computerized control circuits of many household small and major appliances.

However, when used with inductive loads such as electric fans, care must be taken to assure that the TRIAC will turn off correctly at the end of each half-cycle of the AC power.

A snubber circuit (usually of the RC type) is often used between A1 and A2 to assist this turn-off. Snubber circuits are also used to prevent premature triggering, caused for example by voltage spikes in the mains supply. Also, a gate resistor or capacitor (or both in parallel) may be connected between gate and A1 to further prevent false triggering. That, however, increases the required trigger current and / or adds latency (capacitor charging).

For higher-powered, more-demanding loads, two SCRs in inverse parallel may be used instead of one TRIAC. Because each SCR will have an entire half-cycle of reverse polarity voltage applied to it, turn-off of the SCRs is assured, no matter what the character of the load. However, due to the separate gates, proper triggering of the SCRs is more complex than triggering a TRIAC.

In addition to commutation, a TRIAC may also not turn on reliably with non-resistive loads if the phase shift of the current prevents achieving holding current at trigger time. To overcome that, pulse trains may be used to repeatedly try to trigger the TRIAC until it finally turns on. The advantage is that the gate current does not need to be maintained throughout the entire conduction angle, which can be beneficial when there is only limited drive capability available.

OPERATION :

There are four switches for configuring the time. These are INC, DEC, Current Time, Load Time. We have to first set current time and date. After that we can enter the required time. RTC circuit is provided with 3v CMOS battery so that it will retain the time entered even in case of power failure.

PRINTED CIRCUIT BOARD

Printed circuit boards may be covered in two topics namely

1) Technology

2) Design

Introduction to printed circuit boards:

It is called PCB in short printed circuit consists of conductive circuit pattern

Applied to one or both sides of an insulating base, depending upon that, it is called single sided PCB or double-sided PCB.(SSB and DSB).

Conductor materials available are silver, brass, aluminium and copper. Copper is most widely used. The thickness of conducting material depends upon the current carrying capacity of circuit. Thus a thicker copper layer will have more current carrying capacity.

The printed circuit boards usually serves three distinct functions.

1) it provides mechanical support for the components mounted on it.

2) It provides necessary electrical interconnections.

3) It acts as heat sink that is provides a conduction path leading to removal of the heat generated in the circuit.

Advantages of PCB:

1) When a number of identical assemblies are required. PCBs provide cost saving because once a layout is approved there is no need to check the circuit every time.

2) For large equipments such as computers, the saving on checking connections or wires is substantial.

3) PCBs have controllable and predictable electrical and mechanical properties.

4) A more uniform product is produced because wiring errors are eliminated.

5) The distributed capacitances are constant from one production to another.

6) Soldering is done in one operation instead of connecting discrete components by wires.

7) The PCB construction lands itself for automatic assembly.

8) Spiral type of inductors may be printed.

9) Weight is less.

10) It has miniaturization potential.

11) It has reproducible performance.

12) All the signals are accessible for testing at any point along conductor track.

SOFTWARE DESCRIPTION:

Proteus Simulation Screenshot

XTAL2

18

XTAL1

19

ALE

30

EA

31

PSEN

29

RST

9

P0.0/AD0

39

P0.1/AD1

38

P0.2/AD2

37

P0.3/AD3

36

P0.4/AD4

35

P0.5/AD5

34

P0.6/AD6

33

P0.7/AD7

32

P1.0

1

P1.1

2

P1.2

3

P1.3

4

P1.4

5

P1.5

6

P1.6

7

P1.7

8

P3.0/RXD

10

P3.1/TXD

11

P3.2/INT0

12

P3.3/INT1

13

P3.4/T0

14

P3.7/RD

17

P3.6/WR

16

P3.5/T1

15

P2.7/A15

28

P2.0/A8

21

P2.1/A9

22

P2.2/A10

23

P2.3/A11

24

P2.4/A12

25

P2.5/A13

26

P2.6/A14

27

VBAT

3

X1

1

X2

2

SCL

6

SDA

5

SOUT

7

REAL TIME CLOCK

DS1307

I2C BUS

D

7

1

4

D

6

1

3

D

5

1

2

D

4

1

1

D

3

1

0

D

2

9

D

1

8

D

0

7

E

6

R

W

5

R

S

4

V

S

S

1

V

D

D

2

V

E

E

3

16*2 CHARACTER LCD

CRYSTAL 1

32.768KHz

CRYSTAL

11.0592MHz

C1

33p

C2

33p

INCREAMENT

DECREMENT

TIME SET

RELAY SET

D1

LED-GREEN

VCC

KEIL uVision is a standard Windows application..

Create a Project File

To create a new project file select from the Vision menu Project New Project. This opens a standard Windows dialog that asks you for the new project file name.

We suggest that you use a separate folder for each project. You can simply use the icon Create New Folder in this dialog to get a new empty folder. Then select this folder and enter the file name for the new project, i.e. Project1. Vision creates a new project file with the name PROJECT1.UV2 which contains a default target and file group name. You can see these names in the Project Workspace Files.

Select a Device

When you create a new project Vision asks you to select a CPU for your project. The Select Device dialog box shows the Vision device database. Just select the microcontroller you use. We are using for our examples the Philips 80C51RD+ controller. This selection sets necessary tool options for the 80C51RD+ device and simplifies in this way the tool configuration.

Once you have selected a CPU from the device database you can open the user manuals for that device in the Project Workspace Books page.

These user manuals are part of the Keil Development Tools CD-ROM that should be present in your CD drive. .

Create New Source Files

You may create a new source file with the menu option File New. This opens an empty editor window where you can enter your source code. Vision enables the C color syntax highlighting when you save your file with the dialog File Save As under a filename with the extension *.C. We are saving our example file under the name MAIN.C.

Add and Configure the Startup Code

The STARTUP.A51 file is the startup code for the most 8051 CPU variants. The startup code clears the data memory and initializes hardware and reentrant stack pointers. In addition, some 8051 derivatives require a CPU initialization code that needs to match the configuration of your hardware design. For example, the Philips 8051RD+ offers you on-chip xdata RAM that should be enabled in the startup code. Since you need to modify that file to match your target hardware, you should copy the STARTUP.A51 file from the folder C:\KEIL\C51\LIB to your project folder.

Group Project Files

File group allow you to organize large projects. For the CPU startup code and other system configuration files you may create a own file group in the Project Components, Environment, Books dialog box. Use the New (Insert) button to create a file group named System Files. In the project window you may drag and drop the STARTUP.A51 file to this new file group.

Now, the Project Workspace Files lists all items of your project. To open a file for editing, double click on the file name in the Project Workspace. You may need to configure the startup STARTUP.A51 in the editor.

Set Tool Options for Target

Vision lets you set options for your target hardware. The dialog Options for Target opens via the toolbar icon or via the Project - Options for Target menu item. In the Target tab you specify all relevant parameters of your target hardware and the on-chip components of the device you have selected. The following the settings for our example are shown.

Build Project and Create a HEX File

Typical, the tool settings under Options Target are all you need to start a new application. You may translate all source files and line the application with a click on the Build Target toolbar icon. When you build an application with syntax errors, Vision will display errors and warning messages in the Output Window Build page. A double click on a message line opens the source file on the correct location in a Vision editor window.

Once you have successfully generated your application you can start debugging as described under Testing Programs with the Vision Debugger.

Now you may modify existing source code or add new source files to the project. The Build Target toolbar button translates only modified or new source files and generates the executable file. Vision maintains a file dependency list and knows all include files used within a source file. Even the tool options are saved in the file dependency list, so that Vision rebuilds files only when needed. With the Rebuild Target command, all source files are translated, regardless of modifications.

After you have tested your application, it might be required to create an Intel HEX file and to download the application software into the physical device using a Flash programming utility. Vision creates HEX files with each build process when Create HEX file under Options for Target Output is enabled. The Merge32K Hexfile option is available for Code Banking Applications when you have selected the Extended Linker LX51. You may start your Flash programming utility after the make process when you specify the program under the option Run User Program #1.

Conclusion

The project RTC BASED POWER SCHEDULAR has been successfully completed and tested with the integration of the features of every hardware component for its development. Presence of every block has been reasoned out and placed carefully thus contributing to the best working of the unit.

Finally we can conclude that this project application gives a very good features and there is huge scope for further research and development for using the same with the help of advanced technology such as RF Technology, Zigbee etc. for making it to operate wirelessly.

REFERENCES

BOOKS:

[1] Kenneth .J. Ayala, The 8051 Microcontroller and its applications, prentice hall, new Edition, 2006.

[2] Frank Vahid, Embedded system design, Tata Mc Graw hill, 3 Edition, 1995.

[3] Raj Kamal, Embedded Systems, JWE, 4 Edition, 2000.

[4] Jonathan Clark, Applications of Ultrasonic, Tata Mc Graw hill, new Edition, 2002.

WEBSITES:

[5] www.google.com

[6] www.howstuffworks.com

[7] www.epanorama.net

[8] www.wikipedia.org

89S52

MCU

MOC3021 Opto-Coupler

RTC DS1307

Switch

Pad

AC Load (Bulb)

BT136 TRIAC

16*2 LCD DISPLAY

REGULATED POWER SUPPLY

Embedded

System

Software

Hardware

ALP

C

VB

Etc.,

Processor

Peripherals

memory

2