Professional Documents
Culture Documents
MICROCONTROLLER BASED
BY
NADA ELSHEIKH BABIKIR MOHAMMED
INDEX NO. 064085
Supervisor
Dr. Abdulrahmman Karrar
REPORT SUBMITTED TO
University of Khartoum
In partial fulfillment of the requirement for the degree of
B.Sc. (HONS) Electrical and Electronic Engineering
(CONTROL ENGINEERING)
Faculty of Engineering
Department of Electrical and Electronic Engineering
July 2011
ACKNOWLEDGEMENT
Depth of gratitude and gratefulness is owed to those who have contributed to this work.
Their effort will definitely prepare us for our professional life and improve our capacity to
contribute to the profession; we assure them at least we will try our best.
Among those we thank Dr. Abdulrahman Karrar for his continuous support during our
course of study and through this graduation study project.
I wish to express my gratitude to Dr. Shareif F. Babikir, for his constant support and
encouragement.
We also thank Omer and U`staz Khalid and for `assistance in developing the Model.
I would like also to thank my friend, Rayan M. Elmubarak, for helping me formatting this
thesis.
I would like also to thank my partner in this project, Wafa Husam, for her kind sharing of
time and knowledge.
My family always deserve my sincere thanks whole heartedly. I thank them beyond
comprehension.
ii
ABSTRACT
Infant Incubator is of great interest for some newborns, especially if they are weak, low-
birth-weight, sick, preterm, some parameters are to be monitored and their accuracy remains an
important matter. Temperature and humidity remain the most important. This work is focused on
the control problem of these parameters.
This system can automatically control the infant’s temperature at optimum level using
PID concept and to maintain high relative humidity so as to minimize the thermal loss
iii
المستخلص
حاظْت اىخذيج هي راث أهَيت مبيشة باىْسبت ىبعط األطفاه حذيثي اىىالدة ،خاصت إرا ماّج حاىخه اىصحيت ظعيفت ،او
ارا ماُ هْاك ظيق فً اىخْفس اوفً فً حاىت اّخفاض اىىصُ عْذ والدحه ،او ارا ماُ ٍشيط او حَج والدحه ٍبنشا ,فإُ هْاك
بعط اىششوط اىخي يخعيِ سصذها ودقخها ألّها ٍسأىت ٍهَت.
دسجت اىحشاسة واىشطىبت ٍِ اىششوط اىَحيطيت اىَهَت,ىزىل فإُ هزا اىْظاً يَنْه اىخحنٌ حيقائيا فً دسجت حشاسة
اىشظيع في اىَسخىي األٍثو باسخخذاً ٍفهىً اه PIDواىحفاظ عيً سطىبت ّسبيت عاىيت ورىل ىخقييو اىفقذ اىحشاسي.
iv
TABLE OF CONTENTS
Contents
1 INTRODUCTION .............................................................................................................. 1
1.1 Overview...................................................................................................................... 1
2.1 Introduction.................................................................................................................. 3
v
2.11.1 PID Terms ......................................................................................................... 16
3.1 Introduction................................................................................................................ 18
4.1 Introduction................................................................................................................ 26
vi
4.4.1 PIC16F877A microcontroller ............................................................................. 37
6 Conclusion ........................................................................................................................ 52
References………………………………………………………………………………....57
vii
LIST OF TABLES
Table 3-1: Typical Characteristics for Voltage Output Circuit At Vcc 5V - 25°C) ......... 20
Table 3-2 Components......................................................................................................... 24
Table 4-1 Project Requirements .......................................................................................... 26
Table 4-2 Pin Connection for Application........................................................................... 32
Table 4-3 Pin Connection of TRIAC in the Circuit ............................................................. 35
viii
LIST OF FIGURES
x
CHAPTER 1 INTRODUCTION
Chapter1
1 INTRODUCTION
1.1 Overview
Baby Incubator is one of the quite essential life supportive equipment for the
premature babies in the hospitals. Unfortunately, there is a lack of low cost infant
incubators in the developing world.
1
CHAPTER 1 INTRODUCTION
The developed system should be accurate, economical and must provide the
required environment for the growth of the premature baby.
Chapter 3: (Materials and Tools) this chapter talks about all tools and
materials used in the project implementation mentioning brief description of the main
features for each component.
Chapter5: (Results And Discussion) this chapter constitutes the real work in
order to achieve the project objectives and disscuss different things may results or
difference between traditional and advanced method and so on.
References
2
CHAPTER 2 THEORY AND LITERATURE REVIEW
Chapter2
2.1 Introduction
A neonatal intensive care unit, usually shortened NICU and also called a
Special Care Nursery, newborn intensive care unit, intensive care nursery (ICN), and
special care baby unit , is a unit of a hospital specializing in the care of ill or
premature newborn infants.
The problem of premature and congenitally ill infants is not a new one, by any
means. For centuries, people have attempted to save infants that had previously died
from lack of care.
3
CHAPTER 2 THEORY AND LITERATURE REVIEW
Thermal protection of the newborn is the series of measures taken at birth and in
the first days of life to ensure that the newborn does not become either cold or
overheated and a normal body temperature of 36.5-37.5°C (97.7-99.5°F). Since the
consequences of an environment that is too cold or too warm are serious, it is
important to know what is the optimal — i.e. the most suitable — thermal
environment for the new born baby. This is the range of thermal conditions under
which a new born baby can maintain normal body temperature. The range is narrow,
4
CHAPTER 2 THEORY AND LITERATURE REVIEW
especially in low birth weight or sick babies. Basically speaking, the smaller and more
premature the new born is, the less it tolerates cold and heat. Thus there is no single
environmental temperature that is appropriate for all sizes, gestational ages and
conditions of new born babies. What is appropriate for a healthy baby is too cold for a
preterm baby, and what is appropriate for the preterm baby is too hot for the preterm
infant. The newborn cannot regulate its temperature as well as an adult. It therefore
cools down or heats up much faster and is able to tolerate only a limited range of
environmental temperatures. The smaller the new born, the greater the risk. Thermal
stability improves gradually as the baby increases in weight.
The temperature inside the mother's womb is 38°C (100.4°F). Leaving the
warmth of the womb at birth, the wet new born finds itself in a much colder
environment and immediately starts losing heat thus the thermal protection of
newborns is very important but not difficult. The basic principles are the same
whether the baby is born at home or in an institution. As most cooling of the newborn
occurs during the first minutes after birth, it is important to act quickly to prevent heat
loss. The new born baby loses heat in four different ways. Heat loss is mainly due to
evaporation of amniotic fluid from the baby's body. But loss of body heat also occurs
by conduction if the baby is placed naked on a cold surface (e.g. a table, weighing
scale or cold mattress); by convection if the naked new born is exposed to cooler
surrounding air; and by radiation from the baby to cooler objects in the vicinity (e.g. a
cold wall or a window) even if the baby is not actually touching them.
5
CHAPTER 2 THEORY AND LITERATURE REVIEW
Heat loss increases with air movement, and a baby risks getting cold even at a
room temperature of 30°C (86°F) if there is a draught. Most cooling of the new born
occurs during the first minutes after birth. In the first 10-20 minutes, the new born
who is not thermally protected may lose enough heat for the body temperature to fall
by 2-4°C (3.6- 7.2°F), with even greater falls in the following hours if proper care is
not given. If heat loss is not prevented and is allowed to continue, the baby will
develop hypothermia, i.e. a body temperature below normal. A hypothermic baby,
especially if it is small or sick, is at increased risk of developing health problems and
of dying. However, if heat loss is prevented, the new born will stay warm and will
have a much better chance of remaining healthy, or of surviving if it is already sick. In
trying to keep babies warm, it is important to make sure they do not become
overheated. The mechanisms described above may act in reverse and cause
hyperthermia, i.e. a body temperature above normal. Although less common,
hyperthermia is as dangerous as hypothermia [5].
6
CHAPTER 2 THEORY AND LITERATURE REVIEW
therefore is the result of the combined action of the detectors, controller system and
the effectors. In the case of newborn infants, especially preterm infants, immaturity of
the thermoregulatory system makes the infant more vulnerable to changes of
environmental temperature. In the infant model, the physiology of the response to
cold stress is related to the oxidation of brown fat or brown adipose tissue. In full term
newborn infants, non-shivering thermogeneisis (oxidation of brown adipose tissue) is
the major route of a rapid increase of heat production in response to cold exposure.
The figure 6 represents the metabolic response to cold stress [6].
The consequences of cold stress can be quite severe. As the body temperature
decreases, the baby becomes less active, lethargic, hypotonic, sucks poorly and their
cry becomes weaker. Respiration becomes shallow and slow and the heart-beat
decreases. Sclerema – hardening of skin with redness – develops mainly on the back
and the limbs. The face can also become bright red. As the condition progresses it
causes profound changes in body metabolism resulting in impaired cardiac function,
hemorrhage (especially pulmonary), jaundice and death [7].
7
CHAPTER 2 THEORY AND LITERATURE REVIEW
8
CHAPTER 2 THEORY AND LITERATURE REVIEW
2.5 Hyperthermia
.Hyperthermia can cause increased metabolic demands for the neonate. The
neonate may have increased oxygen requirements, apnea, dehydration, metabolic
acidosis and in worse case scenarios heat stroke, brain damage, shock and death [6].
The baby should be moved away from the source of heat, and undressed
partially or fully, if necessary. If the baby is in an incubator, the air temperature
should be lowered. It is important that the baby be breast-fed more frequently to
replace fluids. Every hyperthermic baby should be examined for infection. When
hyperthermia is severe i.e. body temperature above 40°C(104°F°) the baby can be
given a bath. The water should be warm. If it is possible to measure the water
temperature, it should be about 2°C (3.6°F) lower than the baby's body temperature.
Using cooler or cold water is dangerous. It may not achieve the desired effect and the
baby may very quickly become hypothermic. If the baby cannot breast-feed extra
fluids should be given intravenously or by tube.
9
CHAPTER 2 THEORY AND LITERATURE REVIEW
Moreover the baby's temperature and the temperature inside the device should
be monitored frequently. No heating device can function efficiently in a cold room,
because heat loss by radiation to the cold environment may exceed heat generated by
the device.
1. Infant Incubators
2. Radiant Warmers
Before the industrial revolution, premature and ill infants were born and cared
for at home and either lived or died without medical intervention. In the mid-
nineteenth century, the infant incubator was first developed, based on the incubators
used for chicken eggs. Dr. Stephane Tarnier is generally considered to be the father of
the incubator (or isolette as it is now known), having developed it to attempt to keep
premature infants in a Paris maternity ward warm. Other methods had been used
before, but this was the first closed model, additionally, he helped convince other
10
CHAPTER 2 THEORY AND LITERATURE REVIEW
physicians that the treatment helped premature infants. France became a forerunner in
assisting premature infants, in part due to their concerns about a falling birth rate.
Dr. Pierre Budin, followed in Tarnier’s footsteps after he retired, noting the
limitations of infants in incubators and the importance of breastmilk and the mother’s
attachment to the child. Budin is known as the father of modern perinatology, and his
seminal work The Nursling (Le Nourisson in French) became the first major
publication to deal with the care of the neonate.
Incubators were expensive so the whole room often was kept warm instead.
Cross-infection between babies was greatly feared. Strict nursing routines involved
staff wearing gowns and masks, constant hand washing and minimal handling of
11
CHAPTER 2 THEORY AND LITERATURE REVIEW
babies. Parents were sometimes allowed to watch through the windows of the unit.
Much was learned about feeding - frequent, tiny feeds seemed best - and breathing.
Oxygen was given freely until the end of the 1950s, when it was shown that the high
concentrations reached inside incubators caused some babies to go blind. Monitoring
conditions in the incubator, and the baby itself, was to become a major area of
research. Although incubators provided oxygen and warmth, science in the 1950s was
limited and it was not until later that technology played a larger role in the decline of
infant mortality. The development of surfactant is the most important development in
neonatology to date, allowing the oxygenation and ventilation of underdeveloped
lungs.
Not only careful nursing, but also new techniques and instruments now played a
major role. As in adult intensive care units, the use of monitoring and life support
systems became routine. These needed special modification for small babies, whose
bodies were tiny and often immature. Adult ventilators, for example, could damage
babies lungs and gentler techniques with smaller pressure changes were devised. The
many tubes and sensors used for monitoring the baby's condition, blood sampling and
artificial feeding made some babies scarcely visible beneath the technology.
12
CHAPTER 2 THEORY AND LITERATURE REVIEW
Furthermore, by 1975, over 18% of newborn babies in Britain were being admitted to
NICUs. Some hospitals admitted all babies delivered by Caesarian section, or under
2500g in weight. The fact that these babies missed early close contact with their
mothers was a growing concern. As in other area of medicine, the 1980s saw
questions being raised about the human, and the economic costs of too much
technology. Admission policies gradually changed. In addition, treating low birth
weight infants is expensive, especially when there are much cheaper ways of ensuring
healthy babies. The key is prevention. Money can be spent on programs educating
mothers on staying healthy during their pregnancy. One program (one that encourages
women to stop smoking) is one third the price of neonatal intensive care and has been
proven to work. During this program, a significant number of women often quit.
over the last 10 years or so, SCBUs have become much more 'parent friendly',
encouraging maximum involvement with the babies. Routine gowns and masks have
gone and parents are encouraged to help with care as much as possible. Cuddling, and
skin-to-skin contact, also known as Kangaroo care, are seen as beneficial for all but
the frailest (very tiny babies are exhausted by the stimulus of being handled, or larger
critically ill infants). Less stressful ways of delivering high-technology medicine to
tiny patients have been devised - sensors to measure blood oxygen levels through the
skin, for example, and ways of reducing the amount of blood taken for tests.
13
CHAPTER 2 THEORY AND LITERATURE REVIEW
infection still claim many infant lives and are the focus of many current research
projects.
The long term outlook for premature babies saved by NICUs has always been a
concern. From the early years, it was reported that a higher proportion than normal
grew up with disabilities, including cerebral palsy and learning difficulties. Now that
treatments are available for many of the problems faced by tiny or immature babies in
the first weeks of life, long-term follow-up, and minimising long-term disability, are
major research areas.
Besides prematurity and extreme low birth weight, common diseases cared for
in a NICU include perinatal asphyxia, major birth defects, sepsis, neonatal jaundice,
and respiratory distress syndrome due to immaturity of the lungs. The leading cause
of death in NICUs is generally necrotizing enterocolitis. Complications of extreme
prematurity may include intracranial hemorrhage, chronic bronchopulmonary
dysplasia (see Infant respiratory distress syndrome), or retinopathy of prematurity. An
infant may spend a day of observation in a NICU or may spend many months there.
Overall survival rates, for all gestational ages lumped together, are roughly 70%.
Neonatology and NICUs have greatly increased the survival of very low birth
weight and extremely premature infants. In the era before NICUs, infants of birth
weight less than 1400 grams (3 lb, usually about 30 weeks gestation) rarely survived.
Today, infants of 500 grams at 26 weeks have a fair chance of survival.
14
CHAPTER 2 THEORY AND LITERATURE REVIEW
The servo control system adjusts the environmental temperature to keep the skin
temperature constant. Changes in incubator temperature must be observed since the
neonate's skin temperature will not change. Air-heated incubators are widely used for
the care of very small and sick newborns. They provide a clean, warm environment,
15
CHAPTER 2 THEORY AND LITERATURE REVIEW
where the temperature and humidity can be controlled and oxygen can be supplied if
necessary.
1. P for Proportional
2. I for Integral
3. D for Derivative
The output of the controller is the sum of the above three terms.The combined
output is a function of the magnitude and duration of the error signal, and the rate of
change of the temperature or process value.
2. The Integral term removes steady state control offsets by ramping the output
up or down in proportion to the amplitude and duration of the error signal. The ramp
rate (Integral time constant) must be longer than the time constant of the process to
avoid oscillations.
16
CHAPTER 2 THEORY AND LITERATURE REVIEW
While the PID parameters are optimized for steady state control at or near the
set point, high and low cutback parameters are used to reduce overshoot and
undershoot for large step changes in temperature. They respectively set the number of
degrees above and below set point at which the controller will start to decrease or
cutback the output power.
17
CHAPTER 3 MATERIALS AND TOOLS
CHAPTER 3
3.1 Introduction
The incubator is considered as an air conditioned room with special specification which we
can control it with respect to the condition of baby incubator. Incubators are designed to provide
an optimal environment for newborn babies with growth problems (premature baby) or with
illness problems. The incubator is isolated area environment with no dust, bacteria, and has the
ability to control temperature and humidity to remain them in acceptable levels such as (36°C-
38°C) for temperature and (70%-75%) for humidity . The incubator is provided with motor and
fan that sucks the air through it. Then the air-pass on to a heating grid followed by a water
evaporator to gain the required humidity. If it is necessary oxygen can be added [8].
The LM35DZ is precision integrated-circuit temperature sensor, is 3-pin device, give out
an analog voltage of typically 10 mV/C which is directly proportional to the celsius (Centigrade)
temperature.
This sensor is rated for full -55° to +150°C range with linear +10.0 mV/°C scale factor, it
operates from 4 to 30 V [9].
18
CHAPTER 3 MATERIALS AND TOOLS
skin temperature
air temperature
so there are two temperature sensors are used [8].
A capacitive humidity sensor change its capacitance based on the relative humidity (RH)
of the surrounding air.as the relative humidity increases the capacitance also increases. Figure
3.2 shows HS 1101, capacitive type relative humidity.
Figure 3.2 Capacitive humidity sensor Figure 3.3 Capacitive humidity sensor
Relative humidity is the percentage of actual vapor pressure (P) compared to saturated
vapor pressure (Ps).
[8]
Vout=Vcc*(0.00474*%RH+0.2354)
19
CHAPTER 3 MATERIALS AND TOOLS
Table 3-1: Typical Characteristics for Voltage Output Circuit At Vcc 5V - 25°C)
The name PIC initially referred to "Peripheral Interface Controller". It features up to 200
ns instruction execution, 256 bytes of EEPROM data memory, self programming, an ICD, 2
Comparators, 8 channels of 10-bit Analog-to-Digital converter, 2 capture/compare/PWM
functions, 3 timers, a synchronous serial port that can be configured as either 3-wire SPI or 2-
wire I2C bus, a USART, and a Parallel Slave Port [10].
20
CHAPTER 3 MATERIALS AND TOOLS
bidirectional triode thyristor is a solid-state device that acts like two SCRs that have been
connected in parallel with each other (inversely) so that one SCR will conduct the positive half-
cycle and the other will conduct the negative half-cycle. This means that the triac can be used for
control in ac circuits which is required in our circuit so that we can get optimum automatic
control of infant’s temperature.
21
CHAPTER 3 MATERIALS AND TOOLS
family of non-zero crossing triac drivers consist of an aluminum gallium arsenide infrared
LED, optically coupled to a silicon detector chip these two chips are assembled in a 6 pin DIP
package, providing 7.5 KV ac(peak) of insulation between the LED and the output detector.
These output detector chips are designed to drive triac controlling loads on 115 and 220 V AC
power lines the detector chip is a complex device which functions in the same manner as a small
triac, generating the signals necessary to drive the gate of a larger triac. Basically, MOC30XX
family of opto-isolators is capable of controlling large power triacs with a minimum number of
additional components.
Stepper motors are electromechanical devices that convert a pattern of inputs and the rate-
of-change of those inputs into precise rotational motion. The rotational angle and direction for
each change (step) is determined by the construction of the motor as well as the step pattern
input. four-phase unipolar stepper motor that is easily controlled when buffered with an
appropriate high-current driver ULN2003.
22
CHAPTER 3 MATERIALS AND TOOLS
An infant incubator in which the heater for heating the air circulated through the incubator
and the speed of the fan which forces air across the heater to circulate through the incubator are
controlled to increase the temperature of the heated air and delivery of the heated air to the space
in which an infant has been placed for treatment when an access door of the incubator has been
opened []
3.2.8 ULN2003A
3.2.9 Buzzer:
Is mechanical device which produce sound via a magnetized arm repeatedly striking a
diaphragm. These devices operate with a DC voltage and the current requirement is small,
23
CHAPTER 3 MATERIALS AND TOOLS
generally in the region of lO mA. Buzzers generate a `buzzing' noise (single tone) in the
frequency range 300 to 500 Hz.
This part of the hardware provides the required energy for working of the various
integrated circuits that has been developed. The schematic of power supply circuit is as shown in
details in next chapter.
These include the components that are either basic requirement for the above components
or employed for unnecessary purpose. Table 3-2 summarizes theses components.
Components Usage
USB PIC programmer (UP00A) Downloads hex files into PIC chip
24
CHAPTER 3 MATERIALS AND TOOLS
MikroC compiler is used to edit and compile C code for PIC16F877A. Only hex.file is
downloaded into programmer in the microcontroller chip.
Proteus simulator is used to design and simulate electronic circuits.also help to testing the
code.
25
CHAPTER 4 DESIGN AND IMPELEMENTATION
Chapter4
4.1 Introduction
Temperature and humidity are two very important parameters that need to be monitored
continuously in the infant incubator chamber so that similar environment can be replicated for
the pre-term infant or new born baby. Temperature can be displayed in terms of degree Celsius
(0C) and humidity in terms of relative humidity which is expressed as % Relative Humidity
(%RH).
Temperature of Skin 37 0C
Display LCD
26
CHAPTER 4 DESIGN AND IMPELEMENTATION
The block diagram of microcontroller based temperature and humidity controller in the
infant incubator is shown in Figure 4.1.
4.3.1 Sensor
Sensor is the front end device which comes directly in contact with the quantity being
measured. In microcontroller based infant incubator, the choice of transducer or sensor to
measure the temperature of baby, temperature of water reservoir and humidity of baby chamber
is very critical.So we require two types of sensors:
1. Temperature Sensor
2. Relative Humidity Sensor
Temperature sensor
i. Accuracy
ii. High Output
iii. Repeatability
iv. Long term stability
v. High Input Impedance
vi. Linearity
vii. Self Heating
viii. Temperature Compensation
ix. Small Size
28
CHAPTER 4 DESIGN AND IMPELEMENTATION
29
CHAPTER 4 DESIGN AND IMPELEMENTATION
Humidity Sensor
Humidity sensor should provide humidity level in the incubator in terms of relative
humidity (%RH) in the range of 0-100%RH.The humidity sensor must have the following
properties:
i. Accuracy
ii. Temperature Range
iii. Repeatability
iv. Long term stability
v. High Input Impedance
vi. Linearity
vii. Humidity Range
30
CHAPTER 4 DESIGN AND IMPELEMENTATION
31
CHAPTER 4 DESIGN AND IMPELEMENTATION
The power supply circuit converts the 220 V AC into 5 V DC at which various integrated
circuits can work efficiently.
i. Transformer which step down the voltage level from 220 V AC to required voltage level.
32
CHAPTER 4 DESIGN AND IMPELEMENTATION
ii. Full Wave Rectifier is composed of four diodes (IN4007) which are placed as shown in
Figure 4.7. It converts the alternating voltage to a unidirectional voltage.
iii. Capacitor of 1000 AF is used for ripple rejection of the unidirectional voltage obtained
at rectifier end.
iv. LM 7805 is a regulator which regulates the voltage to constant supply which is 5 V DC
in this case. It has three pins i.e. Vin, GND, Vout as as shown in Figure 4.7.
33
CHAPTER 4 DESIGN AND IMPELEMENTATION
34
CHAPTER 4 DESIGN AND IMPELEMENTATION
BT 136 or TRIAC
MOC 3011
Kp, Ti and Td are found by using auto tuning program, can be seen in Figure 4.11.
35
CHAPTER 4 DESIGN AND IMPELEMENTATION
This circuit makes the monitoring of infants temperature in the incubator much more
precise and accurate based on PID concept employed in the software thereby taking careof:
i. Overshoots
ii. Reduce energy wastage.
As seen in Figure 4.9 one terminal of heater is connected to 220V source directly while the
other terminal is connected to this source through MOC 3011 and BT136.The current from
source to terminal 2 of triac doesn’t reach MOC 3011 till gate pin of BT 136 gets high which is
connected to pin6 of MOC 3011 and this high pulse is received according to software
instructions from pin 0.6 (bch) of microcontroller. When high pulse is received gate gets into
active mode and current blocked at pin 2 of BT136 is passed on to pin1 of BT136 and hence
circuit gets completed and heater is switched ON and similarly according to pulse it gets
switched OFF.
36
CHAPTER 4 DESIGN AND IMPELEMENTATION
The driver is the interface that makes switching voltage of 12 volts required by the
unipolar motor from the voltage of work of the microcontroller that is 5 V.
Figure 4.6 shows the mechanism that was inserted in the water reservoir of the newborn
incubator with the objective to control the relative humidity.
In this mechanism, the step motor receives a sign of the microcontroller then moving the
window of the humidity reservoir of coupled to his axle whenever the value of the humidity will
be out of a belt prearranged with the finality of maintaining it inside the belt of comfort
established in the standard .
Software is an integral part of any control system; it interacts with hardware to carry out
different functions which are responsible for the control of parameters. In the given problem the
software can be divided into following subparts:
37
CHAPTER 4 DESIGN AND IMPELEMENTATION
PIC16F877A microcontroller is the main brain of the infant incubator, so the algorithm
inside it must be capable to control and perform all operations including reading the sensor
outputs, processing these readings.
Flowcharts has been developed in this section depicting step by step development of the
software which issue instructions to various components of the hardware thereby making
General Flowchart
38
CHAPTER 4 DESIGN AND IMPELEMENTATION
39
CHAPTER 4 DESIGN AND IMPELEMENTATION
The ADC module in PIC16F877A has eight inputs, it also has high and low voltage
references which are always in our code set to 5 V and 0 V, respectively. LM35 temperature
sensor analog voltage output is applied to channel 0 (AN0) of PIC16F877A which is pin 2
(RA0/AN0). Hence the algorithm to read temperature will be:
.° = ∗500/1024
40
CHAPTER 4 DESIGN AND IMPELEMENTATION
41
CHAPTER 4 DESIGN AND IMPELEMENTATION
42
CHAPTER 4 DESIGN AND IMPELEMENTATION
Figure 4.16 Flowchart for ON-OFF Control of mobile window of Water reservoir
43
CHAPTER 4 DESIGN AND IMPELEMENTATION
PID Subroutine
44
CHAPTER 5 RESULTS AND DISCUSSION
Chapter5
5.1 Results:
Figure 4.8 shows the Simulation results of complete circuit carried out using Proteus
software. The results obtained from the PIC16F877A microcontroller interfaced with two
temperature sensors, humidity sensors, an LCD and LED’s. The LCD is used to monitor the
sensor readings. The LED’s are also connected for identification of the sensor working properly.
The performance of the system depends on working of each individual unit. Hence overall
performance of the unit has been checked and which has been satisfactory.
45
CHAPTER 5 RESULTS AND DISCUSSION
46
CHAPTER 5 RESULTS AND DISCUSSION
47
CHAPTER 5 RESULTS AND DISCUSSION
48
CHAPTER 5 RESULTS AND DISCUSSION
49
CHAPTER 5 RESULTS AND DISCUSSION
5.2 Discussions
Passive humidity control system consists of a reservoir with water whose surface is
crossed on the part of the air flow generated for weathercock. A greater or minor humidity of air
can be gotten regulating the air flow. This humidity of air occurs for the passive diffusion of the
water for the air that passes for the reservoir, not existing a shut mesh control mechanism
because the relative humidity of air is not measured nor controlled, The disadvantages of the use
of this system inhabit in low the quality of the humidity control rate and the necessity of a very
rigorous asepsis. This system used in most of the newborn incubator cannot reach high and
constant levels of humidity to develop the system for newborn incubator using a step motor, to
maintain the relative humidity inside a band of comfort established by the standard (40 % to 60
%) turning in a shut mesh control system.
The relative humidity of the air inside in newborn incubator, without water in humidity
reservoir, if it kept inside of the band of comfort established for the norm
50
CHAPTER 5 RESULTS AND DISCUSSION
The relative humidity of the air inside of the newborn incubator that used water in
humidity reservoir, without control of humidity, go out from the band of comfort if it kept above
of the greatest limit established by standard
The relative humidity of the air inside of the newborn incubator that used water in
humidity reservoir, with control of humidity, if it kept inside of a band preset in agreement with
the norm.
It was verified, with this study, necessity of use water in the humidity reservoir of newborn
incubator used in this work, as well as, to maintain humidity controlled. The expectation is that
the presented results will be able to provoke reflections in the professionals of the health area in
the sense of using water in humidity system of the newborn incubator and that the control of this
humidity could contribute to the thermo-neutral of the environment and to improve the quality of
life of the premature newborns.
5.2.6 Cautions
Air filter
Air filter should be changed at least every three months for the sake of the baby health.
Cleaning
The incubator should be clean every time and specially after the incubation of every baby.
51
CHAPTER 6 CONCLUSION
Chapter 6
6 Conclusion
6.1 Conclusion
The Goal of my thesis was to design and develop microcontroller based humidity and
temperature controller for infant incubator. To achieve this, hardware was developed with
compatible software in mikroc, so that the above mentioned parameters can be monitored for the
normal growth of the infant.
This system can provide optimum automatic control of temperature of the infant using PID
control technique which has been implemented in the software. Moreover it controls the heater,
according to air temperature in the infant chamber. The control of relative humidity in chamber
is required to reduce the thermal loss from the infant’s body.
Some of the future aspects of the work in terms of its improvements are discussed below:
1. Presently only air temperature control mode which measures temperature from infant’s
chamber air has been used. We can enhance the accuracy of system by introducing skin
temperature control mode.
2. Parameters such as pulse measurement can also be introduced for close monitoring.
4. Wireless transfer of data regarding parameters from infant’s unit to the nurse monitoring
station can be very beneficial for the doctors and nurses in critical monitoring of each infant in
the nursery.
5. Webcam that helps the mother and the doctor to see the baby to make sure about his
health condition.
6. Low internal noise level (below the 60 dB limit during normal operation).
52
References
4. Prasanga D., H.L., Yael Maguire, Aileen Wu, Design of a Passive Incubator for
Premature Infants in the Developing World. 2002, Massachusetts Institute Of
Technology, Cambridge, U.S.A.
9. Available: http://mech207.engr.scu.edu/SensorPresentations/Nibbelink%20-
%20Capacitive%20Humidity%20Sensor%20Combined.pdf
10. http://www.noise.physx.u-
szeged.hu/DigitalMeasurements/Sensors/RelativeHumidity/HIH3610.pdf.
53
Appendix A The Code
float x;
float volt;
int air_temp;
char air_temptxt[16];
float xs;
float volts;
int skin_temp;
char skin_temptxt[16];
void measure(){
x=adc_read(0);
volt=x*0.00489;
air_temp=volt*100;
inttostr(air_temp,air_temptxt);
lcd_out(1,1,"air_temp=");
lcd_out_cp(air_temptxt);
delay_ms(2000);
}
void measures(){
xs=adc_read(1);
volts=xs*0.00489;
skin_temp=volts*100;
inttostr(skin_temp,skin_temptxt);
lcd_out(2,1,"skin_temp=");
lcd_out_cp(skin_temptxt);
delay_ms(2000);
}
int h;
A-1
int hm;
char htxt[16];
void hu(){
h=adc_read(2);
hm=h/40;
inttostr(hm,htxt);
lcd_out(2,1,"hum=");
lcd_out_cp(htxt);
delay_ms(2000);
}
int errorNOW;
int PWMon ;
int PWMoff ;
int errorLAST ;
void PID (){
errorNOW = 37 -air_temp;
PWMon= PWMon + (0.49 * errorNOW ) + (0.98 * (errorNOW - (0 *
(errorNOW - errorLAST))));
errorLAST = errorNOW;
if (PWMon > 190) PWMon = 190; //maximum on time
if (PWMon < 10) PWMon =10; //minimum on time
PWMoff = 200 - PWMon;
}
void main() {
trisc=0;
trisd=0;
lcd_init();
lcd_cmd(_lcd_cursor_off);
while(1){
PWM2_Start();
measure();
lcd_cmd(_lcd_clear);
hu();
lcd_cmd(_lcd_clear);
measures();
PID();
if (air_temp<37) {
porta.b7=1 ;
PWM2_Set_Duty(50);}
else {
porta.b7= 0 ;
PWM2_Set_Duty(0); }
if (air_temp>39)
porta.b5=1 ;
else
porta.b5=0;
if (hm<80) {portd= 0x0c;
delay_ms(100);
portd = 0x06;
delay_ms(100);
portd = 0x03;
delay_ms(100);
portd = 0x09;
delay_ms(100); }
A-2
else
portd=0x00;
A-3