Sei sulla pagina 1di 19

Power Saving Time Operated Electrical Appliance Using Microcontroller

AT89S52
Alabi O. A1 and Lawal M.K1
Computer Engineering Technology Department, Federal Polytechnic Offa, Nigeria
kitfad@yahoo.com, mufutaulawa@yahoo.com

ABSTRACT
Power Saving Using Time Operated Electrical Appliance Controlling System is a reliable
circuit that takes over the task of switch on/off the electrical devices with respect to time.
This paper provides alternative replacement to the Manual Switching by the technological
enhancements towards user effective usage and prevent hazard. It has an Inbuilt Real Time
Clock which tracks over the Real Time. When this time equals to the programmed time, then
the corresponding Relay for the device is switched ON. The switching time can be edited at
any Time using the keypad with the features of micro controller. The Real Time Clock is
displayed on four 7-segment display. Power saving is due to CMOS battery incorporated on
the design.
Keywords: Power Saving, Manual Switching, Real Time Clock, CMOS

INTRODUCTION

Power Saving Using Time Operated Electrical Appliance Controlling System is a micro
controller based design [4] [7]. The keyboard part is use to edit input for activation based on
real time with the integration of CMOS on IC DS1305. Micro controller 80C51 has I/O ports,
ROM for storing queue data on real Time mode and MCU for processing and execution set of
instructions[1] [5]. The SSD (Seven Segment Display) is to display output time from the
switch relay.

We are living in the Embedded World. You are surrounded with many embedded products
and your daily life largely depends on the proper functioning of these gadgets. Television,
Radio, CD player of your living room, Washing Machine or Microwave Oven in your
kitchen, Card readers, Access Controllers, Palm devices of your work space enable you to do
many of your tasks very effectively. Apart from all these, many controllers embedded in your
car take care of car operations between the bumpers and most of the times you tend to ignore
all these controllers [6].

A BRIEF INTRODUCTION TO 8051 MICROCONTROLLER:

When we have to learn about a new computer we have to familiarize about the
machine capability we are using, and we can do it by studying the internal hardware design
(devices architecture), and also to know about the size, number and the size of the registers.
A microcontroller is a single chip that contains the processor (the CPU), non-volatile
memory for the program (ROM or flash), volatile memory for input and output (RAM), a
clock and an I/O control unit. Also called a "computer on a chip," billions of microcontroller
units (MCUs) are embedded each year in a myriad of products from toys to appliances to
automobiles. For example, a single vehicle can use 70 or more microcontrollers. The
following picture describes a general block diagram of microcontroller[1] [4].

Fig 1: Block Diagram of Microcontroller

89S52: The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with


8K bytes of in-system programmable Flash memory. The device is manufactured using
Atmel’s high-density nonvolatile memory technology and is compatible with the industry-
standard 80C51 instruction set and pinout. The on-chip Flash allows the program memory to
be reprogrammed in-system or by a conventional nonvolatile memory programmer [1]. By
combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip,
the Atmel AT89S52 is a powerful microcontroller, 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, a six-vector two-level interrupt
architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the
AT89S52 is designed with static logic for operation down 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 con-tents but freezes the oscillator, disabling all other chip
functions until the next interrupt [6]

The hardware is driven by a set of program instructions, or software. Once familiar with
hardware and software, the user can then apply the microcontroller to the problems easily.

The pin diagram of the 8051 shows all of the input/output pins unique to microcontrollers:
Fig 2: Microcontroller Pin Diagram and Pin Functions

ALE/PROG: Address Latch Enable output pulse for latching the low byte of the address
during accesses to external memory. ALE is emitted at a constant rate of 1/6 of the oscillator
frequency, for external timing or clocking purposes, even when there are no accesses to
external memory. (However, one ALE pulse is skipped during each access to external Data
Memory.) This pin is also the program pulse input (PROG) during EPROM programming.
PSEN: Program Store Enable is the read strobe to external Program Memory. When the
device is executing out of external Program Memory, PSEN is activated twice each machine
cycle (except that two PSEN activations are skipped during accesses to external Data
Memory). PSEN is not activated when the device is executing out of internal Program
Memory.
EA/VPP: When EA is held high the CPU executes out of internal Program Memory (unless
the Program Counter exceeds 0FFFH in the 80C51). Holding EA low forces the CPU to
execute out of external memory regardless of the Program Counter value. In the 80C31, EA
must be externally wired low. In the EPROM devices, this pin also receives the programming
supply voltage (VPP) during EPROM programming.
XTAL1: Input to the inverting oscillator amplifier.
XTAL2: Output from the inverting oscillator amplifier.
Port 0: Port 0 is an 8-bit open drain bidirectional port. As an open drain output port, it can
sink eight LS TTL loads. Port 0 pins that have 1s written to them float, and in that state will
function as high impedance inputs. Port 0 is also the multiplexed low-order address and data
bus during accesses to external memory. In this application it uses strong internal pullups
when emitting 1s. Port 0 emits code bytes during program verification. In this application,
external pullups are required[1] [4].
Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pullups. Port 1 pins that have 1s
written to them are pulled high by the internal pullups, and in that state can be used as inputs.
As inputs, port 1 pins that are externally being pulled low will source current because of the
internal pullups.
Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pullups. Port 2 emits the high-
order address byte during accesses to external memory that use 16-bit addresses. In this
application, it uses the strong internal pullups when emitting 1s.
Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pullups. It also serves the
functions of various special features of the 80C51 Family as follows [1] [6] [4]:
Port Pin Alternate Function
P3.0 RxD (serial input port)
P3.1 TxD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)

VCC: Supply voltage


VSS: Circuit ground potential

The following are some of the capabilities of 8051 microcontroller.

 Internal ROM and RAM


 I/O ports with programmable pins
 Timers and counters
 Serial data communication

The 8051 architecture consists of these specific features:

 16 bit PC &data pointer (DPTR)


 8 bit program status word (PSW)
 8 bit stack pointer (SP)
 Internal ROM 4k
 Internal RAM of 128 bytes.
 4 register banks, each containing 8 registers
 80 bits of general purpose data memory
 32 input/output pins arranged as four 8 bit ports: P0-P3
 Two 16 bit timer/counters: T0-T1
 Two external and three internal interrupt sources Oscillator and clock
circuits.

THE CIRCUIT
Fig 4: Power and Output module Circuit

PART LIST

Semiconductor:
IC1 -7806, 6V regulator
IC2 -AT89S51 microcontroller
IC3-DS1307
IC4- 74LS04
IC5- ULN2003
Q1 – Q4 PNP transistor (BC547)
SIP – 10k
Seven Segment Display (SSD) – S542 Common Cathode
D1-D6 -1N4007 rectifier diode
LED1 -5mm light-emitting diode
Resistors (all ¼-watt, 5% carbon):
R1 – R4 -1K
R5 – R8- 10Kolo-ohm
R11 – R13 – 10kilo-ohm
Capacitors:
C2 – C3 – 33P
C4 – 1uF
C1 - IuF
C3 -1000 µF, 5V electrolytic
C4, 3 -0.1µF ceramic disk
C6 47µF/ 16V electrolytic
X1 TAL – 12MHz
X2 Crystal Osc – 32.76KHz
Relay – 12VDC
Miscellaneous:
X1 -230V C primary to V,
500mA secondary transformer
S1-SS3 -Push-to-on switch
S4 -On/off switch
X TAL -12MHz crystal
Stages in the design

1. Power Stage
2. Input Sage
3. Processing stage
4. Output Stage
5. Real Time stage

THE CONSTRUCTION

Input and Output Stage.

The keypad is used as input to edit time for which the switching device output while the
Display indicate output real time using 7- segment Display.

SSD

KEYPAD

DEVICE OUTPUT

Fig 5 Front Design

The pointer shows the relay for the device output

INTERNAL CONNECTED COMPONENTS


Fig 6: Inside construction

Removeable microcontroller on socket for easy access programming.

MICRO CONTROLLER ON BREADBORD

Fig 7: Microcontroller device

Fig 8: Back View of the device


POWER UNIT

MICRO CONTROLLER ON SOCKET

Fig:9 Inside view

The pointer for microcontroller for processing input data via keypad and signal to relay
output.

COUPLED DEVICE

Fig: 10: Final packaging of the device


Fig 11: Showing Output on Microvision compiler interface for compiling and deluging

Fig 11: UniPRO interface for programming microcontroller device.

The Unipro ver 1.0 device was used to upload output file generated from Microvision
compiler in HEX extension. Hex file is already in a machine language to be use on UniPro
10U programmable device.
Fig 12. UniPro 10U programmer device

This device was used to program devices via the ZIP socket.

Fig 13 UniPro 10U on compactable selected devices

UniPro 10U device has 15972 compactable devices with the following features

 E/EPROM
 ASROM
 MPU/MCU
 PLD
 DRAM/SRAM
 IC Card

Sequential approached for the completion of microcontroller based Time Operated Electrical
Appliance using ATMEL AT89S52 as a target device.

The Program flow chart for embedded c code on microcontroller ATMEL (AT89S52)

Write C code Compile C code Hex File Output Hex file Output
Language Using MicroVision uploaded in UniPro programmed into
Programmer AT89S52 Device
Conclusion

Power saving time operated electrical appliance is a locally customized device capable of
switching electrical devices with respect to time and can be used for both home and
commercial cafeteria centers purposely to prevent electrical hazard also generate post
operation of the attached devices .
REFERENCES

[1] http://www.engineersgarage.com/www.engineersgarage.com Copyright © 2011


EngineersGarage. All rights reserved

[2] http://www.8051projects.net/download-d171-time-operated-electrical-appliance-
controlling-system.html, © 2010 Rickey's World

[3] http://www.projectsof8051.com/projects/23-time-operated-electrical-appliance-
controlling-system.html

[4] http://www.8051projects.info/forum/doubts-my-projects/10-power-saving-using-time-
operated-electrical-appliance-controlling-system.html

[5] http://www.8051projects.info/proj.asp?id=47 Copyright © 8051projects.info 2008. All


rights reserved

[6]http://www.google.com.ng/url?sa=t&rct=j&q=time+operated+electrical+appliance+contr
olling+system&source=web&cd=5&ved=0CGoQFjAE&url=http%3A%2F%2Fwww.hbe
onlabs.com%2Fsynopsis%2FTIME%2520OPERATED%2520APPLIANCE%2520CONTRO
L.doc&ei=bceOT6ch0Me0BoSawecJ&usg=AFQjCNFFBlV2pb14oNqBD0ENol8pmWDlx
Q&cad=rja

[7] http://www.4shared.com/file/v2Q_AsqF/time_operated_electrical_appli.html

Malcolm plan. (1990) Digital Systems Book E Published in Great Britain (Second Edition)
Hodder & Stoughtoon.

Floyd. Electronics Devices Published by Charles E. Merrill Publishing Company. A Bell &
Howell Company. Columbus, Ohio 43216. 1st Edition.

The Oxford English Dictionary. (1991) Oxford Unviersity Press. Walton Street. Oxford.
Second edition,