Continuous Liquid Level Controller

35
GROUP ID: 14 Continuous Liquid Level Controller VIER (EC) - 1 - 1. INTRODUCTION In Continuous Liquid Level Controller, Pump will play the role of a door which will be opened and closed as per the real time situation. Sensors are interfaced with the Micro- controller and equipped with the most reliable logical operations so that the most précised leveling of the tank is known to the user on the LCD screen. The output of the sensor will control the operation of the pump/buzzer. Hence our Minor Model will be equipped with the Smart Sensors eligible to contribute its best possible outcome to the Micro-controller. At maximum and threshold level of the tank a buzzer will be heard which will take care of the human values and thereby will take a step towards creating a user-friendly as well as eco- friendly environment. A complete logic is loaded in the controller so that it follows the instruction of the programmer appropriately and works accordingly. The aim of building this model is to save liquid resources and enhance human life in all contexts. This prototype is a reference to the industrial application where continuous liquid control and its monitoring is essential. Hence this model shows our sincere effort in building the Continuous Liquid Level Controller (CLLC) which is a step towards the welfare of the society using embedded technologies.

description

Level Sensing using Ultrasonic Sensor

Transcript of Continuous Liquid Level Controller

Page 1: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 1 -

1. INTRODUCTION

In Continuous Liquid Level Controller, Pump will play the role of a door which will be

opened and closed as per the real time situation. Sensors are interfaced with the Micro-

controller and equipped with the most reliable logical operations so that the most précised

leveling of the tank is known to the user on the LCD screen. The output of the sensor will

control the operation of the pump/buzzer. Hence our Minor Model will be equipped with the

Smart Sensors eligible to contribute its best possible outcome to the Micro-controller. At

maximum and threshold level of the tank a buzzer will be heard which will take care of the

human values and thereby will take a step towards creating a user-friendly as well as eco-

friendly environment.

A complete logic is loaded in the controller so that it follows the instruction of the

programmer appropriately and works accordingly. The aim of building this model is to save

liquid resources and enhance human life in all contexts. This prototype is a reference to the

industrial application where continuous liquid control and its monitoring is essential. Hence

this model shows our sincere effort in building the Continuous Liquid Level Controller

(CLLC) which is a step towards the welfare of the society using embedded technologies.

Page 2: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 2 -

2. LITERATURE WORK

As a part of basic literature survey, we have the PSAR report, in which we studied

description about following topics:

Improvements in or relating to liquid level indicator

Magnetic liquid level indicator

Liquid Level Indicator using Laser beam

Continuous level indicator for solids and liquids.

Non-contact type water level control apparatus.

High-Low level alarm controller

Noninvasive Ultrasonic liquid Level Indicator

Water level detector and indicator system

liquid level indicator using lights

Liquid level monitoring and reporting system

* Detailed description about the topics are mentioned in PSAR report

Besides that we have gone through few website, which helps us to get information about our

topics, which are mentioned in bibliography.

Page 3: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 3 -

3. Materials, Software and methods used

3.1 Hardware Components:

Microcontroller – ATMEGA-16A (AVR)

LCD 16 x 2 - JHD 16*2

ULN2003AC - (Qty. 1)

Regulator IC – LM7805

Relay - JQC-3FC (T73) DC 12V

Buzzer

Voltage Regulator - LM7805

Submersible Pump

Sensor – Ultrasonic Distance Sensor

Electrolytic Capacitor

3.1.1) ATMEGA16 (AVR) CONTROLLER

Page 4: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 4 -

3.1.1.1) General Description

Atmega16 is a low power CMOS 8bit microcontroller based on AVR enhances RISC

architecture. By executing powerful instructions in a single clock the atmega16 achieves

throughput approaching 1MIPS per MHZ allowing the system designer to optimize power

consumption versus processing speed. The main function of ATmega16 is to ensure correct

program execution. The CPU must therefore be able to access memories, perform

calculations, control peripherals and handle interrupts.

3.1.1.2) Features

High-performance, Low-power AVR® 8-bit Microcontroller

Advanced RISC Architecture

131 Powerful Instructions 131 Powerful Instructions

Most Single Most Single--clock Cycle Execution clock Cycle Execution

32 x 8 General Purpose Working Registers

Fully Static Operation

Up to 16 MIPS Throughput at 16 MHz

On-chip 2-cycle Multiplier

High Endurance Non-volatile Memory segments

16K Bytes of In-System Self-programmable Flash program memory

512 Bytes EEPROM

1K Byte Internal SRAM

Write/Erase Cycles: 10,000 Flash/100,000 EEPROM

Optional Boot Code Section with Independent Lock Bits

In-System Programming by On-chip Boot Program

True Read-While-Write Operation

Programming Lock for Software Security

Page 5: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 5 -

3.1.1.3) PIN DESCRIPTION

VCC: Digital supply voltage.

GND: Ground.

Port A (PA7..PA0): Port A serves as the analog inputs to the A/D Converter.Port A

also serves as an 8-bit bi-directional I/O port, if the A/D Converter is not used. Port pins can

provide internal pull-up resistors (selected for each bit). The Port A output buffers have sym-

metrical drive characteristics with both high sink and source capability. When pins PA0 to

PA7 are used as inputs and are externally pulled low, they will source current if the internal

pull-up resistors are activated . The Port A pins are tri-stated when a reset condition becomes

active, even if the clock is not running.

Port B (PB7..PB0): Port B is an 8-bit bi-directional I/O port with internal pull-up

resistors (selected for each bit). The Port B output buffers have symmetrical drive

characteristics with both high sink and source capability. As inputs, Port B pins that are

externally pulled low will source current if the pull-up resistors are activated. The Port B pins

are tri-stated when a reset condition becomes active, even if the clock is not running.

Port B also serves the functions of various special features of the ATmega16 as listed on page

58.

Port C (PC7..PC0): Port C is an 8-bit bi-directional I/O port with internal pull-up

resistors (selected for each bit). The Port C output buffers have symmetrical drive

characteristics with both high sink and source capability. As inputs, Port C pins that are

externally pulled low will source current if the pull-up resistors are activated. The Port C pins

are tri-stated when a reset condition becomes active, even if the clock is not running. If the

JTAG interface is enabled, the pull-up resistors on pins PC5(TDI), PC3(TMS) and

PC2(TCK) will be activated even if a reset occurs.

Port C also serves the functions of the JTAG interface and other special features of the

ATmega16 as listed on page 61.

Page 6: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 6 -

Port D (PD7..PD0): Port D is an 8-bit bi-directional I/O port with internal pull-up

resistors (selected for each bit). The Port D output buffers have symmetrical drive

characteristics with both high sink and source capability. As inputs, Port D pins that are

externally pulled low will source current if the pull-up resistors are activated. The Port D pins

are tri-stated when a reset condition becomes active, even if the clock is not running.

Port D also serves the functions of various special features of the ATmega16 as listed on page

63.

RESET: Reset Input. A low level on this pin for longer than the minimum

pulse length will generate a reset, even if the clock is not running. The minimum pulse length

is given in Table 15 on page 38. Shorter pulses are not guaranteed to generate a reset.

XTAL1: Input to the inverting Oscillator amplifier and input to the internal

clock operating circuit.

XTAL2: Output from the inverting Oscillator amplifier.

AVCC: AVCC is the supply voltage pin for Port A and the A/D Converter.

It should be externally con- nected to VCC, even if the ADC is not used. If the ADC is used,

it should be connected to VCC through a low-pass filter.

AREF: AREF is the analog reference pin for the A/D Converter.

3.1.1.4) ADVANTAGES

Small instruction set to learn

RISC architecture

Built in oscillator with selectable speeds

Inexpensive

Wide range of interfaces including I²C, SPI, USB, USART, A/D, programmable

comparators, PWM, LIN, CAN, PSP, and Ethernet.

Availability of processors in DIL package make them easy to handle for hobby use.

Page 7: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 7 -

3.1.1.5) LIMITATIONS

One accumulator

Register-bank switching is required to access the entire RAM of many devices

Operations and registers are not orthogonal; some instructions can address RAM

and/or immediate constants, while others can only use the accumulator.

3.1.2) ULN 2003 AMPLIFIER

3.1.2.1) GENERAL DESCRIPTION

ULN2003 is a high voltage and high current Darlington array IC. It contains seven open

collector Darlington pairs with common emitters. A Darlington pair is an arrangement of two

bipolar transistors.

ULN2003 belongs to the family of ULN200X series of ICs. Different versions of this family

interface to different logic families. ULN2003 is for 5V TTL, CMOS logic devices. These

ICs are used when driving a wide range of loads and are used as relay drivers, display drivers,

line drivers etc. ULN2003 is also commonly used while driving Stepper Motors.

The ULN2003 is a monolithic IC consists of seven NPN Darlington transistor pairs with high

voltage and current capability. It is commonly used for applications such as relay drivers,

motor, display drivers, led lamp drivers, logic buffers, line drivers, hammer drivers and other

Page 8: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 8 -

high voltage current applications. It consists of common cathode clamp diodes for each NPN

Darlington pair which makes this driver IC useful for switching inductive loads.

The output of the driver is open collector and the collector current rating of each Darlington

pair is 500mA. Darlington pairs may be paralleled if higher current is required. The driver IC

also consists of a 2.7KΩ base resistor for each Darlington pair. Thus each Darlington pair can

be operated directly with TTL or 5V CMOS devices. This driver IC can be used for high

voltage applications up to 50V.

Page 9: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 9 -

3.1.2.2.) Pin Description:

Pin No Function Name

1 Input for 1st channel Input 1

2 Input for 2nd

channel Input 2

3 Input for 3rd

channel Input 3

4 Input for 4th

channel Input 4

5 Input for 5th

channel Input 5

6 Input for 6th

channel Input 6

7 Input for 7th

channel Input 7

8 Ground (0V) Ground

9 Common freewheeling diodes Common

10 Output for 7th

channel Output 7

11 Output for 6th

channel Output 6

12 Output for 5th

channel Output 5

13 Output for 4th

channel Output 4

14 Output for 3rd

channel Output 3

15 Output for 2nd

channel Output 2

16 Output for 1st channel Output 1

Page 10: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 10 -

3.1.3) 7805 REGULATOR IC

3.1.3.1) GENERAL DESCRIPTION

Positive Voltage Regulator ICs

The L78xx series of three-terminal positive regulators is available in TO-220, TO-220FP,

TO-3, D²PAK and DPAK packages and several fixed output voltages, making it useful in a

wide range of applications.

These regulators can provide local on-card regulation, eliminating the distribution problems

associated with single point regulation. Each type employs internal current limiting, thermal

shut-down and safe area protection, making it essentially indestructible. If adequate heat

sinking is provided, they can deliver over 1 A output current. Although designed primarily as

fixed voltage regulators, these devices can be used with external components to obtain

adjustable voltage and currents.

3.1.3.2) FEATURES

Output current up to 1.5 A

Output voltages of 5; 6; 8; 8.5; 9; 12; 15; 18; 24 V

Thermal overload protection

Short circuit protection

Output transition SOA protection

2 % output voltage tolerance

Guaranteed in extended temperature range

Page 11: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 11 -

3.1.4) BUZZER

Piezo buzzer is an electronic device commonly used to produce sound. Light weight, simple

construction and low price make it usable in various applications like car/truck reversing

indicator, computers, call bells etc. Piezo buzzer is based on the inverse principle of piezo

electricity discovered in 1880 by Jacques and Pierre Curie. It is the phenomena of generating

electricity when mechanical pressure is applied to certain materials and the vice versa is also

true. Such materials are called piezo electric materials. Piezo electric materials are either

naturally available or manmade. Piezoceramic is class of manmade material, which poses

piezo electric effect and is widely used to make disc, the heart of piezo buzzer. When

subjected to an alternating electric field they stretch or compress, in accordance with the

frequency of the signal thereby producing sound.

Page 12: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 12 -

3.1.5) Submersible pump

A water pump with an electric motor in the same housing with the pump, designed to operate

while submerged in water. Eliminates suction lift limitations, loss of prime, need for suction

hose, and the noise and fumes of an internal combustion engine.

A submersible water pump operates beneath the earth's surface. A submersible water pump

will not operate if it is not submerged in liquid. A submersible water pump pushes water to

the surface, instead of sucking the water out of the ground like above ground water pumps.

Most submersible pumps are long cylinders that are about 3 to 5 inches around and 2 to 4 feet

long. Submersible water pumps have a hermetically sealed motor that is close-coupled to the

body of the water pump. Having a hermetically sealed motor prevents the water from getting

inside the pumps motor and causing a short circuit. Other components of a submersible water

pump are the cable, which is connected to the motor, and a pipe that transports the water to

the surface of the well.

Page 13: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 13 -

3.1.6) ULTRASONIC SENSOR

3.1.6.1) Features

Minimum range 10 centimeters

• Maximum range 400 centimeters (4 Meters)

• Accuracy of +-1 cm

• Resolution 1 cm

• 5V DC Supply voltage

• Compact sized SMD design

• Modulated at 40 kHz

• Serial data of 9600 bps TTL level output for easy interface with any microcontroller.

Page 14: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 14 -

3.1.7) DC RELAY 12 V

3.1.7.1) GENERAL DESCRIPTION

Relay is an electromagnetic device which is used to isolate two circuits electrically and

connect them magnetically. They are very useful devices and allow one circuit to switch

another one while they are completely separate. They are often used to interface an electronic

circuit (working at a low voltage) to an electrical circuit which works at very high voltage.

For example, a relay can make a 5V DC battery circuit to switch a 230V AC mains circuit.

Thus a small sensor circuit can drive, say, a fan or an electric bulb.

A relay switch can be divided into two parts: input and output. The input section has a coil

which generates magnetic field when a small voltage from an electronic circuit is applied to

it. This voltage is called the operating voltage. Commonly used relays are available in

different configuration of operating voltages like 6V, 9V, 12V, 24V etc. The output section

consists of contactors which connect or disconnect mechanically. In a basic relay there are

three contactors: normally open (NO), normally closed (NC) and common (COM). At no

input state, the COM is connected to NC. When the operating voltage is applied the relay coil

gets energized and the COM changes contact to NO. Different relay configurations are

available like SPST, SPDT, DPDT etc, which have different number of changeover contacts.

By using proper combination of contactors, the electrical circuit can be switched on and off.

Page 15: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 15 -

3.1.8) POLARIZED CAPACITOR

3.1.8.1) GENERAL DESCRIPTION

A polarized capacitor is one which has a polarity, positive on one terminal, negative on the

other. This makes it superficially look like a battery. In use, the capacitor has its positive

voltage always higher than that on the negative terminal, it matters that this is the case and

this gives rise to the term polarized. This sort of capacitor is commonly found in power

supply filters.

3.1.8.2) SYMBOL OF POLARIZED CAPACITOR;

Page 16: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 16 -

3.1.8.3) Polarized fixed capacitor

A polarized ("polar") capacitor is a type of capacitor that have implicit polarity -- it can only

be connected one way in a circuit. The positive lead is shown on the schematic (and often on

the capacitor) with a little "+" symbol. The negative lead is generally not shown on the

schematic, but may be marked on the capacitor with a bar or "-" symbol. Polarized capacitors

are generally electrolytic.

One really needs to pay attention to correctly hooking a polarized capacitor up (both with

respect to polarity, as well as not pushing a capacitor past its rated voltage). If one pushes a

polarized capacitor hard enough, it is possible to begin "electrolyzing" the moist electrolyte.

Modern electrolytic capacitors usually have a pressure relief vent to prevent catastrophic

failure of the aluminum can.

Just remember that polarized capacitors usually have large capacitance per volume compared

to non-polar caps (like ceramic). So it might be hard to find a non-polar cap with an

equivalent value as long as the voltage and capacitance matches.

-

Page 17: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 17 -

3.1.9) LCD DISPLAY

3.1.9.1) GENERAL DESCRIPTION

This is 2 lines by 16 characters LCD display, HD44780-compatible controller, with a

yellow/green backlight. Note: The documentation link is to a slightly different type, but the

connections are the same. The backlight does not have separate pins, it connects to the

ground and 5 Volt pin, the series resistor is in the LCD.

LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of

applications. A 16x2 LCD display is very basic module and is very commonly used in

various devices and circuits. These modules are preferred over seven segments and other

multi segment LEDs. The reasons being: LCDs are economical; easily programmable; have

no limitation of displaying special & even custom characters (unlike in seven segments),

animations and so on.

Page 18: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 18 -

3.1.9.2) Pin Description:

Pin

No Function Name

1 Ground (0V) Ground

2 Supply voltage; 5V (4.7V – 5.3V) Vcc

3 Contrast adjustment; through a variable resistor VEE

4 Selects command register when low; and data register when high Register Select

5 Low to write to the register; High to read from the register Read/write

6 Sends data to data pins when a high to low pulse is given Enable

7

8-bit data pins

DB0

8 DB1

9 DB2

10 DB3

11 DB4

12 DB5

13 DB6

14 DB7

15 Backlight VCC (5V) Led+

16 Backlight Ground (0V) Led-

Page 19: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 19 -

3.2 METHODS:

There were lots of ways to sense the level of liquid i.e. one can calculate the continuous

level of liquid or it may be discrete in nature.

As we were interested in measuring the continuous level, we worked on the same.

There are many sensors from which one can do the need, but we found Ultrasonic

distance sensor to be more efficient .

3.2.1) BLOCK DIAGRAM

Page 20: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 20 -

3.2.2) Description

The above diagram gives the pictorial representation of the devices interfaced with the

microcontroller.

Modules included in the block diagram are:

1) Power supply

2) Microcontroller (CPU)

3) Primary and Secondary tank.

4) Output Devices.

5) Input Devices.

3.2.2.1) Power supply module :

A power supply is a device that supplies electric power to microcontroller and various

other modules which need 5V OR 12V power respectively. A regulated power

supply is one that controls the output voltage or current to a specific value; the

controlled value is held nearly constant despite variations in either load current or the

voltage supplied by the power supply's energy source.

3.2.2.2) Microcontroller (CPU):

A Processing unit which processes data coming from the input devices with the help

of arithmetic and logical operations and responds to the output devices appropriately

is called as Microcontroller.

3.2.2.3) Primary and Secondary tank :

Our model uses two tanks namely primary tank in which sensor resides and secondary

tank in which pump resides. Both these tank can communicate with each other using

an embedded program built into the Microcontroller through an appropriate circuit

design.

3.2.2.4) Output Devices:

The project includes various output devices such as Pump, LCD and Buzzer.

These output devices are activated as per the real time situation and their duty cycle is

determined by the processing unit (Atmega16).

Page 21: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 21 -

3.2.2.5) Input Devices:

This minor model encompasses a sensor as an input device that controls the entire

functioning of the project by transmitting and receiving sound waves thereby using an

Acoustic method for leveling the primary tank taking into account the status the

secondary tank.

Page 22: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 22 -

3.3 SOFTWARES:

Two software were used to design & program our project, one for each i.e.,

Proteus 8 : for design & simulation &

MikroC Pro for AVR : for programming

3.3.1) SIMULATION SOFTWARE

Proteus 8 is a single application with many service modules offering different functionality

(schematic capture, PCB layout, etc.). The wrapper that enables all of the various tools to

communicate with each other consists of three main parts.

Application Framework

Proteus 8 consists of a single application (PDS.EXE). This is the framework or container

which hosts all of the functionality of Proteus. ISIS, ARES, 3DV all open as tabbed windows

within this framework and therefore all have access to the common database.

Common Database

The common database contains information about parts used in the project. A part can

contain both a schematic component and a PCB footprint as well both user and system

properties. Shared access to this database by all application modules makes possible a huge

number of new features, many of which will evolve over the course of the Version 8

lifecycle.

Live Netlist

Together with the common database the maintenance of a live netlist allows all open modules

to automatically reflect changes. The most obvious example of this is wiring in ISIS

producing ratsnest connections in ARES but it goes much further than that. The new Bill of

Materials module contains a live viewer and the 3D Viewer and Design Explorer are also

linked into the live netlist.

Page 23: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 23 -

Snapshot of software:

Page 24: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 24 -

3.3.3.1) Circuit design of the project

Page 25: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 25 -

3.3.2) PROGRAMMING SOFTWARE

3.3.2.1) MikroC Pro for AVR

It is easy to create embedded programs on AVR series through this software.

It allows project management, source code editing, program debugging and complete

simulation in one powerful environment.

More user friendly then C-Programming.

The mikroC PRO for AVR is a powerful, feature-rich development tool for AVR

microcontrollers.

It is designed to provide the programmer with the easiest possible solution to

developing application for embedded systems, without compromising performance or

control.

It allows quickly to develop and deploy complex applications.

Snapshots

Page 26: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 26 -

Page 27: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 27 -

4. PROJECT PROGRAM

C- PROGRAM

sbit LCD_RS at PORTc5_bit;

sbit LCD_EN at PORTc4_bit;

sbit LCD_D4 at PORTc3_bit;

sbit LCD_D5 at PORTc2_bit;

sbit LCD_D6 at PORTc1_bit;

sbit LCD_D7 at PORTc0_bit;

sbit relay at PORTa5_bit;

sbit relay1 at PORTa2_bit;

sbit LCD_RS_Direction at DDc5_bit;

sbit LCD_EN_Direction at DDc4_bit;

sbit LCD_D4_Direction at DDc3_bit;

sbit LCD_D5_Direction at DDc2_bit;

sbit LCD_D6_Direction at DDc1_bit;

sbit LCD_D7_Direction at DDc0_bit; // End LCD module

connections

char i,j,k,l,m,n,o,p;

char r;

int A=0 ;

char txt[6];

void main(){

Lcd_Init(); // Initialize LCD

Lcd_Cmd(_LCD_CLEAR); // Clear display

Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off

Lcd_Out(1,1,"Continuous Level Indicator"); // Write text in first row

Delay_ms(250);

DDRA = 0xff; // As OP

relay=1;

relay1=1;

UART1_Init(9600); // Initialize UART module at 9600 bps

Delay_ms(100); // Wait for UART module to stabilize

h1:

while (1)

{

Page 28: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 28 -

if (UART1_Data_Ready()) { // If data is received,

p = UART1_Read(); // read the received data,

/* Lcd_chr(2,1,p); */

goto x1;

}

}

x1:

while (1)

{

if (UART1_Data_Ready()) { // If data is received,

i = UART1_Read(); // read the received data,

Lcd_chr(2,1,i);

goto x2;

}

}

x2:

while (1)

{

if (UART1_Data_Ready()) { // If data is received,

j = UART1_Read(); // read the received data,

Lcd_chr(2,2,j);

goto x3;

}

}

x3:

while (1)

{

if (UART1_Data_Ready()) { // If data is received,

k = UART1_Read(); // read the received data,

Lcd_chr(2,3,k);

goto x4;

}

}

x4:

while (1)

{

Page 29: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 29 -

if (UART1_Data_Ready()) { // If data is received,

l = UART1_Read(); // read the received data,

Lcd_chr(2,4,l);

goto x5;

}

}

x5:

while (1)

{

if (UART1_Data_Ready()) { // If data is received,

m = UART1_Read(); // read the received data,

Lcd_chr(2,5,m);

goto x6;

}

}

x6:

while (1)

{

if (UART1_Data_Ready()) { // If data is received,

n = UART1_Read(); // read the received data,

if(n== 0x63) //63- ASCII value of 'c'

{

Lcd_chr(2,6,n);

goto x7; }

goto x6;

}

}

x7:

while (1)

{

x10:

if (UART1_Data_Ready()) { // If data is received,

o = UART1_Read(); // read the received data,

if(o== 0x6D) // 6D-ASCII value of 'm'

{

Lcd_chr(2,7,o); // conversion from ASCII to Decimal

Page 30: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 30 -

i= i-0x30 ;

i = i*100;

j= j-0x30 ;

j= j*10;

k= k-0x30 ;

k = k*1;

A = i+j+k;

WordToStr(A, txt);

Lcd_out(2,10,txt);

if (a <25 || a>50 )

{

Lcd_out(1,1,"BUZZER ON ");

relAY1 = 0;

delay_ms(50);

}

else

{

Lcd_out(1,1,"BUZZER OFF ");

relAY1 = 1;

delay_ms(50);

}

goto h1;

}

goto x10;

}

}

}

Page 31: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 31 -

5. TESTING AND VERIFICATION

Page 32: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 32 -

6. ADVANTAGES & APPLICATIONS

6.1) ADVANTAGES

We will Conserve three IMPORTANT resources: LIQUID, POWER, and TIME.

LIQUID- Ensures uninterrupted water supply, never allows tank to spill over or lie

empty.

POWER - Low power consumption leads to power conservation.

TIME – Use of MICROCONTROLLER as logic circuitry automates the whole

process which

ultimately saves the time of user.

No use of power circuitry at the sensing level while using .

VERSATILITY- Usable with tank of any size.

Reduces man power.

Work efficiently.

Power saving.

Work with ease.

User Friendly.

6.2) APPLICATIONS

Our minor model has a very wider scope in the field of chemical and pharmaceutical

industries where continuous level of the tank is required for 24 hour monitoring the

status of the resource.

Moreover the project can have its effect in the field of mechanical engineering in the

form of Boiler Monitoring.

Automated water level indicator can be extensively used to check the increasing and

decreasing level of water in the tank and pipes in various establishments such as

factories, hotels, restaurants, hospitals, offices, schools, colleges and multi-storey

residential apartments having over head water tank of any size, shape and model. So,

no need to go on the roof to check the water level.

Can be used for Municipal water taps for indication of flow of water from tap.

Can also be used to measure underground storage of water.

Page 33: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 33 -

Can be used to predict the arrival of floods.

Water level indicators are used to monitor water level in standpipes and wells.

Used widely in hydraulic industries.

Page 34: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 34 -

7. FUTURE SCOPE and CONCLUSION

7.1) FUTURE SCOPE

Any kind of modification as per the need can be done.

Vast scope in Bottle filling system.

With the use of color sensors type of liquid can be detected.

Flow sensors can be used in future to measure the amount of liquid flowing through

the Valves of the tank in the industries.

7.2) CONCLUSION

The main purpose behind this project was to learn about the various functions of

Atmega16 Controller. We learnt how the real time application works by

communicating various electronic devices by studying their construction and

functions thereby achieving the desired values as per the requirement. We also

learned about how various output devices are interfaced with Atmega16 controller.

With great eagerness we carefully programmed each device which was indeed a very

interesting job done during the term. Finally on completion of this project, our ability

as an engineer is boosted up and now we are sure for our bright future.

Page 35: Continuous Liquid Level Controller

GROUP ID: 14 Continuous Liquid Level Controller

VIER (EC) - 35 -

Bibliography

www.sunromtechnologies.com

www.robokits.com

www.youtube.com

www.engineeringprojects.com

www.engineersgarage.com

www.wikipedia.com

www.alldatasheet.com

www.slideshare.com