You are on page 1of 56

KENYATTA UNIVERSITY

SCHOOL OF ENGINEERING AND TECHNOLOGY

DEPARTMENT ELECTRICAL AND ELECTRONIC ENGINEERING

Bachelor of Science (Biomedical Engineering)

ELECTIVE RESEARCH PROJECT REPORT

EBM 513: Elective Research Project

NAME: KIBET FREDRICK

REG. NO.: J23/5345/2013

TITLE: AUTOMATIC DISTILLED WATER LEVEL MONITOR FOR INFANT

INCUBATORS

A project report submitted to the Department of Electrical and Electronic Engineering in partial

fulfillment of the requirements for the award of the degree of Bachelor of Science in Biomedical

Engineering.

Aug, 2018
Declaration

This project report is my original work, to the best of my knowledge it has never been submitted

to Kenyatta University or any other institution for the award of degree or diploma

NAME : KIBET FREDRICK

Registration Number : J23/5345/2013

Sign: _______________________ Date: ___________________________

TITLE OF THE PROJECT: AUTOMATIC DISTILLED WATER LEVEL MONITOR FOR

INFANT INCUBATORS

SUPERVISOR CONFIRMATION:

This project report has been submitted to the Department of Electrical and Electronic

Engineering, Kenyatta University, with my/our approval as the supervisor:

Sign: _______________________ Date: ___________________________

SUPERVISOR NAME : ENG. M. NZOMO

Sign: _______________________ Date: ___________________________

ii
Abstract

Premature or critically ill baby requires a closed chamber in which a controlled environment is

provided. Incubator allows the user to select the appropriate temperature, humidity, and oxygen

level for the baby. It costs up to KSH 1, 500 per day to incubate a baby in Kenyan [1]. Moreover,

it is only in some few specific hospitals that these incubators are available due to their expensive

prices.

Water is essential for air humidifying before it is circulated in the incubator canopy for

breathing. For incubator, distilled water serves this purpose. Distilled water is manually poured

into a small a rectangular water tank that is placed under the incubator canopy. User is required

to manually check for the level of water in the tank and if the water is below the set minimum

level he/she adds water to maintain humidification. Frequently, the user notices that the water is

completely finished long after the baby has suffered hypoxic injuries or died after breathing a

non-humidified air which could not diffuse across the alveoli sacs of the lungs.

Automatic distilled water level monitor for infant incubators is a system equipped to

automatically and continuously monitor the level of distilled water in the incubator and alarm

when the minimum water level required for humidification is exceeded. The main objective of

this project was to design a low power system that at all times monitor the distilled water level in

the incubator’s water tank and alerts the user if the water exceeds the minimum water level

required by means of LED light and buzzer sound. This will ensure that there is no point the

baby will get exposed to risks of breathing in dry air hence reducing the rate of mortality among

the new born babies. This device collects the data from the ultrasonic sensor mounted above the

rectangular water tank, codes the data into a format that can be understood by the controlling

section of the system and display the water level from the top of the tank on an LCD.

iii
Table of Contents

TITLE: AUTOMATIC DISTILLED WATER LEVEL MONITOR FOR INFANT INCUBATORS.........i

Declaration......................................................................................................................................ii

Abstract..........................................................................................................................................iii

Acronyms......................................................................................................................................vii

List of Figures..............................................................................................................................viii

List of tables...................................................................................................................................ix

CHAPTER ONE: INTRODUCTION..............................................................................................1

1.1 PROBLEM STATEMENT....................................................................................................3

1.2 OBJECJECTIVES.................................................................................................................4

Main objective..........................................................................................................................4

Specific objectives....................................................................................................................4

1.3 JUSTIFICATION...................................................................................................................4

CHAPTER 2: LITERATURE REVIEW.........................................................................................5

2.1 Overview................................................................................................................................5

Analysis of HC-SR04...............................................................................................................6

2.2 Existing System......................................................................................................................7

2.3 Problem Associated With Existing System...........................................................................7

2.4 Proposed System....................................................................................................................8

CHAPTER 3: REQUIREMENT ANALYSIS...............................................................................10

3.1 Ultrasonic Sensor.................................................................................................................10

Distance Calculation...............................................................................................................10

Calibration..............................................................................................................................11

iv
3.2 Arduino Mega......................................................................................................................11

WHY ARDUINO...................................................................................................................12

3.3 LCD Display........................................................................................................................14

3.4 LED......................................................................................................................................14

3.5 Buzzer..................................................................................................................................15

CHAPTER 4: METHODOLOGY.................................................................................................16

4.1 Introduction..........................................................................................................................16

4.2 Hardware design..................................................................................................................16

Arduino Mega Board..............................................................................................................16

Ultrasonic Sensor Circuit.......................................................................................................16

4.2 Software Design...................................................................................................................17

CHAPTER 5: DESIGN AND PLANNING..................................................................................18

5.1 Process Model......................................................................................................................18

CHAPTER 6: IMPLEMENTATION............................................................................................19

6.1 Hardware Implementation....................................................................................................19

6.2 Software Implementation.....................................................................................................20

6.2.1 Flowchart.......................................................................................................................21

6.2.2 Source Code..................................................................................................................22

CHAPTER 7: SYSTEM TESTING...............................................................................................27

7.1 Test Approach......................................................................................................................27

7.2 Test Plan...............................................................................................................................27

7.2.1 Features to Be Tested....................................................................................................27

7.2.2 Testing Tools and Environment....................................................................................28

v
7.3 Test Cases.........................................................................................................................28

7.3.1 Inputs.............................................................................................................................28

7.3.2 Expected Output............................................................................................................28

7.3.3 Testing Procedure..........................................................................................................29

CHAPTER 8: RESULTS...............................................................................................................30

CHAPTER 9: CONCLUSION...................................................................................................34

9.1 Advantages......................................................................................................................34

9.2 Disadvantages.................................................................................................................34

9.3 Future Scope...................................................................................................................35

References......................................................................................................................................36

APPENDIX....................................................................................................................................37

Appendix A: Code.....................................................................................................................37

Appendix B: Budget......................................................................................................................42

Appendix C: Work Plan.............................................................................................................43

vi
Acronyms

LED : Light Emitting Diode

ADC : Analogue to Digital Converter

ECG : Electrocardiography

PC : Personal Computer

GSM : Global System for Mobile Communication

LCD : Liquid Crystal Display

USB : Universal Serial Bus

IDE : Integrated Development Environment

vii
List of Figures

Fig 1.1 Baby Incubator Working and Design

Fig 2.1 internal circuit of Ultrasonic sensor

Fig 2.2 Block Diagram of the system

Fig 3.1 HC-SRO4

Fig 3.2 Arduino Board

Fig 3.3 LCD display

Fig 3.4 LED

Fig 3.5 Piezo Buzzer

Fig. 6.1 Flowchart of the System

Fig 8.1 Distance below set point

Fig 8.2 Distance higher than the set point

viii
List of tables

Table 3.1 Technical Specs of Arduino Mega (2560)

Table 8.1 Results

ix
CHAPTER ONE: INTRODUCTION

1.0 BACKGROUND INFORMATION

An infant incubator is a closed chamber in which a controlled environment is provided to the

premature or critically ill baby. The user can select the appropriate temperature, humidity and

oxygen level suitable for the baby.

Fig 1.1 Baby Incubator Working and Design

Source: frankshospitalworkshop.com

1
The general working of an incubator principle is that air is processed before it reaches baby. An

electric fan draws room air through a bacterial filter which removes dust and bacteria. The

filtered air flows over an electric heating element. The filtered and heated air then passes over a

water tank where it is moistened. It then flows on to the incubator canopy. The incubator

canopy is slightly pressurized. This allows expired carbon dioxide to pass back into the room via

the vent holes and most of the air to be re-circulated. It also prevents unfiltered air entering the

system.

Distilled water is manually poured into a small rectangular tank that is placed under the

incubator canopy. Since there is no system that automatically detects the water level, the user is

required to manually check for the level of water in the tank and if the water is below the set

minimum level he/she adds water to maintain humidification. Frequently, the user notices that

the water is completely finished long after the baby has suffered hypoxic injuries or died after

breathing a non-humidified air which could not diffuse across the alveoli sacs of the lungs.

Automatic Distilled Water Level Monitor for Infant Incubators fully addresses this issue hence

reducing the rate of mortality among the new born babies. Without this microcontroller based

system, monitoring of water level is difficult. This is a perfect replacement of unreliable manual

human control of water level in the incubator’s water tank.

2
The design and implementation provides flexibility and low power consuming system hence less

running costs. It will also be the most reliable and effective to use.

When the water level exceeds minimum level, this causes the activation of the buzzer and red

LED to notify the user that the water is insufficient and that a top up is required, this is also

displayed on the LCD. To do this, LEDs, Buzzer, LCD and HC-SR04 Sensor is interfaced with

the Arduino microcontroller. The analogue quantities of speed is taken from the top of the

rectangular water tank using an ultrasound sensor and converted into corresponding digital

values using an Arduino inbuilt ADC. This converted digital value is sent to the microcontroller

for temporary storage. The user will view the readings of the water level on the LCD at any time.

Arduino Software (IDE) compiler is used to edit, test, simulate and dump the code into the

microprocessor. The performance is verified both in software simulator and hardware design.

The total circuit will completely be verified functionally following the application of the

software.

1.1 PROBLEM STATEMENT

As we know

a) Existing current systems require someone to manually check the level of water all times.

This besides taking a lot of manpower which are valuable resources that can be used

elsewhere, it increases the rate of hypoxic injuries and mortality rate among the babies.

This system solves this problem by providing a real time monitoring of humidification

water.

3
b) The current system for distilled water level monitoring is not available in infant

incubators currently available in the market.

1.2 OBJECJECTIVES

Main objective

To develop a cheap device that will continuously at all times monitor the level of distilled water

in the water tank required for air humidification.

Specific objectives

1 To interface ultrasonic sensor with the microcontroller in order to measure the

distance of water level in the incubator’s water tank required for humidification. The

analog signal of distance is converted into binary information using the Arduino

inbuilt ADC for purposes of processing by means of Arduino micro controller.

2 To compute the distance signal then display the readings on the LCD in centimeters.

3 To design an automatic water level alarm system using LED and Buzzer indicating

the insufficiency of the water.

1.3 JUSTIFICATION

This system is fully automated and does not require any human control. Automatic alert system

enabled by Arduino gives intimacy to the user. The system determines the distance of water level

from the top of the water tank and the readings displayed on the LCD at all times, when water is

sufficient or insufficient. If the amount of water is in the tank is sufficient or insufficient, the

corresponding responses are indicated by means of LEDs lights and buzzer sounds. It is also cost

4
effective to use due to low power consumption. It is easy to handle and efficient. It is also easy to

understand its user interface.

CHAPTER 2: LITERATURE REVIEW

2.1 Overview

Not so much has been done in this field. Among the researches and reports in this area include

the following.

Purnima, PuneetSingh [2], uses both Zigbee and GSM to transmit the data obtained from a

patient. GSM is used for purpose of mobile phones while zigbee is for PCs where the transmitted

signals are processed.

Shrenik Suresh Sarade [3] proposed a project having a simple, microcontroller based heart beat

rate & body temperature measuring device with display the information on LCD display. The

device alarms when the heart beat & the body temperature exceed the provided threshold value.

This threshold value is defined by the programmer at the time of programming of

microcontroller. The threshold value is as 20 to 120 pulses per minute for heart beat indication &

18°C to 38°C for temperature.

5
Wan Seribahiyah [4] does a project where he uses Zigbee, Arduino Uno, and ECG circuit and

temperature sensor. He uses Lab View to process the signals. The problem is complex and

expensive.

This information transmitted wirelessly to the doctor which is not in the vicinity of the patient

through GSM technique. The problem with the use of infrared Device is that the LED light must

be very bright or it will not be sensed by the photodiode.

Analysis of HC-SR04

Fig 2.1 HC-SR04

Source: circuitwiring.com

6
The circuit diagram is shown above. This Ultrasonic Sensor Circuit consists of a set of ultrasonic

receiver and transmitter which operate at the same frequency. When something moves in the area

covered the circuit’s fine balance is disturbed and the alarm is triggered. The ultrasonic circuit is

very sensitive and can be adjusted to reset itself automatically or to stay triggered till it is reset

manually after an alarm.

The ultra-sonic transmitter is built around two NAND gates wired as inverters and they form a

multi-vibrator the output of which drives the transducer. The trimmer P2 adjusts the output

frequency of the transmitter and for greater efficiency it should be made the same as the

frequency of resonance of the transducers in use. The ultrasonic receiver uses a transducer to

receive the signals that are reflected back to it the output of which is amplified by the transistor

TR3, and IC1 which is a 741 op-amp. The output of IC1 is taken to the non-inverting input of

IC2 the amplification factor of which is adjusted by means of P1.

2.2 Existing System

Many existing system for monitoring and controlling other incubator internal environment

generally uses micro-controller ATMEL 89C51 (μC 8051). It does the same job by using

additional devices. The microcontroller-controlled system contains essentially four parts, i.e., the

process, the analog to digital converter, the control algorithm, and the clock. The times when the

measured signals are converted to digital form are called the sampling instants; the time between

successive samplings is called the sampling period and is denoted by h. The output from the

process is a continuous time signal. The output is converted into digital form by the A – D

converter. The conversion is done at the sampling times.

7
2.3 Problem Associated With Existing System

Due to the use of micro controller 8051 the process of making whole device becomes not only

very complex but also difficult and tedious. For operation it requires A-D converter, external

clock, and microcontroller development board.

Consequently, the problems are as follows:-

i. It takes comparatively more time to process.

ii. It requires additional devices for operation.

iii. It requires external clock.

iv. Programming for microcontroller 8051 is difficult.

v. For programming it requires development system.

vi. Circuit size becomes large.

vii. PCB making becomes complex, difficult and tedious.

2.4 Proposed System

To overcome these problems addressed in section 2.3, I have used another advanced

microcontroller called Arduino Mega (ATmega2560). It is in built with many components like

analog to digital converter (ADC), clock of 16 MHz, and shift registers.

8
In this system I have used ultrasonic sensor HC-SR04, to detect the level of water and convert

this analog input into appropriate voltage. This voltage is given to Arduino. According to

program, it will process the analog signal into digital forms giving a particular voltage level for a

particular water level.

16X2 LCD is used to display the output in centimeters. At the same time Arduino also sends the

data to LEDs and Buzzer, if water level is below the minimum set point, the Buzzer and Red

LED is activate while the other LEDs are is deactivated. If the water level is above the minimum

water level, the blue LED is activated while the other LEDs and buzzer is deactivated. In this

manner it will monitor and control the water level efficiently.

9
Fig 2.2 Block Diagram of the system

10
CHAPTER 3: REQUIREMENT ANALYSIS

3.1 Ultrasonic Sensor

HC-SR04 is a commonly used module for non-contact distance measurement for distances from

2cm to 400cm. It uses sonar (like bats and dolphins) to measure distance with high accuracy and

stable readings. It consists of an ultrasonic transmitter, receiver and control circuit. The

transmitter transmits short bursts which gets reflected by target and are picked up by the receiver.

The time difference between transmission and reception of ultrasonic signals is calculated. Using

the speed of sound and ‘Speed = Distance/Time' equation, the distance between the source and

target can be easily calculated.

HC-SR04 ultrasonic distance sensor module has four pins:

 VCC – 5V, input power

 TRIG – Trigger Input

 ECHO – Echo Output

 GND – Ground

 VCC - 5 volt pin on Pi

11
 Trig - Trigger activates the sensor and connect to GIO output pin

 Echo - Receives the signal, read by GPIO input pin

 GND - GROUND PIN

Distance Calculation

Time taken by pulse is actually for to and from travel of ultrasonic signals, while we need only

half of this. Therefore time is taken as time/2.

Distance = Speed * Time/2

Speed of sound at sea level = 343 m/s or 34300 cm/s

Thus, Distance = 17150 * Time (unit cm)

Calibration

For accurate distance readings, the output can be calibrated using a ruler. In the below program a

calibration of 0.5 cm is added.

Fig 3.1 HC-SR04

Source: http://www.ti.com/product/hcsr04

12
3.2 Arduino Mega

The Mega is a microcontroller board based on the ATmega2560. It has 54 digital input/output

pins (of which 14 can be used as PWM outputs), 16 analog inputs, a 16 MHz quartz crystal

oscillator, a USB connection, a power jack, an ICSP header and a reset button. It contains

everything needed to support the microcontroller. It is simply connected to the computer using a

USB cable or powered with an AC-to-DC adapter or battery to get it started. Never fear for

accidental electric discharge, either since the Mega also includes a plastic base plate to protect it.

The Mega 2560 R3 also adds SDA and SCL pins next to the AREF. In addition, there are two

pins placed near the RESET pin. One is the IOREF that allow the shield to adapt to the voltage

provided from the board. The other is not connected and is reserved for future purposes. The

Mega 2560 R3 works with all existing shield but can help adapt to new shields which use these

additional pins.

Fig 3.2 Arduino Board

Source: indiamart.com

13
WHY ARDUINO

Cheap - Arduino boards are inexpensive when compared to other microcontroller platforms.

Cross-platform - The Arduino Software runs on Windows, Macintosh OSX, and Linux

operating systems. Most microcontroller systems can only run on Windows.

Simple, clear programming environment - The Arduino Software (IDE) is easy-to-use for

beginners, yet flexible enough for advanced users to take advantage of as well.

Open source and extensible software - The Arduino software is published as open source tools,

available for extension by experienced programmers. The language can be expanded through C+

+ libraries.

Open source and extensible hardware - The plans of the Arduino boards are published under a

Creative Commons license, so experienced circuit designers can make their own version of the

module, extending it and improving it. Even relatively inexperienced users can build the

breadboard version of the module in order to understand how it works and save money.

Table 3.1 Technical Specs of Arduino Mega

Microcontroller ATmega2560

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limit) 6-20V

14
Digital I/O Pins 54 (of which 14 provide PWM output)

PWM Digital I/O Pins 14

Analog Input Pins 16

DC Current per I/O Pin 20 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 256 KB (ATmega2560) of which 8 KB used by boot loader

SRAM 8 KB (ATmega2560)

EEPROM 4 KB (ATmega2560)

Clock Speed 16 MHz

Length 101.52mm

Width 53.3 mm

Weight 37 g

The ATmega2560 on the Mega comes preprogrammed with a boot loader that allows one to

upload new code to it without the use of an external hardware programmer. The Mega can be

programmed with the Arduino Software (IDE).

15
3.3 LCD Display

Below is a typical LCD display

Fig 3.3 LCD display

Source: https://www.arduino.cc/en/Tutorial/HelloWorld

The LCD will display the body temperature.

3.4 LED

A light-emitting diode (LED) is a two-lead semiconductor light source. It is a p–n junction

diode that emits light when activated. When a suitable voltage is applied to the leads, electrons

are able to recombine with electron holes within the device, releasing energy in the form of

photons. This effect is called electroluminescence, and the color of the light (corresponding to

the energy of the photon) is determined by the energy band gap of the semiconductor. LEDs are

typically small (less than 1 mm2) and integrated optical components may be used to shape the

radiation pattern.

16
Fig 3.4 LED

Source: https://en.wikipedia.org

3.5 Buzzer

A buzzer is an audio signaling device,which may be mechanical, electromechanical, or

piezoelectric (piezo for short).

Fig 3.5 Piezo Buzzer (Source: http://www.instructables.com)

17
CHAPTER 4: METHODOLOGY

4.1 Introduction

This chapter describes the methods which are used to implement this project. This project is

divided into two main parts which are hardware design and software design. Hardware design

focuses on the main controller hardware, Arduino Mega board which connects to the ultrasonic

sensor (HC-SR04), LEDs, LCD and Buzzer. Meanwhile, for the software design, Arduino (IDE)

is used.

4.2 Hardware design

Arduino Mega Board

Arduino Mega board is the main function system in this project because it reads and interprets

the data from the heart rate and the temperature sensor outputs. Arduino software is downloaded

directly through the internet from the Arduino main page in order to build a specific

programmed. Arduino needs a USB cable to power up the board in 5V. Excess power will cause

irreparable damage to the Arduino board.

Ultrasonic Sensor Circuit

The HC-SR04 ultrasonic sensor uses sonar to determine distance to an object like bats or

dolphins do. It offers excellent non-contact range detection with high accuracy and stable

readings in an easy-to-use package, from 2cm to 400 cm or 1" to 13 feet. It operation is not

18
affected by sunlight or black material like Sharp rangefinders are (although acoustically soft

materials like cloth can be difficult to detect). It comes complete with ultrasonic transmitter and

receiver module. Its electrical output signal is proportional to the distance in centimeters.

4.2 Software Design

Arduino Software (IDE) compiler is used to edit, test, simulate and dump the code into the

microprocessor.

19
CHAPTER 5: DESIGN AND PLANNING

5.1 Process Model

In this section, I designed the structure of the system before implementation of circuit. I used

advanced microcontroller called Arduino Mega (2560). It has in built with many components

like analog to digital converter, clock of 16 MHz, shift registers.

In this system I used ultrasonic sensor HC-SR04, to convert speed into appropriate voltage. This

voltage is given to Arduino. According to program it processes the analog signal into digital and

forms a particular voltage level for a particular distance. 16x2 LCD is used to display the output

in centimeters. At the same time it also sends the data to LEDs and buzzer, if the distance

become higher than the set point the Buzzer becomes activated and it alarms and at the same

time the LEDs Red.

20
CHAPTER 6: IMPLEMENTATION

6.1 Hardware Implementation

In this section, I designed my project Automatic Distilled Water Level Control for Infant

Incubators. I used ultrasonic sensor HC-SR04. HC-SR04 generates a small voltage corresponds

to the speed sound travels from the top of the water tank to the surface of water. This generated

voltage is in the continuous, analog form. This speed is converted into distances in the

microcontroller.

This voltage is fed to the controller unit. Here I use Arduino Mega (2560) as a controller. This

voltage is given to in 6 of the Arduino Mega. Arduino

21
Mega reads analog input and converts this analog voltage into digital bits form using inbuilt A to

D converter. It converts analog voltage level in any number between 0 and 1023. It uses 10 bits

for processing. This is given to the microcontroller, it multiplies the digital data with coefficient

0.034/2 and converts this voltage in particular value. This value is nothing but the distance in

centimeters. This data is sent out to digital ports (8, 9, 10, and 13). Consequently, Arduino Mega

sends out data for displaying on 16x2 LCD.

Corresponding data flow chart and the program for working of project are given in section 6.2.1

and section 6.2.2 respectively.

A 16X2 LCD is connected with microcontroller such that Pin 1 is connected to ground and pin 2

is connected to VCC through Arduino for activating or switching ON the LCD. On pin 3 a 10k

ohms for adjusting the brightness of LCD screen. RS and Enable pin is connected to pin 12 and

11 respectively for communication with Arduino. LCD displays distance in centimeters. At the

same time Arduino sends control bit 0 or 1 on the digital ports 8,9,10 and 13. This bit is used for

controlling part. For bit 0 Arduino sends 0V and for bit 1 it sends 5V at the output. LED is

connected to digital port 8. If the distance is less than desired or set distance Arduino gives logic

high level to the pin 8, and 9. But when current distance goes just or more above the set level it

sends logic high level to the digital pin 10 and 13.

22
According to the logic level of digital pin 8, 9, 10 and 13 LED and Buzzer circuit gets input

hence switching them ON/OFF. Once, distance goes higher than the set point, Buzzer and LEDs

are activated. Thus distance of the water level in the water tank is monitored.

6.2 Software Implementation

For software implementation, software Arduino IDE was used. This software enables us to load

the program in Arduino board.

23
6.2.1 Flowchart

Fig. 6.1 Flowchart of the System

24
6.2.2 Source Code

// include the library code:

#include <LiquidCrystal.h>

// defines pins numbers

const int trigPin = 7;

const int echoPin = 6;

const int buzzer = 10;

const int ledPin1 = 8;

const int ledPin2 = 9;

const int ledPin3 = 13;

// defines variables

long duration;

int distance;

int safetyDistance;

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()

25
// set up the LCD's number of columns and rows:

lcd.begin(16, 2);

pinMode(trigPin, OUTPUT);

// Sets the trigPin as an Output

pinMode(echoPin, INPUT);

// Sets the echoPin as an Input

pinMode(buzzer, OUTPUT);

pinMode(ledPin1, OUTPUT);

pinMode (ledPin2, OUTPUT);

pinMode (ledPin3, OUTPUT);

Serial.begin(9600);

// Starts the serial communication

lcd.print("Water Level!");

delay (2000);

void loop() {

// Clears the trigPin

26
digitalWrite(trigPin, LOW);

delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds

duration = pulseIn(echoPin, HIGH);

// Calculating the distance

distance= duration*0.034/2;

safetyDistance = distance;

lcd.setCursor(0, 1);

lcd.print("Distance:");

// set the cursor to column 6, line 1

lcd.setCursor(10, 1);

// print the distance readings in cm:

lcd.print(distance);

27
lcd.setCursor(13, 1);

// set the cursor to column 12, line 1

lcd.print("CM");

delay(200);

// if distance is less or equal to 5cm turn on green led and buzzer on

if (distance <= 5)

lcd.clear ();

digitalWrite(buzzer, LOW);

digitalWrite(ledPin1, LOW);

digitalWrite(ledPin2, HIGH);

digitalWrite(ledPin3, HIGH);

lcd.print("Sufficient Water!");

else

lcd.clear ();

28
digitalWrite(buzzer, HIGH);

digitalWrite(ledPin1, HIGH);

digitalWrite(ledPin2, LOW);

digitalWrite(ledPin3, HIGH);

lcd.print("Add Water!");

// Prints the distance on the Serial Monitor

Serial.print("Distance: ");

Serial.println(distance);

29
CHAPTER 7: SYSTEM TESTING

7.1 Test Approach

The project “Automatic Distilled Water Level Control for Infant Incubators” is made as

explained in the above chapters. It is necessary to check that the system is working properly or

not. It can be tested in two methods. The system should display the current distance of water

from the sensor and if it goes beyond the set point it alarm to notify the user of the water

shortage. It should operate properly in the given operating range. If the system does not work

properly then it is necessary to troubleshoot the problem. The system should complete all the

objectives.

7.2 Test Plan

For testing the project two parts are made. First part is used to check the program, in this step I

checked if the program was working properly or not. I did this by using Arduino IDE.

Second part was used to check hardware component like LCD and Buzzer.

7.2.1 Features to Be Tested

After building the whole circuit I tested it, testing procedure is given in section 7.3.3.

This project should satisfy some features. Features to be tested as follows:-

c) HC-SR should be able to hive the distance of water from the top of the water tank.

d) Arduino should give the required outputs on output ports.

30
e) LCD should display the real time distance measurements.

f) Buzzer should be ON when distance is beyond set point otherwise it should be OFF.

g) System should be stable and work proper in the given range of distances.

7.2.2 Testing Tools and Environment

For testing of the project I required some tools, like to test Arduino program I required software

called Arduino IDE, using this I could check whether the program was working properly or not.

For hardware checking I required power supply and proper range of distances from the surface of

water from the top of the water tank. The normal distance was to be in the range of 1 cm to 5 cm.

7.3 Test Cases

In this section I discussed about the inputs, expected output, and the testing procedure.

Testing tools required for the circuit is explained above.

7.3.1 Inputs

The project required two inputs. The inputs were as follows:-

a) Power supply :-

31
Power supply is the basic need of any electronic circuit. Here I used 5v dc battery to give power

Arduino and sometimes I could give the power directly from the computer or mobile phone

using.

b) Distance :-

As we know that the project is mainly based on the distance. It uses distance from the surface of

water to the top of the incubator water tank as input and controls the LEDs and Buzzer.

7.3.2 Expected Output

After building the whole circuit we test it, testing procedure is given in section 7.3.3.

This project should give some desired outputs. Expected outputs are as follows:-

i. LCD should display the real time distance of water from the top of the incubator water

tank.

ii. Buzzer should be OFF within set points.

iii. Buzzer should be ON if distance is beyond set points.

iv. Blue LED should be ON within set points else OFF

v. Green LED should be ON at all times to show that the system is on.

vi. Red LED should be ON if distance is beyond the set point else OFF

32
7.3.3 Testing Procedure

The power supply was given to the Arduino using computer. In this way the whole testing circuit

is built. Now I gave the inputs to the HC-SR04 as varying its distance from the water surface by

pouring in and out of water into and out of the water tank for incubator.

Change in distance was shown on the 16x2 LCD screen. System worked according to program.

Output of the circuit was observed.

Summary of testing procedure:-

1) The circuit was connected according to the instructions given in section 6

2) Power was given to the system.

3) Distance across HC-SR04 was varied.

4) Working of LCD, LEDs and Buzzer was observed.

33
CHAPTER 8: RESULTS

As project names Automatic Distilled Water Level Control for Infant Incubators, the project

gives five outputs. One is displaying distance and warning on LCD screen, second is turning ON

and OFF the Buzzer, and the rest turning ON and OFF LEDs.

a) When distance was above the set water minimum point (i.e. 5cm) the Blue and the Green

LED are ON. Consequently, Red LED and buzzer were turned OFF. The LCD displayed the

current distance and the phrase ”Sufficient Water”

Fig 8.1 Distance within the set point

34
b) When distance was below the set water minimum point (i.e. 5cm) the Buzzer, Green LED

and the Red LED are ON. Consequently, Other LED connected was OFF. The LCD

consequently displayed the readings of the distance and the phrase “Add Water!”

Fig 8.2 Distance below the set point

35
Table 8.1 Results

Analog Distance Readings State based on Response of LEDs

Input Value (CM) = Sensed*0.034/2 Distance displayed and Buzzer

(mV) on LCD
0 0 Error Buzzer ON

Red LED ON

Green LED ON
58.8 1 Sufficient Water Buzzer OFF

Green LED ON

Blue LED ON

Red LED OFF


117.6 2 Sufficient Water Buzzer OFF

Green LED ON

Blue LED ON

Red LED OFF


176.5 3 Sufficient Water Buzzer OFF

Green LED ON

Blue LED ON

Red LED OFF


235.3 4 Sufficient Water Buzzer OFF

Green LED ON

36
Blue LED ON

Red LED OFF


294.1 5 Sufficient Water Buzzer OFF

Green LED ON

Blue LED ON

Red LED OFF


352.9 6 Add Water Buzzer ON

Green LED ON

Blue LED OFF

Red LED ON
411.8 7 Add Water Buzzer ON

Green LED ON

Blue LED OFF

Red LED ON
470.6 8 Add Water Buzzer ON

Green LED ON

Blue LED OFF

Red LED ON

37
CHAPTER 9: CONCLUSION

Automatic Distilled Water Level Monitor for Infant Incubators is an excellent choice for

blooming maternities in developing courtiers like Kenya because is a real time monitor of

humidification water necessary for baby. It is also cost effective due to low power consumption.

It is of greater efficiency since it provides a friendly user interface that is easy to read and

understand. The system also acts as a watch dog in case of insufficiency of humidification water

in the incubator prompting for immediate addition of water in the tank.

In my project, I have designed and implemented an efficient Automatic Distilled Water Level

Monitor for Infant Incubators with an Arduino board. Output was verified by setting the distance

of water from the top of the incubator water tank at different levels and observing the LEDs and

Buzzer for appropriate response as per the program. There is still room for future development

that would enhance the system and increase its business value as indicated in section 9.3.

9.1 Advantages

 This project is used in all incubators both at Hospital as well as Home.

 To monitor the water level is easy and real time that could have otherwise have been

difficult for humans to monitor manually, especially for extended periods of time.

 This system prevents wastage of energy due to low power consumption.

9.2 Disadvantages

 It is only maintained by a technical person. Thus, it is difficult to be maintained.

38
9.3 Future Scope

 Use of wireless (GSM) Technology to transmit the output of the system to other external

devices such as mobile phones of the users thus increasing the area range of usage of the

device.

 Putting an additional water tank such that if the water is used up below the minimum set

point, it automatically adds distilled water to the main tank for humidification.

39
References

[1] https://www.standardmedia.co.ke/business/article/1144007581/hospitals-face-acute-

shortage-of-incubators

[2] Purnima, PuneetSingh “Zigbee and GSM Based Patient Health Monitoring System” 2014

International Conference on Electronics and Communication System (lCECS -2014)

[3] Shrenik Suresh Sarade et. al “ patient monitoring and alerting system by using gsm”

International Research Journal of Engineering and Technology (IRJET) Volume: 02

Issue: 03, June-2015

[4] Wan Seri BahiyahBinti w SudinPatient monitoring system using wireless sensor network

40
APPENDIX

Appendix A: Code

// include the library code:

#include <LiquidCrystal.h>

// defines pins numbers

const int trigPin = 7;

const int echoPin = 6;

const int buzzer = 10;

const int ledPin1 = 8;

const int ledPin2 = 9;

const int ledPin3 = 13;

// defines variables

long duration;

int distance;

int safetyDistance;

// initialize the library with the numbers of the interface pins

41
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup()

// set up the LCD's number of columns and rows:

lcd.begin(16, 2);

pinMode(trigPin, OUTPUT);

// Sets the trigPin as an Output

pinMode(echoPin, INPUT);

// Sets the echoPin as an Input

pinMode(buzzer, OUTPUT);

pinMode(ledPin1, OUTPUT);

pinMode (ledPin2, OUTPUT);

pinMode (ledPin3, OUTPUT);

Serial.begin(9600);

// Starts the serial communication

lcd.print("Water Level!");

delay (2000);

42
}

void loop() {

// Clears the trigPin

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds

duration = pulseIn(echoPin, HIGH);

// Calculating the distance

distance= duration*0.034/2;

safetyDistance = distance;

lcd.setCursor(0, 1);

lcd.print("Distance:");

// set the cursor to column 6, line 1

43
lcd.setCursor(10, 1);

// print the distance readings in cm:

lcd.print(distance);

lcd.setCursor(13, 1);

// set the cursor to column 12, line 1

lcd.print("CM");

delay(200);

// if distance is less or equal to 5cm turn on green led and buzzer on

if (distance <= 5)

lcd.clear ();

digitalWrite(buzzer, LOW);

digitalWrite(ledPin1, LOW);

digitalWrite(ledPin2, HIGH);

digitalWrite(ledPin3, HIGH);

lcd.print("Sufficient Water!");

44
else

lcd.clear ();

digitalWrite(buzzer, HIGH);

digitalWrite(ledPin1, HIGH);

digitalWrite(ledPin2, LOW);

digitalWrite(ledPin3, HIGH);

lcd.print("Add Water!");

// Prints the distance on the Serial Monitor

Serial.print("Distance: ");

Serial.println(distance);

45
Appendix B: Budget

In this chapter, I give an approximation of how much I spent in this project

ITEM QUANTITY PRICE


Arduino Mega 1 Ksh2500

(ATmega2560 R3)
16×2 LCD Module for 1 Ksh250

Arduino
Ultrasonic sensor 1

(HC-SR04) Ksh200
Piezo Buzzer 1

Ksh25
Breadboard 2 Ksh 300
Jumper Wires 65 pcs Ksh 100
L.E.Ds Ksh 15

3
Resistors: 220 Ω Ksh 100

Total 13 Ksh. 3, 490

46
Appendix C: Work Plan

PROJECT SCHEDULE
SEMESTER 1 SEMESTER 2

Months May Jun Jul Jul Aug Aug Aug Aug


Project
Project Report

Background Research

Report Preparation

Final Report

presentation
Implementation

Design
Selection and ordering

components
Coding

Simulation and

Hardware

implementation
Write up

Submit Project

Presentation

47

You might also like