Automatic Water Level Controller
Automatic Water Level Controller
CONTROLLER
ENGINEERING
1
DECLARATION
This project is my original piece of work that has not been presented as partial fulfillment of any
award. It has not been done anywhere by anybody nor presented to any institution for the award
of any academic purpose.
SIGNATURE..................................... DATE…………………………….
This research has been submitted with my approval to the Kenya National Examination
Council.
Supervisor:
MR MUTAI
SIGNATURE..................................... DATE…………………………….
2
DEDICATION
I dedicate this work to my family; more so my lovely mom Arfon Abdi, my grandmother
Saladho Nuno and my aunt Yasmin for their warm guidance and love.
3
ACKNOWLEDGEMENT
First and foremost, I want to thank God who has enabled me to complete my project and course
as a whole.
I also want to thank my supervisor Mr. Mutai who helped me, gave enthusiastic support and
advice throughout my project. He also approved the script from the beginning to the end.
Thanks also to my fellow mates at the College for their support, effort and advice that led to the
successive publishing and writing of this Technical Project.
4
TABLE OF CONTENT
DECLARATION......................................................................................................................................2
DEDICATION..........................................................................................................................................3
ACKNOWLEDGEMENT........................................................................................................................4
ABSTRACT..............................................................................................................................................8
CHAPTER ONE.......................................................................................................................................9
INTRODUCTION....................................................................................................................................9
1.2 Justification.......................................................................................................................................10
1.4 Constrains.........................................................................................................................................10
CHAPTER TWO....................................................................................................................................11
2.0 Review..............................................................................................................................................11
2.1 Sensors..............................................................................................................................................12
CHAPTER THREE................................................................................................................................13
3.0 Methodology.....................................................................................................................................13
5
3.7 Voltage Regulators............................................................................................................................19
3.10 Transistor........................................................................................................................................23
3.12 Capacitor.........................................................................................................................................25
3.13 Relay...............................................................................................................................................25
3.23 Features...........................................................................................................................................30
CHAPTER FOUR...................................................................................................................................32
SYSTEM IMPLEMENTATION............................................................................................................32
4.4 Linker/Locator..................................................................................................................................36
4.5 Loader...............................................................................................................................................36
4.6 Testing...............................................................................................................................................36
4.7 Debugging.........................................................................................................................................36
6
4.8 Development Process........................................................................................................................37
4.13 Program...........................................................................................................................................38
CHAPTER FIVE....................................................................................................................................39
5.11 Packaging........................................................................................................................................42
5.13 Conclusion......................................................................................................................................42
5.15 Recommendations...........................................................................................................................43
References...............................................................................................................................................44
7
ABSTRACT
Automatic water level controller is designed to monitor the level of water in a tank. It
displays the level of water and when it is at the lowest level; a pump is activated
automatically to refill the tank. When the tank is filled to its maximum capacity, the pump is
automatically de-energized. Several circuits are put together to ensure proper working of
this design, and the block diagram includes: the supply unit, the micro-controllerr unit, the
sensor unit and the pump drives unit. The power unit is responsible for turning on the entire
circuit. Some components are used to set up power unit and they include; a 15v step down
transformer, a bridge rectifier circuit, a smoothening capacitor and a voltage regulator IC.
The microprocessor (AT89S52) controls virtually all the actions carried out in this design.
The sensor unit is responsible for sensing the level of water and transfer the current position
of water to the microcontroller.
8
CHAPTER ONE
INTRODUCTION
The project “automatic water level controller” is designed to monitor the level of liquid in the
tank. The system has an automatic pumping system attached to it so as to refill the tank once
the liquid gets to the lower threshold, while offing the pump once the liquid gets to the higher
threshold. Sustainability of available water resource in the world is now a dominant issue. This
problem is quietly related to poor water allocation, inefficient use, and lack of adequate and
integrated water management. Water is commonly used for agriculture, industry, and domestic
consumption. Therefore, efficient use of water and monitoring are potential constraints for
home or office water management systems. Moreover, the common method of level control
for home appliance is simply to start the feed pump at a low level and allow it to run until a
higher water level is reached in the water tank. This water level control, monitors and
maintains the water level in the tank and ensures the continuous flow of water round the clock
without the stress of going to switch the pump ON or OFF thereby saving time, energy and
water. Besides this, liquid level control systems are widely used for monitoring liquid levels in
reservoirs, silos. This method also replaces the floaters in water controller with probe sensors
due to higher maintenance costs involved with the floaters and the ease of configuration due
to the programming which makes it easy to detect faults unlike the floaters where you will
need to change the whole set-up. Proper monitoring is needed to ensure water sustainability is
actually being reached with disbursement linked to sensing and automation. Such
programmatic approach entails microcontroller based automated water level sensing and
controlling.
The goal or objectives of which the designed device is expected to accomplish is to build an
automatic water level controller with automatic control system. In this project, sensors are
placed at different level of the tank and with the aid of these sensors, the micro-controller
monitors the level of the liquid at any particular point in time. Some of the objectives are:
9
1. To build an automatic water level controller with automatic control system.
1.2 Justification
I came up with the idea of automatic water level controller because of human error and
inconsistence that is associated with manually operated water pumping system which wastes
time and electricity. The other reason is because of the programming involved in this project
which sets the path. This method also replaces the floaters found in water contollers with probe
sensors which are easily adjustable and has low maintenance cost.
The project was designed to automatically control the pump which ensures constant reserve of
water in the reservoir. The scope of the design was kept concise and simple in order not to
introduce unnecessary complexities and render it generally uncomfortable. The system does not
have attached complex peripheral device which though impossible for the detail printable
information, has been excluded for reasons of affordability of material of low range, and less
accurate performances as opposed to a well-built automatic water pump which was used to
achieve this aim. The automatic water level controller detects and control the water in the tank.
1.4 Constrains
The biggest setback experience during the course of this project is difficulties in finding the
design of the project. Secondly sourcing of the materials and components I used for the project
were difficult to find like; pump and buffer for programming.
10
1.5 Limitations of the Project
It is significant to know that this design is limited to 12v, 5amps electric pump and cannot be
used to control industrial water pump above 5 amps.
This project’s report writing was designed is in such a way that each chapter is related to the
next as shown below:
POWER SUPPLY
FIG
1.0
CONTROL CONTROL
UNIT UNIT
E
INPUT UNIT
CHAPTER TWO
2.0 Review
An automatic water level controller detects the water level in the tank and also ensures
continuous water flow round the clock because of its automatic water pump. Water control is
made up of microcontroller written in C programming language. This program is burnt into an
IC called AT89S52 With 40 pins. The level of measurement consists of determining the distance
from the upper surface of a liquid in a reservoir or vessel or any arbitrarily chosen mark located
11
above or below this surface by itself. The level is not an independent physical quantity
describing the state of a substance through direct and indirect level. Some examples of direct
level measurement are dipstick, the bubbler, immersion electrode, capacitor type, liquid level
radiation type liquid level measurement. For instance, the dipstick, is very simple. The stick
being dipped periodically through a hole and the hole and the immersion mark is being read off
with the aid of the calibration on the stick. Then, the direct level measurement is sight glass.
Depending on the manometer principle, the transparent tube is placed in a convenient and its
being connected to the lower part of the tank and graduated for safety reasons.The top the bright
glass is vented into the tank and the sight has isolation valve top and bottom while the micro-
base water level controller has the ability to switch on the pumping machine when the water in
the tank has gone below gauge level automatically switching OFF the pumping machine when
the water in the tank has reached its maximum level. Electronic circuit has undergone
tremendous changes since the invention of a triode by LEE DE FOREST in 1907. In those days
the active components like resistors, inductors and capacitors etc of the circuit were separated
and distinct unit connected by soldered lead. With the invention of a transistor in 1984 by W.H
Brattain and I. Barden, the electronic circuit became considerably reduced in size. It was due to
the fact that transistors were not only cheaper, more reliable and less power consumption but
were much smaller in size than an electronic tube. To take advantage of small transistor’s size,
the passive component too was reduced in size thereby making the entire circuit very small.
Development of printed circuit board (PBC) further reduced the size of electronics equipment by
eliminating bulky wiring and tie point.
2.1 Sensors
Level sensor detects the level of substance that flows including liquids, slurries, granular
materials and powders. All substances that flow to become essentially level in their containers
(or other physical boundaries) because of gravity. The substance to be measured can be inside
a container or can be in its natural form (e.g., river or lake). The level measurement can be
either continuous or point value. Continuous level sensors measure within a specified range
and determine the exact amount of substance in a certain place.
12
CHAPTER THREE
3.0 Methodology
There are many methods of designing an automatic water level control with switching device,
but all these methodologies require human assistance. In this project an automatic water level
control with switching device is designed using electronic control to refill the water without
human intervention. The system design was carefully arranged to refill the water tank any time
water gets low to a certain level. Finally, the system automatically shuts down the water pump
by putting the electric pump off when the tank is full. The approach used in this work is the
modular design approach. The overall design was broken into function block diagrams where
each block in the diagram represents a section of the circuit that carries out a specific function.
The system was designed using functional blocks as shown in the block diagram below. In this
method the circuit is designed to display 3 different level using three sensors to monitor the in-
flow of water in the tank. However, these displays can be increased and decreased depending
upon the level resolution required. This can be done by increasing or decreasing the number of
13
level detectors and associated components. Diode full-wave rectifier are used to power the
system through a volt’s battery. The rectifier output is filtered using capacitor C through C3
respectively. The final design schematic circuit diagram of the method is shown below;
This project’s design of automatic water level controller with switching device is to ensure a
higher rate of water monitoring. The major components used in the project design ; are level
detection sensors, micro-controller IC AT89S52, the power supply unit and relay switch.
Sensors are devices that convert physician’s property or a change in the physician property
into a more easily manipulated form e.g., voltage, displacement, resistance. The major forms
of energy that sensors can detect can be classified as motion, temperature, light pressure,
electrical, magnetic, chemical and nuclear. It is important to know that a wide variety of
sensors can measure temperature but may be more useful to an electronic circuit because it
converts temperature to an electrical signal compatible with electronic circuit. The number of
sensors and transducers available for use in modern industrial system seem almost unlimited.
The fluid level detection sensors are input transducers used to accept input signal to the IC
4066 and for other operation of the tank. The performance of the device for easy maintenance
and service, the fluid level detection sensor works on the principle that water conducts
14
electricity. Therefore, different level of water should allow flow of current through the fluid
level detection sensor.
A transformer is a device consisting of two closely coupled coils called primary and secondary
coils. An AC voltage applied to the primary appears across the secondary with a voltage
multiplication proportional to the primary appears across the secondary with a voltage
multiplication proportion to the turn ratio of the transformer and a current multiplication
inversely proportional to the turn ratio power is conserved turn ration = /VS = NP/Ns and power
VP
out = power in or Vs x Is = UP X IP
VP = primary voltage
For the 12 volts step down transformer needed for this project, the turn ratio is 240:12 it is
represented as shown below.
Transformer Voltage
15
Input high voltage Output:
Low voltage
main supply AC
AC
DIODES
The term diode usually implies a small signal device with current typically in the milliamp
range. A semiconductor diode consists of a PN junction and has two (2) terminals, an anode
(+) and cathode (-). Current flows from anode to cathode within the diode. Diodes are
semiconductor devices that might be described as passing current in one direction only. The
latter part of that statement applies equally to vacuum tube diodes. Diodes however, are far
more extremely versatile in fact. Diode can be used as voltage regulators, turning devices in
radio frequency tuned circuit. Frequency multiplying device in radio frequency circuit, mixing
devices application or can be used to make logic decision in digital circuit. There are also
diodes which emit “light” known as light emitting diodes or LED.
LED
The first diode in the figure is a semiconductor diode which could be a small signal diode of the
IN914 type commonly used in switching application, a rectifying diode of the IN4001 (400v
1A) type or even one of the high powers, high current stud mounting types. You will notice the
straight bar end has the letter “K” this denote the ‘cathode” while “a” denotes anode. Current
can only flow from anode to cathode and not in the reverse direction, hence the “arrow”
appearance. This is one very important property of diodes.
The next diode is the simplest form of vacuum tube or valve. It simply has the old cathode and
anode. These terms were passed on to modern solid-state devices. Vacuum tube diodes are
mainly only of interest to restore and tude enthusiasts. The third diode is a Zener diode which
is fairly popular for the voltage regulation of low current power supplies whist it is possible to
obtain high current. Zener diodes most regulation today is done electronically with the use of
dedicated integrated circuits and pass resistors. The last diode is the light emitting diode or
LED. A LED actually doesn’t emit as much as plastic lens installed over it and this
concentrates the amount of light.
Light emitting diodes commonly called LED, do dozens of different jobs and are found in all
kinds of devices. Among other things, they form the numbers on digital close, transmit
information from remote controls, light up watches and tell you when your appliances are
turned on collected together, they can form images on a jumbo television screen or illuminate
a traffic light. Basically, LED are just tiny light bulbs that fit easily into an electrical circuit
but unlike ordinary incandescent bulbs, they don’t have a filament that will burn out and they
don’t get hot. They are illuminated by the movement of electron in a semiconductor material.
Many circuits use a LED as a usual indicator of some sort even if only as an indicator of
power supply being turned on.
VC
17
R
Most LED operate at 1.7v although this is not always the case and it is wise to check. The
dropping resistor is simply the net supply voltage minus the 1.7v led voltage then divided by
the led brightness current express as “amps” (ohms law). Note the orientation of both cathode
and anode with respect to the ground end and the supply end usually with led the longer lead is
the anode. LED has several advantages over conventional incandescent lamps for thing. They
don’t have a filament that will burn out, so they last much longer. Additionally, their small
plastic bulb makes them a lot more durable. They also fit more easily into modern electronic
circuits but the main advantage is efficiency. In conventional incandescent bulb, the light
production process involves generating a lot of heat. The filament must be warm this
completely wastes energy.
A bridge rectifier can be made using four individual diodes, but it is also available in special
packages containing the four diodes required. It is called full-wave rectifier because it uses the
entire AC waves (both positive and negative section). 1.4v is used up in the bridge rectifier
because each diode uses 0.7v when diodes are conducting as shown in the figure below. The
maximum current they can pass rates bridge rectifiers and the maximum reverse voltage they
can withstand. This must be of atleast three times the supply RMS voltages so that the rectifier
can withstand the peak voltage.
18
FIG 3.4 BRIDGE RECTIFIER CIRCUIT REPRESENTATION
Alternate pairs of diode conduct changing over the connections so the alternating directions of
AC are converted to the direction of DC.
A voltage regulator also called a “regulator” has only three legs and appears to be a
comparatively simple device but it is actually a very complex in integrated circuit. A regulator
converts varying input voltages and produces a constant “regulated” output voltage. Voltage
regulators are available in a variety of output. Last two digits in the name indicate the output
voltages as shown in the table below:
19
VOLTAGE REGULATORS OUTPUT VOLTAGES
NAME VOLTAGE
LM7805 + 5 Volt
LM7809 +9 Volt
LM7905 -5 Volt
LM7909 -9 Volt
20
FIG 3.5 LM7805 INTEGRATED CIRCUIT INTERNAL SCHEMATIC
LM7005
Resistance is the property of a component which restricts the flow of electric current. Energy
is used up as the voltage across the component drives the current through it and this energy
appears as heat in the component. Resistance is measured in ohms, the symbol for ohm is an
omega and is quite small for electronics. So, resistance is often given in Kn and Mn, Kn =
1000n IMn = 100000n. Resistors used in electronic can have resistance as low as 0.1n or as
high as 10mn. Resistors are connected in series and parallel.
R1
=R
R2
21
FIG 3.7 RESISTORS CORRECTED IN SERIES
When resistors are connected in series their combined resistance is equal to the individual
resistance added together. For example, if resistor R1 and R2 are connected in series, their
combined resistance R is given by:
FIG3.8 RESISTORS
CONNECTED IN
PARALLEL
R
R1 = When resistors
R2
are connected in
parallel their
combined
resistance is less than any of the individual resistance. There is a special equation for the
combined resistance of two resistors R1 and R2 combined resistance in parallel R = R1 + R2
R 1 X R2
For more than two resistors connected in parallel a more difficult equation must be used. This
adds up the reciprocal (“one over”) of each resistance to give the reciprocal of the combined
1 2 3 4 5 6 7 8 9
22
2. The second band gives the second digit
22 x 100
= 2200 ohms
3.10 Transistor
C C
B B
E E
PNP NPN
The letter refers to the layer of semiconductor material used to make the transistor. Must
transistors used today are NPN because this is the easiest type to make from silicon. This page is
23
mostly about NPN transistors. The lead is labelled base (B) collector (C) and emitter (E) these
terms refer to the internal operation of a transistor but they are not much in understanding how a
transistor is used.
The diagram below shows the two current paths through a transistor. The small base current
controls the larger collector current. When the switch is closed, small current flows into the
base (B) of the transistor. It is just enough to make LED(B) glow dimly. The transistor
amplifiers this small current to allow a larger current to flow through from its collector (C) to
its emitter (E). This collector current is larger enough to make
Collector current
path
When the switch is open no base current flows, so the transistor switches off the collector
current. Both LEDs are off. A transistor amplifier current can be used as a switch. This is the
arrangement where the emitter (E) is in the controlling circuit (base current) and in the
controlled circuit (collector current) is called common emitter mode. It is the most widely used
arrangement for transistors.
24
3.12 Capacitor
3.13 Relay
A relay is an electrically operated switch. Current flowing through the coil of the relay creates
a magnetic field, which attracts a lever and changes the switch contacts. The coil current can
be on or off so relay has two switch position and they are double throw (change over)
switches.
Relays allow one circuit to switch a second circuit, which can be completely separated from the
first. There is no electrical connection inside the relay between the two circuits; the link is
magnetic and mechanical.
Electromagnetic Normal
open
B A Normal
V1 close
C
V2
25
The coils of a relay pass a relatively large current. Typically, 30mn for a 12v relay but it can
be as much as 100mn lower voltages. Most ICs (chips) cannot provide this current and a
transistor is usually used to amplify the small IC current to the larger value required for the
relay coil.
Piezo electric ceramic buzzer element has a simple structure in which piezo ceramic element is
glued to vibration plates. When alternating voltage is applied to piezo ceramic element, the
element expands or shrinks diametrically. This characteristic is utilized to make vibration plate
bend to generate sounds. The acoustic generating method can be roughly divided into self-drive
oscillation method and external-drives oscillation method. The former shows the lowest
impedance on the acoustic generator, and produces the sound by the positive feedback
oscillation circuit to make neconace thereby big sound pressure can be obtained by a simple
circuit.
1. Sensor unit.
2. Display unit.
3. Control unit.
26
3.16 Power Supply Unit
There are main types of power supply some are designed to convert high voltage AC mains
electricity to a suitable low voltage supply for electronic circuits and other devices. A power
supply can be broken down into a series of blocks, each of them perform a particular function
AC
230 v Regulator
Transformer Rectifier Smoothing Regulator
Main’s r 5VDC
SYSTEM
Rectifier: Converts AC to DC but the DC output is varying. Diodes are the main rectifier used.
Smoothing: Smoothers the DC from varying greatly to a small ripple regulator; eliminates
ripple by setting DC output to a fixed voltage.
The display unit consists of four seven segment displays, attached to the port or the micro
controller. These seven-segment display arrangements show the level of the liquid at any
particular point in time.
The seven-segment used in the design is common mode which is a type of seven-segment in
which the anodes of all the individual segment are linked together. Therefore, for any of the
segment to be lighted, OV is supplied to the cathode. The choice of common anode seven-
27
segment display in my design was because the micro controller sinks TT2 logic better then
sourcing it. The segment of the displays is connected to port 0 of the micro controller and the
display is made to display any figure or characters by sending the corresponding hexadecimal
valve to port 0.
All the anodes of the seven segments LED are internally connected together and brought out
to VCC, which is connected to the emitter of the switching transistor (NPN C945) and its
collector to the VCC, and its base is then connected to our terminal of 10kn resistor which in
turn is connected from the micro controller.
This type of display comes in a variety of colours, sizes and packaging stiles. While red is still
the most favoured colour, green, yellow and orange LED readouts are also available. The
readout come packaged in standard Dip configuration with clear or modified diffused lens the
latter for “full flood” visibility. It’s mode of fabrication is based in either a common cathode or
common anode arrangement but common-anode arrangement was used in this project for
easier configuration. The seven-segment display gets its name from the fact that seven
illuminated segments are used to configure the digit 0-9 and a few lower- and upper-case
letters. Its arrangement is in the figure of number eight. It reads out list of segments required
for it to illuminates is given below in common cathode. All the cathodes are internally tied
together and brought out to circuit ground through an external current limiting, or pull-down
resistor. Turns
the LED segment “ON” also in common anode arrangement all anodes are internally
connected and brought out to VCC through an external current limiting, or pull-up resistor. A
low voltage to any LED cathode turns it on. It allows for maximum flexibility due to their
sizes and shapes. The diagram of the seven-segment display is shown below: a
28
f b
g
e
c
FIG 3.13 SEVEN SEGMENT d DISPLAY LAYOUT
The input unit consists of sensors that monitor the liquid level and effect of “I” to “0” transition
on the port of the micro-controller. The sensors consist of seven pairs of NPN transistors
connected in Darlington pair form. The container is calibrated into different level with each
level having sensors attached to it. The sensors consist of a base of a NPN transistor (C945)
while connecting the emitter to the transistor to a +5v. The collector of the NPN transistor is
attached to the base of another NPN transistor (C945) via a 100n resistor while growing the
emitter of the NPN transistor.
A grounding probe is connected at the base of the container so as to ground the liquid content of
the container. The ports of microcontroller where the individual sensors would be attached is
pulled up to VCC (+5v) putting the port to logic 1. As the liquid level rises, it first touches the
first probe placed out level 1. The probe becomes a rounded and since the probe was connected
to the base of a NPN transistor (C945) which is active low, the transistor is activated and thus
switches. The +5v supply on its emitter to its collector which in turn activates the NPN
transistor connected to it. This NPN transistor switches the ground attached to its emitter to its
collector and thus the ports of the microcontroller where the collector is connected is now
grounded. Therefore logic 1 to 0 transitions are seen by the microcontroller whenever a
particular level is attained by the liquid.
The 89552 is a low power high performance Cmos 8-bit microcomputer with 4k bytes of flash
programmable and erasable read only memory (PEROM). The device is manufactured using
Atmel high density non-volatile memory technology and is compatible with the industry
29
standard MC5-51 instruction set and pin out. The on-chip flash allows the program memory to
be reprogrammed in system or by a conventional non-volatile memory programmer. By
combining a versatile 8-bit CPU with flash on a monolithic chip, the Atmel AT89552 is a
powerful microcomputer, which provides a highly flexible and cost-effective solution to many
embedded control applications.
3.23 Features
Port 0
Port 0 is an 8 –bit open- drain bi – directional 10 port. As an output port, each pin can sink eight
TT2 inputs. When 1s are written to port 0 pins. The pins can be used as high impedances input.
Port 0 may also be configured to be the multiplexed low order.
30
3.26 Pump Control Segment
The pump control segment consists of a 10k resistor diode, an NPN transistor and 1 12v relay.
The 240vac is attached to the common of the relay while the pump is attached to the normally
open pin of the relay. A diode is connected across the energizing coil of the relay to bias the
relay while the microcontroller controls the biasing of the relay by sending logic 1 or logic 0 to
the base of the NPN transistor, which in turn biases the relay.
31
CHAPTER FOUR
SYSTEM IMPLEMENTATION
As seen in chapter one, the project consists of six blocks which depicts the functional parts of
the system. In this section, I will like to make conceptual design of the system to have in the
detail design of the hardware. The design gives an overview on the function of the major block,
how they are integrated and the data flow arrangement. A sensitive automatic detector of water
level controller switching device design process can be characterized by the following;
1. Definition of task.
2. Requirement.
In defining a task, every design comes from an idea or a problem that require a solution.
Questions may be generated on what exactly that is required to be achieved and the feasibility
of the ideas as regards to the implementation. If these questions are analysed critically with
tangible solutions to the problem, a development of this idea into a reality is the next step.
Requirement for design process have to be considered once an idea has been established. The
need to determine whether or not the idea require a pc or not, depends on complexity of the
circuitry, or whether the circuit to be designed needs to make a complex data. The compare
these factors with topic with ICS (AND GATE) which two input when high logic changes
output. Preferably, a microcontroller will be the option base on the circuit to be designed with
less hardware connection and flexibility. In writing a program that performs a desire function
accesses the ability of the microcontroller. However, I thought that among all the components
used here the one that consumes the higher power is the light emitter diodes (LED) which need
as much as 12-volt to glow and draws as maximum as 500m amp of current. As a result of this
I decided to use 12-volt 1 amp rated transformer. For this design after the voltage is stepped to
12-volt using a transformer. A full wave rectifier circuit was designed using four diodes
(IN4001). This value of diode is used here because from the specification of voltage/diodes
32
rectifying data books this value is adequate for lower voltage say 0.24-volt current =1 amps.
Therefore 1.27 amps is the maximum load current that can be drawn in the whole system. Also,
it is known that after rectification, the same voltage (12 volt) continues to flow into the filter.
As a result, the load voltage 12-volt thus vdc=load voltage =12 volt.
33
4.1 Software Design
Software is a computer program or instructions that cause the machine to do work. Software
as whole can be divided into a number of categories based on the type of work done. The two
primary softwares are; Operating software (system software), which controls the working of
the computerand Application software, which addresses the multitude of task for which people
use computer. Application software also performs word processing, data base management, etc.
In addition to these task-based categories, several types of software are described based on
their application.
PLANING HARDWARE
34
BUILDING THE
PROGRAM
SETTINGPROPERTIES
WRITING CODES
TESTING
Software development involves series of steps or is a set of activities that are necessary to be
taken for the development of reliable and maintenance software. It is of great importance
because hardware design cannot be used with micro-controller base system without depending
on software. Typical micro-controller development systems (MDS) include; VDU registers
and RAM which serve as a stone for the PROM programmer. Software system is the term used
to describe a program that is provided by the manufacturer to aid the development of users
(applications) programs. These include, programs that convert assembly language into
machine code (assembler), or high-level language into machine code (interpreter or compiler).
It also includes programs that facilitate modifications (edition), the computer aided
development methodology, which is essential for software development is summarized below.
This is a kind of word processer that is used. After keying the used program codes using the
input device, the program is displayed on the VDU. The text edition can be used to check and
correct errors in the programs. In a nutshell, the text edition is used to edit the programs after it
has been written.
TRANSLATOR
An assembler translates assembly language in the form of ammonic (memory aids) into
machine code. A good feature of assembler is creating a list that shows the machine code and
the assembly language of the program side by side. A compiler on the other hand translates a
high-level language into machine code. An interpreter reads the source code of our programs
one line at a time and performs the specification instructions contained in that line.
35
4.4 Linker/Locator
This is used to join the different modules that make up the programs together in the correct
sequence and this is to be bound to addresses. The linker/locator pair works together to
coordinate between the separate modules for smooth programs execution.
4.5 Loader
4.6 Testing
After the programs is written, it was tested. This involves executing the programs with selected
inputs called test cases. The result whether or not the program is functioning as desired.
4.7 Debugging
In writing the software for this project, a modular approach was employed. This made it easier
to check for errors and debug the program. Three major tools were used in the development
process; the C51 compiler was used to translate from the source code into the object code. The
SDCPP was employed to link the program while the PACKIHX did the conversion from binary
to hexadecimal.
36
and pointers. These suites it to system level programming where these operations are common.
C has only 32 key words as compared with Q-basic for IBM pc which contain 159 key words.
After the design of the software, a text editor is employed to enter the source into the disk file.
As noted earlier, the text editor also functions as error correcting in the program. The text
editor used is the CRIMSON text editor.
The small device C “compiler” comes with a lot of modules. It does the task of compilation,
linking binary to hexadecimal conversion. Once the compilation command is issued an object
1. The display unit displays the present level of the water for example, “3”
2. The micro-controller monitors the sensors and opens the pump once the water level has
gone too low, and the display system shows “L” which means low.
3. The micro-controller closes the pump when it shows “F” which means full in its display.
37
4.13 Program
If (! P1 – 5) Є
P2 – 1 = 0
3
// level 1
If ((! P1 – 0) 88 (P1 -1) 88 (p1 -2) 88 (P1 – 3) 88 (P1 - 4)
Po = OX79
3
// display level 3
If ((! P1 – 0) 88 (! P1 – 1) 88 (P1 – 2) 88 (P1 – 3) 88 (P1 – 4) Є
Po = OX24
3
// display level 3
If ((! P1 – 0) 88 (! P1 – 1) 88 (P1 -2) 88 (P1 – 3) 88 (P1 – 4)) Є
Po = OX30
3
38
CHAPTER FIVE
After the design and implementation phase, the system built has to be tested for durability and
effectiveness and also ascertain if there is need to modify the design. The system was first
assembled using breadboard. All the components were properly soldered to the Vero board
from which some tests were carried out at various stage to ensure proper functioning of
component’s expected data. The components were tested using a digital Multimeter (DMM).
Resistors were tested to ensure that they are within the tolerance value. Faulty resistor was
discarded. The AT78LS05 voltage regulator, the resulting output was 5.02v which is just a
deviation of 0.20v from the expected result of 5.00v. The pump was also tested to ensure that it
was working properly.
This chapter entails the overall system testing of integrated design of voltage measurement
device. The testing and integration were done to ensure that the design is functioning properly
as expected there by enabling one or even intended users for which the project was targeted for,
to appreciate its implementation and equally approaches used in the design and integration of
various modules of the project. However, this involves checks made to ensure that all the
various units and subsystems function adequately. Also there has to be good interface existing
between the output /input unit subsystem. When the totality of the modules was integrated
together, the system was created and all modules and sections responded to as specified in the
design through the power supply delivering into the system designed.
Similar components like resistors were packed together. The other components include
capacitors, switches, transformers, Diodes (rectifier) LED, transistors, voltage regulators etc
Reference was made to colour coding data sheet to ascertain the expected value of resistors used.
Each resistor was tested and the value read and recorded. Also, for transistor test the DIMM was
39
switched to the diode range. The collector, base, emitter junctions were tested in the following
order. The collector, emitter and base pins were gotten from the data analysis on power
transistor.
The system was powered and operated upon using several possibilities. They include making
sure that the pump only starts when the water level has gone below the mark, and stops when the
water level has reached maximum. The seven-segment display was also tested to make sure
correct level was displayed on the seven-segment display screen. The sensors were also tested.
Expectedly the transformer was rated 220v/12v, 1000mA. From the mains power supply, the
primary coil receives 220v input, the output was measured to be 16.75v using a DMM. Test
data on a transformer has it that the resistance of the primary windings for step down
transformer is higher than that of the secondary side this was ascertained.
40
5.8 Other Test
The bucket used as tank in my project was tested in other to make sure there was no leakage .
The horse or pipe conveying the water from the lower tank to the upper tank was tested or
checked for any kind of breakage or leakage.
VALUE VALUE
240Vac
CAPACITOR 10 10.20
10 10.15
30 29.82
2000 2000 5%
220 218
1000 9980
41
5.10 Performance Evaluation
From the table above, it shows that the range between the expected value and the actual can be
tolerated. As a result of this, the drift in expected value has no critical effect on the system
design since the result current range was also exceeded. Also, the operational voltage was not
exceeded.
5.11 Packaging
After the completion of the work, the circuitry was enclosed in a case to avoid damage. This is
very vital to the packaging of any electronic equipment. The enclosure provides protection as
well as attraction that is, it adds aesthetic value to the work.
5.13 Conclusion
Going through the planning, flow process, design and software implementation, the system
has been a tough one. Chapter one to four has actually tried as much as possible to explain
vividly almost all (if not all) what is involved in the construction of this project. After the
complete design of the system, the deviation between the expected result and the actual result
was very close. The performance and efficiency were beyond expectation and from every
ramification the design of automatic water controller was successful.
During the course of designing this system there were series of problems encountered which
came on the way of achieving the desired goals of this project. Some parts require re-
designing and the software debugging also created a bit of the problem. After installing the
pump, I noticed that the bucket was punched thereby making water to leak. This was so
challenging because it made me to change the tank which affected the budget.
42
5.15 Recommendations
I strongly recommend that the government should set up industries for production of basic
electronic components locally and establish research centres in each University/College to
enable students have good sound practical knowledge on electronic components and their
operations.
References
Aye, T. S., & Lwin, Z. M. (2006). Microcontroller Based Electric Expansion Valve Controller
for Air Conditioning System, World Academy of Science, Engineering and Technology.
Vol.
2864.
Total Volatile Basic Nitrogen from Selected fish Species using Reflectance Spectrosc
opic
Measurements of pH Sensitive filmsî,
Dietz, P., Yerazunis W., & Leigh, D. (2003). Very Low-Cost Sensing
43
Monitoring System for Batch Tea Dryer, CCSE Journal of Agricultural
Lau, U., & Dermot, D. (2005). Sensors Operation. London: Chand &
Company.
44