MICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM

Similar documents
Principle and Interface Techniques of Microcontroller

2. Write an 8051 program to generate a square wave of 25 khz at pin P2.3 using XTAL = 12 MHz. Solution:

Chapter Family Microcontrollers Instruction Set

8051 Microcontroller

Interfacing ahantronix 128x64 Graphic Module to an 8-bitMicrocontroller

Assembly Language programming (2)

Interrupts. EE4380 Fall 2001 Class 9. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

Chapter 3. Bit Addressable Area. By DeccanRobots

Microcontroller Intel [Instruction Set]

Embedded Controller Programming

ELEG3923 Microprocessor Ch.4 I/O Ports

Introduction To MCS-51

Module Contents of the Module Hours COs

ELEG3923 Microprocessor Ch.9 Timer Programming

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman

8051 I/O and 8051 Interrupts

8051 Microcontroller Assembly Programming

Assembly Language programming (3)

Digital Blocks Semiconductor IP

Control Transfer Instructions Jump, Loop, and Call. ECE473/573 Microprocessor System Design, Dr. Shiue

FACULTY OF ENGINEERING LAB SHEET

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

JUMP, LOOP AND CALL INSTRUCTIONS

8051 Overview and Instruction Set

LCD AND KEYBOARD INTERFACING

Chapter 6 Interrupts. (I. Scott Mackenzie) By: Masud-ul-Hasan

UNIT-III ASSEMBLY LANGUAGE PROGRAMMING. The CPU can access data in various ways, which are called addressing modes

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 9 Simple I/O Interfacing

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING

Programming of 8085 microprocessor and 8051 micro controller Study material

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Serial Port Programming in Assembly Module No: CS/ES/12 Quadrant 1 e-text

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

INTERFACING 16 2 LCD WITH 8051

Dodatak. Skup instrukcija

~: Simple Programs in 8051 assembly language :~

Lecture 5. EEE3410 Microcontroller Applications Department of Electrical Engineering Assembly Language Programming (1)

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING

Interrupt Programming: Interrupts vs. Polling Method:

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS

;~~~~~~~~~~~~ ;P4-6-1.ASM ~ ;~~~~~~~~~~~~ SYMBOLS RS REG P2.0 EN REG P2.1 PICK REG P3.0 RELAY0 REG P3.1 RELAY1 REG P3.6 RELAY2 REG P3.

CoE3DJ4 Digital Systems Design. Chapter 6: Interrupts

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples.

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

build_char macro P1,P2,P3,P4,P5,P6,P7,P8 ;Macro for building a custom character

INTERRUPTS PROGRAMMING

Microcontroller. Instruction set of 8051

8051 Programming using Assembly

Microcontroller and Applications

CPEG300 Embedded System Design. Lecture Interface with Peripheral Devices

Instruction Set Of 8051

Q. Classify the instruction set of 8051 and list out the instructions in each type.

Principle and Interface Techniques of Microcontroller

FlashFlex51 Microcontroller Control of CompactFlash Card in TrueIDE Mode

What Registers are available? Programming in Assembler. Assembler Programming - like early Basic. Assembler Data Movement Instructions

EE6502- MICROPROCESSOR AND MICROCONTROLLER


ET2640. Unit 5:ADVANCED I/O TECHNIQUES Pearson Education, Inc. Pearson Prentice Hall Upper Saddle River, NJ 07458


LCM12232A LCM12232A. 122 x 32 1/32D STN( EL / 100VAC 400HZ LED / 4.2VDC


CHAPTER 3 JUMP, LOOP, AND CALL INSTRUCTIONS

Application Brief D-005

1. LCD (Liquid Crystal Display)interface

8051 Single Board Monitor Programming. Minmon - Yeralan & Ahluwalia. PaulMon1 & PaulMon2 - Paul Stoffregen

8051 Serial Port. EE4380 Fall02 Class 10. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

CPEG300 Embedded System Design. Lecture 6 Interrupt System

ENE 334 Microprocessors

Question Bank Microprocessor and Microcontroller

Report Title: Digital Voltmeter using 89C51

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller and Applications Subject Code:

Timers and interrupts

ET355 Microprocessors Friday 6:00 pm 10:20 pm

Assembly Language programming (1)

INSTRUCCIONES ARITMETICAS ERROR! MARCADOR NO DEFINIDO.

Microcontroller and Embedded Systems:

CPEG300 Embedded System Design. Lecture 8 Timer

MODEL ANSWER SUBJECT- MICROCONTROLLER(12187) CLASS-EJ5E CLASS TEST-02 Q1.)Attempt any THREE of the following.

Chapter Addressing Modes

DR bit RISC Microcontroller. Instructions set details ver 3.10

8051 I/O and Class 6 EE4380 Spring 03. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

SN8F5000 Family Instruction Set

TUTORIAL Assembly Language programming (2)

ELEG3924 Microprocessor

ET2640 Microprocessors

MODEL ANSWER SUMMER 17 EXAMINATION Subject Title: Microcontroller Subject Code:

8051 Timers. Class 7 EE4380 Fall Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

Department of EIE / Pondicherry Engineering College. Timer/Counters. Department of EIE / Pondicherry Engineering College 1

C H A P T E R 1 INTRODUCTION

CEIBO FE-W7 Development System


Advantages of Using a Dallas Semiconductor DS1232 MicroMonitor

C51 Family. Architectural Overview of the C51 Family. Summary

ELEG3923 Microprocessor Ch.3 Jump, Loop, and Call

Alexandria University Faculty of Engineering Communications & Electronics Department.

WZMICRO>COM

MicroConverter Technical Note - uc007 User Download (ULOAD) Mode

Dragonchip. Instruction Set Manual

Transcription:

MICROCONTROLLER BASED WATER LEVEL CONTROL SYSTEM The present concept implements controlling of pump which pumps water from the sump (underground tank) to the overhead tank, using 8951 microcontroller. The control panel, i.e. the main control unit of the system which consists of the primary control switches, pump indicator, siren and level indicators. The visual example of how switches And the indicators can be placed as shown the figure below. Front view of the model In the figure shown above there are total of nine LEDs, four of which indicates the water level in the tank, another four indicates the water level in the sump and one LED indicates whether the pump is ON/OFF. It also consists of three switches. 1. Switch 1 is the main power switch which is used to activate the system. 2. Switch 2 is used to select whether to operate the pump in AUTO or MANUAL mode. 3. Switch 3 comes to picture only when the system is operated in MANUAL mode. It controls the direct activation of the pump. Description : This system is built around an 8951 microcontroller and the circuit diagram is as given below.

Circuit diagram of Water level indicator cum controller As you can see in the above diagram, port 0 is exclusively used as an input port which takes the information regarding the water level in the sump as well as in the overhead tank. Port 1 is used as output port which is connected to the indicator that indicates the water level in both the tanks. Port 2 is used as in/out port, it takes the input from switch 2 and switch 3 and gives the output which is connected to pump indicator, siren and the relay which controls the switching of the pump. Working of the system: There are two modes of working for the system 1. Manual mode 2. Auto mode Which is controlled by switch 2 (refer control panel diagram) Manual mode:

When the system is active and in manual mode, it only indicates the water levels in the tanks and it doesn t control any working of the pump. To activate the pump in manual mode switch 3 is used. In this mode the operator should manually control the working of the pump. As in case if the tank is full, operator should switch of the pump which is not the case when compared to auto mode. Auto mode: When the system is active and in auto mode, it only indicates the water levels in the tanks and it controls the working of the pump. Programm: ;********************************************************************** ********************** ;Objective : Water Level Indicater and Motor Protection ;Name of the Programmer : Prateek Kaura ;Hardware Used : CPU Board, Led Card, Power Supply, 8 pin connector ; Two pin connector ;Program Description ; Crystal=11.0592kHz ; Port0 is used as LCD ; Port1 is used for Motor ; Port2 is used for LED s ; Port3 is used for RF Module ;Status : ;**********************Hardware declaration**************************************************; lcd equ p0 RS BIT P2.5 EN BIT P2.4 buzzer bit p2.3 GREEN bit p2.0 YELLOW bit p2.1 RED bit p2.2 senser1 bit p3.0 senser2 bit p3.1 senser3 bit p3.2 senser4 bit p3.3 relay1 bit p1.0 key1 bit p1.3 ;********************************************************************** ***********************; ORG 0000H ;RESET OPERATION

SJMP POWERON ;GO TO POWERON LABEL ORG 0003H ;EXTERNAL0 INTERRUPT ORG 000BH ;TIMER0 INTERRUT ORG 0013H ;EXTERNAL1 INTERRUPT ORG 001BH ;TIMER1 INTERRUPT ; ljmp timer1 ORG 0023H ;SERIAL COMMUNICATION INTERRUPT ORG 0030H POWERON: MOV SP,#70H ; Move the stack pointer at 70h location MOV IE,#00H ; Disable all the interrupts MOV IP,#00H ; Disable the interrupt priority register MOV P0,#0FFH ; Move 0FFH in in port 0 MOV P1,#0FFH ; Move 0FFH in in port 1 MOV P2,#0FFH ; Move 0FFH in in port 2 MOV P3,#0FFH ; Move 0FFH in in port 3 ;*RAM variable declaration,30h-7fh ;. ;. ;********************************************************************** ***********************; ;*****************POWER ON *************************************************************** ; ;****************************RAM CLEARANCE**********************************************; MOV R0,#7FH RAM_CLR: MOV @R0,#00H ; Clear the RAM from 00 to 7FH DJNZ R0,RAM_CLR ;;**********************************MAIN PROG****************************************************** setb yellow clr relay1 mov lcd,#38h

mov lcd,#01h mov lcd,#0eh mov lcd,#80h MOV DPTR,#DATA1 main1: setb yellow mov r2,#70d main3: setb RELAY1 jnb senser1,check1 djnz r2,main3 mov r2,#50d sjmp main5 main11: jnb p1.3,main3 sjmp main11 main: setb buzzer setb yellow jnb senser1,check1 sjmp main main5: clr relay1 setb yellow MOV DPTR,#level4

sjmp main11 check1: clr green setb YELLOW jb senser1,main3 jnb senser2,check2 MOV DPTR,#level1 djnz r2,check1 mov r2,#20 sjmp main check2: clr YELLOW clr green ;jnb p3.2,main3 jnb senser3,check3 jb senser2,main MOV DPTR,#level2 sjmp check2 check3: clr red mov r3,#04 clr YELLOW clr green clr relay1 buzzer_on: clr buzzer setb buzzer jb senser3,main MOV DPTR,#level3

djnz r3,buzzer_on check34: setb buzzer clr red clr YELLOW clr green clr relay1 jb senser3,main7 MOV DPTR,#level3 sjmp check34 main7: ljmp main DISPLAY_: CLR A MOVC A,@A+DPTR MOV LCD,A ACALL DATA INC DPTR JZ EXIT SJMP DISPLAY_ EXIT: RET ;****************command************* command: clr RS setb EN clr EN ACALL DELAY ret ;*****************data*************** data: setb RS setb EN

clr EN ACALL DELAY ret ;***************************delay*************************************** delay: mov 33h,#50d loop1: mov 34h,#50d loop2: mov 35h,#20d loop3: djnz 35h,loop3 djnz 34h,loop2 djnz 33h,loop1 ret ;**************************************data byte****************************************************************** ORG 300H DATA1: DB WATER LEVEL,0 level1: DB Low Level,0 level2: DB Medium Level,0 level3: DB High Level,0 level4: DB Input Line Fail,0