MAKERERE UNIVERSITY

COLLEGE OF ENGINEERING, DESIGN, ART AND TECHNOLOGY

DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING

PROJECT TITLE

DESIGN AND IMPLEMENTATION OF A LOW COST HANDS-

FREE TAP AND FLUSH TOILET SYSTEM

BY

RICHARD KIIZA REGISTRATION NUMBER: 14/U/23330/PS

STUDENT NUMBER: 214023468

A final year project report submitted in partial fulfilment of the requirements for the award of the Degree of Bachelor of Science in Electrical Engineering of Makerere University.

JUNE 2019

DECLARATION

I Richard Kiiza, declare to the best of my knowledge and understanding that this report is my original work and has not been submitted to any university or other institution of learning for any academic award, where research was made, it is fully referenced.

Signature:

Date: 24/06/2019

i

APPROVAL

This final year project report was submitted to Makerere University for examination purpose with the approval of the following supervisors;

Ms. Sheila Mugala

Lecturer

Department of Electrical and Computer Engineering

Signature: Date: 24/06/2019

ii

ACKNOWLEDGEMENT

I am so grateful to the God Almighty for his unending love, favor and providence to me during from the start of the final year project up to the end plus the compilation of this report.

I would like to extend my heartfelt gratitude to my parents for the facilitation and financial support they gave me.

I also extend my appreciation to my project partner Mr. Jesse Kavuma for being such a cooperative person as this smoothened the project work.

Special thanks go to my final year project Supervisors Ms. Sheila Mugala and Ms. Margaret Nanyonga for their continuous guidance since I per took this project and during the compilation of this report.

iii

DEDICATION I dedicate this report to my parents who have been there to give me the gift of education up to this moment. I am grateful for their selfless efforts.

iv

ABSTRACT

In Uganda today, there is an increase in the use of water-borne toilets both in public, commercial, residential and health facilities. However, increased spread of diseases in the public due to the touching of flush toilet and tap handles in water-borne toilets is rampant. Using a low cost design, the control of taps and toilet flush handles can be automated and the spread of these diseases reduced. This project comes with the added value of conservation of water which is a major concern and increase in durability of the restroom ware.

The main objective of this project was to automate toilet flushing and water tap control in waterborne toilets

The process of achieving the objectives involved research and collection of data from both written literature and the internet. A market research shortly followed for inquiries on price and available systems. Using the information obtained, different circuit designs were obtained and compared. The most suitable circuit was simulated in Proteus Simulation Software and a prototype developed. The prototype was then tested with already installed waterborne toilet.

The result was a user friendly hands-free flush toilet and tap system, with an efficient electronically controlled mechanism. This was realized with a low cost design, affordable to the public and to an appreciable percentage, free of errors that surfaced as flushes or water flows without a human trigger.

Consequently, the toilet user does not touch the toilet flush handle or the tap while washing his or her hands. The spread of diseases is therefore minimized. From this, recommendations were made and these included; modifying the circuit to cater for cases where there is no water in the tap or cistern and improvement of the sensitivity and speed of the motion sensors.

In conclusion, the prototype developed is a huge step forward in improving the sanitation in water borne toilets. This system is slowly gaining popularity in the developed countries but the products developed there are not affordable in the developing countries like Uganda. The low cost design presented here therefore provides a suitable equivalent to automate toilet flushing and tap control.

Table of Contents DECLARATION ...... i v

APPROVAL ...... ii

ACKNOWLEDGEMENT ...... iii

DEDICATION ...... iv

ABSTRACT ...... v

LIST OF FIGURES ...... ix

LIST OF ABBREVIATIONS ...... xi

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

1.1 PROJECT BACKGROUND ...... 1

1.2 SIGNIFICANCE ...... 1

1.3 STATEMENT OF THE PROBLEM ...... 1

1.4 OBJECTIVES ...... 1

1.4.1 Main objective ...... 1

1.4.2 Specific objectives ...... 1

1.5 JUSTIFICATION ...... 2

1.6 SUMMARY OF THE METHODOLOGY ...... 2

2 CHAPTER TWO: LITERATURE REVIEW ...... 4

2.1 FLUSHING TOILESTS ...... 4

2.1.1 INTRODUCTION ...... 4

2.1.2 TYPES OF FLUSH TOILETS ...... 5

2.2 FAUCETS ...... 6

2.3 COMPONENTS USED IN THE PROTOTYPE DESIGN ...... 7

2.3.1 THE 555 ...... 7

2.3.2 ELECTROMECHANICAL RELAY ...... 11

2.3.3 NAND GATE ...... 12

2.3.4 THE BATTERY ...... 12

2.3.5 VOLTAGE REGULATOR ...... 13

2.3.6 MOSFET...... 14

vi

2.3.7 PIR SENSOR ...... 15

2.3.8 SOLENOID VALVE ...... 16

2.3.9 ...... 16

2.3.10 ...... 17

3 CHAPTER THREE: METHODOLOGY ...... 18

3.1 INTRODUCTION ...... 18

3.1 BLOCK DIAGRAM OF THE SYSTEM ...... 18

3.2 BRIEF DESCRIPTION OF PLACES VISITED ...... 18

3.3 COMPONENT SELECTION CRITERIA ...... 19

3.3.1 Selection of the Relay Switch ...... 19

3.3.2 Selection of the solenoid valve ...... 19

3.3.3 Selection of the used motor ...... 20

3.3.4 Selection of the PIR sensor ...... 20

3.3.5 Selection of the voltage regulator ...... 21

3.5 CIRCUIT SIMULATION ...... 22

3.6 PROTOTYPING ...... 23

3.7 MECHANICS & ASSEMBLY ...... 23

4 CHAPTER FOUR: RESULTS AND ANALYSIS ...... 24

4.1 INTRODUCTION ...... 24

4.2 FIELD RESEARCH ...... 24

4.3 SIMULATION RESULTS ...... 24

4.4 COMPLETE CIRCUIT DESIGN ...... 27

4.5 FLOW CHART ...... 28

4.6 BUILDING OF THE CONTROL CIRCUIT ...... 29

4.7 MECHANICS AND ASSEMBLY ...... 31

5 CHAPTER FOUR: LIMITATIONS, CONCLUSION AND RECOMMENDATIONS ...... 34

4.1 LIMITATIONS ...... 34

vii

4.2 CONCLUSION ...... 34

4.3 RECOMMENDATIONS ...... 34

REFERENCES ...... 35

APPENDIX ...... 36

viii

LIST OF FIGURES Figure 2.1: Visualization of the flush toilet system ...... 4 Figure 2.2: Visualization of a faucet ...... 7 Figure 2.3: The 555 timer IC ...... 7 Figure 2.4: 555 timer cross-section showing pin configuration ...... 9 Figure 2.5: 555 timer in monostable operation mode ...... 10 Figure 2.6: 555 timer as a circuit driver...... 11 Figure 2.7: The electromechanical relay ...... 12 Figure 2.8: The 12V 7AH battery ...... 13 Figure 2.9: Voltage regulator IC ...... 14 Figure 2.10: The MOSFET IC ...... 15 Figure 2.11: The PIR sensor ...... 15 Figure 2.12: The Solenoid valve ...... 16 Figure 2.13: Visualization of a typical ...... 17 Figure 2.14: The Visualization of a ...... 17 Figure 3.1: Block diagram of envisioned system ...... 18 Figure 3.2 The 12V DC solenoid valve ...... 19 Figure 3.3: The 12V DC motor ...... 20 Figure 3.4: The PIR motion sensor ...... 21 ix

Figure 3.5: The L7805 regulator IC ...... 22 Figure 4.1 Circuit before triggering ...... 25 Figure 4.2 Circuit after triggering ...... 26 Figure 4.3 the control circuit for the automated flush toilet/ faucet ...... 28 Figure 4.4: Flow chart for the control process ...... 29 Figure 4.5: Soldered control circuit for Flush toilet system ...... 30 Figure 4.6: Soldered control circuit for tap system ...... 31 Figure 4.7: The motor is hooked to the flush handle ...... 32 Figure 4.8: The automated faucet on standby Figure 4.9: The automated faucet after triggering 33 Figure 4.10: The demonstration board containing the control circuits, motor and the battery ...... 33

LIST OF TABLES Table 2.1: Truth Table of a NAND gate ...... 12 Table 3.1 the L7805 pins and their purposes ...... 22 Table 4.1: Summary of the input and output of the timer circuit ...... 27

x

LIST OF ABBREVIATIONS

A

AC Alternating Current

AH Hour

C Capacitance

DC Direct Current

IC

MOSFET Metal Oxide Semiconductor Field Effect

R Resistor

RC Resistor-Capacitor

TTL Transistor Transistor Logic

V

xi

1 CHAPTER ONE: INTRODUCTION 1.1 PROJECT BACKGROUND In Uganda today, there is an increase in the use of water-borne toilets both in public, commercial and residential facilities. However, hygiene, which is a key factor in curbing disease spread is a concern. This is because the use of water-borne toilets calls for flushing and later washing of one’s hands. During the two processes, the user touches the handle of the toilet reservoir and that of the sink and so does the next person. This is one of the ways diseases such as cholera, Ebola, diarrhea, dysentery and many others spread in the community.

1.2 SIGNIFICANCE

The significance of the project is to curb the spread of diseases by eliminating the need to touch flush toilet and tap handles. This is a major step in maintenance of good health in the society.

Secondly, the automatic control of the flow of water ensures sustainable use of water resources and cutting of water bills. This comes with the advantage of stopping the tap as soon as the user leaves to avoid waste of water.

The third advantage that comes with this project is that the durability of the tap and flushing equipment is improved. This is because there’s minimized tampering since no touching is required.

1.3 STATEMENT OF THE PROBLEM

There is an increased spread of diseases in the public due to the touching of flush toilet and tap handles in water-borne toilets. Using a low cost design, the control of taps and toilet flush handles can be automated and the spread of these diseases minimized.

1.4 OBJECTIVES

1.4.1 Main objective

To improve hygiene through design of a low cost hands-free flushing and tap system.

1.4.2 Specific objectives

• To design a low cost control circuit for faucet switching

1

• To design a low cost control circuit for hands-free flushing toilet system. • To implement the control circuits in specific objectives 1 and 2 into a working prototype.

1.5 JUSTIFICATION

There are two main points that justify this project; Cost On the market today, there are hands-free flush toilets and taps. However these are not frequently used by local people as they are installed in fancy facilities like luxurious hotels. The available hands-free flush and tap systems are imported and are therefore expensive, which is the main reason why they are not installed in schools, public restrooms, arcades and many other places.

With the current developments in technology, the necessary equipment required to build a handsfree flush and tap system at an affordable cost; friendly to the Ugandan market, is available.

Health With the ever-growing population of Uganda, and the slow growth in health care and medical facilities, prevention of diseases is better than cure. Communicable diseases easily spread in the community if multiple people share toilet flush handles and taps. We believe the proposed project is a big step towards maintaining a healthy Uganda.

1.6 SUMMARY OF THE METHODOLOGY

Literature study: Study the literature on the implementation techniques and specifications.

Market survey: Investigate the cost of the hands-free flush and tap systems used in hotels and other facilities.

Simulation of electric circuit: Design and simulate several possible circuits using a simulation software e.g. multisim so as to study the expected outcome of the designs.

Presentation of design for advice and approval: Seeking of guidance and approval of selected design from the university supervisors and technical experts.

Compile design requirements: Identify and purchase the components needed to implement the intended design.

2

Then the simulated circuit will be implemented and tested

3

2 CHAPTER TWO: LITERATURE REVIEW

2.1 FLUSHING TOILESTS

2.1.1 INTRODUCTION

In 1860s, Thomas Crapper constructed the first flush toilet. The credit for inventing the flush toilet goes to Sir John Harrington, godson of Elizabeth I, who invented a water closet with a raised cistern and a small downpipe through which water ran to flush the waste in 1592 [1].

Figure 2.1: Visualization of the flush toilet system

4

Three basic operations for a flush toilet

Flushing the toilet opens the flush valve: A flush lever moves an arm to lift a flapper valve or tank ball to permit water to rush into the toilet bowl below, washing away waste into the sewer pipe. Other toilets may use a siphon-flush valve to activate the flush cycle. At the end of the flush cycle, a float arm, or a float moving on a vertical stalk (newer valves) drops to open a valve permitting the toilet tank to refill with water.

Re-Filling the Toilet Cistern or Tank: When the toilet tank water level reaches the proper level, the float closes the toilet tank fill valve.

Additional Water Enters the Toilet Bowl: during the re-filling of the cistern or toilet tank, as long as the toilet fill valve is open to allow water to enter the toilet, most designs use a small diameter tube to direct a portion of the incoming water down the cistern tank overflow tube (see sketch in Figure 2.1 above) and into the toilet bowl. This extra water helps assure a proper level of water in the toilet bowl to prepare it for its next use [2]

2.1.2 TYPES OF FLUSH TOILETS

2.1.2.1 Gravity flush

This one uses the weight of the water itself to create the flushing pressure. In order to maximize the pressure, the distance that water must travel to the bowl is increased like in an elevated cistern. Water from the tank is forced into the bowl, cleaning it and removing waste at the same time.

2.1.2.2 Pressure-assisted

These work similarly to gravity flush systems, but contain an extra mechanism used to force water into the toilet bowl even harder. A plastic tank containing an air-filled balloon is pressurized every time water begins to refill in the toilet’s ceramic tank.

During a flush, the compressed air inside the balloon pushes water into the bowl at a higher flow rate than would be possible in a gravity tank. This allows a system to use less water and still be as strong as a gravity flush system, or use the same amount of water more effectively.

Because of the extra force applied during the flush, pressure-assisted toilets are louder than other flushing systems.

5

2.1.2.3 Dual Flush

Dual flush systems are quickly becoming popular due to their environmentally conscious design, allowing you to use more or less water depending on the waste you need to flush. Two levers or buttons are installed on the same toilet unit, allowing you to make a “full” or “partial” flush. The full flush works just like any other toilet, using roughly 1.6 gallons of water to remove a mixture of solid and liquid waste.

A partial flush, on the other hand, is designed for only liquid waste and uses 1.1 gallons of water. Many countries have adopted the dual flush system and mandate its installation in new constructions because of its impressive water-saving capabilities.

2.1.2.4 Double Cyclone/Tornado Flush

Instead of the traditional rim holes, the Tornado Flush releases water into the bowl using two large nozzles on either side to create a centrifugal, cyclonic rinsing action. The high-efficiency system uses only 1.28 gallons per flush for both solid and liquid waste [3].

2.2 FAUCETS

By definition, a faucet is a device that controls the flow of a liquid, especially water, out of a pipe. A tap is a commonly known example of a faucet. Most faucets in Uganda are manually controlled. A valve is turned by hand in one direction to allow water to flow out of the tap. And turned in the other direction to stop the water from flowing.

An automatic faucet is a faucet equipped with a proximity sensor and mechanism that opens its valve to allow water to flow in response to the presence of a hand or hands in close proximity. The faucet closes its valve after a few or when it no longer detects the presence of hands. Most automatic faucets are battery powered and incorporate an active infrared sensor to detect hand motion. Applications of automatic faucets are mainly public restrooms at airports, hotels and a few residential areas with the purpose of reducing water wastage and transmission of disease-causing microbes.

6

Figure 2.2: Visualization of a faucet

2.3 COMPONENTS USED IN THE PROTOTYPE DESIGN

2.3.1 THE 555 TIMER

Figure 2.3: The 555 timer IC

This IC is a monolithic timing circuit that can produce accurate and highly stable time delays or oscillation. It is very much reliable, easy to use and cheaper in cost.

Some of its applications including monostable and astable , dc-dc converters, digital logic probes, waveform generators, analog frequency meters and tachometers, temperature measurement and control devices, voltage regulators.

7

The timer operates in one of the two modes either as a monostable (one-shot) or as an astable (free-running) multivibrator.The SE 555 is designed for the operating temperature range from – 55°C to 125° while the NE 555 operates over a temperature range of 0° to 70°C [4].

The 555 timer has the following important features;

• It has a temperature stability of 50 parts per million (ppm) per degree change in temperature, or equivalently 0.005 %/ °C.

• The duty cycle of the timer is adjustable with the maximum power dissipation per package is 600 mW and its trigger and reset inputs are logic compatible.

• It operates from a wide range of power supplies ranging from + 5 Volts to + 18 Volts supply voltage.

• Sinking or sourcing 200 mA of load current.

• The external components have to be selected properly so that the timing intervals can be made into several minutes Proper selection of only a few external components allows timing intervals of several minutes along with the frequencies exceeding several hundred kilo .

• It has a high current output; the output can drive TTL [4].

The IC pin configuration is as shown below;

8

Figure 2.4: 555 timer cross-section showing pin configuration

The connections to the pins are as detailed below; Pin 1: Grounded Terminal: All the voltages are measured with respect to this terminal.

Pin 2: Trigger Terminal: This pin is an inverting input to a that is responsible for transition of flip-flop from set to reset. The output of the timer depends on the amplitude of the external trigger pulse applied to this pin.

Pin 3: Output Terminal: Output of the timer is available at this pin. There are two ways in which a load can be connected to the output terminal either between pin 3 and ground pin (pin 1) or between pin 3 and supply pin (pin 8). The load connected between pin 3 and ground supply pin is called the normally on load and that connected between pin 3 and ground pin is called the normally off load.

Pin 4: Reset Terminal: To disable or reset the timer a negative pulse is applied to this pin due to which it is referred to as reset terminal. When this pin is not to be used for reset purpose, it should be connected to + VCC to avoid any possibility of false triggering.

Pin 5: Control Voltage Terminal: The function of this terminal is to control the threshold and trigger levels. Thus either the external voltage or a pot connected to this pin determines the pulse

9 width of the output waveform. The external voltage applied to this pin can also be used to modulate the output waveform. When this pin is not used, it should be connected to ground through a 0.01 micro to avoid any noise problem.

Pin 6: Threshold Terminal: This is the non-inverting input terminal of comparator 1, which compares the voltage applied to the terminal with a reference voltage of 2/3 VCC. The amplitude of voltage applied to this terminal is responsible for the set state of flip-flop.

Pin 7 : Discharge Terminal: This pin is connected internally to the collector of transistor and mostly a capacitor is connected between this terminal and ground. It is called discharge terminal because when transistor saturates, capacitor discharges through the transistor. When the transistor is cut-off, the capacitor charges at a rate determined by the external resistor and capacitor.

Pin 8: Supply Terminal: A supply voltage of + 5 V to + 18 V is applied to this terminal with respect to ground [pin 1] [4].

The circuit design of 555 timer in monostable operation mode is as shown in Figure 2.4.

Figure 2.5: 555 timer in monostable operation mode

10

In timer mode, better known as monostable mode, the 555 simply acts as a “one-shot” timer; when a trigger voltage is applied to its trigger lead, the chip’s output goes from low to high for a duration set by an external RC circuit.’

This 555 timer circuit in monostable mode, it can be used to drive a circuit as illustrated in Figure 2.5;

Figure 2.6: 555 timer as a circuit driver.

2.3.2 ELECTROMECHANICAL RELAY

It is an electrically operated switch that completes or interrupts a circuit by physical movement of electrical contacts into contact with each other [5].

When a current flows through the coil, an electro-magnetic field is set up. The field attracts an iron armature, whose other end pushes the contacts together, completing the circuit. When the current is switched off, the contacts open again switching the circuit off.

This relay has the following advantages; much lower contact resistance, they are quick acting and easy to reset.

11

Figure 2.7: The electromechanical relay 2.3.3 NAND GATE

This gate is a combination of an AND and NOT gates, and is a commonly used logic gate. It is known as a universal gate because it can be used to realize all the other logic gates. It consists of one or more inputs with a single output. The output of the NAND gate is always at logic 1 and only goes to logic 0 when all the inputs to the NAND gate are at logic 1 [6].

The truth table for this gate is as shown below;

Table 2.1: Truth Table of a NAND gate

2.3.4 THE BATTERY.

A battery is a device that produces electrons through electrochemical reactions, and contains positive (+) and negative (-) terminals. A battery consists of one or more electrochemical cells, which transform stored chemical energy directly into electrical energy. When an external load

12 connects to a battery, electrons cross from the negative to the positive terminal, creating an electrical current

Batteries are classified into primary and secondary batteries. Primary batteries are disposable batteries. They are built to be used only once and then discarded. This is because the chemical reactions that take place within primary batteries cannot be reversed, and the active materials do not go back to their original forms. These battery types are normally used in portable devices, which require minimal current drain. Common varieties of disposable or primary batteries include alkaline batteries and zinc-carbon batteries.

Secondary batteries, also called rechargeable batteries, are built to be recharged and reused many times. Secondary batteries usually include active materials that are assembled in a discharged state. These batteries can be recharged upon the application of , which helps to reverse the chemical reactions that take place when the battery is used. Devices designed to supply a suitable current source are known as chargers or rechargers. Lead-acid batteries are the most ancient type of rechargeable battery [7].

The battery used in this project was a sealed lead-acid battery rated 12V and 7AH.

Figure 2.8: The 12V 7AH battery 2.3.5 VOLTAGE REGULATOR

This is an electrical or electronic device that maintains the voltage of a power source within acceptable limits. They are used in electronic designs in which excessive variations to the voltage are not acceptable as this can lead to the damage of the equipment. Electronic voltage regulators utilize solid-state semiconductor devices to smooth out variations in the flow of current. In most cases, they operate as variable resistances; that is, resistance decreases when the electrical load is heavy and increases when the load is lighter. Two types of design for regulators are available; step

13 regulators, in which switches regulate the current supply, and induction regulators, in which an induction motor supplies a secondary, continually adjusted voltage to even out current variations in the feeder line [8].

Figure 2.9: Voltage regulator IC 2.3.6 MOSFET

MOSFET is an acronym for Metal Oxide Semiconductor Field Effect Transistor. It is a semiconductor device which is widely used for switching and amplifying electronic signals in the electronic devices. It is a four terminal device with source(S), gate (G), drain (D) and body (B) terminals. It works as a switch and a control signal is always applied to the gate and current flows between the drain and source. The body terminal is always grounded or connected to a high depending on the type of the MOSFET [9].

14

Figure 2.10: The MOSFET IC 2.3.7 PIR SENSOR

It has two slots in it where each slot is made of a special material that is sensitive to infrared (IR). When the sensor is idle, both slots detect the same amount of IR, the ambient amount radiated from the room or walls or outdoors. When a warm body like a human or animal passes by, it first intercepts one half of the PIR sensor, which causes a positive differential change between the two halves. When the warm body leaves the sensing area, the reverse happens, whereby the sensor generates a negative differential change. These change pulses are what is detected [10].

Figure 2.11: The PIR sensor

15

2.3.8 SOLENOID VALVE

It is usually used when fluid flow is to be controlled automatically. When energized, a magnetic field builds up which pulls a plunger against the action of a spring, and when de-energized, it goes back to its originally position and the result of this is an open and close operation.

Figure 2.12: The Solenoid valve

2.3.9 RESISTORS

The purpose of a resistor in an electrical or electronic circuit is to regulate the flow of electrons (current) through them by using the type of conductive material from which they are composed. They can be connected together in various series and parallel combinations to form resistor networks which can act as voltage droppers, voltage dividers or current limiters within a circuit.

They are passive devices that is they contain no so source of power but rather attenuate the current or voltage through them. For the current to flow through them, there has to be a potential difference across the terminals of the resistor.

Modern fixed value resistors can be classified into four broad groups: Carbon Composition Resistor: Made of carbon dust or graphite paste, low wattage values Film or Cermet Resistor: Made from conductive metal oxide paste, very low wattage values Wire-wound Resistor: Metallic bodies for heatsink mounting, very high wattage ratings Semiconductor Resistor: High frequency/precision surface mount thin film technology

16

Some of the characteristics to be looked at when choosing a resistor depending on the environment where it will be used include the following; temperature Coefficient, Voltage Coefficient, Noise, Frequency Response, Power, Temperature Rating, Physical Size and Reliability [11].

Figure 2.13: Visualization of a typical resistor

2.3.10 CAPACITORS

This is referred to as an active device. It has the ability to store energy in form of electrical charge producing a potential difference across its plates. It basically consists of two plates electrically separated by a dielectric material. Because of this, DC can not flow through a capacity but instead allows a potential difference to be present across its plates as electric charge. Capacitance is the electrical property of a capacitor and is the measure of a capacitors ability to store an electrical charge onto its two plates with the unit of capacitance being the Farad.

The amount of potential difference present across the capacitor depends upon how much charge was deposited onto the plates by the work being done by the source voltage and also by how much capacitance the capacitor has [12].

Figure 2.14: The Visualization of a Capacitor

17

3 CHAPTER THREE: METHODOLOGY

3.1 INTRODUCTION

This chapter explains the various steps involved in execution of the project. It expounds on the interconnection of various components to come up with a single working prototype to meet the objectives specified earlier in chapter 1. It expounds on interconnection of various component. Therefore, this chapter is an account of all the stages and procedures followed during the hardware and software design and implementation of the project including the tools and resources used in the project.

3.1 BLOCK DIAGRAM OF THE SYSTEM

Figure 3.1: Block diagram of envisioned system The system consists of a control circuit to which sensors and a contactor are connected. The sensor inputs determine whether a signal is or is not sent to the contactor. The contactor activates the valve/motor to release or hold back water from the water reservoir or tap, or to flush the toilet for the case of the motor. All the above interconnected modules are powered from central point.

3.2 BRIEF DESCRIPTION OF PLACES VISITED

Public: These include Makerere University halls of residence that is University Hall, Lumumba, Living-Stone and Africa Hall. Of course, we didn’t visit all of them but sampled a few as mentioned above. In addition, a visit was made to Mulago Hospital. The purpose of this visit to the above mentioned public places, was to find out the kind of toilets taps they are using and the potential of them leading to the infections to contamination.

18

Business: this was a market visit to find out whether the intended automated systems were already on the local market and if there, at what price. This involved going to shops and malls around Kampala known to be selling equipment to do with plumbing and all that’s needed to have a fully running toilet.

During such visits, a few people were interviewed as attached in the Appendix

3.3 COMPONENT SELECTION CRITERIA

3.3.1 Selection of the Relay Switch

The function of the relay switch in this project was to switch on or off the motor or solenoid valve depending on the instructions received from the control circuit. The relay that can handle the current being drawn by the motor and valve was needed and according to the rating of the motor and valve, the next available on the market was SRD – 05VDC – SL – C, 10A, relay and it was preferred for high power DC switching applications.

3.3.2 Selection of the solenoid valve

There are direct operated, pilot operated and semi-direct operated solenoid water valves. The valves can also be categorized as AC valves and DC valves. The AC valves operate using the mains supply, which is usually 220V 50/60Hz. The DC solenoid valves have a wide range, for example 12V and 24V solenoid valves. The solenoid valve used in this project was a 12V solenoid valve, selected for its low cost and lower power consumption than the other valves [13].

Figure 3.2 The 12V DC solenoid valve

19

3.3.3 Selection of the used motor

The DC motor used in this project was a 12V DC motor. It was selected on the basis of the power supply capability of the battery, and its ability to flush the toilet through a gearing system. The gearing system was included in the system for the purpose of transforming the speed to torque ratio so as to have a torque high enough to turn the flush handle on the cistern .

Figure 3.3: The 12V DC motor

3.3.4 Selection of the PIR sensor

The front-end sensor in a PIR module is a passive energy component which implies that it does not actively emit energy in order to detect motion. Hence, during prolonged idle operations when there is little or no movement that is to be detected, these sensors are more energy efficient. For this reason, the PIR sensor was preferred to all other types since it offered the least power consumption.

Passive Infrared sensors also have very long lives and therefore do not need to be replaced regularly.

20

Figure 3.4: The PIR motion sensor The figure above shows the PIR motion sensor that was used in this project. The sensor allows for delay time adjustment and distance adjustment. The delay time is the time for which the output of the motion sensor remained in the digital high state after it was triggered. The distance adjustment is the maximum distance away from the sensor, for which it detects motion.

3.3.5 Selection of the voltage regulator

The 7805 IC is a three terminal device which gives a fixed output voltage of 5V. This voltage is essential for running low voltage electronic devices in control circuits plus a wide range of other applications. The figure below shows the 7805 IC and its pins labelled. Several manufacturers produce the IC below and these include; , ON semiconductor, incorporated, to mention but a few.

21

Figure 3.5: The L7805 regulator IC The voltage regulator is packaged in many other formats but the figure above focuses on the one used in this project. The main features of the IC include;

• It requires a small number of external devices to function fully. • Has internal current limiting and thermal shutdown features. • It can deliver up to 1.5A of current if properly cooled by a heat sink. • It is cheap.

Table 3.1 the L7805 pins and their purposes

PIN PIN Description number 1 Input The positive unregulated voltage is connected to this pin 2 Ground This pin is common to both the input and output circuit and is connected to ground. 3 Output This is the output pin. The voltage at this pin is regulated at 5V DC It should be noted that the 7805 IC only accepts DC voltage at its input and it outputs DC voltage as well. 3.5 CIRCUIT SIMULATION

The process of simulation was carried out using Proteus simulation software. The method of simulation was chosen because it was the best way to predict the behavior of the circuit, down to the smallest component without building the physical circuit. This was done through building and running a virtual circuit on a computer to mimic the operation of a physical circuit. The components used in the design were simulated but to a great extent had the characteristics of

22

those in the physical environment. Proteus software was preferred to other software like; Multisim and LT Spice because of its user friendliness and ease in use.

3.6 PROTOTYPING

The process of prototyping was directed towards achieving one of the main objectives, which was to prototype the control circuit for the hands-free flushing toilet and tap system. The process involved the arrangement, soldering and connection of all the components of the control circuit. The tools used included; soldering iron, pliers, side-cutter, power extension and a multi- meter.

The materials used included; the electronic components, solder, prototyping board, connecting wires and a battery. The control circuit was completed by hand and this was preferred to printing the circuit board because the later would be expensive.

3.7 MECHANICS & ASSEMBLY

The Control circuit was the main focus of the design in this project. However, for a complete system, work in the mechanical and plumbing field was done. The purpose of this work was to support the cistern, faucet, the motor, motion sensors, control circuit and battery in the effort to demonstrate the intended design. The materials used included; a wooden board, cable ties, cable clips, metal supports for the cistern, nails, screws, water pipes, pipe-joint accessories and a tap.

23

4 CHAPTER FOUR: RESULTS AND ANALYSIS 4.1 INTRODUCTION

This chapter entails the results of both software and hardware implementation of the project. It expounds on what the results were and shows how the components were put together to come up with a working circuit. It also explains the findings during the research study.

4.2 FIELD RESEARCH

The field research involved visiting places like schools, hospitals, malls, universities and many others, to obtain the ratio of the water-borne toilets to the latrines. It was noticed that in the urban area, that is in Kampala and the neighboring suburbs, above seventy five percent of the toilets were water borne toilets. I would like to mention however that slums were not considered as part of the case study. Of all the toilets observed in the places visited, none of them was an automated flush toilet. The faucets in the places visited were all manually operated faucets.

Stores dealing in toilet-ware were also visited, in search of automated flush toilets and faucets. To our surprise, none of the stores in the city had the products we were searching for. An oral interview with one of the store managers indicated that the automated flush toilets and faucets were not a good product for the Ugandan market because they are expensive. The manager however hinted that the for the luxurious constructions, online orders were made. For example, for the hotels and airports.

Hospitals were visited and among these were Mulago, Mengo hospital, Rubaga hospital and International Hospital Kampala. From observations made, all the flush toilets and faucets were hand operated. This gave us more motivation for our project as hospitals were considered a very critical place.

4.3 SIMULATION RESULTS

In reference to Figure 2.5, the test circuit was simulated using proteus software as shown below;

24

Figure 4.1 Circuit before triggering Figure 4.1 shows the result before the triggering signal arrives and the output voltage is zero as displayed on the voltmeter.

When the triggering signal arrives, the output changes from a low to a high that is to a voltage of

5 V. Using the formula, time = 1.1푅1퐶 , we selected 푅1 = 10푘 & 퐶 = 퐶1 = 470휇퐹 to give a delayed turn off of about 5s. The results of the simulation are shown below:

25

Figure 4.2 Circuit after triggering It can be observed from the screenshot above that on triggering the timer circuit, its output went digital high for a certain time (period). The waveform was analyzed as shown below. Analyzing the waveform of the timer output;

푡ℎ푒 ℎ표푟𝑖푧표푛푡푎푙 푠푐푎푙푒 = 0.5푠 푝푒푟 푠푞푢푎푟푒.

푛푢푚푏푒푟 표푓 푠푞푢푎푟푒푠 = 10

푡𝑖푚푒 푑푒푙푎푦 = 10 ∗ 0.5푠 = 5푠

푡ℎ푒 푡ℎ푒표푟푒푡𝑖푐푎푙 푣푎푙푢푒 표푓 푡𝑖푚푒푟 푑푒푙푎푦 = 1.1 ∗ 470휇퐹 ∗ 10푘 = 5.17푠

26

Comparing the theoretical value and the value of the time delay of the timer circuit showed that the two results differed but to a small extent. The input and output are summarized in the table below; Table 4.1: Summary of the input and output of the timer circuit Input Output 0 V ( when the trigger arrives) 5 V When there is no trigger, the trigger terminal is connected to a high 0 V voltage through resistor R3. The value of R3 is such that in this case the voltage at terminal 2 is greater than Vcc/3

Figure 4.2 was modified to add a load (motor) through a transistor and relay which will act as a switch to the load in the intended circuit as this will be of a higher voltage load as compared to the control circuit.

It was observed that the circuit output voltage was 0V before triggering and 5V for 5s after triggering. After the 5s, the circuit output became 0V again. In the circuit with the motor, the motor ran for 5s every after a trigger.

In the circuit with the solenoid valve for the tap system, the valve could be open for 5 seconds as the user is washing his/her hands without having to physically touch the tap.

4.4 COMPLETE CIRCUIT DESIGN

During the design, it was also noted that the different parts of the circuit operated at different voltages and it was therefore important to consider voltage regulation. The control circuit needed 5V volts to operate. The control circuit was however required to run loads that required 12V to operate. This called for the consideration of intermediate switches like and relays.

Also a NAND gate IC to invert the signal from the motion sensor on its way to the timer IC had to be included. The advantage of this method was in its purpose. It prevented the building of a circuit without reference as this would lead to errors in the final design. With all this included, the circuit is as shown below;

27

Figure 4.3 the control circuit for the automated flush toilet/ faucet

A fly-back (1N4007) was used to protect the relay coil from excessive current due to back emf during circuit turn off.

4.5 FLOW CHART

A flow chart was constructed to show the flow of control signals in the designed system.

28

start

Input at motion Sensor

Set motion Set motion Set NAND detector output detector output gate Motion and NAND gate YES NO and NAND gate output to detected ? input to digital input to digital digital high low high

Set NAND gate Timer circuit output to not triggered digital low

Timer circuit triggered

Timer output MOSFET gate set high for set high for time , t time , t

Actuator turned Relay turned on on for time for time , t delay , t

Stop

Figure 4.4: Flow chart for the control process

4.6 BUILDING OF THE CONTROL CIRCUIT

The trigger in the simulation circuit was replaced by PIR sensor and the circuit soldered on the as shown Figure 4.5 and Figure 4.6 for the two control circuits.

29

Figure 4.5: Soldered control circuit for Flush toilet system

30

Figure 4.6: Soldered control circuit for tap system 4.7 MECHANICS AND ASSEMBLY

The process of assembling the final system involved the careful placing of the motion sensors, cistern, motor to flush, battery, tap and control circuits. For the purpose of testing the system, the sensors and solenoid valve were mounted on an already installed tap. The pictures below show the results of the assembly.

The motor was hooked on the flush handle of the toilet such that it flushes when the motor rotates.

31

Figure 4.7: The motor is hooked to the flush handle

When the toilet user brings his hand close to the PIR sensor, then the toilet flushes automatically thus eliminating him/ her having to touch the toilet handle.

32

The tap system both in standby mode and in active mode after detecting the presence of a hand or any body motion within the sensor’s range were visualized as shown below;

Figure 4.8: The automated faucet on standby Figure 4.9: The automated faucet after triggering

Figure 4.10: The demonstration board containing the control circuits, motor and the battery

33

5 CHAPTER FOUR: LIMITATIONS, CONCLUSION AND RECOMMENDATIONS

5.1 LIMITATIONS

Learning how the different manual flushing toilets work for the first time was challenging due to limited time. This called for a lot of research and consultations in order to learn.

Financial constraints. This project involved activities such as consultations, purchasing of different electronic components used in the project.

The mechanical and plumbing work. These presented difficulties because my partner and I were not experienced in these fields. A specific challenge in the plumbing work was finding the right pressure for the solenoid valve to operate as desired. This was hard to achieve, as it required a lot of water to achieve the high pressure needed.

The flush toilet automatic control is only compatible with systems which have a flushing handle thus cannot be used for those with a flushing push button.

5.2 CONCLUSION

The project was successful since we achieved all the intended objectives. This involved understanding the current manual operations of the system, developing of the prototype circuit for automation of the flushing process.

The hands-free flush and tap system is an essential in Uganda today as we fight to improve the general health in the public. In addition, the system should be affordable given that it can easily be achieved using the resources available. Prevention is better than cure.

5.3 RECOMMENDATIONS

The government and the community should consider implementing such technology to their toilet systems as a way of improving on hygiene and reducing on the spread of diseases contracted from contaminations.

34

REFERENCES

[1] The British Association of Urological Surgeons, "A brief History of the Flush Toilets," [Online]. Available: https://www.baus.org.uk/museum/164/the_flush_toilet. [Accessed 10 May 2019].

[2] "Toilet Flush Mechanisms," [Online]. Available: https://inspectapedia.com/plumbing/Toilet_Tank_Operation.php. [Accessed 10 May 2019].

[3] "Types of Toilet Flushing Systems," SOUTH WEST PLUMBING, [Online]. Available: https://www.southwestplumbing.biz/types-of-toilet-flushing-systems/. [Accessed 06 May 2019].

[4] "INTRODUCTION TO 555 TIMER IC," [Online]. Available: http://todayscircuits.blogspot.com/2011/06/555-timer-complete-basicguide.html#.VUBpt9Kqqko. [Accessed 13 May 2019].

[5] T. Agarwal, "Electromechanical Relay Construction and Working," EL-PRO-CUS, [Online]. Available: https://www.elprocus.com/electromechanical-relay-working-with-applications/. [Accessed 19 May 2018].

[6] [Online]. Available: https://www.techopedia.com/definition/8492/nand-gate. [Accessed 16 May 2019].

[7] "What is a Battery," [Online]. Available: https://www.techopedia.com/definition/16316/battery.. [Accessed 29 May 2019].

[8] "What is a voltage regulator," AUTODESK, [Online]. Available: https://www.autodesk.com/products/eagle/blog/what-is-a-voltage-regulator/. [Accessed 20 May 2019].

[9] ELEPROCUS, "MOSFET as a switch," [Online]. Available: https://www.elprocus.com/mosfet-as-aswitch- circuit-diagram-free-circuits/. [Accessed 17 May 2019].

[10] "PIR motion sensor tutorial," Instructables circuits, [Online]. Available: https://www.instructables.com/id/PIR-Motion-Sensor-Tutorial/. [Accessed 20 May 2019].

[11] "Electronics Tutorials," [Online]. Available: https://www.electronicstutorials.ws/resistor/res_1.html. [Accessed 31 May 2019].

[12] "Electronics tutorials," [Online]. Available: https://www.electronicstutorials.ws/capacitor/cap_1.html. [Accessed 1 June 2019].

[13] Tameson, "Solenoid Valve Types," [Online]. Available: https://tameson.com/solenoid-valvetypes.html. [Accessed 6 June 2019].

35

APPENDIX

INTERVIEW WITH DR FRANCIS GRADUATE TRAINEE AT MULAGO HOSPITAL

In this interview, were able to find out that the flushing toilets and the taps at this government hospital are manually operated.

In his explanation though in the theatre they have those that can be operated by a foot to avoid using the hand, but these increase chances of a doctor falling down as he keeps support on one foot. Also these ones the way they were designed, they cover a big area in the theatre unlike the normal taps.

But the biggest part of the hospital that is patient wards, is covered with the taps which are manually opened and closed with hands.

Due to this, they have to be with an extra person whose work is to open and close the tap because according to the procedure, the doctor doing the operation cannot touch the tap and at the same time touch the patient as this might be a potential source of infecting the patient.

Another solution they usually take is to open the tap and keep water flowing to avoid opening and closing when you have to have your hand on the patient but this is costly to the hospital.

He also elaborated that some patients do not know how to flush very well thus if it was automatically operated where the patient provides the trigger and the machine does the work, it would improve the hygiene of their hospital.

INTERVIEW WITH MR. SEMWOGERERE

He is a business man on Ham Towers building Market Street number B5 Nakasero. On addition to the market survey, an interview was held with this businessperson in order to ascertain our findings concerning what is available on the market. He told us that he has been dealing in the manually operated flush systems as the automated ones on the international market are traded expensively and these according to him may not find market here in the local market. His thought was that if these were available at a cheaper price, they would find market in places like hospitals, schools, malls in the city and some homes.

36

On addition to the above interviews, random interviews were conducted with the health ministers of the sampled halls were they listed concerns like some students can wash their hands and forget to close the taps as this is a costly bill to the University.

37