You are on page 1of 93

MURANG’A UNIVERSITY OF TECHNOLOGY

SCHOOL OF ENGINEERING AND TECHNOLOGY

DEPARTMENT OF MECHANICAL ENGINEERING

VOICE BASED HOT COLD WATER DISPENSOR SYSTEM USING RAPSBERRY PI

STEPTHEN MUTHEE

EN200/1310/2019

A Project proposal submitted to the Department of Electrical Engineering in partial

fulfillment for award of Degree in Bachelor of Technology in Electrical and Electronic

Engineering, Murang’a University of Technology

2023
DECLARATION

I, Stephen Muthee of registration number EN200/1310/2019, hereby declare that this project

titled Voice based hot cold water dispenser system using raspberry pi has been carried out by me

under the supervision of Dr.Mwangi. It has not been presented for award of any degree in any

institution. All sources of information are specifically acknowledged by means of reference.

……………………………………….. ……………………….

Signature DATE

STEPHEN MUTHEE

EN200/1310/2019

SUPERVISOR

…………………………………….. ………………………………….

Dr. Mwangi DATE

Department of Electrical and Electronic engineering

School of Engineering andTechnology

Murang’a University of Technology

i
DEDICATION

This project report is dedicated with profound admiration and appreciation to GOD

ALMIGHTY for giving me strength and breathe and my beloved mum and my younger

brother for their moral support. Great appreciation also goes to my supervisor Dr.

Mwangi and all my lecturers, classmates and MUT family who made it a success

through their constant support supervision, encouragement and moral support.


ACKNOWLEDGEMENT

I thank Almighty God for protecting me during this noble exercise and enabled me to finish

successfully, secondly, I appreciate my supervisor Dr. Mwangi for guiding me through my

project, finally I thank my parent for tireless support during the exercise.
TABLE OF CONTENTS
DECLARATION.......................................................................................................................2
Acknowledgment......................................................................................................................3
LIST OF FIGURES................................................................................................................................
LIST OF TABLES..................................................................................................................................
ABBREVIATIONS................................................................................................................................

ABSTRACT..............................................................................................................................9
CHAPTER 1...........................................................................................................................10
1.0 INTRODUCTION.........................................................................................................................10

1.1 PROBLEM STATEMENT................................................................................................11


1.2 OBJECTIVES...............................................................................................................11
1.2.1 MAIN OBJECTIVE....................................................................................................................11
1.2.2 SPECIFIC OBJECTIVES..............................................................................................................11
1.2.3 JUSFICATION...........................................................................................................................11

CHAPTER TWO...................................................................................................................12
LITERATURE REVIEW........................................................................................................12
2.0 Introduction...............................................................................................................................12
2.1 MICROCONTROLERS BASED IRRIGATION SYSTEMS...................................................................12
2.2 MICROPROCESSORS BASED IRRIGATION SYSTEMS....................................................................13

CHAPTER THREE...............................................................................................................14
3.0 Methodology......................................................................................................................14
Introduction.................................................................................................................................14
3.1. Sensor and Data Acquisition.....................................................................................................14
3.2 Water Optimization...................................................................................................................14
3.3. Control......................................................................................................................................15

CHAPTER FOUR..................................................................................................................17
4.1 RESULTS AND ANNALYSIS..........................................................................................................17
4.2 Discussion..............................................................................................................................17

CHAPTER FIVE...................................................................................................................18
CONCLUSION...................................................................................................................................18
REFERENCES....................................................................................................................................19
APPENDIX.............................................................................................................................19
6.PROJECT TIME PLAN.......................................................................................................19
APPENDIX 2.....................................................................................................................................20
7. PROPOSED BUDGET.....................................................................................................................20

ACRONYMS AND ABBREVIATIONS

 IoT: Internet of Things

 ML: Machine Learning

 ASR: Automatic Speech Recognition

 TTS: Text-to-Speech

 GPIO: General Purpose Input/Output

 LED: Light Emitting Diode

 LCD: Liquid Crystal Display


 PCB: Printed Circuit Board

ABSTRACT

The Voice Based Hot Cold Water Dispenser System using Raspberry Pi is a project aimed at

developing an innovative solution to the conventional water dispensing systems. The system uses

the Raspberry Pi microcontroller along with various other electronic components to create a

voice-activated water dispenser that can dispense hot or cold water as per the user's request. The

project aims to address the limitations of the traditional water dispensers that require physical

touch to operate. The voice-activated system offers a more hygienic and convenient method of

dispensing water. The system utilizes a temperature sensor to detect the temperature of the water

and an ultrasonic sensor to detect the presence of a cup. The user can command the system using

voice commands to dispense hot or cold water as per their requirement. The project provides an

affordable and effective solution to enhance the user experience of water dispensers in homes,

offices, and public places.


CHAPTER ONE

INTRODUCTION

1.1 Overview

This chapter introduces the background to the study, problem statement, and objectives of the

study, significance and the scope of the study for the Voice based hot cold water dispenser

system using raspberry pi

1.2 Background of the Study

Water dispensers are ubiquitous in public places such as offices, schools, hospitals, and shopping

malls. They provide convenient access to drinking water, which is essential for maintaining good

health and hydration. However, traditional water dispensers require physical contact, which can

be a source of concern in the era of COVID-19 and other infectious diseases. To address this

concern, voice-based water dispensers have emerged as an alternative solution.

The Voice-Based Hot Cold Water Dispenser System using Raspberry Pi is an innovative system

that provides users with a contactless and hands-free way of accessing hot and cold drinking

water using voice commands. The system is based on the Raspberry Pi single-board computer,

which is a low-cost, small-sized, and energy-efficient device that can perform a wide range of

computing tasks. The Raspberry Pi is equipped with various sensors and modules, such as

microphones, speakers, temperature sensors, and relays, which enable it to interact with the user,

detect the temperature of the water, and control the dispensing of water.

The system uses automatic speech recognition (ASR) technology to recognize the user's voice

commands and respond with text-to-speech (TTS) technology. The system also features an LCD

1
screen and LED indicators to provide feedback to the user about the system status and water

temperature.

The project's objectives are to design, develop, and test a voice-based hot-cold water dispenser

system using Raspberry Pi that can be easily installed and used in public places. The system aims

to provide a safe, hygienic, and convenient way of accessing drinking water without physical

contact. The system's design also aims to be energy-efficient, reliable, and cost-effective.

1.3 Statement of Problem

The aim of this research is to develop a voice-based hot-cold water dispenser system using

Raspberry Pi 3. The problem this study addresses is the inconvenience of using traditional water

dispensers that require manual operation, especially in public places such as offices, hospitals,

and schools. The proposed system will allow users to request hot or cold water using voice

commands, eliminating the need for physical contact with the dispenser and improving hygiene.

The study will focus on designing and evaluating the effectiveness of the system in terms of

accuracy, speed, and user satisfaction.

1.4 Objectives

1.4.1 General Objective

The main objective of the project is to develop a smart and innovative water dispenser system

that can dispense hot or cold water on voice command, using Raspberry Pi technology. The

system should be convenient, hygienic, and accessible, and should address the limitations of

traditional water dispenser systems.

2
1.4.2 Specific Objectives

To achieve the general objectives of this project, the following specific objectives are formulated.

 Develop a voice recognition system: The first objective of the project is to develop a voice

recognition system that accurately recognizes voice commands and responds by

dispensing hot or cold water. The voice recognition system should be able to accurately

identify different users and their commands.

 Implement temperature control: The second objective is to implement an accurate

temperature control system that can dispense water at the desired temperature. This

requires developing a heating and cooling system that can accurately control the

temperature of the water being dispensed.

 Design a user-friendly interface: The third objective is to design a user-friendly interface

that allows users to interact with the system easily. The interface should be intuitive and

easy to use, allowing users to specify the temperature and volume of water they want to

dispense.

 Ensure safety and hygiene: The fourth objective is to ensure that the system is safe to use

and hygienic. This involves designing the system in such a way that it minimizes the risk

of accidents or injuries, particularly when dispensing hot water. It also involves designing

the system to be easy to clean and maintain, reducing the risk of contamination.

1.5 Significance of the Study

The project is designed to provide a convenient and accessible way for users to access hot and

cold water using voice commands. the system can have significant practical applications in

various settings such as offices, hospitals, and public spaces, where people may not have easy
3
access to manual controls or may be unable to operate them due to physical disabilities. The

voice control feature of the system can help reduce the spread of germs and bacteria by

eliminating the need for physical contact with the controls.

Secondly, the project provides an opportunity for students to gain practical knowledge and

experience in integrating different hardware and software components to create a functional

system. This can help develop key skills in problem-solving, programming, and hardware design,

which are highly valued in the job market.

Finally, the project involves the use of Raspberry Pi, a widely accessible and affordable platform

for designing and developing various IoT applications. This can help promote the adoption of IoT

technologies in various industries, such as healthcare, manufacturing, and logistics, among others.

1.6 Justification

The proposed research on voice-based hot-cold water dispenser system using Raspberry Pi 3 is

justified due to the need for an efficient and convenient water dispensing system that eliminates

the need for physical contact, especially in the current climate of COVID-19. The use of voice-

based systems has become increasingly important due to their ease of use and convenience. The

developed system will have practical implications for public places such as offices, hospitals, and

schools, where water dispensers are commonly used. The use of Raspberry Pi 3 presents an

innovative and cost-effective solution for the development of voice-based systems. The proposed

research will also provide insights into the effectiveness of the developed system in terms of

accuracy, speed, and user satisfaction, which will inform future improvements and developments

in the field of voice-based water dispensers.

4
1.7 Scope of the study

The proposed system will involve the development of software that enables voice recognition

and control of the water dispenser system. This includes the design and implementation of

algorithms that can recognize and respond to voice commands accurately. The project also

includes the integration of the selected hardware components and software modules to create a

functional prototype of the water dispenser system.

5
CHAPTER TWO

LITERATURE REVIEW

2.0 Introduction:

In recent years, the development of voice-based systems has gained significant attention due to

their ease of use, convenience, and potential to improve hygiene in public places. Water

dispensers are commonly used in public places such as offices, hospitals, and schools, but they

require physical contact, which can be a potential source of infection. The use of voice-based

systems for water dispensers presents an innovative and practical solution that eliminates the

need for physical contact.

2.1 Related Work:

Several studies have been conducted on the development of voice-based systems for various

applications, including water dispensers. For example, [1] developed a voice-activated water

dispenser system using Amazon Alexa, which was found to be accurate and convenient to use.

[2] Development of a voice-controlled water dispenser using Arduino, which was found to be

effective in reducing the risk of infection in hospitals.

In terms of the use of Raspberry Pi in voice-based systems, [3] developed a voice-controlled

home automation system using Raspberry Pi, which was found to be reliable and cost-effective.

[4] developed a voice-activated smart home system using Raspberry Pi, which was found to be

easy to use and cost-effective.

6
However, there is limited research on the use of Raspberry Pi in voice-based water dispensers.

Thus, this study aims to contribute to the existing knowledge by designing and developing a

voice-based hot-cold water dispenser system using Raspberry Pi 3.

2.3 Methodology:

The proposed study will involve the design, development, and evaluation of a voice-based hot-

cold water dispenser system using Raspberry Pi 3. The system will be designed to recognize and

respond to voice commands for hot or cold water, and the user interface will be designed to be

user-friendly and hygienic. The system will be tested for accuracy, speed, and user satisfaction,

and the strengths and weaknesses of the developed system will be identified.

2.4 Conclusion:

The proposed study aims to contribute to the existing knowledge on voice-based systems and

their potential application in the field of water dispensers. The use of Raspberry Pi presents an

innovative and cost-effective solution for the development of voice-based systems, and the results

of the study will provide insights into the effectiveness of the developed system in terms of

accuracy, speed, and user satisfaction.

7
CHAPTER THRE

METHODOLOGY AND MATERIALS

3.0 METHODOLOGY

3.1 Intoduction

This system include series of many function like cooling and heating process, voice based

controlling, maintaining temperature and controlling flow of water and also displaying

temperature. Voice is integral part of the system. Since, it is faster to process rather than to

process written text. Voice based water dispenser consist of hardware and software. Hardware

include relay module, dispenser system to control flow of water using pump motors, temperature

sensor module to control the temperature of water and to display it and IR sensor to detect

whether the glass is place below the tap of dispenser system. Raspberry pi is a credit card size

computer, used for voice recognition. Software part consist of VNC viewer and ra0spbian. VNC

viewer provide platform to view the program running on raspberry pi. By combining hardware

and software part an adaptable voice based hot cold water dispenser using raspberry pi is design

3.2 System design

The voice based hot/cold water dispenser based on Raspberry pi contains a water level sensor, IR

sensor, temperature sensor, microphone,16x2 LCD display, buzzer, solenoid valves,2 water tanks

(1 for hot water and another for cold water), water heater, relays.

The main backbone of the model is Raspberry pi 3 model B+ is the latest product in the

Raspberry Pi 3 range, boasting a 64-bit quad core processor running at 1.4GHz, dual-band 2.4

GHz and 5 GHz wireless LAN, Bluetooth


8
4.2/BLE, faster Ethernet, and PoE capability via a separate PoE HAT.

Raspberry pi 3B+ uses the SDHC slot or USB storage device for booting up and storing files.

Python is used as the programming language to interface with the Raspberry Pi.

The microphone is connected to the Raspberry pi 3 model B+ in order to take voice commands

from the user which is processed in the Raspberry pi board and 16x2 LCD display is used to

display the temperature of hot water only.

The Raspberry Pi processes the signal given by Bluetooth module through voice recognition

helps the system to dispense hot and cold water.

In certain case, when the user communicates through BT module and gives the instruction

“Dispense Hot water", then the Raspberry Pi processes the voice signals via microphone and

sends the signal for the relays to switch on the water heater and same when the user says

“Dispense Cold water, then the Pi board sends the signal to the solenoid motors to turn ON to

dispense cold water from cold water tank.

The solenoid valve is connected to the relay which is connected to the Raspberry pi pin which in

turn relay ON/OFF when the voice commands has been processed by the Raspberry pi when user

provides voice commands. The solenoid valves are connected to hot and cold-water tanks when

the raspberry pi sends the signals to the solenoid valve of any tank (depends on the user

commands weather he/she needs hot/cold-water) via relays connected to the

Raspberry pi dispenses the water particular quantity (depends on user applications).

The IR sensor is connected to the Pi board at the place where cup/jar/bottle is placed to know that

there is a cup/jar/bottle at the dispenser pipe where hot/cold-water is dispensed which is used to

identify weather the cup/jar/bottle is placed or not for proper water dispensing into the
9
cup/jar/bottle, which also notifies the user via buzzer beeps when the cup/jar/bottle is not placed

properly in the water dispenser counter.

Buzzer in the system beeps in order inform the user that the water is fully dispensed. The

temperature sensor is used to measure the temperature of the hot which is connected to Raspberry

pi and the water heater via relay in the hot water tank. When the user the water heater through

relay to turn off the heater

3.3 Proposed system

3.4 System Requirements

3.4.1 Hardware Requirements:

 Raspberry Pi 3 board

 Power supply for Raspberry Pi

10
 Hot and cold water dispenser unit

 Temperature sensors

 Relay module

 Jumper wires

 Breadboard

 Resistors

3.4.2 Software Requirements:

 Raspbian operating system for Raspberry Pi

 Python 3 programming language

3.5 System development plan

3.5.1 Requirement Analysis: The first step in system development is to analyze the

requirements of the system. This involves identifying the functionalities of the system, such as

11
voice recognition, temperature control, water dispensing tanks, and safety features, as well as the

hardware and software components needed to implement these functionalities.

3.5.2 System Design: The next step is to design the system architecture based on the

requirements identified in the previous step. This includes selecting the appropriate hardware

components, such as the Raspberry Pi 3, temperature sensors, heating and cooling elements,

water dispenser, and voice recognition module, as well as designing the software modules, such

as the user interface and safety features.

3.5.3 Component Integration: Once the system design is complete, the hardware and software

components are integrated into a working prototype. This involves assembling the hardware

components and connecting them to the Raspberry Pi 3, as well as writing and testing the

software modules on the Raspberry Pi 3

3.5.4Testing and Debugging: After the prototype is assembled, it undergoes testing and

debugging to ensure that it functions as intended. This includes testing the voice recognition

module, temperature sensors, heating and cooling elements, water dispenser, and safety features,

as well as ensuring that the user interface is intuitive and easy to use.

3.5.5 User Acceptance Testing: Once the system has been tested and debugged, it undergoes

user acceptance testing to ensure that it meets the requirements and expectations of the end users.

This involves soliciting feedback from a group of representative users, such as family members

or colleagues, and making any necessary adjustments based on their feedback.

3.5.6 Production Deployment: After the system has been fully tested and approved by the users,

it is deployed for production use. This involves manufacturing and assembling the hardware

components, installing and configuring the software modules, and performing any necessary

maintenance and support tasks to ensure that the system operates smoothly

12
3.6 MATERIALS

Below are material component used for the voice based hot cold water dispenser system using

raspberry pi

Raspberry Pi 3

The Raspberry Pi 3 is a small computer board that

serves as the main controller of the system. It is responsible for processing voice commands,

controlling the solenoid valve, and monitoring the temperature sensor.

Relay

A relay is used to control the solenoid valve that regulates the flow of water in the system.

LCD Display

TO DISPLAY THE OUTPUT Liquid Crystal Display (LCD) is widely used in various

electronics’ applications. It is commonly used in various systems to show different status and

13
parameters. LCD16x2 has 2 lines with 16 characters in each line. Each character is made up of

5x8 (column x row) pixel matrix

Solenoid valve:

A solenoid valve is used as a water controlling valve, it is a simple electromagnetic device that

converts electrical energy directly into linear mechanical motion. A solenoid valve is the

combination of a mechanical valve and basic solenoid. So a solenoid valve has two parts namely

electrical solenoid and a mechanical valve. A solenoid valve is an electromechanically operated

valve.

Breadboard
14
It is used making temporary connection of the system

CHAPTER FOUR

Conclusion

By implementing this project the overall result will be successful. The motive of making the

project cost efficient and user friendly is taken into account and achieved. The proposed system

will be created with the use of different sensors, Raspberry Pi as controller and microphone to get

command from user. With the help of the Raspberry Pi, the voice recognition mode can be

controlled and is sent to the sensor. The system will be programmed to have communication

capability. Taking into consideration the target audience of elderly and handicapped people, the

project will be user friendly.

15
Reverences

[1]Sonali Sen, Shamik Chakrabarty, Raghav Toshniwal, AnkitaBhaumik," Design of an

Intelligent Voice Controlled Home Automation System, "Department of Computer Science St.

Xavier’s College, Kolkata international Journal of Computer Applications (0975 –8887) Volume

121 –No.15, July 2015. [2] Abhishek Srivastava, ShubhamDwivedi, Saurabh Bhardwaj, Mr. Hem

Chandra Joshi,” Study of Automatic Water Dispenser”, International Journal on Emerging

Technologies (Special Issue NCETST-2017) 8(1): 88- 91(2017) [3] Mukesh Kumar, Shimi S.L,

“Voice Recognition Based Home Automation System for Paralyzed People” International Journal

of Advanced Research in Electronics and Communication Engineering (IJARECE) Volume 4,

Issue 10, October 2015.

APPENDIX

5.0 PROJECT TIME PLAN

ACTIVITY FEB MARCH APRIL MAY JUN JULY AUG SEPT


E
IDENTIFY RESEARCH TOPIC
RESEARCH
ABSTRACT WRITING
PROPOSAL WRITING
CONSULTATIONS
FINAL BUDGET PREPARATION
DOCUMENTATION
PROJECT PRESENTATION
PROPOSAL SUBMISSION

APPENDIX 2

5.2. PROPOSED BUDGET


16
ITEM NO. ITEM QUANTITY PRICE PER UNIT AMOUNT
1. Raspberry pi 3 1 3100 3100
2. Relays 1 600 600
3. DC water pump 2 1200 1200
4. LCD 1 450 450
5. IR sensors 1 200 200
6. Temp sensors 2 500 1000
7. 12v transformer 1 600 600
8. 9v Battery 2 50 100
9. Power supply 1 200 200
cable
10. miscellaneous 600
11. Total 8050

3.1 Introduction

Till now voice based water dispenser system was not existing. This system include series of many

function like cooling and heating process, voice based controlling, maintaining temperature and

17
controlling flow of water and also displaying temperature. Voice is integral part of the system.

Since, it is faster to process rather than to process written text. Voice based water dispenser

consist of hardware and software. Hardware include Peltier module, dispenser system to control

flow of water using pump motors, temperature sensor module to control the temperature of water

an d to display it and touch sensor to detect whether the glass is place below the tap of dispenser

system. Raspberry pi is a credit card size computer, used for voice recognition. Software part

consist of VNC viewer and ra0spbian. VNC viewer provide platform to view the program

running on raspberry pi. By combining hardware and software part an adaptable voice based hot

cold water dispenser using raspberry pi is design

3.2 Design creteria

In this system the water dispenser is fully automated. Not only voice recognition but also heating

and cooling processes are inbuilt in this system. This system includes a series of many functions

like heating and cooling process, voice based controlling, maintaining temperature, controlling

flow of water and also displaying the temperature. Power supply is provided to Raspberry Pi

which is connected to 4-channel relay module. 4-channel relay module act as a switch. Pin

no.2,3,4,VCC and GND of Raspberry Pi is connected to 1,2,3,VCC and GND of 4-channel relay

module respectively.4-channel relay module consist of four relay, each relay has Normally

Open(NO),Normally Close(NC) and Common(COM) terminal.4-channel relay module allows

voltage up to 5V6V through them, when relay is on. Five submersible pump motor i.e.

m1,m2,m3,m4 and m5.Three pump motor m1,m2 and m3 is connected to 3 relays i.e. positive

terminal of each motor is connected to each normally open terminal of relay. A touch sensor is

used to sense weather the glass is placed in below the pipe or not. The signal pin of touch sensor

is given to VCC pin of relay module. Here it sense the glass and send further information to relay

switch. Relay switch decides whether drain the water on not. The power supply is given by

18
battery connecting positive pin of battery and VCC pin of touch sensor. The GND pin of touch

sensor is given to negative of battery. Temperature controller module consist of K0, K1, 12V,

GND pins. Each common terminal of relay in shorted and connected to 12V terminal of

temperature controller module. Negative terminal of m1, m2 and m3 is connected to ground

terminal of temperature controller module. To detect the temperature of water and also control

the temperature which does not exceeds more than 45C. Two Peltier module require is taken

common and connected to positive terminal of battery. Negative terminal of each Peltier is taken

common and connected to k0 terminal of the temperature controller module.k1 terminal of

temperature controller module is connected to negative terminal of battery or vice versa. For

heating and cooling continuously through heat sink which is on both side of Peltier module pump

motor m4 and m5 are used. Positive terminal of the both pump motor is connected to wire i.e.

come from 12V of temperature controller module which is shorted andconnected to positive of

6V battery. Negative terminal of temperature controller module which is given to negative of 6V

battery. Audio input is given to microphone. This audio input passed through the Raspberry Pi.

Raspberry Pi and micro-controller are connected via I2C SPI bus communication. Micro-

controller takes input from IR sensor. Four channel relay modules operating at 24Volts. Relay

work as a switch, which is operated by micro-controller. Relay module is used to operate the

pump motor. Pump motor operating at 3-6Volts, 130-220 mA and flow rate is 80-120L/H. Pump

motor regulate the flow of water. The IR sensor checks whether glass is present below the tap or

not. If the glass is present then IR sensor sends the signal to micro-controller, which switch on the

relay and hence pump motor starts. If glass is not present near the tap IR sensor sends the signal

to micro-controller to turn off relay and hence pump motor stops. Heating and cooling of water in

dispenser system is done by using Peltier device. Peltier device operating at 12Volts and 6-7A.

Simultaneously both side get heat and cold. After turning on the device, the hot side will heat

quickly, the cold side will cool quickly. Maximum temperature of water is set by using
19
temperature controller so that the temperature of water should not exceed beyond the set

temperature. Raspberry Pi module is small sized computer. VNC is software used to program a

Raspberry Pi. The program is in form of language Python. This Raspberry Pi module is used to

decide whether input is hot water or cold water. This module is programmed in such way that

water will stop after 10 seconds. This will save the water and also limit the flow of water

The Raspberry Pi processes the signal given by Bluetooth module through voice recognition
helps the system to dispense hot and cold water.

In certain case, when the user communicates through BT module and gives the instruction

“Dispense Hot water", then the Raspberry Pi processes the voice signals via microphone and
sends the signal for the relays to switch on the water heater and same when the user says
“Dispense Cold water, then the Pi board sends the signal to the solenoid motors to turn ON
to dispense cold water from cold water tank.

Python IDLE software is used for programming the Raspberry Pi.

Water level sensor will measure the quantity of the hot and cold water as well in the
Jar/glass/bucket (which depends on the applications). It gives the signals to the Raspberry Pi
in order to turn off the solenoid valve motor.

Ultrasonic sensor is used to measure the water quantity and through voice command the

quantity of water dispensed it is controlled.

3.2 mzter
20
21
Requirements gathering and Analysis techniques

Users of a system have their preferences. Requirement gathering and analysis looks for these

expectations of the users for the proposed system. Some various tasks/tools and techniques used

for requirement analysis. Actions applied at this stage include; analyzing, documentation,

validation, and managing the software or system requirements. The activity carried to identify

where the problem is, in an attempt to fix the system. This step involves breaking down the

system in different pieces to analyze the situation, analyze project goals, break down what needs

to be created, and engage users so that definite requirements can be defined.

Techniques describe how tasks are performed under specific circumstances. A task may have

none or one or more related techniques. A technique should be related to at least one task. The

following are some of the well-known requirements gathering techniques and analysis that will

be used−

2.2.1 Document Analysis

Reviewing the documentation of the existing SGR train reservation existing system can help

when creating AS–IS process document, as well as driving gap analysis for scoping of migration

projects. In an ideal world, we would even be reviewing the requirements that drove creation of

the existing system – a starting point for documenting current requirements. Nuggets of

information are often buried in existing documents that help us ask questions as part of validating

requirement completeness.

22
2.2.2 Interface analysis

Interfaces for a software product can be human or machine. Integration with external systems and

devices is just another interface. User centric design approaches are very effective at making sure

that we create usable software. Interface analysis – reviewing the touch points with other external

systems is important to make sure we don’t overlook requirements that aren’t immediately visible

to users.

2.2.3 Interview

Interviews of stakeholders and users are critical to creating the great software. Without

understanding the goals and expectations of the users and stakeholders, we are very unlikely to

satisfy them. We also have to recognize the perspective of each interviewee, so that, we can

properly weigh and address their inputs. Listening is the skill that helps a great analyst to get

more value from an interview than an average analyst.

2.2.3 Observation

By observing users, an analyst can identify a process flow, steps, pain points and opportunities

for improvement. Observations can be passive or active (asking questions while observing).

Passive observation is better for getting feedback on a prototype (to refine requirements), where

active observation is more effective at getting an understanding of an existing business process.

Either approach can be used.

23
2.2.4 Prototyping

Prototyping is a relatively modern technique for gathering requirements. In this approach, you

gather preliminary requirements that you use to build an initial version of the solution - a

prototype. You show this to the client, who then gives you additional requirements. You change

the application and cycle around with the client again. This repetitive process continues until the

product meets the critical mass of business needs or for an agreed number of iterations.

2.3 System Design Techniques

System design involves designing the elements of a system: the architecture, modules, and other

components. This is done to satisfy the requirements of the system. The purpose of the system

design is to provide the needed data and information about the system and its elements. It is used

in the implementation stage and enables the architectural entities as defined in modules and

views of the system architecture. System analysis, on the other hand, is the process that

decomposes a system into its component pieces to define how well those components interact to

accomplish the set requirements. There are various inputs to a system, i.e., Statement of work,

Requirement determination plan, and Current situation analysis, proposed system requirements

including a conceptual data model, modified DFDs, and Metadata (data about data).

24
2.3.1 Use Case Diagrams

The use case diagrams show to outline the requirements based on the development life cycle. The

two use cases include passenger and management use cases. A passenger can view schedules,

make or cancel reservations. On the other hand, the management adds, deletes, or modifies train

information. It adds and deletes terminals, updates departure times, and updates fares.

2.3.2 Logical Design

Logical design pertains to an abstract representation of the system's data flow, inputs, and

outputs. It describes the inputs (sources), outputs (destinations), databases (data stores),

25
procedures (data flows) all in a format that meets the user requirements. While preparing the

logical design of a system, the system analyst specifies the user needs at a level of detail that

virtually determines the information flow into and out of the system and the required data

sources. Data flow diagram, E-R diagram modeling, are used.

2.3.3 Physical Design

Physical design relates to the actual input and output processes of the system. It focuses on how

data is entered into a system, verified, processed, and displayed. It produces the working system

by defining the design specification that specifies precisely what the canwillate system does. It is

concerned with user interface design, process design, and data design.

2.3.4 Data Flow Diagram

The flow of data of a system or a process is represented by DFD. It also gives insight into the

inputs and outputs of each entity and the process itself. DFD does not have control flow and no

loops or decision rules are present. Specific operations depending on the type of data can be
26
explained by a flowchart. Data Flow Diagram can be represented in several ways. The DFD

belongs to structured-analysis modeling tools. Data Flow diagrams are very popular because they

help us to visualize the major steps and data involved in software-system processes.

2.4 System Development Techniques

This involves conceiving, specifying, designing, programming, documenting, testing, and fixing

bugs engaged in creating and maintaining applications, frameworks, or other software

components. The result of this stage should be a system that meets the customer expectations,

reaches completion within time and cost evaluations, and works effectively and efficiently in the

current and planned Information Technology infrastructure.

27
2.4.1 Activities carried out in SDLC

Requirements, design, implementation, testing, deployment, operations, Maintenance.

2.4.2 Phases of SDLC

Planning. Obtaining approval for the project, initiate, assess feasibility, plan, schedule. Analysis.

Understand business needs and processing needs. Design. Define solution system based on.

Requirement and analysis decision. Implementation. Construct, test, train users, install a new

system. Maintenance keeps the system healthy and improve.

2.4.3 Languages used in the development of the online train

reservation system

2.4.3.1 Php

It is widely-used Open-Source general-purpose scripting language, especially suited for Web

development. It is embedded into HTML.

2.4.3.2 SQL

SQL is found to be an interactive language that is on the rising path, among other programming

languages. Tech giants like Amazon, Google, IBM, Oracle, Helix, Microsoft, etc., continue to

utilize SQL in their systems. This is considered to be a standardized program that is used to

perform relational functions and operations. SQL has these advantages in modifying database

tables and index structures; its high-speed functional ability can retrieve a large number of

records from a database quickly, has well-defined standards, and does not require the substantial

writing of codes open-source language which is portable and easy to use.

28
2.5 System Testing Techniques

2.5.1 Black Box Testing

Black Box Testing is a method of Software Testing, also called Behavioral Testing. The primary

function of black-box testing is to test the interior design/implementation of an item which

cannot be known to the tester. The name itself says that the inspector who will check the product

will give input and examine the output results without prior knowledge of source code. More

Efficient and Suitable for large code segments. No need for any Coding or Programming

knowledge. A large number of testers can test the software application without prior knowledge

of programming or operating system. The disadvantages of black-box testing are: Only limited

coverage of application as the tester cannot target specific code segment, Test cases are

challenging to design as the inspector doesn't have prior knowledge on specifications and coding.

2.5.2 White Box Testing

White Box Testing is one of the software testing methods, also known as Open Box Testing,

Transparent Box Testing, or Glass Box Testing. It is defined as a testing method in which the

tester can able to test the internal functions of a product with prior programming knowledge

under specific conditions. The significant role of this testing is to study the whole internal

structure of a software product and need to find out the inappropriate unit code. It helps to

optimize the entire internal source code as the tester has programming knowledge. Almost all

paths of a software product will be covered. As the inspector has programming knowledge, it

will be easy to find out the inappropriate unit code. However, white box testing requires highly

29
skilled testers and debugging tools, results will be more efficient, but according to resources, it

may become expensive. Even though all the source code paths will be covered, there may be a

chance of missing to find out hidden errors.

2.6 Existing Systems

2.6.1 Kenya Railways SGR Train Online Booking Website

On January 8, 2018, Kenya Railways launched the Madaraka Express train service Website. The

website came after months of challenges getting the tickets. The prior available means of booking

SGR tickets for the trains between Nairobi and Mombasa were either using USSD Code *639# or

visiting the respective station.

30
Passengers enjoy the convenience of booking a ride on the Madaraka Express Train and SGR

inter county train through Kenya railway’s online booking system. It is quick and very easy to

use.

Well, the long-awaited online booking platform is here and despite it missing some useful

features like the ability to select your preferred seat and even print your ticket, it still does the

most important part, get you space on the train on your preferred date of travel.

The system performs a search to see if there are any seats available for the selected time and date

of travel, if there is, you will get to a page like this:

31
After which you can select the number of seats you want and the couch, First Class or Second

Class. Next, you will input your details, including your name, ID/Passport number and

Nationality. As of now, the system only supports Payment via M-Pesa so ensure that you input

the phone number that you will use to pay for the ticket via M-Pesa, or you can choose to Pay

Later if you would rather pay for the ticket at a later time. If you choose to pay immediately, once

you enter your phone number and click pay now, you will be prompted to enter your M-Pesa PIN

on your mobile phone and the payment will be processed immediately thanks to the use of the

new M-Pesa API. The online booking platform does not allow you to select your preferred seat,

so keep the M-Pesa message safe as you will need the account number to print your ticket at the

terminus on the day of travel, which means you should be there well over an hour before the set

travel time.

2.7 Conclusion

The railway reservation system shall facilitate the passengers to enquiry about the trains available

on the basis of source and destination, booking and cancellation of tickets, enquiry about the

status of the booked ticket, etc. The aim of case study is to design and develop a data base

maintaining records of different trains, train status and passengers. This proposal contains

introduction to the railways reservation system. It is the computerized system of reserving the

seats of train seats in advance. It is mainly used for a long route. Online train reservation shall

make the process for the reservation of seats very much easier than ever before.

32
CHAPTER THREE

METHODOLOGY

3.1 Introduction

This chapter will focus on the system development methodology that will be used, for instance,

waterfall model, spiral model, and the techniques that will be applied in the collection of data for

analysis and design.

3.2 System Development Methodology

The Raspberry Pi processes the signal given by Bluetooth module through voice recognition

helps the system to dispense hot and cold water.

In certain case, when the user communicates through BT module and gives the instruction

“Dispense Hot water", then the Raspberry Pi processes the voice signals via microphone and

sends the signal for the relays to switch on the water heater and same when the user says

“Dispense Cold water, then the Pi board sends the signal to the solenoid motors to turn ON to

dispense cold water from cold water tank.

Python IDLE software is used for programming the Raspberry Pi.

Water level sensor will measure the quantity of the hot and cold water as well in the

Jar/glass/bucket (which depends on the applications). It gives the signals to the Raspberry Pi in

order to turn off the solenoid valve motor.


33
Ultrasonic sensor is used to measure the water quantity and through voice command the quantity

of water dispensed it is controlled.

3.2.1 Rapid Application Development

The methodology that is used is the Rapid Application Development. This methodology is an

incremental model where the components or functions are developed in parallel. The

developments are time boxed, delivered and then assembled into a working prototype. Rapid

Application Development focuses on gathering customer requirements through workshops or

focus groups, early testing of the prototype by the customer using iterative concept, reuse of

existing prototypes, continuous integration and rapid delivery. The RAD method of software

development structures the life cycle of the project in five phases (including 3 systemic).

Initialization prepares the organization and determines the scope and terms of communication.

(Lawrence 2012). The framework defines a space for objectives, solutions and resources.

The design models the solution and validates its systemic coherence. Construction is realized in

an active prototype (permanent validation). The completion is reduced to a final quality control

at the pilot site. Without being bound to tools, RAD method recommends the use of

programming tools for graphical user interface (CASE), which allow for quick prototypes. In this

regard, we must not confuse the RAD method (which comes from the current agile approaches)

which seeks functional application quality and technique, with RAD tools, including the

automatic generation of code. Online Knowledge defines Rapid Application Development as “a

34
methodology that enables organizations to develop strategically important systems faster while

reducing development costs, lifespan and maintaining quality. This is achieved by using a series

of proven application development techniques, within a well-defined methodology.”

Traditional development life cycles, however, are too slow and rigid to meet the business

demands of today’s economy due to the increased technology. A new methodology must be

implemented, one that allows organizations to build software applications faster, better, and

cheaper. RAD enables such development

It will be conducted in the following phases;

i. Requirement Planning - In this phase, the frequently asked question is why the system

needs to be built and will be answered appropriately. The system’s requirements are

clearly defined and a thorough feasibility study is done from various perspectives

including technical, financial, and organizational where the system users will be involved

fully.

ii. User design phase - This phase involves problem identification and solution analysis.

Efforts will be made to predict the problems that the developers might face while creating

the system. The end-deliverables of this phase will be used to determine the method of

system creation and provide guidance to the developer.

iii. Construction phase – This will be the phase where the actual development of the system

will take place, it will entail the actual coding of the system using the specified software

and hardware specifications.

35
iv. Implementation phase – In this phase, the system will be tested for defects that will

then be rectified, and finally installed. Bundled along are other essential activities

including training and maintenance. This phase is usually split into smaller, more specific

phases such as Development and Deployment and Maintenance. However, the above four

phases are the most common and accepted ones.

Figure 3.1 Rapid application development (RAD) model

3.2.2 Justification of the Design

i Faster delivery time - RAD reduces the project development life cycle due to a reduced

requirement analysis, this is achieved by prototyping technique and usage of automated

tools like CASE which enhances reuse of code rather than coding from scratch.

36
ii Greater client satisfaction - The RAD methodology involves active participation of the

customers and end users in all stages of analysis and development of the application. It is

especially helpful in scenarios where the user requirements are uncertain, or not fixed.

iii Better project management - In RAD, there is active participation of the management,

the development teams, as well as the business owners and end users. This results to a

better collaboration between all stakeholders, hence, a better understanding of the client

requirements and expectations. Also, the project receives better visibility and support.

iv Reduced risk - Due to the iterative approach and prototyping, testing and integration of

end user feedback happens at each stage of product development. Hence, the end product

has lesser number of changes and defects, thereby minimizing the risks involved in the

project.

3.3 Data Collection Methods

The researcher will use various methods to collect data from currently existing train reservation

systems. Data will be collected from the existing systems' stakeholders, and these are the users of

the train reservation systems. Techniques used include; observation, internet, and the

administration of questionnaires.

1. Observation, to gain a clear understanding of the current system, the research will use

observation to understand the operations of the current system. This will be done to

understand how the system works. Consideration for collecting data is used since it accesses

people in real life, has a suitable method for explaining meaning and content, and is a reliable

tool for analyzing validity and in-depth understanding.

37
Advantages

i Allows validity of data and facts to be checked out. This is because the researcher can

cross check what they have observed by asking questions.

ii Observation is relatively inexpensive since all the researcher needs is to take down points

on what they have seen.

iii The researcher can see exactly what is being done and hence have first-hand information.

Disadvantages

i. People may knowingly or unknowingly act and perform differently when being observed.

2. Internet, to meet the proposed system required specifications, the researcher will use the

internet to gather facts about the existing systems. This will help them perform a thorough

scrutiny of the current systems to get requirements.

3. Questionnaires, A questionnaire is an instrument for collecting data, and almost always

involve asking a given subject to respond to a set of oral or written questions Questionnaires will

be also be used to collect data since they are Quick to complete, produce standardized data that is

easily classified, Reliable and they Enable comparison between different groups and populations.

4. Oral Interviews, these will be carried out on some customers and staff of the Kenyan Railway

Corporation (KRC). This is about how customers book and board the train, how customer data

and information is stored and how trips are scheduled and management is done.

This method has the following advantages;

38
i. The researcher will be exposed to first-hand information from the current administrators of

the current system; this helps to get the feel of the proposed system.

ii. The researcher will be able to ask follow up questions and this will help to gain more insight

into the proposed system.

3.4 System Requirements

3.4.1 Hardware requirements

1. System: Raspberry Pi 3 model B

2. Ram: 1 GB.

3. Monitor: 15 VGA Color.

4. SD card: 16GB class 10.

5. External mouse and keyboard.

6. HDMI to VGA convertor

3.4.2 Software requirements

1. Operating system: Ubuntu Mate, Windows

2. Front-end: Java JDK 1.6

3. Software’s used: Android Studio, Python, MySQL, PHP

39
3.4.3 Functional Requirements

Functional requirements are those related to the technical functionality of the system. They

provide a complete description of how the system will function and operate from the users’

perspective. The function of the potential system or its component is defined. The function will

be described as a set of inputs, the behavior, and outputs.

3.4.4 Non-Functional Requirements

These are those requirements that describe the features and attributes of the system, rather than

what it will do.

Usability – The system will be easy to use so as to achieve the desired goals.

Reliability – The system will be simple and thorough testing will be done to establish all the

constraints at development stage.

Security – The security of the system will be achieved through access control and proper

authentication. Only registered users will be granted access to various pages, and data stored in

the database will only be manipulated by users with such rights.

Maintainability – Proper improvements will be made on a constant basis to ensure the

functionality of the system is not compromised.

3.5 Ethical Considerations

Research about weaknesses in deployed train reservation systems raises a variety of pressing

ethical concerns. In addition to ethical issues common to vulnerability research, such as the

potential harms and benefits of vulnerability disclosure, online train reservation researchers face

questions that flow from the unique and important role. Should researchers worry that their own

work (not unlike the flaws they study) could sway an election outcome? How should researchers
40
address the risk that identifying specific flaws will lead to a false sense of security, after those

particular problems have been resolved? This paper makes an early effort to address these and

other questions with reference to experience from previous SGR train reservation system security

reviews. We hope our provisional analysis will help practicing researchers anticipate and address

ethical issues in future studies.

CHAPTER FOUR

REQUIREMENTS GATHERING & SYSTEM ANALYSIS

4.1. Gathering requirements

Gathering requirements is the process of generating a list of requirements (functional, system,

technical, etc.) from the various stakeholders (customers, users, vendors, IT staff, etc.) that will

be used as the basis for the formal system requirements (Michael, 2019).

4.1.1. Interviews

These are invaluable tool at the beginning of the process for getting background information on

the business problems and understanding a current-world perspective of what the system being

proposed needs to do.

It provides flexibility to the interviews. The interview has a better response are than mailed

questions, and the people who can read and write can also answer the questions. The interviewer

can judge the nonverbal behavior of the respondent. The interviewer can decide the place for an

interview in a private and silent place, unlike the ones conducted through emails which can have

a completely different environment.

Conducting interview studies can be very costly as well as very time-consuming. An interview

can cause biases. Interview studies provide less anonymity, which is a big concern for many

respondents. There is lack of accessibility to respondents (unlike conducting mailed questionnaire

41
study) since the respondents can be around any corner of the world or country (Mammou Eid,

2015).

4.1.2. Questionnaires

An instrument for collecting data, which almost always involves asking a given subject to

respond to a set of oral or written questions. Questionnaires are one of the most affordable ways

to gather quantitative data. Questionnaires are also practical way to gather data. They can be

targeted to group of your choice and managed in various ways. It’s quick and easy to collect

results with online. Questionnaires and surveys allow respondents to maintain their anonymity.

Dishonest answers – Respondents may not be 100% truthful with their answers. Unanswered

questions – When using questionnaires, there is a chance that some questions will be ignored or

left unanswered. Your questions uncomplicated and you will avoid question skipping and get

better completion rates.

4.1.3. Observation Method

Refers to a form of non-experimental research designed to watch behavior as it organically and


spontaneously unfolds in a natural environment (Observational Research, n.d.).

Very direct method for collecting data or information – best for the study of human behavior.
Data collected is very accurate in nature and also very reliable. Improves precision of the research
results. Problem of depending on respondents is decreased.

Observation like the controlled observation require some special instruments or tools for effective
working, which are very costly.

computerized system. This was carried out on the existing system. It helped to show the

weaknesses of the existing system (Jawahar).

42
4.2 Requirements Analysis

The primary goal of this phase was to create a detailed Functional Specification defining the full

set of system capabilities to be implemented, along with accompanying data and process models

illustrating the information to be managed and the processes to be supported by the new system

It involved examination of the collected data. Models such as Data Flow Diagrams (DFD) and

Entity Relationship Diagrams (ERD‟s) were used to model individual processes and data

respectively. Under here requirements were classified as functional and nonfunctional

requirements, the determination and analysis of requirements helped the researcher to achieve his

second objective.

4.2.1 Functional Requirements

The following requirements were captured for the intended use of the system.

• User account: The registered user can directly do the booking of train and if there is a

new user he may register or he only sees the train details. But for the reservation of ticket,

he must register first.

• Creation of new user account: When there is a new customer, he should fill the form

containing field like Username, First name, Last name, phone No and Password.

• Checking Availability: To check the available train the user should input the origin city

and destination city, date of journey.

• Reservation of Train: After providing all information the system will ask user for con-

firmation. After confirming the information, the trains get reserved.

• Canceling / Rescheduling of Ticket: To reschedule reservation the customer should log

into his account and can change departure date and time.

43
4.2.2 Non-functional requirements

The application was designed to fulfill the following non-functional requirements.

• Performance Requirements: Performance of the system is dependent on the bandwidth

of the internet and also the hardware itself.

• Security Requirements: There is only one authorized person who can see the confiden-

tial Information. The information of the customer is only available for the administrator.

• Software Quality Attributes: The system is very user friendly, interoperable and

Flexible.

4.3 System Analysis

System analysis can be defined as a process of investigation of a real or planned system to


determine the function of the system, identify the problems of the system, analyzing and
synthesizing the various factors and determining a satisfactory solution. The purpose of the
system analysis is for an analyst to look carefully into the manual system and automate it into

44
CHAPTER FIVE

SYSTEM DESIGN

This showed the application of system theory to product development by defining the

architecture, components, modules, interfaces and data for a system to satisfy specified

requirements. The goal of design phase was not just to produce a design for the system; instead,

it was to find the best possible design within the limitations imposed by the requirements and the

physical as well as the social development in which the system was to operate (Stair, 1996). The

system design process was divided into logical, conceptual and physical design.

In Logical design; the logical model of the system was developed indicating all the vital steps

the system development went through. Here, the researcher used case tools like flow charts and

data flow diagrams. Conceptual design was a description of the proposed system in terms of a set

of integrated ideas and concepts about what it should do, behave, and look like, that was

understandable by the users in the manner intended. The Physical design was the physical

realization of logical design. Tables, forms and reports were created and relationships defined

45
among these tables and security constrains set during the physical design the researcher

translated the expected schemas into actual database structures. In here the researcher achieved

his third objective.

5.1 Logical design

In this case the logical model of the system was developed indicating all the vital steps the

system development went through. In this, the research used case tools like flow charts and data

flow diagrams. These models were vital in the development of the system. This stage included

the graphical user interface design, input design in which the user inputs in data, the output

design which displays the results of what a user will have entered, and database design where

data is stored for easy management. These designs provided the technical blueprint from which

the system was built. A combination of layout tools such as hand sketches and CASE tools were

used to come up with both input and output designs. Database design was based on the

Relational data model and the database management system employed was MySQL.

5.2 Conceptual design

This was a description of the proposed system in terms of a set of integrated ideas and concepts

about what it should do, behave, and look like, that will be understandable by the users in the

manner intended. The process begun with identifying the entities required by the users and then

identifying all the important relationships that exist between the entities. The result was the

model of the user interface that has been developed.

5.3 Physical design

This was the physical realization of logical design. Tables, forms and reports were created and

relationships defined among these tables and security constrains set. During the physical design

46
the researcher translated the expected schemas into actual database structures and at this time, he

had to map:

i. Entities to tables

ii. Relationship to foreign key constraints

iii. Attributes to columns primary unique identifiers to primary key constraints.

iv. Unique identifiers to unique key constraints

v.Attributes to columns.

5.4 Use case diagram.

Use-case diagrams describe the high-level functions and scope of a system. These diagrams also

identify the interactions between the system and its actors. The use cases and actors in use-case

diagrams describe what the system does and how the actors use it, but not how the system

operates internally (IBM, 2021).

User admin

47
Figure 1: Use Case Diagram

Search Train

Register

Verify

Login

Add Train

Reserve Seat
Add route

48
5.5 Class Diagram.

Figure 2: Class Diagram

5.6 Data Flow Diagram

A data-flow diagram is a way of representing a flow of data through a process or a system. The

DFD also provides information about the outputs and inputs of each entity and the process itself.

A data-flow diagram has no control flow, there are no decision rules and no loops (Wikipedia,

2021).

Level 0 Data Flow Diagram

49
Figure 3: Level 0 DFD

LEVEL 1 Data Flow Diagram

Figure 4: Level 1 DFD

Level 2 Data Flow Diagram

50
Figure 5: Level 2 DFD (Registered User)

Figure 6: Level 2 DFD for Admin

Level 3 Data Flow Diagram

51
Figure 7: Level 3 DFD

5.7 Entity Relationship Diagram

Figure 8: ER Diagram

52
CHAPTER SIX

SYSTEM DEVELOPMENT

This system has been coded in the following manner and the following are the processes through

which it functions.

Querying Destinations from the database and showing them in the search form

Figure 9: Fetching Destinations from the Database

The following is the output of the above code.

Figure 10: Search Destinations form

53
Code for searching and displaying the input entered in the search form

Figure 11: Querying Searched values from database

The following is a screenshot for the code that queries the searched values from the database.

The results of the code above are shown below.

Figure 12: Output for search

54
User Registration Code

Figure 13: User Signup Code1

Figure 14: User Signup Code2

User Sign Up Interface

55
Figure 15: User Signup Screenshot

User Login Code Screenshot

Figure 16: User Sign in code screenshot

56
User sign in page

Code screenshot for admin dashboard

Figure 17: Admin Dashboard 1

57
Code Screenshot for viewing user profile

Figure 18: Code screenshot for viewing user profile

User profile screenshot

58
Code screenshot for user viewing their bookings.

Figure 19: User Bookings screenshot 2

Figure 20: User bookings screenshot 2

59
Screenshot for user bookings page.

Figure 21: User bookings page

The following is the screenshot for admin dashboard

Figure 22: Admin Dashboard

60
Code Screenshot for Admin Adding Trains to the database

Figure 23: Adding Trains Code Screenshot 1

Figure 24: Adding Train code Screenshot 2

61
The following is the screenshot for adding trains page

Figure 25: Screenshot for adding train page

Code Screenshot for deleting trains

Screenshot for admin delete train page

62
Code Screenshot for creating train destinations

63
Figure 26: Code Screenshot for creating destinations

The following screenshot shows the page for creating train destinations for admin.

Code screenshot for managing train bookings

64
Figure 27: Code Screenshot for viewing and managing train bookings 1

Figure 28: Code Screenshot for viewing and managing train bookings 2

The following code is used to cancel or confirm train bookings.

65
Figure 29: Code screenshot for cancelling or confirming bookings.

Admin page for managing bookings.

Figure 30: Admin page for confirming or cancelling bookings.

66
CHAPTER SEVEN

SYSTEM TESTING/ VALIDATION

System Testing (ST) is a black box testing technique performed to evaluate the complete system
the system's compliance against specified requirements. In System testing, the functionalities of
the system are tested from an end-to-end perspective.

System Testing is usually carried out by a team that is independent of the development team in
order to measure the quality of the system unbiased. It includes both functional and Non-
Functional testing (Tutorials Point, 2021).

7.1 Unit testing

Unit testing involves the testing of each unit or an individual component of the software
application. It is the first level of functional testing. The aim behind unit testing is to validate unit
components with its performance.

A unit is a single testable part of a software system and tested during the development phase of
the application software.

The purpose of unit testing is to test the correctness of isolated code. A unit component is an
individual function or code of the application. White box testing approach used for unit testing
and usually done by the developers.

Whenever the application is ready and given to the Test engineer, he/she will start checking every
component of the module or module of the application independently or one by one, and this
process is known as Unit testing or components testing. (Tutorials Point, n.d.)

Some crucial reasons for unit testing.

Unit testing helps tester and developers to understand the base of code that makes them able to
change defect causing code quickly.

Unit testing helps in the documentation.

Unit testing fixes defects very early in the development phase that's why there is a possibility to
occur a smaller number of defects in upcoming testing levels.
67
It helps with code reusability by migrating code and test cases.

7.2 Integration testing

Integration testing (sometimes called integration and testing, abbreviated I&T) is the phase in
software testing in which individual software modules are combined and tested as a group.
Integration testing is conducted to evaluate the compliance of a system or component with
specified functional requirements (Wikipedia, n.d.).

It occurs after unit testing and before validation testing. Integration testing takes as its input
modules that have been unit tested, groups them in larger aggregates, applies tests defined in an
integration test plan to those aggregates, and delivers as its output the integrated system ready for
system testing. Integration tests demonstrate that although the components were individually
satisfaction, as shown by successfully unit testing, the combination of components is correct
and consistent. Integration testing is specifically aimed at exposing the problems that arise from
the combination of components.

7.3 Functional testing

Functional tests provide systematic demonstrations that functions tested are available as specified
by the business and technical requirements, system documentation, and user manuals. Functional
testing is centered on the following items:

Valid Input : identified classes of valid input must be accepted.

Invalid Input : identified classes of invalid input must be rejected.

Functions : identified functions must be exercised.

Output : identified classes of application outputs must be exercised.

Systems/Procedures: interfacing systems or procedures must be invoked. Organization and


preparation of functional tests is focused on requirements, key functions, or special test cases. In
addition, systematic coverage pertaining to identify Business process flows; data fields,
predefined processes, and successive processes must be considered for testing. Before functional

68
testing is complete, additional tests are identified and the effective value of current tests is
determined.

7.4 System Testing

System Testing (ST) is a black box testing technique performed to evaluate the complete system
the system's compliance against specified requirements. In System testing, the functionalities of
the system are tested from an end-to-end perspective.
System Testing is usually carried out by a team that is independent of the development team in
order to measure the quality of the system unbiased. It includes both functional and Non-
Functional testing (Tutorialspoint, n.d.).
7.5 White Box Testing

White Box Testing is a testing in which the software tester has knowledge of the inner workings,
structure and language of the software, or at least its purpose. It is used to test areas that cannot
be reached from a black box level.

7.6 Black Box Testing

Black Box Testing is testing the software without any knowledge of the inner workings, structure
or language of the module being tested. Black box tests, as most other kinds of tests, must be
written from a definitive source document, such as specification or requirements document, such
as specification or requirements document. It is a testing in which the software under test is
treated, as a black box. you cannot “see” into it. The test provides inputs and responds to outputs
without considering how the software works.

Unit Testing:

Unit testing is usually conducted as part of a combined code and unit test phase of the software
lifecycle, although it is not uncommon for coding and unit testing to be conducted as two distinct
phases.

Test strategy and approach

Field testing will be performed manually and functional tests will be written in detail.

Test objectives

 All field entries must work properly.

69
 Pages must be activated from the identified link.
 The entry screen, messages and responses must not be delayed.

Features to be tested

Verify that the entries are of the correct format

 No duplicate entries should be allowed

All links should take the user to the correct page

 Integration Testing:

Software integration testing is the incremental integration testing of two or more integrated
software components on a single platform to produce failures caused by interface defects.

Test Results:

All the test cases mentioned above passed successfully. No defects encountered.

Acceptance Testing:

User Acceptance Testing is a critical phase of any project and requires significant participation by
the end user. It also ensures that the system meets the functional requirements

Test Results:

All the test cases mentioned above passed successfully. No defects encountered.

User Registration Module Test

Before a user is able to make reservations for trains, he/ she will be required to register an
account in the system or if they have accounts they will be required to sign in first.

The account registration window is shown in the screenshot below.

70
Figure 31: Account Registration Page

The user is required to enter their full name, contact number, email address and password during
signup. The system ensures that the details entered are correct e.g. that the email contains the
correct syntax. Failure to which an appropriate error message is displayed.

Figure 32: Wrong Email Syntax error

71
The system also confirms if the email and phone number has already been registered into the
system. If yes, the system advises the user to try signup with another email failure to which
he/she will not be able to sign up.

Figure 33: Email Already exists

On the event that the details entered are correct, the following success message is displayed by
the system.

Figure 34: Registration Success

User Login Module Test

The user will be required to enter their correct password and email in order to login into the
system.

In case of incorrect details, the system issues warning as the following.

72
Figure 35: Wrong Sign in details

But if the login details are correct, the user will be redirected to their accounts page.

Figure 36:Accounts Page

Testing Module for Searching Trains

The system is equipped with a user-friendly search form for filtering and finding the trains that
carry passengers between the specified routes a customer enters.

The form queries the starting point and the stoppage point from the database and displays results,
if any matches.

The form must also validate that all the search fields have been filled up correctly, if not the
search button is disabled.

73
Figure 37: Search Form

Search form correctly filled

Results

74
Figure 38: Correct Search Results

75
CHAPTER EIGHT

SUMMARY, RECOMMENDATION AND CONCLUSION AND FUTURE WORK.

8.1 Conclusion

Before modern computing, the reservation system was done using manual means. This meant
that the passenger had to spend a lot of unnecessary time waiting in queues in order to book their
train tickets. The manual process of reservation was also prone to numerous human errors, which
made a lot of passengers dissatisfied Nowadays competition is so fierce between transport
industries that there are lot of discounts and a lot of luxuries given to customers that will give an
edge to that particular industry. The online train reservation automates these processes of
booking railways tickets online, thus reducing the time wasted as well as the errors that are
involved in the manual process. People will argue that online reservation system are expensive,
and create unfair competition between industries that don’t use them.

From the research view, online train reservation is one the greatest innovations that have taken
place in the rail industry and those companies that have not yet embraced online reservation
system ought to lose out, they may sight additional costs, maintenance cost and the cost of
development as their drawbacks but business is more than any other occupation, it is a continual
dealing with the future; and continual calculation, an instinctive exercise in foresight. World
Wide Web and the Internet is here and transport companies for the future will seize this
opportunity to develop online reservation systems and prosper.

8.2 Recommendations

Room for improvement will never cease to exist, and the software created can also be improved.
This is especially because is created within a limited time. With more time, the software can be
improved to include security and different types of users. This would be the first step in making
the software network-enabled, and eventually more robust. This was the original after-thought to
programming the software, the software can also be equipped with real-time train tracking using
google maps, in addition, the software can also be improved in terms of the complexity
calculations it can do, and be made more flexible.

76
The research recommends the following about the system:

1. The administrators and staff of Railway company be trained on how to use the system,
thus enabling them to understand the functionality of the entire system.

2. More research on this system is required to fully identify and eliminate some of the weak-
nesses and integrate it with financial institutions to enable online payment.
3. There is need for the system upgrade as user’s requirements change. User requirements
might differ with the changing times; therefore, it is of great help for the system to be
flexible enough.

8.3. Summary

Today Railways are under unprecedented pressure to produce economic results or perish as fuel,
labor, and asset costs escalate and demand declines, many companies are taking important role in
transportation, and to make reservation reliable they need a strong system that will make
reservation easier, faster and safer. The project designed is to meet requirements of an online
train reservation system. It has been developed in XHTML, PHP, CSS, JAVASCRIPT and
database has been built in MySQL. By using this application, the companies can provide
reservation services and information to their customers without the limitation of office hours or
manpower. Not only does it let customers book trips around the clock from any location with an
internet connection but it is also designed for use by the company to internally manage their
business processes; minimizing human errors and overcoming difficulties and problems that
arose in the previous system.

The Train Ticket Reservation System will enable the customer to buy and pay for train ticket, ask
for information online easily and even cancel a reservation. Furthermore, staff can sell ticket
using Train Ticket Reservation System after checking train ticket availability for the customer
and print the ticket to the customer that queue up in the counter. The method to solve this
problem is to create an online train booking ticket system using System Development Life Cycle
(SDLC). Customer can buy the bus ticket over the Internet, 24 hours a day, 7 days a week and
the train ticket can't be lost, stolen or left behind.
77
8.4. Future Work

In future, our system will be integrated with live train location tracking capability using google
maps so that users can know where the train is at what time.

We can also consider integrating our system with online financial institutions like banks in order
to be able to process payments online.

In the future, a feature will be added to allow discounts on prices and users be able to apply
coupons during payments.

Our system will be expanded to serve train reservations not only in Kenya but also in other parts
of the world.

78
REFERENCES

Ainin, S., & Mohezar, J. N. (2008). E-Ticketing as a New Way of Buying Tickets. Kuala Lumur:

Kamal-Raj.

Asad, A., & N.K, A. M. (2012). Design and Developing SGR Iraqi Bus Reservation System.

International Jornal of Scientific Knowledge, 50-62.

Athukorale, & Dissanayake. (2008). Automated Train Ticket System. Moratuwa: University of

Moratawa.

Athukorale, A., & Dissanayake, C. (2008). Automated Train Ticket System. Moratuwa:

Univercity of Moratawa.

Farah, N. (2008, April 24). Dspace. Retrieved September 4, 2015, from unimap:

Joshua, A. (2000). Public–Private Participation to Rescue Railway Development in Kenya.

Ibadan: Feature press.

kumar, N., & A.Gopikrishna. (2015). A Robust and Secure SGR Bus ticket Reservation system.

International journal of computer science, 159.

Melisa, K. (2007). SGR Train Ticketing System. Kuala Lumpur: University of Malay.

O‟Brien, J. a. (2001). Management information system.

Payton, P. (2004). Oxford Dictionary of National Biography. Oxford: Oxford press.

Rochester, J. B. (1996). "Tools for Knowledge Workers"Using Computers in Information.

79
Indianapolis.

Ryan, S. (2010). The Impact of SGR Reservation System. Houston: University of Houston.

Wardell, D. J. (1991). Airline Reservation Systems. Researcher Paper.

Wells, M. (2002). “Introductory Microsoft Access.

Marwedel, P. (2018). Embedded System Design: Embedded Systems Foundations of Cyber-

Physical Systems, and the Internet of Things. Cham: Springer International Publishing.

APPENDICES

Appendix 1: Budget

ITEM AMOUNT(Kshs)

Laptop 50,500.00 Kshs

Typing 3000.00 Kshs

Printing 1,500.00 Kshs

80
Transport 5000.00 Kshs

Data collection 5,000.00 Kshs

Internet connection 8000.00 Kshs

Miscellaneous 3000.00 Kshs

Total 76,000.00 Kshs

Appendix 2: Project Schedule

Work Plan

NO. Activity Duration Proposed Proposed Deliverables

(days/weeks) Start Date End Date

1 Project Identification 3 days 30/5/2021 01/6/2021 Research area and Implementation

area

81
2 Proposal Writing 4weeks 02/6/2021 07/7/2021 Proposal document

4 Data collection 4 days 10/7/2021 13/07/2021 Collect user requirements

5 Requirement specification 3 days 15/07/2021 17/07/2021 Functional and non-functional

and analysis requirements

6 Feasibility Study 2weeks 20/07/2021 3/08/2021

7 Software design 2 weeks 4/08/2021 18/08/2021 Design documentation

8 Coding and Testing 3 weeks 20/08/2021 10/09/2021 Interface database Logical part of

system Complete application

9 Implementation 2 days 11/09/2021 12/09/2021 System Rollout

10 Documentation and report 3days 14/09/2021 16/09/2021 Complete Software Report

writing

Activity JULY AUGUST SEPT OCT

Problem study

Literature review

Methodology

System analysis

82
Coding

Testing

Project documentation

TIME SCHEDULE

83
TIME SCHEDULE IN GANTT CHART

Activity Weeks

1 2 4 6 10 17 24 25 26 28

Project

description

Project

proposal

Literature

Review

Software

analysis and

design

Coding

Software

testing

Implementatio

Documentation

84

You might also like