evsjv `k cigvyy kw³ Kwgkb BANGLADESH ATOMIC ENERGY COMMISSION

Similar documents
EE6008-Microcontroller Based System Design Department Of EEE/ DCE

Section 13. Timer0 HIGHLIGHTS. Timer0. This section of the manual contains the following major topics:

Section 14. Timer1 HIGHLIGHTS. Timer1. This section of the manual contains the following major topics:

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING B.ENG (HONS) ELECTRICAL AND ELECTRONIC ENGINEERING EXAMINATION SEMESTER /2016

Interrupts on PIC18F252 Part 2. Interrupts Programming in C Language

POWER SAVER METER USING MICROCONTROLLER TO SAVE ELECTRICITY UPTO 30-40%

DTMF BASED HOME AUTOMATION

SH69P48A EVB. Application Notes for SH69P48A EVB SH69V48A JP2 J4(ICE_J4) S1 IDD TEST JP1 74HC273 JP4 JP3 74HC273 JP6 STKOVE JP7 SW1 J5(ICE_J5)

The University of Texas at Arlington Lecture 21_Review

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING. BEng(Hons) Electrical and Electronics Engineering SEMESTER 1 EXAMINATION 2016/2017

EasyPIC5 Development System

Keywords Digital IC tester, Microcontroller AT89S52

Interrupts on PIC18F252 Part 2

SECURE DIGITAL ACCESS SYSTEM USING IBUTTON

which means that writing to a port implies that the port pins are first read, then this value is modified and then written to the port data latch.

Using Timers of Microchip PIC18F Microcontrollers

3 PHASE FAULT ANALYSIS WITH AUTO RESET FOR TEMPORARY FAULT AND TRIP FOR PREMANENT

These 3 registers contain enable, priority,

SH69P55A EVB. Application Note for SH69P55A EVB SH69P55A EVB SH69V55A

University of Jordan Faculty of Engineering and Technology Department of Computer Engineering Embedded Systems Laboratory

CENG-336 Introduction to Embedded Systems Development. Timers

SH69P21 EVB. Application Note for SH69P21 EVB SH69P21 EVB SH69P21

Smart Programmable Timer

Mechatronics and Measurement. Lecturer:Dung-An Wang Lecture 6

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING MSC SYSTEMS ENGINEERING AND ENGINEERING MANAGEMENT SEMESTER 2 EXAMINATION 2016/2017

Three criteria in Choosing a Microcontroller

PIC Microcontroller Introduction

IMPROVING PROCESS CONTROL APPLICATIONS BY USING IP COMMUNICATIONS

Input/Output Ports and Interfacing

BHARATHIDASAN ENGINEERING COLLEGE. III Year / V Semester / EEE MICROPROCESSORS AND MICROCONTROLLERS (R-2013)

SANKALCHAND PATEL COLLEGE OF ENGINEERING, VISNAGAR. ELECTRONICS & COMMUNICATION DEPARTMENT Question Bank- 1

Department of Electronics and Instrumentation Engineering Question Bank

MicroProcessor. MicroProcessor. MicroProcessor. MicroProcessor

Using the HT16K33 in DVD Player Panel Applications

Display Real Time Clock (RTC) On LCD. Version 1.2. Aug Cytron Technologies Sdn. Bhd.

Laboratory 9. Programming a PIC Microcontroller - Part I

Embedded World Television, Radio, CD player, Washing Machine Microwave Oven Card readers, Palm devices

Embedded Systems and Software

Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad

CHAPTER 6 CONCLUSION AND SCOPE FOR FUTURE WORK

Hardware Interfacing. EE25M Introduction to microprocessors. Part V. 15 Interfacing methods. original author: Feisal Mohammed

3. The MC6802 MICROPROCESSOR

PIC18F452 Timer adjustment

Design and construction of ENP for Car : a novel Embedded System

EEE394 Microprocessor and Microcontroller Laboratory Lab #6

Embedded System Design

Unit 2. Computer Control. PIC stands for PROGRAMMABLE INTERFACE CONTROLLER. A PIC chip takes in input signals and then controls output transducers

Embedded Systems. PIC16F84A Internal Architecture. Eng. Anis Nazer First Semester

UNIT V MICRO CONTROLLER PROGRAMMING & APPLICATIONS TWO MARKS. 3.Give any two differences between microprocessor and micro controller.

A Programmer for the 68HC705C8 MicroController Figure 1 PROG05 As Built PROG05 User Guide Version C1 Page 1 of 14

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

Laboratory: Introduction to Mechatronics

Microcontrollers. Microcontroller

CONTENTS. dspicpro4 KEY FEATURES 4 CONNECTING THE SYSTEM 5 INTRODUCTION 6

PIC18F452 Timer adjustment

8051 Microcontroller

Introduction to Embedded Systems

ES-562/564U COMBINATION CLOCK/TIMER

LABORATORY MANUAL Interfacing LCD 16x2, Keypad 4x4 and 7Segment Display to PIC18F4580

DS 1682 Total Elapsed Time Recorder with Alarm

µpad: Microprocessor for Academic Development

DEV-1 HamStack Development Board

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip.

Chapter 2. Overview of Architecture and Microcontroller-Resources

Laboratory 10. Programming a PIC Microcontroller - Part II

MICROPROCESSOR RELAY FOR PROTECTION OF ELECTRICAL SYSTEMS

Bolt 18F2550 System Hardware Manual

Embedded Systems and Software

Introduction to Microcontroller Apps for Amateur Radio Projects Using the HamStack Platform.

ECE Senior Project Status Report. for. Scalable Regulated Three Phase Rectifier. September 21, Prepared by: Tyler Budzianowski.

Architecture of Computers and Parallel Systems Part 6: Microcomputers

DS1676 Total Elapsed Time Recorder, Erasable

Microcomputer Architecture and Programming

INTERFACING HARDWARE WITH MICROCONTROLLER

Design and Installation of Home Automation and Security System Using Microcontroller and ZigBee Modulation

Team 3. By: Miriel Garcia. Microcontrollers/ TI MSP430F5438A. ECE 480 senior Design. Application Note 4/3/15

C and Embedded Systems. So Why Learn Assembly Language? C Compilation. PICC Lite C Compiler. PICC Lite C Optimization Results (Lab #13)

Microcontroller Based Automatic Temperature Control System

Homework 5: Circuit Design and Theory of Operation Due: Friday, February 24, at NOON

General Purpose Programmable Peripheral Devices. Assistant Professor, EC Dept., Sankalchand Patel College of Engg.,Visnagar

INTRODUCTION. Mechanical Considerations APPLICATION NOTE Z86E21 THERMAL PRINTER CONTROLLER ZILOG

Downloaded from Elcodis.com electronic components distributor

Microcontroller Overview

EB-51 Low-Cost Emulator

History and Basic Processor Architecture

Rapid40i PIC Prototyping PCB User Manual

Microcontrollers. Fig. 1 gives a comparison of a microprocessor system and a microcontroller system.

AVR Intermediate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

Rapid40iXL PIC Prototyping PCB User Manual

Laboratory: Introduction to Mechatronics. Instructor TA: Edgar Martinez Soberanes Lab 1.

LCD. Configuration and Programming

8051 Microcontroller

SH69P25/P23/P20B EVB. Application Note for SH69P25/P23/P20B EVB SH69P25/P23/P20B EVB SH69V25

CONTENTS BIGAVR2 KEY FEATURES 4 CONNECTING THE SYSTEM 5 INTRODUCTION 6

AVR MICROCONTROLLER ARCHITECTURTE

NH-67, TRICHY MAIN ROAD, PULIYUR, C.F , KARUR DT. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING COURSE MATERIAL

PCI-1751U. 48-bit Digital Input/Output Card with Universal PCI Bus. User Manual

SIOX Four I/O Mini Module

Lecture (02) PIC16F84 (I)

ME 515 Mechatronics. A microprocessor

Transcription:

Design and Development of Microcontroller Based Programmable Timer for Supply Control Md. Shahzamal, Mohammad Abu Sayid Haque, Md. Nasrul Haque Mia, Md. Anzan-Uz-Zaman, Sardar Masud Rana, Mahbubul Hoq, Fahmida Akter, Farhana Hafiz, Mahmudul Hasan NUCLEAR ELECTRONICS DIVISION NOVEMBER 2013 INSTITUTE OF ELECTRONICS ATOMIC ENERGY RESEARCH ESTABLISHMENT SAVAR, GPO BOX 3787, DHAKA-1349, BANGLADESH evsjv `k cigvyy kw³ Kwgkb BANGLADESH ATOMIC ENERGY COMMISSION

Edited by: Mahbubul Hoq Yasmeen Maula Mohammod Abu Sayid Haque Published by: Institute of Electronics Atomic Energy Research Establishment Ganakbari, Savar, Dhaka Bangladesh Atomic Energy Commission Printed by: Scientific Information Unit Atomic Energy Research Establishment Ganakbari, Savar, Dhaka Bangladesh Atomic Energy Commission

Design and Development of Microcontroller Based Programmable Timer for Supply Control *Md. Shahzamal 1, Mohammad Abu Sayid Haque 1,, Md. Nasrul Haque Mia 1,Md. Anzan-Uz-Zaman 1, Sardar Masud Rana 1, Mahbubul Hoq 1, Fahmida Akter 1, Farhana Hafiz 1, Mahmudul Hasan 2 1 Institute of Electronics, Atomic Energy Research Establishment, Savar, Dhaka, Bangladesh 2 Atomic Energy Research Establishment, Savar, Dhaka, Bangladesh Abstract: Timers are frequently used in the industries to run process/operation with predefined time interval. The most popular type of timer is the programmable timer that has various facilities to configure the timer by users. However, it is expensive to build such timer using ICs and discrete components. Moreover, when programmable timer is used for laboratory instruments, it is expected to be flexible to handle. Microcontroller has the potential to solve these constraints. In this development work, we have developed a microcontroller based programmable timer with digital display system that can be configured to connect the AC main line to the instruments for a specific time interval. This device can function in two modes: manual mode and programmable mode. In the programmable mode, the device connects AC main line to the power outlet for a set interval. The device has been designed and tested in the laboratory. Keywords: Timer, Microcontroller, A. C supply and Display System. I. INTRODUCTION Timers that schedule an event according to a predefined time value in the future are an integral part of many real-time embedded systems, similar to setting an alarm clock. They find applications in the control of sequential functions of industrial machinery at varying time intervals, in the laboratory to power instruments for a specific time and perform processes for a specific duration. Usually, two kind of timer are frequently used in various applications such as mechanical and electronic timers. Electronics timers are manufactured today to meet the complex function of industries. The Electronic timer consists of a crystal controlled stable oscillator, sequencing logic circuits, driving circuits and a digital display system with a facility depends on the application for connecting the output to individual machinery/system to control the operation at pre-determined time interval. ---------------------------------------- *Corresponding Author: Md. Shahzamal, Scientific Officer Institute of Electronics, AERE, Savar, Dhaka, Bangladesh E-mail: zamal.iebaecbd@gamil.com, Phone: 88-027788250, Mob: 880191295235. Page 1 of 7

The timers which can be configured to set time interval is called programmable timer. The programmable timer is usually designed with different functions that would be flexible to customize by the users. To build such timer, many ICs and components are required. Therefore, manufacturing cost prohibit deploying programmable timer in many applications. Moreover, when programmable timer is used in laboratory, it should be sophisticated. In this development work, we have developed a microcontroller based programmable timer with digital display system. It works in two modes: manual mode and programmable mode. In manual mode, it can function like switch board. In the programmable mode, user can set the time how long AC main line could be connected to the power outlet. Then, it is disconnected automatically. The time is set for hours, minutes and seconds i.e. the time format is HH:MM: SS. Therefore, the maximum time would be 99h: 59m: 59s. The remaining time is shown on the display system designed with six seven-segment LEDs. This paper is organized as follows. In the section-ii, we have discussed about hardwire designing and software developing. We have presented timing performance in the section-iii and section-iv concludes our development work. II. DESIGN AND DEVELOPMENT Figure-1 shows the functional unit of the developed system. The first block is the switching unit that is used to change the operation mode of the system. It can change the system form manual mode to programmable mode. In the programmable mode, the system requires power supply to operate the circuit. This is done in the programmable circuit enable unit. Then, the time interval that the AC supply is continued is set through the push switches. The microcontroller receives the value of time and process to prepare the 16-bit timer that is integrated with the microcontroller. Finally, the relay circuit is energized for the predefined time. As a result, the AC main line connects to the power outlet. The remaining time is presented continuously on the LEDs based seven segment display system. The system can be reset pushing the timer start switch. Figure-2 shows the circuit diagram of the developed system. The working principle of the system is described in the following paragraphs. Figure-1: Functional Diagram of the Developed System. Page 2 of 7

A. Switching Options A two way contact switch has been used to change the operation mode. One wire is connected to the input of the switch. But, one connection is permanently connected in the both modes. When it is in the position of manual mode, the circuit connection to the socket is established with another manual contact switch. Figure-2: Circuit Diagram of the Developed System. B. Power Supply When the two way contact switch is connected to the programmable mode, the circuit is powered with a power supply that enables the programmable mode operation. This is constructed with a step down transform and a bridge rectifier. The output of the rectifiers is filtered with a combination of capacitor and resister. This produces a positive DC voltage with small amount of ripple. This voltage is passed through a regulator IC-7812 and +12V is derived from the output. The IC-7812 is protected with a reverse connected diode. The output voltage is filtered using a small capacitor. This +12V is used to operate relay. This output again is fed to input of IC-7805 and +5 V is obtained as output. This voltage is supplied to operate the microcontroller. C. Microcontroller PIC-16F72 Most of the task of the developed programmable timer is done using the microcontroller PIC-16F72. It has 2K x 14 words of FLASH Program Memory and 128 x 8 bytes of Data Memory (RAM) [3]. The operating frequency could be up to 20 MHz. It has three I/O ports named PORTA, PORTB and PORTC. PORTA is a 6-bit wide, bi-directional port. PORTB and PORTC are also a bi-directional, but 8-bit wide. Some pins for these I/O ports are multiplexed with an alternate function for the peripheral features on the device. In general, Page 3 of 7

when a peripheral is enabled, the pin may not be used as a general purpose I/O pin. The microcontroller has three timers: two 8-bit timers and one 16-bit timer. These timers can work counter as well when external clock is supplied to the respective pins while timers operate with the internal oscillator. D. Timer Operation Controller The operation of the programmable timer is controlled through the four pins of PORTB (RB7, RB6, RB5 and RB4). These pins have an interrupt-on-change feature. Only pins configured as inputs can cause this interrupt to occur. The input pins (of RB7:RB4) are compared with the old value latched on the last read of PORTB. The mismatch outputs of RB7:RB4 are OR d together to generate the RB Port Change Interrupt with flag bit RBIF (INTCON <0>). A mismatch condition will continue to set flag bit RBIF. Reading PORTB will end the mismatch condition and allow flag bit RBIF to be cleared. We have connected four push switches to enter the instructions to the microcontroller, as shown in figure-3. Switch-1 connected with RB4 is the set/reset switch. When the switch is pressed, the operation of entering time begins or reset entering time. The switch-2 is used to select which digit will be incremented. SW-3 is used to increment the value of the digit selected by the SW-2. If the digit is incremented above the maximum value for that digit, then it resets to zero again. SW-4 starts timer and displaying remaining time. After pushing this switch, the program transfer to timer configuration subroutine and start timer operation. We have developed a subroutine, named scanning switches and actions, to perform these operations. The follow chart is shown in the figure-4. This subroutine is executed with RB Port Change Interrupt. It also includes the de-bounce steps to avoid the unnecessary interrupt. This program receives the value of time interval and necessary instruction to start timing. Figure-3: Operation Controlling Switches. Figure-4:Flow Chart for Actions of Switches. Page 4 of 7

E. Timer Configuration The Timer1 module is a 16-bit timer/counter consisting of two 8-bit registers (TMR1H and TMR1L), which are readable and writable. The TMR1 Register pair (TMR1H:TMR1L) increments from 0000h to FFFFh and rolls over to 0000h. The TMR1 Interrupt, if enabled, is generated on overflow, which is latched in interrupt flag bit TMR1IF (PIR1<0>). This interrupt can be enabled/disabled by setting/clearing TMR1 interrupt enable bit TMR1IE (PIE1<0>). In this system, we have configured timer to generate signal after every half second. Further, we have used this signal to generate tick every second. As the operating frequency of the designed circuit is 4 MHz, each instruction cycle is equal to 1 us. We have also set 1: 8 presale values that divide the clock by 8. Therefore, to generate timer overflow after every half second the number of increments would be, = 62500 Thus, the timer will rolls over after half second if it starts to increment from 65553-62500= 3035=0BDB. This is done reloading TMR1L with DB and RMR1H with 0B. Figure-5 shows the flowchart for fixing remaining time. After every overflow, TMR1 Register pair rewrites. A noticing signal is produced to decrement the least significant digit. Next digits are adjusted after every decrement. The updated value is presented on the display system. Figure-5: Remaining Time Calculation Flowchart. Figure-6: Relay Driving Circuit F. Relay Driving Circuit The AC line is controlled through a relay based circuit as shown in figure-6. The microcontroller set high pin RB3 to connect AC to the outlet. The RB3 provide the bias current to the driving transistor and energized the relay to establish connection. This pin is kept high until every digit of remaining time becomes zero. A LED diode has been connected to show the status of the timer. The rectifier diode avoids the unwanted firing of relay. Page 5 of 7

G. Display System The time setup is monitored observing the entered digit on the display. The display system also shows the remaining time. The display system has been constructed using seven segment LEDs. A register memory is assigned to control the glow of LEDs for each segment. The register value is found out through different subroutines. The controlling subroutine selects the appropriate pattern for each digit to be displayed. Each digit is displayed applying time division technique. One segment is powered for a fixed interval and then turn off to power other segments. However, the data bus is common for all segments. III. RESULT AND DISCUSSION The system has two parts: 1) Designing Hardware Circuit and 2) Designing required Software. The system has been designed and tested successfully in the laboratory. The developed system is very cheap and flexible. The maximum time that can be set is 99H: 59M: 59S. As the time setting is independent of the ability of the timer of microcontroller, the system can be run for the maximum time perfectly. The picture-1 shows our developed board. The timing accuracy has been presented in the following Table-1. Table-1: Comparison of timing with standard watch. Observation No. Set time for the Timer Time passed in the standard watch Differences In Seconds 01 00:05:00 00:04:58-02 02 00:20:00 00:10:02 +02 03 00:30:00 00:20:00 00 04 00:40:00 00:40:00 00 05 00:50:00 00:50:01 +01 06 01:00:00 01:00:00 00 Picture-1: Developed Programmable Timer. Figure-7: PCB for the Developed System Page 6 of 7

IV. CONCLUSSION We have successfully developed a prototype of a programmable timer. The developed system is very useful to run an instrument for a specific time interval. The timing is very precise as the system has been developed by the microcontroller. The performance of the system depends on the loads in many cases. The programmable timer has limited functions. In future, the system would be upgraded adding new functions such as periodic ON/OFF. REFERENCES [1] Electronic Industrial Timers, www.dcmsme.gov.in/publications/pmryprof/it/ch8.pdf [2] Jonathan Gana KOLO and Umar Suleiman DAUDA, Development of a Simple Programmable Control Timer, Leonardo Journal of Sciences, Issue 12, January-June 2008, p. 175-186. [3] Data Sheet of Pic-16F72, ww1.microchip.com/downloads/en/devicedoc/39597b.pdf [4] Introduction to Embedded Programming - Timers, www.scriptoriumdesigns.com/embedded/timers.php [5] Y. K. Woo, Timer and Timer Services, www.csie.dyu.edu.tw/~swang/rtos/l11.pdf [6] Mitesh P. Parikh, programmable timer for appliances, www.electronicsforu.com/efylinux/circuit/.../ci-01-prog-timer.pdf [7] A Digital Timer Implementation using 7 Segment Displays, www.users.cecs.anu.edu.au/~salman.durrani/_teaching/tb5.pdf Page 7 of 7