Kabete Poly
Kabete Poly
TECHNOLOGY
TRADE PROJECT
FAULT ALARM
TABLE OF CONTENTS
DECLARATION..............................................................................................................................i
DEDICATION................................................................................................................................ii
TABLE OF CONTENTS...............................................................................................................iii
LIST OF FIGURES.........................................................................................................................v
LIST OF TABLES..........................................................................................................................vi
ACKNOWLEDGEMENT.............................................................................................................vii
LIST OF ABBREVIATIONS......................................................................................................viii
LIST OF SYMBOLS......................................................................................................................ix
OPERATIONAL DEFINITION......................................................................................................x
ABSTRACT...................................................................................................................................xi
CHAPTER ONE..............................................................................................................................1
1.1 INTRODUCTION.................................................................................................................1
1.2 PROBLEM STATEMENT...................................................................................................1
1.3 MAIN OBJECTIVE..............................................................................................................2
1.3.1 SPECIFIC OBJECTIVE.....................................................................................................2
1.4 JUSTIFICATION OF PROJECT..........................................................................................2
1.5 ASSUMPTIOPNS.................................................................................................................2
1.6 LIMITATIONS.....................................................................................................................2
CHAPTER TWO.............................................................................................................................3
2.1 LITERATURE REVIEW......................................................................................................3
CHAPTER THREE.........................................................................................................................7
3.0 METHODOLOGY................................................................................................................7
3.1 BLOCK DIAGRAM.............................................................................................................7
3.1.1 POWER SUPPLY..............................................................................................................7
3.1.2 MICROCONTROLLER UNIT .....................................................................................7
3.1.3TEMPERATURE SENSOR................................................................................................7
3.1.4 SWITCHING CIRCUIT.....................................................................................................8
3.2 SCOPE OF STUDY..............................................................................................................8
3.3 STUDY DESIGN..................................................................................................................8
3.3.1 POWER SUPPLY..............................................................................................................8
3.3.2 MICROCONTROLLER....................................................................................................9
3.3.3 TEMPERATURE SENSOR...............................................................................................9
3.3.4 SWITCHING CIRCUIT...................................................................................................10
3.4 CIRCUIT DIAGRAM.........................................................................................................11
3.4.1 CIRCUIT OPERATION..................................................................................................11
3.5 TABLE OF LIST OF COMPONENTS..............................................................................12
CHAPTER FOUR.........................................................................................................................13
4.1 STUDY FINDINGS............................................................................................................13
4.1.1 Table of Input and Expected results.................................................................................14
CHAPTER FIVE...........................................................................................................................15
5.1 DISCUSSION AND INTERPRETATIONS.......................................................................15
CHAPTER SIX..............................................................................................................................16
6.1 CONCLUSSIONS AND RECOMMENTATIONS............................................................16
6.1.1 CONCLUSSIONS............................................................................................................16
6.1.2 RECOMMENDATIONS.................................................................................................16
REFERENCES..............................................................................................................................17
APPENDIX....................................................................................................................................18
DECLARATION
THE CANDIDATE
i) The Project named above was approved by the Departmental Academic Board and
supervised by
______________________________________
(Supervisor’s Name)
ii) I personally carried out the project whose report follows after this declaration.
iii) I received no undue help from unauthorized persons other than the normal guidance
from my supervisor.
v) The report submitted to the Department of medical engineering is the original work.
SUPERVISOR
I _____________________________________ declare that I supervised the above candidate’s
project and the report contained here is the genuine work of the candidate.
Signature of supervisor: ______________________ Date __________________
DEDICATION
To my beloved parents and my entire family for their moral support and encouragement. Also
for their care and responsibility of bringing me up and for their great financial help. Special
thanks goes to my mother for continuous prayers and support. Above all to my lecturer who
used most of his time assisting me in this project.
ACKNOWLEDGEMENT
I also appreciate the department of medical engineering staff for the encouragement and
suggestions regarding the project.
Special thanks go to heavenly father whose unfailing love and everlasting blessings throughout
this project and make it successful.
ABSTRACT
In this thesis, we presented the design and development of an integrated device for measuring
temperature in drugs storage units. As wastage of spoilt drugs increases day by day due to unfavorable
temperatures the need for an accurate and affordable temperature monitoring devices is essential to
ensure quality of drugs for a long period of time. However, most temperature monitoring and
measuring devices are expensive. Our proposed temperature monitoring device is economical and user
friendly and uses optical technology to measure the temperature.
The goal of this thesis is design low-cost device which measures the temperature of a storage unit
using a temperature sensor called LM35 then sending a signal to the microcontroller which controls the
powering of the cooling system and also raises an alarm when the cold room falls out of range for a
prolonged period of time. The thesis explains how a single-chip microcontroller can be used to analyze
heart beat rate signals in real- time. The Hardware and software design are oriented towards a single-
chip microcontroller-based system, hence minimizing the size. It will be shown that the device meets
diverse and conflicting requirements, including reliability, minimum loading effects, and low battery
power consumption. Qualitative and quantitative performance evaluation of the device on real signals
shows accuracy in temperature monitoring system, even under intense of physical activity.
LIST OF ABBREVIATIONS
AC- Alternating Current
C- Capacitor.
D- Diode
f- Frequency
Hz- Hertz
K- Kilo-Ohms
kHz- Kilohertz
pF- Pico-farad
P-n- positive-negative
PV- Photovoltaic
R- Resistor
S- Switch
STC- Standard Test Conditions
SPK- Speaker
T- Transistor
V- Voltage
LIST OF SYMBOLS
Switch
battery
Earth
Resistor
Capacitor
Diode
Relay
OPERATIONAL DEFINITION
Microcontroller based cold room with a fault alarm – A device use to monitor the temperature
of a storage unit.
CHAPTER ONE
1.0 INTRODUCTION
Temperature is an important factor in determining the environment in which some products
like chemicals will be stored without getting damaged. When temperature is higher or lower
than the required one, the products will get spoilt. Most of the chemicals need to be stored at a
temperature range of 4˚C to 8˚C such includes drugs, blood banks and food among others. To
maintain this temperature, an electronic gadget is required to control the cooling machine.
Such units exist. However, in case they break down, no one will know till the stored products
get damaged. These cases of break down have occurred causing massive losses to the owners.
To prevent this, an effective method of controlling and reading the temperature in the freezer
needs to be devised.
Therefore, I came up with microcontroller based cold room control with fault alarm. When
temperature is higher than required, it powers the cooler to lower the cold room temperature
of the environment and when the temperature is lower than required it stop powering the
cooler. This ensures that temperature is maintained at the required level. If the temperature
falls outside the required range for some time, the system generates an audible alarm to alert
of a possible failure.
It will also reduce the expenses caused by lose of damaged products due to unfavorable
temperatures.
I. Medicine and drugs for storage will be stored in their collect favorable temperature and
they will last long without getting damaged.
III. Gain more knowledge in research about electrical devices to improve the future of
medical technology.
1.7 LIMITATION OF STUDY
The following are the main challenges that were faced in my research:
I. In availability of some components from immediate town thus having to use equivalent
II. Lack of information and proper knowledge from the sellers of the components used in
the project.
III. Time required for the project was also used for performing of other duties therefore
1.8 ASSUMPTION
The results and findings of the study is to increase yield and save money.
CHAPER TWO
2.0 LITERATURE REVIEW
It is a summary that has been published about a particular subject. It provides a user with an idea
about the current situation in terms of what has been done about the project; sometimes it
indicates suggestions on what needs to be done to increase the knowledge and understanding of a
particular problem. In this chapter the designer analyses the blocks making up the project then
selects the most suitable unit to the project.
A power supply is an electronic device that supplies electric energy to an electrical load.
The primary function of a power supply is to convert one form of electrical energy to
another and, as a result, power supplies are sometimes referred to as electric power
converters. Some power supplies are discrete, stand-alone devices, whereas others are built
into larger devices along with their loads. Examples of the latter include power supplies
found in desktop computers and consumer electronics devices.
It converts unregulated AC into a constant DC. With the help of a rectifier it converts AC supply
into DC. Its function is to supply a stable voltage (or less often current), to a circuit or device that
must be operated within certain power supply limits. The output from the regulated power supply
may be alternating or unidirectional, but is nearly always DC.
CIRCUIT OPERATION
A regulated power supply is used to provide the required amount of power at specific voltage
from a primary source which can be ac mains or a battery. A transformer changes the ac mains
(line) voltage to a required value by stepping the voltage up or down. A rectifier is then used to
convert the ac power into dc power using half wave rectifier, full wave rectifier using a
transformer with Centre-tapped secondary winding or a bridge rectifier. But the output of a
rectifier may be fluctuating. A filter circuit is used for smoothing out the ac variations from the
rectified voltage. The four types of filters may be used: 1) Capacitor filter, 2) Inductor filter, 3)
L-C filter and 4) R-C filter.
A voltage regulator is necessary to maintain a constant output dc voltage by providing line
regulation and load regulation. A Zener -regulator, transistorized regulator or three terminal IC
regulators can be used for this purpose.
CIRCUIT DIAGRAM
A power supply can by broken down into a series of blocks, each of which performs a particular
function.
Fig1.1
2.1.1 TRANSFORMER
A transformer is a static device that transfers electrical energy from one circuit to another
through inductively coupled conductors—the transformer's coils. A varying current in the first or
primary winding creates a varying magnetic flux in the transformer's core and thus a varying
magnetic field through the secondary winding. This varying magnetic field induces a varying
electromotive force (EMF) or "voltage" in the secondary winding. This effect is called mutual
induction.
If a load is connected to the secondary, an electric current will flow in the secondary winding
and electrical energy will be transferred from the primary circuit through the transformer to the
load. In an ideal transformer, the input power (P p) equals the output power (Ps).
Pp=Ps
Power (P) = voltage (V) X current (I)
P=VI
Therefore,
VsIs=VpIp
Fig1.2
2.1.2 RECTIFICATION
This is the process of converting ac to dc. This is required because the electronic circuits
operate with dc while the mains supply is ac. Also the battery requires to be charged with dc
power.
There are three typical methods of rectification:
3. Bridge rectification.
Fig 1.3
In this method of rectification, a single diode is used with a transformer as shown above. The
rectified output waveform is also shown above. This gives an output voltage of half the
transformer output. For example a 12 volts transformer gives an output of 6 volts. The output is
A center tapped transformer makes it possible to use two diodes to have all the advantages of a
bridge rectifier. The peak inverse voltage of the diodes must exceed the peak voltage of the
transformer secondary coil. Even though this method gives the required full wave rectification,
Fig 1.5
This is made up of four diodes connected in a bridge circuit. The diodes guide the ac voltage
pulse alternatively through the load. Two diodes conduct for each half cycle. The peak inverse
voltage of the diodes only needs to exceed half the peak-to-peak voltage of the ac.
A power supply unit for electronic circuit must provide a dc voltage of minimum ripple
waveform. The output of a bridge rectifier is still not constant as it rises and falls to zero 100
times in a second. To reduce the ripple voltage to tolerable level, a smoothing circuit is needed.
Smoothing is performed by a large value electrolytic capacitor connected across the DC supply
to act as a reservoir, supplying current to the output when the varying DC voltage from the
rectifier is falling. The diagram shows the unsmoothed varying DC (dotted line) and the
smoothed DC (solid line). The capacitor charges quickly near the peak of the varying DC, and
fig 1.6
Note that smoothing significantly increases the average DC voltage to almost the peak value
(1.4 × RMS value). For example 6V RMS AC is rectified to full wave DC of about 4.6V RMS (1.4V
is lost in the bridge rectifier), with smoothing this increases to almost the peak value giving
Smoothing is not perfect due to the capacitor voltage falling a little as it discharges, giving a
small ripple voltage. For many circuits a ripple which is 10% of the supply voltage is satisfactory
and the equation below gives the required value for the smoothing capacitor. A larger capacitor
will give less ripple. The capacitor value must be doubled when smoothing half-wave DC.
5 × Io
Smoothing capacitor for 10% ripple, C =
Vs × f
Vs = supply voltage in volts (V), this is the peak value of the unsmoothed DC
Circuits require dc power supply that can maintain a fixed voltage while supplying enough
A filter network is used to flatten out the rectified signal into a nearly flat (rippled) dc voltage
pattern.
When the power supply is unregulated, sudden changes within the ac input voltage (spikes,
dips, etc) will be expressed at the supply’s output. Sensitive circuits like digital circuits can not
be run on such. This is because the circuit can operate improperly due to false triggering among
others. Unregulated power supply cannot maintain a constant output voltage as the load
resistance changes.
Therefore, a voltage regulator circuit is needed. This eliminates the spikes and maintains a
A voltage regulator is designed to automatically adjust the amount of current flowing through
the load so as to maintain a constant output voltage by comparing the supply’s dc output with a
circuit, an error amplifier, a conduction element and a voltage reference element. This is
illustrated below.
Fig1.6
There are different types of regulator ICs in the market. Some are designed to output a fixed
voltage, others to give a negative voltage while others are designed to be adjustable.
The digit XX represents the output voltage. E.g. 7805 is a 5 volt output regulator. This devices
can handle up to 1.5 A in properly heat sunk. To remove unwanted input or output
spikes/noise, capacitors can be attached to the regulator‘s input and output terminals.
Fig 1.8
XX represent the negative output voltage. These likewise can handle a maximum output of
LM 35 sensor
LM35 is a 3 pin temperature sensor which requires a VCC and GND and in return the remaining
third pin gives us an analog output. This output is then provided to the ADCs present in At Mega
328P IC which according to a formula calculate the temperature in °C format. The LM35 series
are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional
to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear
temperature sensors calibrated in ° Kelvin.
Features
. A microcontroller is a self-contained system with peripherals, memory and a processor that can
be used as an embedded system. Most programmable microcontrollers that are used are
embedded in other consumer products or machinery including phones, peripherals, automobiles
and household appliances for computer systems.
There are several different kinds of programmable microcontrollers which can be categorized by
several parameters including Bits, Flash size, RAM size, instruction set, and number of
input/output lines, packaging type, architecture, supply voltage and speed.
`8-bit Microcontrollers are the most popular and widely used microcontroller. The 8-bit
microcontroller has 8-bitinternal bus and the ALU performs all the arithmetic and logical
operations on a byte instruction. The well-known 8-bit microcontroller is 8051.
Microcontroller basics
1. CPU- Microcontrollers brain is named as CPU. CPU is the device which is employed to fetch
data, decode it and at the end complete the assigned task successfully. With the help of CPU all
the components of microcontroller is connected into a single system. Instruction fetched by the
programmable memory is decoded by the CPU.
3. Input/output ports – I/O ports are basically employed to interface or drive different
appliances such as- printers, LCD’s, LED’s etc.
. 4. Serial Ports – These ports give serial interfaces amid microcontroller & various other
peripherals such as parallel port.
5. Timers – A microcontroller may be in-built with one or more timer or counters. The timers &
counters control all counting & timing operations within a microcontroller. Timers are employed
to count external pulses. The main operations performed by timers are- pulse generations, clock
functions, frequency measuring, modulations, making oscillations, etc.
6. ADC (Analog to digital converter) – ADC is employed to convert analog signals to digital
ones. The input signals need to be analog for ADC. The digital signal production can be
employed for different digital applications (such as- measurement gadgets).
7. DAC (digital to analog converter) – this converter executes opposite functions that ADC
perform. This device is generally employed to supervise analog appliances like- DC motors, etc.
8. Interpret Control- This controller is employed for giving delayed control for a working
program. The interpret can be internal or external
ATmega328P
Parameter Value
CPU type 8-bit AVR
Performance 20 MIPS at 20 MHz[2]
Flash memory 32 Kb
SRAM 2 kB
EEPROM 1 kB
28-pin PDIP, MLF, 32-pin
Pin count
TQFP, MLF[2]
Maximum operating frequency 20 MHz
Number of touch channels 16
Hardware QTouch Acquisition No
Maximum I/O pins 23
External interrupts 2
USB Interface No
USB Speed –
A switch is an electrical component that can break an electrical circuit, interrupting the current or
diverting it from one conductor to another. The mechanism of a switch may be operated directly
by a human operator to control a circuit, or by a moving object such as a door-operated switch,
or may be operated by some sensing element.
A relay is a switching circuit that is operated by electricity. Switches are made to handle a wide
range of voltages and currents.
SWITCHING CIRCUIT
MOSFET AS A SWITCH
Due to very high input (Gate) resistance we can parallel together many different MOSFET's until
we achieve the current handling limit required. While connecting together various MOSFET's
may enable us to switch high current or high voltage loads.
To overcome this problem Power Field Effect Transistors or Power FET's where developed.
By applying a suitable drive voltage to the Gate of an FET the resistance of the Drain-Source
channel can be varied from an "OFF-resistance" of many hundreds of kΩ's, effectively an open
circuit, to an "ON-resistance" of less than 1Ω, effectively a short circuit. We can also drive the
MOSFET to turn "ON" fast or slow, or to pass high currents or low currents. This ability to turn
the power MOSFET "ON" and "OFF" allows the device to be used as a very efficient switch
with switching speeds much faster than standard bipolar junction transistors.
2.5 ALARM
FAN (COOLER)
This is the part of the system which generates the cooling when powered. In this case I have
used a fun to represent the cooling system. This is because of the expenses of using a whole
refrigeration system. When the fun is powered it cools the storage area, and when the storage
area is at a temperature required the fan will then shut down to stop the cooling.
CHAPTER THREE
3.0 BLOCK DIAGRAM
Power Supply
Sensor
Control Circuit
Fault Alarm
3.0.0 POWER SUPPLY
It steps down voltage from 240V AC to stable 5V DC to power the electronic circuit.
This is the brain of the system. This monitors the temperature level, operates the cooler as well
as driving the display.
Supply power to the freezer on receiving a signal from the control circuit.
This generates an audible alarm when the cold room falls out of range for a prolonged period of
time.
3.5 SCOPE
The scope of this project is to design a temperature monitoring device that will control the
temperature of a storage unit where drugs will be stored. It will keep the storage unit at the set
temperature.
3.6 STUDY DESIGN
3.2.1.0 TRANSFORMER
Vp Is Tp
= = = =a
Vs Ip Ts
Vp Is
= = =a
Vs Ip
Vp= 240V
Vs= 6V
Is= 1A
Therefore,
240 1
= =
12 Ip
Ip=0.025A
P= 240 X 0.025
P= 6VA
3.2.1.1 RECTIFICATION
A=h*l =2πh
H =A÷ 2π
π 2π
=∫ sin ∅ d ∅ +∫ sinθdθ
0 π
V=Vmaxsin θ
Va=vmax/2π∫ sin ∅ dθ
∝
Va=vmax/2π (-cos ∅ /π )
Va=vmax/2π(−cos π +cos ∝)
When ∝=0
Va= vmax/2π( 1+cos 0 )
Va =Vmax/2π( 2 )
Va =Vmax /π
Va= 0.318
Va=0.318 x2
=0.636Vmax
But Vmax 6
3.2.1.3 SMOOTHING
5 × Io
Smoothing capacitor for 10% ripple C¿
Vs× f
5 ×1
C=
6 ×50
C=0.01666667F
C= 1666.667µF
Technical specifications
Output voltage = 5v
Current =1A
If the temperature is 0°C, then the output voltage will also be 0V. There will be rise of 0.01V
(10mV) for every degree Celsius rise in temperature. The voltage can converted into
temperature using the below formulae.
3.2.3 CONTROL UNIT (MICROCONTROLLER)
KEY PARAMETERS
PARAMETERS VALUE
Flash 32 Kbytes
RAM 2 Kbytes
Pin Count 28
Max. Operating Frequency 20 MHz
CPU 8-bit AVR
# of Touch Channels 16
Hardware No
Max I/O Pins 26
Ext Interrupts 24
USB Interface No
No
USB Speed
COMPONENTS TYPE
Microcontroller ATmega328P
Regulator LM 7805
4 Diodes IN400I
Buzzer
Transformer 6V Output
Fan
CHAPTER FOUR
4.0 STUDY FINDINGS
1. The designer was able to use at mega 328P microcontroller to process and execute
2. The designer managed to make use of LM35 temperature sensor to control the
If the temperature is 0°C, then the output voltage will also be 0V. There will be rise of 0.01V
(10mV) for every degree Celsius rise in temperature. The voltage can converted into
temperature using the below formulae.
4.1 Test points
3.microcontroller( output) 5V
4.microcontroller( input) 5V
CHAPTER FIVE
5.0 DISCUSSION AND INTERPRETATION
LM35 is a precession Integrated circuit Temperature sensor, whose output voltage varies, based
on the temperature around it. It is a small and cheap IC which can be used to measure
temperature anywhere between -55°C to 150°C. It can easily be interfaced with any
Microcontroller that has ADC function.
Power the IC by applying a regulated voltage like +5V (VS) to the input pin and connected the
ground pin to the ground of the circuit. Now, you can measure the temperate in form of voltage
as shown below.
The output of the LM35 sensor is connected to the microcontroller ADC. The microcontroller is
programed in its language which it understands. It works under the instructions given to it. The
microcontroller is powered by power supply unit where, the transformer steps down 240 AC V
to 6V AC. . The rectifier converts AC to DC but the DC output is varying. A smoothing capacitor
smooth’s the DC from varying greatly to a small ripple. Then the regulator eliminates the ripple
by setting DC output to a fixed voltage.
The microcontroller sends a signal to the switching circuit which contains a transistor (MOSFET)
as a switch, which closes the connection of power to the fan (cooler). When the temperature
required at the storage unit is achieved the sensor again sends a signal to the microcontroller
which sends a signal to the switching circuit to switch off the fan (cooler).
CHAPTER SIX
6.0 RECOMENDITION
After a thorough research, the project was tested and it worked. However, there is room for
improvement. I would recommend that in the future, the time selection and temperature control
6.1 CONCLUSION
All these objectives were met. However the project was not accurate in the set temperature and
the time due to in availability of the exact calculated resistors and capacitors as well as the
temperature sensor.
In general, the specific objectives of the project were met. However, they were not met with the
required accuracy. The deviation however is not a major one but within the acceptable error.
6.2 REFERENCE
1. Sensor ,Nanoscience biomedical engineering instrument edited by Richard c.durf 3 rd
edition
3. Hughes ,electrical and electronic technology 11th edition revised by John Hiley ,keith
7. Scherz, P. (2000) Practical Electronics for Inventors. United States of America. The
8. Boylestad, R and Nashelsky, L. (2008) Electronic Devices and Circuit Theory. 7 th Edition
9. Horowitz, P. (1980) The Art of Electronics. 2nd Edition. England Cambridge University
Press: Pg 63
10. ,. http/www.wikipedia.com
6.3 APPEDIX
No Components Specification Quantity Price in Ksh
4 Diodes IN4001 4 60
Regulator
7 Casing 1 750
8 Buzzer 1 150
10 LED
12 Connecting 3 Meters 60
Wires
13 Typing and
Printing
14 Transistor 250
MOSFET
TOTAL 3160