0% found this document useful (0 votes)
72 views43 pages

Edit

The document describes a project on automatic water level monitoring and control using a microcontroller. It aims to save electricity and water by automatically controlling a pump based on the water levels in the source and main tanks. The system uses sensors to measure water levels and a microcontroller circuit to control the pump. Detailed information about the components, design, fabrication, testing and evaluation of the system is provided.

Uploaded by

Priya Vaishnavi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views43 pages

Edit

The document describes a project on automatic water level monitoring and control using a microcontroller. It aims to save electricity and water by automatically controlling a pump based on the water levels in the source and main tanks. The system uses sensors to measure water levels and a microcontroller circuit to control the pump. Detailed information about the components, design, fabrication, testing and evaluation of the system is provided.

Uploaded by

Priya Vaishnavi
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 43

PROJECT REPORT ON

AUTOMATIC WATER LEVEL MONITORING & CONTROLLER USING MICROCONTROLLER CIRCUIT


Submitted in fulfillment for award of degree of Bachelor of Science in

Electrictronics Branch

Submitted by:

Deepika.S Ananya Thanuja Sharanya.S

Department of Electronics

AKNOWLEDGEMENT

ABSTRACT
This project presents how we use the sensors and electronics circuit for residential and household purpose.

Here in this project we show that how we use conductive sensor to control the working of pump. Working of the pump is controlled by the water level of the source tank, if the main tank is empty then pump gets automatically on and when it is fully filled then pumps get automatically off. But even when there is no water in the source tank, pump will remain switched off. So working of the pump totally depends upon both, the source as well as main tank.

CONTENTS
Certificate Acknowledgement Abstract Contents
1.

1 2 3 4 5 5 5 6 6 7 7 31 32 34 37 38 42 47 50

CHAPTER 1: INTRODUCTION
1.1 Aim 1.2 Objectives 1.3 Motivations 1.4 Overview

2.

CHAPTER 2: THEORITICAL BACKGROUND


2.1 Theoretical Background

3.

CHAPTER 3: PROJECT DESRCIPTION


3.1. Block Diagram 3.2. Circuit Diagram 3.3. Operation 3.4. Components

4. 5. 6. 7.

CHAPTER 4: DESIGN PROCEDURE CHAPTER 5: FABRICATION CHAPTER 6: TESTING AND EVALUATION CHAPTER 7: CONCLUSION AND SCOPE OF FUTURE WORK REFRENCES APPENDIX
4

51 52 54

8.

CHAPTER 1:Introduction
1.1 AIM:
The main aim of Automatic water level monitoring and control is: We know that the demand of electricity is very high than demand in our country so, Automatic water level monitoring and control is to save electricity. To save water which is the First necessity of human being To Increase pump set life. To protect motor from getting damaged in case of no load (i.e., no water in main line condition), because in industries where large pumps are required for water intake, there the motor protection is necessary.

1.2 LEARNING OBJECTIVES:

Development on MIC-89C52: This contains an automatic movement that can save water from overflow.

Implementation of important subjects of engineering studies such as Embedded Systems, Control Systems, and Machines etc. to the fullest.

1.3 MOTIVATION:
5

Water level controllers Indicator is highly recommended for metro cities or areas where drinking water is supplied through pipelines which are further distributed in homes, hotels, societies etc. At large these systems not only help us but our neighborhoods and society also, as it reduces the wastage of water by cutting down any further overflows than what you need. This system can also help in saving the electrical energy by making automatic switching of electrical motor when there is no water in main pipeline or when water overflows.

1.4 OVERVIEW:
This product is designed to automatic control of motor, which ensures constant reserve of water in storage tanks. Automatic water level controller is used to automatically fill the over head tank as and when it gets empty and monitor the water level in it. Automatic water level controller switches ON the motor when the water level in the overhead tank drops below pre fixed low level(on point) and puts off the motor when water level rises up to pre fixed high level (off point) motor also switches off when the sump water is exhausted before filling overhead tank, pump running dry, Mains voltage fluctuations.

CHAPTER 26

Theoretical background
Why we are choosing a Microcontroller?
As it provides on chip microprocessor, RAM, ROM, Parallel I/O port, Serial I/O port etc. hence its cost is less, size is less, power consumption is less and speed is more. Software development tools like assembler, C compilers etc are easily available and are easy to upgrade

History of the Microcontroller Introduction


A microcontroller (also MCU or C) is a computer on a chip. It is a type of microprocessor emphasizing high integration, low power consumption, self-sufficiency and cost-effectiveness, in contrast to a general-purpose microprocessor (the kind used in a PC). In addition to the usual arithmetic and logic elements of a general purpose microprocessor, the microcontroller typically integrates additional elements such as read-write memory for data storage, read-only memory, such as flash for code storage, EEPROM for permanent data storage, peripheral devices, and input/output interfaces. At clock speeds of as little as a few MHz or even lower, microcontrollers often operate at very low speed compared to modern day microprocessors, but this is adequate for typical applications. They consume relatively little power (milliwatts), and will generally have the ability to sleep while waiting for an interesting peripheral event such as a button press to wake them up again to do something. Power consumption while sleeping may be just nanowatts, making them ideal for low power and long lasting battery applications.
7

Microcontrollers are frequently used in automatically controlled products and devices, such as automobile engine control systems, remote controls, office machines, appliances, power tools, and toys. By reducing the size, cost, and power consumption compared to a design using a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to electronically control many more processes.

Microcontrollers vs. Microprocessors


MICROPROCESSORS

MICROCONTROLLERS A microcontroller single-chip contained CPU, RAM, ROM, Peripherals, I/O port Communicate by port internal hardware is fixed ROM is larger than RAM (usually) Microcontrollers are suitable to processing information in computer systems.

A microprocessor: single-chip contained only CPU bus is available RAM capacity, num of port is selectable RAM is larger than ROM (usually) Microprocessor are suitable to control of I/O devices in designs requiring a minimum component

Microcontroller for Embedded Systems

In the literature discussing microcontrollers, we often see the term Embedded System. Microcontrollers are widely used in Embedded System products. An Embedded product uses a microcontroller to do one task and one task only. In an Embedded System there is only one application software that is typically burned into ROM and X-86 PC contains or is connected to various Embedded products such as keyboard, printer, modem, disk controller, sound card, CD-ROM driver, mouse and so on. Each one of theses peripherals has a microcontroller inside it that performs only one task. .

Why use 8 bit microcontroller


The following features of 8- bit microcontrollers make it useful to be used for IC testing. Low cost. Low power consumption High speed perform Represent a transition zone between dedicated, highvolume, 4-bit micro- controllers and the high performance 16 bit microcontrollers.
Bit

addressing used for test pin monitoring or program

control flags.

8 bit word size adequate for many computing tasks and

control or monitoring applications

89c51
9

4K Bytes of In-System Reprogrammable Flash Memory 128 x 8-bit Internal RAM Two 16-bit Timer/Counters Six Interrupt Sources

10

Pin Configuration

11

PIN DIAGRAM DESCRIPTION

Vcc

Supply Voltage

GND

Ground

Port 0

Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are 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 bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs.
12

When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. 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 and verification.

Table I. Alternate Functions of Port 1

Port 2

Port 2 is an 8-bit bidirectional I/O port with internal pullups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled
13

high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. 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 uses 8-bit addresses (MOVX @ RI), Port 2 emits 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 bidirectional I/O port with internal pullups. 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 receives some control signals for Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S52, as shown in the following Table. Table II. Alternate Functions of Port 3

14

RST (Reset input)

A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO Bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled.

ALE/PROG

Address Latch Enable 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 of 1/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
15

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 microcontroller 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.EA should be strapped to VCC for internal program executions.This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming. XTAL 1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit

XTAL 2 Output from the inverting oscillator amplifier.


16

ARCHIECTURE 89s52

17

Special Function Registers


18

A map of the on-chip memory area called the Special Function Register (SFR) space is shown in Table I Note that not all of the addresses are occupied, and unoccupied addresses may not be implemented on the chip. Read accesses to these addresses will in general return random data, and write accesses will have an indeterminate effect. User software should not write 1s to these unlisted locations, since they may be used in future products to invoke new features. In that case, the reset or inactive values of the new bits will always be 0. Timer 2 Registers: Control and status bits are contained in registers T2CON (shown in Table II) and T2MOD for Timer 2. The register pair (RCAP2H, RCAP2L) is the Capture/Reload registers for Timer 2 in 16-bit capture mode or 16-bit auto-reload mode. Interrupt Registers: The individual interrupt enable bits are in the IE register. Two priorities can be set for each of the six interrupt sources in the IP register. Dual Data Pointer Registers: To facilitate accessing both internal and external data memory, two banks of 16-bit Data Pointer Registers are provided: DP0 at SFR address locations 82H-83H and DP1 at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1. The user should ALWAYS initialize the DPS bit to the appropriate value before accessing the respective Data Pointer Register.
19

Power off Flag: The Power off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR. POF is set to 1 during power up. It can be set and rest under software control and is not affected by reset.

Memory Organization
MCS-51 devices have a separate address space for Program and Data Memory. Up to 64K bytes each of external Program and Data Memory can be addressed.
Program Memory

If the EA pin is connected to GND, all program fetches are directed to external memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H through FFFFH are to external memory.
Data Memory

The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space. When an instruction accesses an internal location above address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. Instructions which use direct addressing access the SFR space. For example, the following direct addressing instruction accesses the SFR at location 0A0H (which is P2).
20

MOV 0A0H, #data Instructions that use indirect addressing access the upper 128 bytes of RAM. For example, the following indirect addressing instruction, where R0 contains 0A0H, accesses the data byte at address 0A0H, rather than P2 (whose address is 0A0H). MOV @R0, #data Note that stack operations are examples of indirect addressing, so the upper 128 bytes of data RAM is available as stack space.

Watchdog Timer (One-time Enabled with Reset-out) The WDT is intended as a recovery method in situations where the CPU may be subjected to software upsets. The WDT consists of a 14-bit counter and the Watchdog Timer Reset (WDTRST) SFR. The WDT is defaulted to disable from exiting reset. To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H). When the WDT is enabled, it will increment every machine cycle while the oscillator is running. The WDT timeout period is dependent on the external clock frequency. There is no way to disable the WDT except through reset (either hardware reset or WDT overflow reset). When WDT overflows, it will drive an output RESET HIGH pulse at the RST pin.

Using the WDT

21

To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H). When the WDT is enabled, the user needs to service it by writing 01EH and 0E1H to WDTRST to avoid a WDT overflow. The 14-bit counter overflows when it reaches 16383 (3FFFH), and this will reset the device. When the WDT is enabled, it will increment every machine cycle while the oscillator is running. This means the user must reset the WDT at least every 16383 machine cycles. To reset the WDT the user must write 01EH and 0E1H to WDTRST. WDTRST is a write-only register. The WDT counter cannot be read or written. When WDT overflows, it will generate an output RESET pulse at the RST pin. The RESET pulse duration is 98xTOSC, where TOSC = 1/FOSC. To make the best use of the WDT, it should be serviced in those sections of code that will periodically be executed within the time required to prevent a WDT reset.

WDT during Power-down and Idle In Power-down mode the oscillator stops, which means the WDT also stops. While in Power down mode, the user does not need to service the WDT. There are two methods of exiting Power-down mode: by a hardware reset or via a level-activated external interrupt which is enabled prior to entering Power-down mode. When Power-down is exited with hardware reset, servicing the WDT should occur as it normally does whenever the AT89S52 is reset. Exiting Power-down with an interrupt is significantly different. The interrupt is held low long enough for the oscillator to stabilize. When the interrupt is brought high, the interrupt is serviced. To prevent the WDT from resetting the device while the interrupt pin is held low, the WDT is not started until The interrupt is pulled high. It is suggested that the WDT be reset during the interrupt service for the interrupt used to exit Power-down mode.
22

To ensure that the WDT does not overflow within a few states of exiting Power-down, it is best to reset the WDT just before entering Power-down mode. Before going into the IDLE mode, the WDIDLE bit in SFR AUXR is used to determine whether the WDT continues to count if enabled. The WDT keeps counting during IDLE (WDIDLE bit = 0) as the default state. To prevent the WDT from resetting the AT89S52 while in IDLE mode, the user should always set up a timer that will periodically exit IDLE, service the WDT, and reenter IDLE mode. With WDIDLE bit enabled, the WDT will stop to count in IDLE mode and resumes the count upon exit from IDLE.

Interrupts
The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These interrupts are all shown in Figure 1 Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which disables all interrupts at once. Note that Table I shows that bit position IE.6 is unimplemented. User software should not write a 1 to this bit position, since it may be used in future AT89 products. Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register T2CON. Neither of these flags is cleared by hardware when the service routine is vectored to. In fact, the service routine may have to determine whether it was TF2 or EXF2 that

23

generated the interrupt, and that bit will have to be cleared in software.

The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers overflow. The values are then polled by the circuitry in the next cycle. However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which the timer overflows.

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. 2.1Either 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.2. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-bytwo flip-flop, but minimum and maximum voltage high and lowtime specifications must be observed.

Figure 2.1 Oscillator Connections

Figure 2.2 External Clock Drive Configuration

Idle Mode

24

In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. Note that when idle mode is terminated by a hardware reset, the device normally resumes program execution from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when idle mode is terminated by a reset, the instruction following the one that invokes idle mode should not write to a port pin or to external memory.

Power-down Mode
In the Power-down mode, the oscillator is stopped, and the instruction that invokes Power-down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the Power-down mode is terminated. Exit from Power-down mode can be initiated either by a hardware reset or by an enabled external interrupt. Reset redefines the SFRs but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize.

8051 INSTRUCTIONS
SINGLE BIT INSTRUCTIONS
25

SETBBIT CLR BIT CPL BIT JB BIT, TARGET JNB BIT, TARGET JBC BIT, TARGET

SET THE BIT =1 CLEAR THE BIT =0 COMPLIMENT THE BIT 0 =1, 1=0 JUMP TO TARGET IF BIT =1 JUMP TO TARGET IF BIT =0 JUMP TO TARGET IF BIT =1 & THE

1.1 MOV INSTRUCTIONS:- MOV instruction simply copy the

data from one location to another location.


1.2 MOV D,S ; Copy the data from(S) source to D(destination)

MOV R0,A ; Copy contents of A into Register R0 MOV R1,A ; Copy contents of A into register R1 MOV A,R3 ; Copy contents of Register R3 into Accumulator. DIRECT LOADING THROUGH MOV MOV A,#23H ; Direct load the value of 23H in A MOV R0,#12H ; direct load the value of 12H in R0 MOV R5,#0F9H ; Load the F9 value in the Register R5

ADD INSTRUCTIONS ADD instruction adds the source byte to the accumulator (A) and place the result in the Accumulator.
26

ADD A,#42H ; By this instructions we add the value 42H in Accumulator. ADD A,R3 ; By this instructions we move the data from register r3 to accumulator and then add the contents of the register into accumulator . SUBROUTINE CALL FUNCTION
1.2.1.1 ACALL, TARGET ADDRESS ; By this instructions we

call subroutines with a target address within 2k bytes from the current program counter. ACALL is a limit for the 2 k byte program counter, but for upto 64k byte we use LCALL instructions. Note that LCALL is a 3 byte instruction. ACALL is a two byte instruction. AJMP stands for absolute jump. It transfers program execution to the target address unconditionally. The target address for this instruction must be within 2k byte of program memory. LJMP is also for absolute jump. It transfers program execution to the target address unconditionally. This is a 3 byte instructions LJMP jump to any address within 64 k byte location. 51

INSTRUCTIONS RELATED TO THE CARRY

27

1.3 JC TARGET; JUMP TO THE TARGET IF CY FLAG =1 1.4 JNC TARGET; JUMP TO THE TARGET ADDRESS IF

CY FLAG IS = 0 2 3 INSTRUCTIONS RELASTED TO JUMP WITH ACCUMULATOR


3.1.1.1.1

JZ TARGET; JUMP TO TARGET IF A = 0 JNZ TARGET; JUMP IF ACCUMULATOR IS NOT ZERO.

3.1.1.1.1.1.1

3.1.1.1.1.1.2 This instruction jumps if register A has a value other than zero 3.1.1.1.2
3.1.1.1.2.1.1.1

INSTRUCTIONS RELATED TO THE ROTATE

RL A; ROTATE LEFT THE ACCUMULATOR By this instruction we rotate the bits of A left. The bits rotated out of A are rotated back into A at the opposite end.
3.1.1.1.3

RR A:- By this instruction we rotate the contents of the accumulator from right to left from LSB to MSB. RRC A: - This is same as RR A but difference is that the bit rotated out of register first enters in to carry and then enter into MSB. RLC A:- ROTATE A LEFT THROUGH CARRY. This shifts the data from MSB to carry and carry to LSB. RET:- This is return from subroutine. This instruction is used to return from a subroutine previously entered by instructions LCALL and ACALL. RET1:- This is used at the end of an interrupt service routine. We use this instruction after interrupt routine.

3.1.1.1.4

3.1.1.1.5

3.1.1.1.6

3.1.1.1.7

28

52 PUSH:- This copies the indicated byte onto the stack and increments SP. This instruction supports only direct addressing mode. POP; POP FROM STACK. This copies the byte pointed to be SP to the location whose direct address is indicated, and decrements SP by 1. Notice that this instructions supports only direct addressing mode. DPTR INSTRUCTIONS:MOV DPTR,#16 BIT VALUE; LOAD DATA POINTER This instructions load the 16 bit DPTR register with a 16 bit immediate value 3.1.1.1.8 INC BYTE:This instruction adds 1 to the register or memory location specified by the operand. INC A INC Rn INC DIRECT 3.1.1.1.9 DEC BYTE :This instruction subtracts 1 from the byte operand. Note that CY is unchanged. DEC A DEC Rn DEC DIRECT

CHAPTER 3:29

DESCRIPTION PROJECT:

OF

30

3.4 COMPONENTS:

Regulator:

The regulator (7805) provides circuit designers with an easy way to regulate DC voltages to 5v. Here 78 stands for positive and 05 stands for 5 volts. The 7805 is a positive voltage DC regulator that has only 3 terminals. They are: Input voltage, Ground, Output Voltage. General Features: Output Current up to 1A Short Circuit Protection Thermal Overload Protection

Capacitors:

A capacitor or condenser is a passive electronic component consisting of a pair of conductors separated by a dielectric. When a voltage potential difference exists between the conductors, an electric field is present in the dielectric. This field stores energy and produces a mechanical force between the plates. In this circuit our capacitor is used to remove ripples. In this we have used both electrolytic and ceramic capacitor of various ratings.

31

Resistors:
A resistor is a two-terminal electronic component that produces a voltage across its terminals that is proportional to the electric current through it in accordance with Ohm's law. Resistors of various ratings are used in this circuit. Resistance is used in front of led to drop the voltage from 5v which is coming from microcontroller to 3v which is required by the led to glow.

Microcontroller:

The 89C51 is a low-power, high-performance CMOS 8-bit microcomputer with 8K bytes of Flash Programmable and Erasable Read Only Memory (PEROM).

LEDs:

A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices, and are increasingly used for lighting. In this we are using leds to show the level of water in tank.

Transistors:

32

In this we have used NPN and PNP transistors. NPN transistor will be used to turn the motor on and PNP to convert negative voltage to positive voltage.

Crystal oscillator:

A crystal oscillator is an electronic circuit that uses the mechanical resonance of a vibrating crystal of piezoelectric material to create an electrical signal with a very precise frequency. This frequency is commonly used to keep track of time to provide a stable clock signal for digital integrated circuits

CHAPTER 4:33

DESIGN PROCEDURE
ACCORDING TO CIRCUIT DIAGRAM WE HAVE COLLECTED THE COMPONENTS REQUIRED IN OUR PROJECT. THEN WE ASSEMBLED THOSE COMPONENTS ON THE PCB BOARD ACCORDING TO CIRCUIT DIAGRAM. AFTER THE ASSEMBLING OF THESE COMPONENTS THEN WE SOLDERED THOSE COMPONENTS ON THE PCB BOARD. WE MADE THE HARDWARE CONNECTIONS WITH THE VARIOUS COMPONENTS. THEN WE ASSEMBLED THE HARDWARE ON THE PLYWOOD. WHOLE

34

35

CHAPTER 5:FABRICATION TECHNIQUES


The fabrication techniques used in this project can be broadly classified into: Mechanical Fabrication, consisting of mechanical design i.e. frame, tower, tank etc. Electrical Fabrication, consisting of electrical design i.e. making PCB, soldering etc.

36

Mechanical Fabrication
1) For the basic frame we are using plywood cut out accordingly so as to adjust the PCB on the top, the transformer, the main and source tank .

Electrical Fabrication
1) Soldering

How to solder?
Mount components at their appropriate place; bend the leads slightly outwards to prevent them from falling out when the board is turned over for soldering. No cut the leads so that you may solder them easily. Apply a small amount of flux at these components leads with the help of a screwdriver. Now fix the bit or iron with a small amount of solder and flow freely at the point and the P.C.B copper track at the same time. A good solder joint will appear smooth & shiny. If all appear well, you may continue to the next solder connections.

Tips for good soldering


1. Use right type of soldering iron. A small efficient soldering iron (about 10-25 watts with 1/8 or 1/4 inch tip) is ideal for this work. Keep the hot tip of the soldering iron on a piece of metal so that excess heat is dissipated.

2.

37

3.

Make sure that connection to the soldered is clean. Wax frayed insulation and other substances cause poor soldering connection. Clean the leads, wires, tags etc. before soldering.

4. Use just enough solder to cover the lead to be soldered. Excess solder can cause a short circuit. 5. Use sufficient heat. This is the essence of good soldering. Apply enough heat to the component lead. You are not using enough heat, if the solder barely melts and forms a round ball of rough flaky solder. A good solder joint will look smooth, shining and spread type. The difference between good & bad soldering is just a few seconds extra with a hot iron applied firmly.

Precautions
1. Mount the components at the appropriate places before soldering. Follow the circuit description and components details, leads identification etc. Do not start soldering before making it confirm that all the components are mounted at the right place. Do not use a spread solder on the board, it may cause short circuit. Do not sit under the fan while soldering. Position the board so that gravity tends to keep the solder where you want it.
38

2. 3. 4.

5. 6.

Do not over heat the components at the board. Excess heat may damage the components or board. The board should not vibrate while soldering otherwise you have a dry or a cold joint.

CHAPTER 6:TESTING AND EVALUATION


All the components used in constructing the WATER LEVEL CONTROLLER CIRCUIT came pre tested therefore the tests performed were done after the completion of the project. The following tests were performed:

Visual Observation

39

A visual observation of the WATER LEVEL AND MONITORING CIRCUIT was conducted to look for any broken connection or any stray wire that can restrict the flow of water or any other visible fault. No problem was found during this visual evaluation.

Operational Test
The circuit was operated and checked whether it is performing the desired operation.

No problem was found during this test.

CHAPTER 7:CONCLUSION AND SCOPE OF FUTURE WORK


The project required knowledge of Microcontrollers and basic analog and digital electronics. Since its the water level control, various other fuctions

40

CHAPTER 8:references
Following are some internet sites, books, magazines taken as reference for this project:

http://www.scribd.com http://www. electronicsforu.com http://www.indianengineer.wordpress.com/2008/ 09/17/microprocessor-projects-water-levelcontroller.com http://www.microcontrollerbooks.com http://www.datasheetcatalog.com/datasheets_pdf/ K/A/7/8/KA78XX.shtm


41

http://www.dxportal.com/stats/content/250368IC-4049.html http://www.mashhadkit.com/2004/Learning/imag es/IC4049.gif http://www.bitsbox.co.uk/images/7805.jpg www.8051projects.info/datasheets/BC548.pdf www.datasheetpro.com/496229_view_BC558_da tasheet.html http://www.electronic-circuitsdiagrams.com/alarmsimages/alarmsckt6.shtml http://www.sapconinstruments.com/conductivity/ water-level-switch.html www.electronicstutotials.com/oscillators/crystaloscillators.htm

Books:

Programming and Customizing Microcontroller by :Myke Predko Embedded Systems by Dr. K.V.K.K Prasad

8051

The 8051/8052 Microcontroller by: Craig Steiner Muhammad ali mazidi and robin D Mckinlay,"The 8051 microcontroller and

42

embedded system using assembly and c", Pearson Education. Designing Embedded Hardware :John Catsaulis by Shroff Pub.

The 8051 Microcontroller Architecture Programming and Applications by: Kenneth J. Ayala, West Publishing company.

43

You might also like