l £ > / D c ? n I / s i I O S ALUM AND LIME DOSING CONTROLLERS FOR WATER TREATMENT PLANT A dissertation submitted to the Department of Electrical Engineering, University of Moratuwa in partial fulfillment of the requirements for the degree of Master of Science LIBRARY UNIVERSITY O F MORATUWA, SRI L A N K A M O R A T U W A by L.P. HETTIARACHCHI £ 2 1 . 3 " o r \ . 3 Supervised by: Dr. Palitha Dasanayake Department of Electrical Engineering University of Moratuwa, Sri Lanka December 2007 University of Moratuwa 91205 9 1 2 0 5 DECLARATION The work submitted in this dissertation is the result of my own investigation, except where otherwise stated. It has not already been accepted for any degree, and is also not being concurrently submitted for any other degree. ....J&feg: L.P. Hettiarachchi Date: I endorse t te declaration by the candidate. Dr. 'alitha Dassanayake i CONTENTS Declaration Abstract Acknowledgement List of Figures List of Tables List of Principal Symbols 1 . I n t r o d u c t i o n 1.1 Background 1.2 Problem Background 1.3 Research Objectives 1.4 Organization of Dissertation 2. Literature Review 2.1 Historical Review 3. Research Design and Methodology 3.1 Introduction 3.2 Assumptions 3.3 Data Collection 3.4 Design of the System 3.5 Methodology of the Research 4. Research Findings 4.1 Introduction 4.2 Constructed Relationship 4.3 Development of The System 5. Conclusions and Recommendations 5.1 Conclusions, Remarks and Discussion 5.2 Recommendations for Future Research li References Appendices Appendix - A Appendix - B Appendix - C Appendix - D Abstract Many techniques are applied to the control of Alum and Lime commonly termed as coagulant dosing in a drinking water treatment plant. Coagulant dosing rate is non linear correlated to raw water parameters such as turbidity, conductivity, pH, temperature, etc. Manual method called Jar testing is used to decide the Alum and Lime dosage. However in practical situation, Jar testing is carried out maximum three times per day. But the parameters of water sources are continuously changing specially on rainy days. Therefore overdosing and underdosing of Alum and Lime are normally occurred. Excessive coagulant overdosing leads to increase treatment costs and human health problems, while underdosing leads to failure to meet the water quality targets and less efficient operation of the water treatment plant. It means that important requirement arises to automate the system with optimum coagulant dosage. The research is aimed to propose an alternative to the jar test allowing for an on line determination of optimal coagulant dosage from raw water characteristics and design a system for feeding Alum and Lime automatically with a monitoring display. The reasonable assumption made by this research is, except turbidity and pH value, other parameters are almost same throughout year. After analyzing thousand number of jar test results with corresponding turbidity values and pH value of incoming water, it was found turbidity value of raw water and the dosage of Alum has a relationship and pH value of raw water and the dosage of Lime has another relationship. Relationship of turbidity value of raw water and the dosage of Alum is second order polynomial. However pH value of raw water and the dosage of Lime have stepwise relationship. And also actual values of three hundred situations were taken and applied to check the validity of relationships and it is proved that the relationships which has obtained are well suited to develop the automation system. Next objective is designing of hardware and software part of controller of an automotive system to dose Alum and Lime using the relationship. PIC16F876 microcontroller is selected as the controller; it made the task easier. Since PIC16F876 has 8-bit with analogue to digital converters, it handled analogue output of turbidity sensor and pH sensor. In this project MAX 7219 display driver IC could be easily interfaced with microcontroller by using three wires (SDO, SDI and SCLK) and LOAD (CE) which is common today named as Serial Peripheral Interface (SPI).The PIC16F876 chip is in electrical erasable packaged version (FLASH), and it helped for programming several times for testing our object before implementing. IV Finally complete control and feeding system for Alum and Lime was designed. Value of turbidity was measured by a turbidity sensor. That value was taken to the microcontroller that decides the Alum dosage and changes the valve position using stepper motor accordingly. Either increment or decrement of the value of turbidity by 10 makes the changing of valve position in ADC. Either increment or decrement of the value of pH value by 0.1 makes the changing of valve position in LDC. Using MAX7219 IC current value of turbidity and current value of pH are displayed in ADC and LDC respectively. Key features of the system are simple relationships constructed to find optimum coagulant dosage and ability of handling practical situations of water treatment plants using automation system with microcontrollers. Acknowledgement My foremost duty is to express my sincere gratitude to my supervisor, Dr. Palitha Dassanayake, Senior Lecturer, University of Moratuwa, for his great insights, perspectives, guidance and sense of humor. My appreciation to the Professor H.Y.R. Perera, Head of Department of Electrical Engineering, Senior Lectures of Department of Electrical Engineering and Department of Mechanical Engineering for helping in various ways to clarify the things related to my academic works in time with excellent cooperation and guidance.. Sincere gratitude is also extended to the people who serve in the Department of Electrical Engineering office. The author extends sincere gratitude to Mrs. P.N.S. Yapa, Deputy General Manager (Greater Colombo), National Water Supply and Drainage Board who gave the permission to do the analysis at Ambatale Water Supply Scheme and also Mrs. Asha, Senior Chemist and all the staff members of the laboratory at Ambatale Water Supply Scheme who gave me assistance for data collection. Love and affection to my parents, Mr. and Mrs. Hettiarachchi, my husband, Chandana and my son, Ginura for their patience and understanding. Lastly, I should thank many individuals, friends and colleagues who have not been mentioned here personally in making this educational process a success. May be I could not have made it without your supports. VI List of Figures Figure Page 3-1: Layout Diagram of Ambatale Water Treatment Plant 11 3-2: Pin Configuration of PIC 16F876 16 3-3: Pin Configuration of MAX7219 18 3-4: Block Diagram of the System 20 4-1: Linear Relationship of Turbidity and Alum Dosage 25 4-2: Logarithmic Relationship of Turbidity and Alum Dosage 26 4-3: Second Order Polynomial Relationship of Turbidity and Alum Dosage 27 4-4: Power Relationship of Turbidity and Alum Dosage 28 4-5: Exponential Relationship of Turbidity and Alum Dosage 29 4-6: Third Order Polynomial Relationship of Turbidity and Alum Dosage 30 4-7: Fourth Order Polynomial Relationship of Turbidity and Alum Dosage 31 4-8: Fifth Order Polynomial Relationship of Turbidity and Alum Dosage 32 4-9: Sixth Order Polynomial Relationship of Turbidity and Alum Dosage 33 4-10: Relationship of pH value and Lime Dosage 38 4-11: System Diagram 40 4-12: Relationship of Amount of valve opened and Optimum Alum Dosage 42 4-13: Schematic Diagram of the Hardware 45 viii List of Tables Table P a g e 4-1: Details of R-Squared Value with Different Trend Lines 24 4-2: Details of Seasonal Variations 35 4-3: Details of Experimental Lime Dosage for Different pH Values 36 4-4: Requirement of Alum dosage for different pH values 37 4-5: The sequence of switching the windings of ADC 43 4-6: The sequence of switching the windings of LDC 44 viii List of Principal Symbols Table ANN - Artificial Neural Network FRBS - Fuzzy Rule Based System SCD - Streaming Current Detector ADC - Alum Dosing Controller LDC - Lime Dosing Controller A/D - Analogue to Digital SOM - Self Organizing Map UEGO - Universal Exhaust Gas Oxygen LCD - Liquid Crystal Display USB - Universal Serial Bus PLC - Programmable Logic Controllers PIC - Programmable Intelligent Computer IX Chapter 1 Introduction 1.1 Background Water treatment costs five to ten rupees per cubic meter. However maintaining the standards of water quality is a must in water sector. Therefore it is very important to make standard quality of water at minimum cost. Automating systems in water treatment is a successful solution for fulfilling that requirement. The water that is found in rivers and reservoirs are usually not suitable for drinking. The rivers and reservoirs are polluted by the activities of man and animals. The effluents of the industries situated along the water source, domestic wastes, storm water and sewage-all enter the water source through a system of drains and waterways. The purification or the treatment process consists of five major steps. They are Aeration, Addition of chemicals, Sedimentation, Filtration, and Disinfection. Introducing Oxygen into water is called Aeration. By this means the taste, colour and odour causing substances and gasses are removed. Process of Addition of chemicals is also called a process of coagulation and flocculation. Lime and Alum are the chemicals used in water treatment. When chemicals are added to water, it reacts with soil and clay particles, microorganism and other substances. This is called coagulation. These particles associate with similar particles to form big floes. The process is called flocculation. The floes when it is heavy sink to the bottom. The result is clear water at the top. The third step is sedimentation. The floes as stated above are formed in large sedimentation tanks. Clear water is found at the surface of the tank. This water is sent into the sand filters through network of channels. The suspended solids and some microorganisms are removed by filtration process. Disinfection is the last step. This is also called as chlorination as it uses chlorine gas to disinfect water. Chlorine is a strong oxidizing agent and it destroys pathogens- that are disease causing organisms like Bacteria remaining in the water. 1 After designing and constructing water treatment plant in proper way, main operational activity that affects water quality is adding of quantity of chemicals. Excessive amount of Alum/Lime dosing leads to public health matters and chemicals are very expensive since those chemicals are imported. Alum costs forty thousand rupees per metric ton and lime costs fifteen thousand per metric ton. Less amount of coagulant dosing causes poor quality of water and decrement of efficiency of rest of stages of water treatment. Therefore it is very significant to dosing optimum amount of chemical. Optimum amount of Alum/Lime is decided by a laboratory test called jar test. But this traditional method takes some time to give the readings. At that time parameters of water is changed. Therefore identification of a new method for deciding the optimum dosage is needed for automating the Alum/Lime feeding system. After doing the jar test dosage is changed manually. Therefore this whole procedure relies on manual intervention. In this case, automating the system with suitable on line measurement can reduce manpower and chemical costs and improve compliance with treated water quality targets. 1.2 Problem Background The water industry is facing increased pressure to produce higher quality treated water at a lower cost. The coagulation - flocculation process is a major step in the production of potable water, allowing the removal of colloidal particles. The main difficulty is to determine the optimum coagulant dosage related to the incoming water characteristics. Excessive coagulant overdosing leads increased treatment costs and public health concerns, while underdosing leads to failure to meet the water quality targets and less efficient operation of the water treatment plant. For the moment manual method called jar testing is available to predict optimum coagulant dosage rate. Jar testing involves taking raw water sample and applying different quantities of coagulant to each sample. After a short period of time each sample is assessed for water quality and the dosage that produces the optimal result is used as set point. Operators change the dose and make a new jar test if the quality of treated water changes. 2 Disadvantages associated with jar testing are the necessity to perform manual intervention, and lack of adaptation to abrupt changes of water characteristics. After getting the jar test results manual controlling system is used to change the dosage. Therefore whole procedure is done by manual control and it leads to wastage of expensive chemicals, failure to meet water quality targets and reduced efficiency of sedimentation and filtration processes. 1.3 Research Objective The main objectives of this research is to propose an alternative to the jar test allowing for an on line determination of optimal coagulant dosage from raw water characteristics and design a system for feeding Alum and Lime automatically with a monitoring display. 1.4 Organization of Dissertation This report consists of five chapters. The first chapter discusses the background of the study, shape of the problem and goals which are going to achieve. The second chapter is the literature review. It consists of historical review of coagulant dosage controllers in water treatment plants and presents the state of the situation. In chapter three under research design and methodology, it has discussed method of data collection and method of pull off configuration of the system, layout diagrams and components of the system. The chapter four is discussing the research findings. It includes equations for optimum Alum and Lime dosage and system algorithm, software and hardware developed. The final chapter which is chapter five discussed the conclusions and recommendations. The report ends with References and Appendices. 3 Chapter 2 Literature Review Alum and lime dosing controlling in water treatment plants is a developing area. In Sri Lanka context, dearth of literature can be readily retrieved. However experimentations and projects are done and ongoing worldwide to some extent. This chapter presents literature on Alum and Lime dosing controlling in water treatment plants, microcontroller based systems, water quality parameters, jar test in to water treatment process, covering wide range of text books, journal articles, thesis reports, reputed websites and etc. 2.1 Historical Review Studies were carried out related to Alum and Lime (coagulant) dosing controlling in water treatment plants and followings describes about them. Various types of intelligent methods used in dosing control of water treatment are one of a study area popular in water sector. In a research article by Juuso et al., (2003), was addressed the Linguistic equations method, an intelligent method using to define new operating point of chemical dosing according to the quality or amount of incoming water. In this paper data were recorded from a real water purification process and two kinds of models were derived for the process by using this information, namely steady state and a dynamic model. Static model defines the new operating point and the dynamic model predicts a reasonable dosing rate for the chemicals in the current working point. They also stated that linguistic equation helped them handled quite small data since linguistic equation do not necessarily need expert knowledge unlike fuzzy systems and do not have to be as large as for neural network. They concluded that dynamic model needs improvement before using it in the controller design. 4 An integrated coagulant dosing system based on unsupervised and supervised neural network models, as well as various statistical techniques are introduced in the research done by Valentin et al„ (2000). The system developed includes raw water validation and reconstructed based on a Kohonen self-organizing feature map and prediction of coagulant dosage using multilayer perception. The performance of the network was dependent on the quality and completeness of data provided for system training. Also they stated that continuous updating of training data would certainly improve the performance of the system. Valentin and Denoeux's (2002) research was focused on a neural network - based software sensor for coagulation control in a water treatment plant. It described the application of artificial neural network techniques to coagulation control in drinking water treatment plants. The software sensor developed was a hybrid system including a self-organizing map (SOM) for sensor data validation and missing data reconstruction, and a multi-layer perception (MLP) the coagulation process They also stated that this system can handled various sources of uncertainty such as atypical input data, measurement errors and limited information content of the training set. In the research article by Baxter et al„ (2002) was discussed a methodology for developing with a handful of time and successful ANN models of drinking water treatment process. They presented that the ANN modeling methodology allows utilities to develop multiple - variable nonlinear models of complex unit processes such as coagulant dosing control in a simple sequential fashion. Their conclusion was ANN modeling methodology allowed utilities to develop multiple variable nonlinear models of complex unit processes in a simple sequential fashion and with improved usability. And they also stated that ANN technology will p l a y a larger role in helping utilities meet customer and regulatory demands on finished water quality through improved modeling in future. Project Report, Delft 2000 was reviewed the principles of various types and architectures of neural network and fuzzy adaptive systems and their applications to integrated water resources for management. It concluded that fuzzy-based methods are applied for identifying optimal control action of wastewater treatment plant determining optimal dosage thereof and determining leakage. Combination of expert knowledge was also applied. Fuzzy rule based systems (capable of building rules automatically) had been applied for determining optimal control action and filling in the measured data. 5 In the research article done by Masson et al., (1999) was addressed another software sensor design, based on empirical data ecological modeling and it stated that process monitoring and control in water treatment relies heavily on accurate and reliable sensor information. Whereas many process parameters can be measured continuously using relatively simple and cheap physical sensors, the determination of certain quantities of interest requires costly laboratory analysis which cannot be performed on-line. They also stated that such high level information could be inferred from available measurements of observable quantities using a statistical model called as software sensor. Both research article done by Mirsepassi et al., (1995) and Evans et al., (1998) were addressed the potential effectiveness of an approach of building a software sensor for on-line determination of optimal coagulant dosage from raw water characteristics such as turbidity, pH. conductivity, etc., based on artificial neural network. Studies done by Bernazeau et al., (1992) and Dental (1995) emerged an automatic device called a streaming current detector (SCD) in coagulation monitoring and control. This device was based on the measurement of the net residual charge surrounding turbidity and colloidal particles in water. It required a set point to be entered, assumed to represent an optimum water quality standard. Streaming current values above the set point indicated an excess of coagulant, while values below the set point indicated insufficient coagulant dosage for full flocculation to occur. A jar test needs to be carried out to determine the set point. They also stated that this method is costly and limited efficiency for certain types of raw water quality. In the research article done by Trautmann and Denoeux (1995) was addressed applications of self organizing maps (SOM's) to water quality monitoring. The SOM model combined the goals of projection and clustering algorithms and might be seen as a method for automatically arranging high - dimensional data. It used at the same time to visualize the clusters in a data set , and to represent the data on a two dimensional map in a manner that preserves the non linear relations of the data items, nearby items being mapped to neighboring position on the map. Studies on coagulant control and optimization done by Lind, (1994) were focused on both manual and automatic methods to predict optimum coagulant dosage rate. 6 The article written by Pask, (1993) has illustrated budget saving of selecting optimum chemical dosage in water treatment by jar test. According to that for accurate jar test it took minimum one and half hours. Chazel's (2006) research on controlling oxygen sensors with an automotive microcontroller had addressed the feasibility of controlling a UEGO sensor directly from a microcontroller, with a low level of cost and complexity. The use of a microcontroller was particularly adequate for this application. He also stated that the two regulation loops were easily implemented on the microcontroller and interfaces were immediately removed by software. By using microcontroller electronics came to simple and only basic components were required since all the regulation tasks were handled by microcontroller. The article written by .Tahan, (2003) was discussed the parameters that characterize water quality, measuring water quality parameters using analytical equipment and principle of coagulation flocculation process. Also he stated that turbidity, pH value, temperature, conductivity, dissolved oxygen and UV's absorption were the main parameters for coagulation flocculation process. Turbidity detection was used to measure the total solids content whereas UV's absorption detection could be employed to measure the total content of dissolved organic matter. PIC Microcontroller Solutions including the microchip advantage, flexible programming options, PIC microcontroller migration strategy, PIC microcontroller product architectures (Baseline architecture, Mid-range architecture, High performance architecture), general purpose microcontroller features (Low power nanoWatt technology, high pin count high density memory, low pin count and space constrained, PIC microcontrollers with high voltage support and fan control capabilities), PIC microcontrollers with an integrated LCD module, PIC microcontrollers with integrated USB and PIC microcontrollers with Ethernet capabilities were demonstrated in http://www.microchip.com website, (2007). Microcontroller Interfacing Techniques including advantages, disadvantages and examples of digital I/O control and monitoring, voltage based control and monitoring, parallel and serial bus, Asynchronous communication (1-wire, Rs232/RS485, Ethernet) and Synchronous communication (2-wire, 4-wire) were demonstrated in http://www.bipom.com website, (2007). 7 Project done by Arthur C. Clarke Institute for Modern Technologies, (2005) was revealed PIC microcontrollers are low cost, industry standard high performance and 8-bit with analogue to digital converters. They used PIC16F873 for their project of length counter. Emunrud's (2002) research on Programmable Logic Controllers has addressed on the history of PLC development, the components that make up PLCs, need and current effort to standardize PLCs, advantages and disadvantages compared to other control systems. It concluded that the one major disadvantage to PLC was lack of standardization and this caused much confusion if the PLC used for an application was replaced by one from a different manufacturer, or if a PLC programmer was replaced by a person with a different understanding of PLC programming. 8 Chapter 3 Research Design and Methodology 3.1 Introduction Main objective of this research is to develop models to automate Alum and Lime dosing for water treatment plant and to predict relationships between measuring parameters (turbidity and pH value) of water and amount of dosage of Alum and Lime. 3.2 Assumptions Alum and Lime dosage is depends on water parameters of Turbidity, pH value, temperature, conductivity, dissolved Oxygen, UV's absorption, etc. However considering one water source conductivity, dissolved oxygen, temperature and UV's absorption remain same. Turbidity, number of particles in water is the main cause for optimum Alum dosage and pH value is the main cause for optimum Lime dosage. Therefore Ambatale Water treatment plant which distributes water to Colombo area is selected for this research and followings afis the basic information of it. Year Commissioned 1966 (Old Plant) 1994 (New Plant) • Water Source • Water Intake Kelani River 02 Pump Houses ( Old & New) 577,000 cum per day Sedimentation Tanks 05 Tanks capacity 61,300 cum each 04 Tanks capacity 45,000 cum each 9 • Filters 26 (18+8) Rapid Gravity Sand Filters Chemicals Alum A12(S04)3. 14H20 Lime Ca(OH) 2 Chlorine gas CI2 Water Storage 03 Tanks (91,000, 4200, 6600 cum) Production per day 470,000 cum (105 million gallons) • Production Capacity 500,000 cum per day (maximum) Water Treatment Operation The treatment plant gets its water supply from Kelani River. Water treatment involves physical chemical and biological processes that transform raw water into drinking water. Aeration, addition of chemicals, sedimentation, filtration and disinfection are the major steps. Aeration means air (oxygen) is introduced to water. By this means, the taste, colour and odour causing substances and gases are removed. Then chemicals, lime and alum are adding. When chemicals are added to water they react with soil and clay particles, microorganisms and other substances. This is called coagulation. These particles associate with similar particles to form big floes. This process is called flocculation. The floes when it is heavy sink to the bottom. The result is clear water at the top. Then the sedimentation process is carried out. The floes as stated above are formed in large sedimentation tanks. These clarification tanks are called pulsators, pre-treaters and centriflocs. Clear water is found at the surface of the tanks. This water is sent into the sand filters through a network of channels. The next step is filtration. Water is filtered through the rapid gravity sand filters. The suspended solids and some microorganisms are removed by the process. After that Alum is again added to do the pH correction. This is called as addition of post Lime. Last step of the water treatment process is disinfection. This is also called chlorination as it uses chlorine gas to disinfect water. Chlorine is a strong oxidizing agent and it destroys pathogens; that is disease causing organisms like bacteria remaining in the water. Figure 3-1 shows layout diagram of Ambatale water treatment plant. 10 Fi g 3- 1 La yo ut D ia gr am o f A m ba ta le W at er T re at m en t Pl an t 3.3 Data Collection This research is based on field data and experimental results using real data. One thousand number of jar test results for raw water were recorded (Appendix-A) to predict a relationship between measuring parameters (turbidity and pH value) of water and amount of dosage of Alum and Lime. Three hundred numbers of experiments are done to check the validity of results (Appendix-B). 3.4 Design of the System Design of the Controller This design is for controlling alum and lime dosing according to the turbidity and pH value of the incoming water. At the same time the system should indicate the value of turbidity and pH value in a display unit. Features of the system are described below. Since the dosing controller is designed using a microcontroller it allows for the flexibility of ease of operation. The changing of dosage of Alum is occurred where the difference of turbidity value equal to ten (10) according to the initial value of turbidity. Then new value of turbidity is the initial value for next time. The changing of dosage of Lime is occurred where the difference of pH values equal to point one (0.1) according to the initial value of pH value. Then new value of pH value is the initial value for next time. Value of turbidity, value of pH, current dosing rates of alum and lime are indicated. A master reset button can be used in case where the system locks-up due to some unpredictable event. 12 Selection of the Main Controller To control the system, a microcontroller, a programmable logic controller or a PC using some form of I/O can be used. Microcontrollers generally can be classified into 8-bit, 16-bit, and 32-bit family based on the size of their arithmetic and index register(s). It generally consists of ROM(Read Only Memory), RAM(Random Access Memory), Stack Pointers, Registers, Accumulator, Input/Output Ports, Timers, Analog to Digital Converter(ADC), Digital to Analog Converter(DAC), UART or SPI (for communication purposes). Some have special built in features that comes with Liquid Crystal Display Driver (LCD) that will enable them to drive LCD displays, EEPROM (Electrical Eraseable Programmable Read Only Memory) which is a non volatile memory that will enable it to store data permanently. It can be implemented using high level language or assembly language. Clock speed determines how much processing can be accomplished in a given amount of time by the MCU. Some have a narrow clock speed range. Sometimes a specific clock frequency is chosen to generate another clock required in the system, e.g. for serial baud rates. The processing technology of the microcontroller is N-channel metaloxide semiconductor (NMOS) or high-density complementary metal-oxide semiconductor (HCMOS). In HCMOS, signals drive from rail-to-rail, unlike earlier NMOS processors. Since these criteria can significantly affect noise issues in system design, HCMOS uses less power and thus generates less heat. The design geometries in HCMOS are smaller, which permit denser designs for a given size and thus allow higher bus speeds. The denser designs also allow lower cost, for more units can be processed on the same sized silicon wafer. For these reasons, most MCUs today are produced using HCMOS technology. The advantages of microcontroller are that all MCUs have on-chip resources to achieve a higher level of integration and reliability at a lower cost. An on-chip resource is a block of circuitry built into the MCU which performs some useful function under control of the MCU. Built-in resources increase reliability because they do not require any external circuitry to be working for the resource to function. They are pre-tested by the manufacturer and conserve board space by integrating the circuitry into the MCU. 13 Some of the more popular on-chip resources are memory devices, timers, system clock/oscillator, and I/O. Memory devices include read/write memory (RAM), read- only memory (ROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), and electrically erasable memory (EEM). The term EEM actually refers to an engineering development version of an MCU where EEPROM is substituted for the ROM to reduce development time. Timers include both real-time clocks and periodic interrupt timers. Other timer functions include timer compare and/or input capture lines. I/O includes serial communication ports, parallel ports (I/O lines), analog-to digital (A/D) converters, digital-to-analog (D/A) converters, liquid crystal display drivers (LCD), and vacuum fluorescent display drivers (VFD). Other built-in resources may include computer operating properly (COP) watchdog system which can be hardware or software based. A microcontroller is a single integrated circuit. Integrating the memory and other peripherals on a single chip and testing them as a unit increases the cost of that chip, but often results in decreased net cost of the embedded system as a whole. Even if the cost of a CPU that has integrated peripherals is slightly more than the cost of a CPU + external peripherals, having fewer chips typically allows a smaller and cheaper circuit board, and reduces the labor required to assemble and test the circuit board. Microcontrollers are useful to the extent that they communicate with other devices, such as sensors, motors, switches, keypads, displays, memory and even other micro- controllers. Many interface methods have been developed over the years to solve the complex problem of balancing circuit design criteria such as features, cost, size, weight, power consumption, reliability, availability, manufacturability. Many microcontroller designs typically mix multiple interfacing methods. In a very simplistic form, a micro-controller system can be viewed as a system that reads from (monitors) inputs, performs processing and writes to (controls) outputs. PLCs are typically industrial processes in manufacturing where the cost of developing and maintaining the automation system is high relative to the total cost of the automation, and where changes to the system would not be expected during its operational life. 14 Very complex process control, such as used in the chemical industry, may require algorithms and performance beyond the capability. Very high-speed or precision controls may also require microcontroller solutions. PLCs are not very good at handling large amount of data, or complex data. Microcontrollers are better for that. PLCs are also not very good with databases or displaying data. Main Controller The main controller is mainly established by using PIC16F876 microcontroller which is shown by Fig 3-2. This microcontroller has the following features that are best suited to conduct the task. It process low cost, industry standard high performance and 8-bit with analogue to digital converters. The support for a variety of range of input/output functions, and this microcontroller allow the user to determine whether to use a certain pin as input or output. There are 192 bytes of RAM and has 22 input/output pins in additional several peripheral features such as timers, counters, etc. There is also a serial port it capable of being programmed easily and interfaced with computer via standard RS232 port. In this project MAX 7219 display driver IC can easily interfaced with microcontroller by using three wires (SDO, SDI and SCLK) and LOAD (CE) which is common today named as Serial Peripheral Interface (SPI). The varieties of software tools are available for developing and debugging source code for the controller. The MPLAB software is used for developing the system because it is windows based an easy software development in 8-bit microcontroller. The PIC16F876 chip is in electrical erasable packaged version (FLASH), and it is suitable for programming several times for testing our objective is implemented. 15 MCLR/Vpp 1 28 RB7/PGD RAO/ANO 2 27 RB6/PGC RA1/AN1 3 26 RB5 RA2/AN2/ 4 25 RB4 Vref- RA3/AN3/ 5 24 RB3/PGM Vref+ RA4/T0CKI 6 23 RB2 RA5/AN4/SS 7 22 RBI Vss 8 21 RBO/INT OSC1/CLKIN 9 20 VDD OSC2/ 10 19 Vss CLKOUT RCO/TIOSO/ 11 18 RC7/RX/DT T1CKI RC1/T10SI/ 12 17 RC6/TX/CK CCP2 RC2/CCP1 13 16 |RC5/SDO RC3/SCK/ 14 15 RC4/SDI/SDA SCL Fig 3-2.: Pin Configuration of PIC16F876 16 Display Driver Unit The display driver unit consists of 7-segment displays for visualizing the value of turbidity (or pH value) of the incoming water and the current dosage rate of Alum (or Lime). The MAX7219 display driver chip can derive multiplexed 7-segment displays, and convenient 3-wire serial interfacing with main controller. This IC is compact, common cathode display driver up to 8-digits. Included on chip is a BCD code-B decoder, multiplexer, scan circuitry of the display drivers, and on 8x8 static RAM that store each digit. The circuit of the display driver unit is shown in Fig 3-3. Sensor Unit The sensor is established in raw water just before adding Alum (or Lime) to measure the turbidity (or pH value). The turbidity sensor gives the interrupts to the microcontroller when the turbidity value is increased or decreased by 10 in ADC. The pH sensor gives the interrupts to the microcontroller when the turbidity value is increased or decreased by 0.1 in LDC. Selected turbidity meter, WQ710 is perfectly matched for the design since it can be inserted into low pressure pipes by using standard compression coupler for turbidity monitoring and readings are giving every three seconds. It shows that output currents at the maximum turbidity values close to 20mA, so that it is easy to work with microcontroller. Selected pH sensor, PH-BTA has an Ag-AgCl combination electrode with a range of 0 to 14 pH units. It is a high quality electrode for water quality monitoring. And also it is very compatible with microcontroller interfacing. Stepper Motor The stepper motor is to change the position of valve. Either increment or decrement of the value of turbidity by 10 valve position is changed according to the pre defined values in ADC. Either increment or decrement of the value of pH value by 0.1, valve position is changed according to the pre defined values in LDC. 17 DIN 1 24 DOUT DIG 0 2 23 S E G D DIG 4 3 22 SEG DP GND 4 21 S E G E DIG 6 5 20 SEG C DIG 2 6 19 V+ DIG 3 7 18 ISET DIG 7 8 17 S E G G GND 9 16 SEG B DIG 5 10 15 SEG F DIG 1 11 14 S E G A LOAD (CS) 12 13 CLK Fig 3-3: Pin Configuration of MAX7219 18 UNIVERSITY OFMORATUWA, SR! LANKA MORATUWA Stepper motors are commonly used in measurement and control applications. Following features are common to all stepper motors make them ideally suited for these types of applications. Stepper motors are brushless. The commutator and brushes of conventional motors are some of the most failure - prone components and they create electrical arcs that are undesirable or dangerous in some environments. Stepper motors will turn at a set speed regardless of load as long as the load does not exceed the torque rating for the motor. Stepper motors move in quantified increment or steps. As long as the motor runs within its torque specification, the position of the shaft is known at all times without the need for a feedback mechanism. Stepper motors are able to hold the shaft stationary. (Holding torque) Stepper motors have an excellent response to start - up, stopping and reverse. 3.5 Methodology of the research The study is based on primary data collection of jar test unit data. It is taken from Ambatale water treatment plant. Three no of jar tests are carried out per day. Data from May, 2006 to April, 2007 were recorded. Since it includes whole year both dry and rainy conditions are covered. Turbidity and pH value of incoming water, Alum requirement pre Lime requirement and post Lime requirement in ppm consist in the sample. After analyzing the data, equations for optimum dosage of Alum and pre Lime with Turbidity and pH of incoming water are found respectively. Then three hundred real situations are taken and applied new results to them. There turbidity, pH value of raw water and turbidity, pH value at settled water at pulsators, pre-treaters and centriflocs, turbidity, pH value of filtered water and turbidity, pH value of final water are measured. Above procedure was done to check the validity of results. 19 9 1 2 0 5 Then the system is designed using PIC16F876 microcontroller as the controller. Source codes are constructed using Assembly codes. Value of turbidity is measured by a turbidity sensor. That value is taken to the microcontroller and it makes .the decision of the Alum dosage and changes the valve position using stepper motor accordingly. Either increment or decrement of the value of turbidity by 10 makes the changing of valve position in ADC. Either increment or decrement of the value of pH value by 0.1 makes the changing of valve position in LDC Using MAX7219 IC value of current value of turbidity and current value of pH are displayed in ADC and LDC respectively. Block diagram of the system is shown in Fig 3-4. Fig 3-4: Block Diagram of the System 20 Chapter 4 Research Findings 4.1 Introduction This chapter discussed the relationship of Alum dosage with turbidity for ADC, the relationship of Lime dosage with pH value for LDC, automotive systems of Alum dosing and Lime dosing and hardware design of the system and software design of the controller. 4.2 Constructed Relationships Relationship of Alum dosage with turbidity for ADC After analyzing of turbidity of raw water and Alum dosage which is measured by Jar test from May, 2006 to April, 2007 following graphs were obtained. According to the jar test results value of turbidity and corresponding Alum requirement is plotted in x-y scatter chart in Microsoft Excel. Then a "best-fit" line was drawn through the data points. First, best fit straight line was considered. It is shown in Fig 4-1. Linear regression technique is powerful tool to show that the data.points are fit into a straight line. Given a set of data (/i'^ii with n data points, the slope, y-intercept and correlation coefficient, r, can be determined using the following: T V - m y * b = ^ n 21 » T (*/)- y i v y s—t J • J—i J—/-' (The limits of the summation, which are i to n, and the summation indices on x and y have been omitted.) Correlation coefficient, r can take on values from 0 to 1, where 1 means there is a perfect match and means that all the points are on the line exactly. (Most statistical texts show the correlation coefficient as "r", but Excel shows the coefficient as "R". Whether it is as r or R, the correlation coefficient gives us a measure of the reliability of the linear relationship between the x and y values). According to the Fig 4-1, • R-squared, r2 = 0.7923 • Correlation Coefficient, r = 0.8901 Also the graph shows that best fit straight line is not suited to lower values and upper values of turbidity. Therefore other best fit lines have to be considered. Fig 4-2 shows the Logarithmic line. Non linear regression technique is also same as linear regression technique. There also correlation coefficient, r can take on values from 0 to 1, where 1 means there is a perfect match and means that all the points are on the line exactly. According to the Fig 4-2, • R-squared, r2 = 0.4944 • Correlation Coefficient, r = 0.7031 Also the graph shows that best fit logarithmic line is not suited to lower values and upper values of turbidity. Therefore other best fit lines have to be considered. Fig 4-3 shows the second order polynomial line. 22 According to the Fig 4-3, • R-squared, r2 = 0.8573 • Correlation Coefficient, r = 0.9259 According to the results correlation coefficient, r value is close to 1 and that indicated excellent second order polynomial reliability. However other best fit lines are also considered. Fig 4-4 shows the power line. According to the Fig 4-4, • R-squared, r2 = 0.6504 • Correlation Coefficient, r = 0.8064 The graph shows that best fit logarithmic line is not suited to upper values of turbidity. Fig 4-5 shows the exponential line. According to the Fig 4-5, • R-squared, r2 = 0.8106 • Correlation Coefficient, r = 0.9003 Therefore best suited curve fit is polynomial. However high order polynomial reliability is also considered. Fig 4-6 shows the third order polynomial line. According to the Fig 4-6, • R-squared, r2 = 0.8575 • Correlation Coefficient, r = 0.9260 Fig 4-7 shows the fourth order polynomial line. According to the Fig 4-7, • R-squared, r2 = 0.8577 • Correlation Coefficient, r = 0.9261 23 Fig 4-8 shows the fifth order polynomial line. According to the Fig 4-8, . R-squared, r2 = 0.861 • Correlation Coefficient, r = 0.9279 Fig 4-9 shows the sixth order polynomial line. According to the Fig 4-9, . R-squared, r2 = 0.8619 • Correlation Coefficient, r = 0.9283 Table 4-1: Details of R-Squared Value with Different Lines Best fit 2 R-squared, r Correlation Coefficient, r 1-r 1. Straight line 0.7923 0.8901 0.1099 2. Logarithmic line 0.4944 0.7031 0.2969 3. Second Order Polynomial 0.8573 0.9259 0.0741 4. Third Order Polynomial 0.8575 0.9260 0.0740 5. Fourth Order Polynomial 0.8577 0.9261 0.0739 6. Fifth Order Polynomial 0.861 0.9279 0.0721 7. Sixth Order Polynomial 0.8619 0.9283 0.0717 According to the table Correlation Coefficient, r is considerably near to 1 in polynomial line. Therefore this data is reliable for polynomial. And also it reveals that higher the order of the polynomial, better the curve fit. But Correlation Coefficient, r is changing considerably small. Therefore second order polynomial is reliable for data points. 24 ro en Fi g 4- 1 : L in ea r R el at io ns hi p of T ur bi di ty a nd A lu m D os ag e o 50 10 0 15 0 20 0 25 0 30 0 35 0 Tu rb id ity ( N TU ) -• — A lu m ( l/m in ) •L in ea r (A lu m ( l/m in )) M C T> Fi g 4- 2 : L og ri th m ic R el at io ns hi p of T ur bi di ty a nd A lu m D os ag e 50 10 0 15 0 20 0 25 0 30 0 35 0 T u rb id it y (N T U ) A lu m ( l/m in ) Lo g. ( A lu m ( l/m in )) M — I Fi g 4- 3 : S ec on d O rd er P ol yn om ia l R el at io ns hi p of T ur bi di ty an d A lu m D os ag e 50 10 0 15 0 20 0 25 0 30 0 35 0 Tu rb id it y (N TU ) -A lu m ( l/m in ) P ol y. ( A lu m ( l/m in )) • | 20 E M CO 10 5 0 25 0 30 0 Tu rb id it y (N T U ) -A lu m ( l/m in ) P ow er ( A lu m ( l/m in )) Fi g 4- 4 : P ow er R el at io ns hi p of T ur bi di ty a nd A lu m D os ag e 25 Fi g 4- 5 : E xp on en ti al R el at io ns hi p of T ur bi di ty a nd A lu m D os ag e 30 25 0 30 0 35 0 Tu rb id it y (N TU ) R 2 = 0. 81 06 •• — A lu m ( l/m in ) E xp on . (A lu m ( l/m in )) • oo o Fi g 4- 6 : T hi re d O rd er P ol yn om ia l R el at io ns hi p of T ur bi di ty an d A lu m D os ag e 50 10 0 15 0 20 0 25 0 30 0 35 0 Tu rb id it y (N TU ) 1 -• — A lu m ( l/m in ) •P ol y. ( A lu m ( l/m in )) -• — A lu m ( l/m in ) •L in ea r (A lu m ( l/m in )) Fi g 4- 7 : F ou rt h O rd er P ol yn om ia l R el at io ns hi p of T ur bi di ty an d A lu m D os ag e 25 0 30 0 35 0 Tu rb id ity ( N TU ) Fi g 4- 8 : F ift h O rd er P ol yn om ia l R el at io ns hi p of T ur bi di ty an d A lu m D os ag e 25 0 30 0 35 0 Tu rb id ity ( N TU ) -• — A lu m (l /m in ) •L in ea r (A lu m ( l/m in )) Fi g 4- 9 : S ix th O rd er P ol yn om ia l R el at io ns hi p of T ur bi di ty an d A lu m D os ag e 25 0 30 0 35 0 Tu rb id it y (N TU ) •A lu m ( l/m in ) P ol y. ( A lu m ( l/m in )) Relationship OPTIMUM ALUM 1 = 10 + 0.05 (TURBIDITY) + 6 x 10 s (TURBIDITY)2 DOSSAGE (l/min) J Turbidity is measured in NTUs. It shows that relationship of turbidity value of raw water and the dosage of Alum has a relationship of second order polynomial. And also this equation is valid to turbidity values from 2 NTU to 300 NTU. Seasonal Variations (Dry Season and Wet Season) In Sri Lanka only two seasonal changes are occurred, dry season and wet season. However if it is a rainy day, turbidity is changed rapidly both in wet season and dry season. And also according to the Appendix-A, it is observe that for same turbidity values has same optimum Alum dosage whether it belongs to dry season or wet season. For an example, it is considered the samples from 825 to 860 in Appendix-A. Then the season is checked and following details are obtained. Therefore optimum dosage for same turbidity values may not changed according to the season. 34 Table 4-2: Details of Seasonal Variations Sample No Turbidity (NTU) Alum (ppm) Alum (l/min) Dry Season Wet Season 825 204.0 16 20 V 826 204.0 16 20 V 827 205.0 16 20 V 828 205.0 16 20 V 829 206.0 16 20 V 830 206.0 16 20 V 831 207.0 16 20 V 832 207.0 16 20 V 833 208.0 16 20 V 834 208.0 16 20 V 835 209.0 16 20 V 836 209.0 16 20 V 837 209.0 16 20 V 838 210.0 16 20 V 839 210.0 16 20 V 840 211.0 16 20 V 841 211.0 16 20 V 842 212.0 16 20 V 843 212.0 16 20 V 844 213.0 16 20 V 845 213.0 16 20 V 846 214.0 12 15 V 847 214.0 16 20 V 848 214.0 16 20 V 849 215.0 16 20 V 850 215.0 16 20 V 851 216.0 14.5 18.13 V 852 216.0 16 20 V 853 216.0 16 20 V 854 217.0 16 20 V 855 217.0 16 20 V 856 218.0 16 20 V 857 218.0 16 20 V 858 219.0 16 20 V 859 219.0 16 20 V 860 220.0 16 20 V 35 Relationship of Lime dosage with pH value for LDC After analyzing of turbidity of raw water and Alum dosage which is measured by Jar test from May, 2006 to April, 2007, Table 4-3 is obtained. Table 4-3 Details of Experimental Lime Dosage for Different pH Values pH Value No of Samples Lime Dosage (l/min) T 17.5 15 12.5 10 7.5 5 2.5 0 5.8 54 53 1 5.9 54 1 52 1 6.0 54 1 53 6.1 56 56 6.2 70 1 57 12 6.3 77 4 8 65 6.4 116 3 2 23 85 3 6.5 147 1 16 48 78 4 6.6 101 3 29 66 1 2 6.7 79 3 73 3 6.8 65 1 59 3 2 6.9 68 1 7 59 1 7.0 54 1 53 7.1 2 2 7.2 1 1 7.3 2 • 2 According to the Table 4-3, it shows that for all individual pH value has particular optimum Lime dosage which has occurred frequently. As an example, when pH value is equal to 6.3, optimum Lime dosage is 10 l/min in 65 times out of 77 samples. Therefore pH value of raw water and the optimum dosage of Lime have stepwise relationship. 36 Table 4-4 Requirement of Alum dosage for different pH values pH value Lime Dosage (l/min) 5.8 17.5 5.9 15.0 6.0 15.0 6.1 12.5 6.2 12.5 6.3 10.0 6.4 10.0 6.5 7.5 6.6 7.5 6.7 5.0 6.8 5.0 6.9 2.5 7.0 0.0 7.1 0.0 7.2 0.0 7.3 0.0 Validity of the Equations After obtaining optimum values for Alum and Lime dosage, they were applied to three hundred real situations. Then quality of final water was measured. According to the WHO (World Health Organization) Guide Lines, recommended value of turbidity is smaller than 5 and recommended pH value is smaller than 8. Those conditions are satisfied. Therefore relationships for optimum dosage of Alum and Lime are accurate. 37 Fi g 4- 10 : R el at io ns hi p of p H V al ue a nd L im e D os ag e 2 0 'c 18 | 16 o) 14 8* 1 2 w § 10 Q 8 o E 6 5. 8 5. 9 : • 6. 1 6. 2 • 6. 3 • 6. 4 6 5 • 6. 6 6 7 • 6 .8 0 • 6. 9 7. 1 0 7. 2 7. 3 • • 5. 7 6. 2 6. 7 pH v al ue 7. 2 7. 7 • Li m e D os ag e (l/ m in ) 4.3 Development of the system The Fig 4-11, system diagram illustrates the basic structure used by the system. The value of turbidity measured by a turbidity sensor is an analogue value that is given as an input to the microcontroller. Following computations are conducted in the microcontroller. • Convert analogue to a digital value. • Make the decision of the optimum dosage value. • Calculate the difference between current value and initial value of turbidity. • Display the value The above mentioned functions are explained with an example. Sample Calculation Let's assume that at the start, value of turbidity is 124 NTU. First that value is converted to digital value. The ADRESH:ADRESL register pair is the location where the 10-bit A/D result is loaded at the completion of the A/D conversion. This register pair is 16-bits wide. The A/D module gives the flexibility to left or right justify the 10-bit result in the 16-bit result register. The A/D Format Select bit (ADFM) controls this justification. The extra bits are loaded with ' 0 ' s . 10-bit Result ADFM = 1 (Right Justified) 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 ADRESH ADRESL 10-bit Result = 124NTU 39 T V al ue M ea su re m en t M A X 7 21 9 C om pu ta tio n th e di ff er en ce = 10 C om pu ta tio n th e m ov em en t of s te pp er m ot or Po si tio ni ng r ot or po le s ac co rd in g to th e eq ua tio n Fi fi 4- 11 S ys te m D ia gr am D is pl ay U ni t N O Sa tu ra tio n Y ES I C ha ng in g th e po si tio n of r ot or po le s The data base is developed to find the optimum Alum dosage (Refer Appendix-D). It is based on the equation obtained between the value of turbidity and the optimum alum dosage (Optimum Alum Dosage - 10 + 0.05 x (Turbidity) + 6 x 10"5 x (Turbidity)2). According to the field data turbidity varies from 4 NTU to 292 NTU. Therefore half step mode permanent magnet stepper motor with 1.8° step angle is used. In Appendix-D, angle movement of stepper motor for different turbidity values is also shown. Then the criterion is defined to select the angle movement of stepper motor with digital value of turbidity in the source code (Appendix-C). As per the example, angle movement of the stepper motor is 154.1°. Since the optimum Alum dosage is proportional to the angle movement of stepper motor, optimum Alum dosage is also proportional to amount of valve opened. Figure 4-12 shows the relationship of amount of valve opened and optimum Alum dosage. Then also a loop is defined to giving interrupts when turbidity value is changed by 10. Initial value - 124NTU - '0000111110' Saturation value - 134NTU - '0010000110' Then the flag is on and change the angle accordingly. Movement of the angle for 134NTU is 160°. 41 Fi g: 4 -1 2 R el at io ns hi p of A m ou nt o f V al ve O pe ne d an d O pt im um A lu m D os ag e _ 30 0. 0 ~o o c d> Q . O CD > 05 > 25 0. 0 20 0. 0 ~ 15 0. 0 o 10 0. 0 c: 3 o E < 50 .0 0. 0 0 .0 0 5. 00 10 .0 0 15 .0 0 20 .0 0 25 .0 0 O pt im um A lu m D os ag e (l/ m in ) 30 .0 0 35 .0 0 Design of the hardware The Fig 4-12, shows the Schematic Diagram of the Hardware used by the system. Following major components are indicated in the diagram. • A/D converters The Analog to digital converter module has five inputs for the 28 pin devices and eight for the other devices. The analog input charges a sample and hold capacitor. The output of the sample and hold capacitor is the input into the converter. The converter then generates a digital result of this analog level via successive approximation. The A/D conversion of the analog input signal results in a corresponding 10 bit digital number. The A/D module has high and low voltage reference input that is software selectable to combination of RA2 and RA3. • Selection and calculation of motor position Selection is done by the microcontroller from the criteria written with referring Appendix-D, turbidity value and the angle movement. • Stepper motor controlling Table 4-5 shows the sequence. Table 4-5: The sequence of switching the windings of ADC STEP STATOR WINDING 1 2 3 4 MOVEMENT (°) 0 ON ON OFF OFF 0.0 0.5 OFF ON OFF OFF 0.9 1 OFF ON ON OFF 1.8 1.5 OFF OFF ON OFF 2.7 2 OFF OFF ON ON 3.6 2.5 OFF OFF OFF ON 4.5 3 ON OFF OFF ON 5.4 3.5 ON OFF OFF OFF 6.3 4 ON ON OFF OFF 7.2 43 Either increment or decrement of the value of pH value by 0.1 makes the changing of valve position in LDC. Alum is changed from 5.5 to 7.5. Full step mode permanent magnet stepper motor with 15° step angle is used. Table 4-6 shows the sequence. Table 4-6: The sequence of switching the windings of LDC STEP STATOR WINDING 1 2 3 4 MOVEMENT (°) 0 ON ON OFF OFF 0 1 OFF ON ON OFF 15 2 OFF OFF ON ON 30 3 ON OFF OFF ON 45 4 ON ON OFF OFF 60 • Display unit using MAX7219 The MAX7219 drives common-cathode LED displays from one to eight seven- segment digits in length. It can also be used to drive up to 64 discrete LEDs configured as eight common-cathode clusters of eight LEDs each. When the MAX7219 is used with seven-segment displays, it can be configured to automatically convert binary-coded decimal (BCD) values into appropriate patterns of segments. The MAX7219 interfaces with controllers through three pins: data in, clock, and load. It connects to the LED displays in a straightforward way; pins SEG A through SEG G and SEG DP connect to segments A through G and the decimal point of all of the common-cathode displays. Pins DIGIT 0 through DIGIT 7 connect to the individual cathodes of each of the displays. 44 Fi g 4- 12 : Sc he m at ic D ia gr am o f th e H ar dw ar e 1N 54 00 -4 LM 78 12 V O U T V IN LM 78 05 V O U T V IN V D D R C O /T IO S O m C K I R C 1/ T 10 S I/ C C P 2 R C 2/ C C P 1 R A O /A N O R C 3/ S C K /S C L R A 1/ A N 1 R C 4/ S D I/ S D A R A 2/ A N 2A /R E F - R C 5/ S D O R A 3/ A N 3/ V R E F + R C 6/ T X /C K R A 4f T 0C K I R C 7/ R X /D T R A 5/ S S /A N 4 D IG O D IG 1 D IG 2 D IG 3 D IG 4 D IG 5 D IG 6 D IG 7 M C LR /V P P /T H V R B O /IN T R B 1 R B 2 R B 3/ P G M R B 4 R B 5 R B 6/ P G C R B 7/ P G D LO A D C LK D O U T D IN O S C 2/ C LK O U T V /v - 4M H z -J W V O S C 1/ C LK IN M A X 72 19 P IC 16 F8 76 1N 40 01 *4 IR F Z 44 N IR F Z 44 N IR F Z 44 N IR F Z 44 N L Chapter 5 Conclusions and Recommendations 5.1 Conclusions, Remarks and Discussion To conclude, this research adhered to the initial objectives, which were stated. The major activity of this research was to propose an alternative to the jar test allowing for an on line determination of optimal coagulant dosage from raw water characteristics and design a system for feeding Alum and Lime automatically with a monitoring display. Coagulant dosing rate is non-linearly correlated to raw water parameters of turbidity, conductivity, pH, temperature, dissolved oxygen and UV's absorption. It was assumed that except turbidity and pH value, other parameters are almost same throughout year. After analyzing thousand number of jar test results with corresponding turbidity values and pH value of incoming water, it was demonstrated turbidity value of raw water and the dosage of Alum has a relationship and pH value of raw water and the dosage of Lime has another relationship. Relationship of turbidity value of raw water and the dosage of Alum has a relationship of second order polynomial. However pH value of raw water and the dosage of Lime have stepwise relationship. And also real three hundred situations were taken and applied to check the validity of relationships and it proved that relationship which has obtained are well suited to develop the automation system. The major component of the research is designing a fully automation system for measuring the turbidity and pH value, deciding the operating points, automatically changing the dosage accordingly and turbidity and pH monitoring system. Value of turbidity was measured by a turbidity sensor. That value was taken to the microcontroller and it decided the Alum dosage and changes the valve position using stepper motor accordingly. Either increment or decrement of the value of turbidity by 46 10 makes the changing of valve position in ADC. Either increment or decrement of the value of pH value by 0.1 makes the changing of valve position in LDC. Using MAX7219 IC value of current value of turbidity and current value of pH are displayed in ADC and LDC respectively. System consists three major parts. They are sensors (turbidity sensor for ADC and pH sensor for LDC), controller and stepper motor. Selected turbidity meter, WQ710 was perfectly matched for the design since it can be inserted into low pressure pipes by using standard compression coupler for turbidity monitoring and readings are giving every three seconds. It showed that output currents at the maximum turbidity values close to 20mA, so that it is easy to work with microcontroller. PIC16F876 microcontroller is selected as the controller; it made the task easier. Since PIC16F876 has 8-bit with analogue to digital converters it handled analogue output of turbidity sensor and pH sensor. In this project MAX 7219 display driver IC could be easily interfaced with microcontroller by using three wires (SDO, SDI and SCLK) and LOAD (CE) which is common today named as Serial Peripheral Interface (SPI). The PIC16F876 chip is in electrical erasable packaged version (FLASH), and it helped for programming several times for testing our objective is implemented. PIC16F876 was simple for motor controlling specially stepper motor controlling. The varieties of software tools are available for developing and debugging source code for the controller. The MP LAB software is used for developing the system which is windows based an easy software development in 8-bit microcontroller and it made developing and debugging the source code easy and simple. 5.1 Recommendations for Future Research The recommendations given in this chapter is mainly based on the research findings. All this research shows that any complex situation can be handled by doing reasonable assumptions and using simple selections. Tropical countries like Sri Lanka can use this simplification method for different lakes and rivers. After analyzing a water source, relationships for Alum and Lime dosing with turbidity and pH value can be found. For Kelani River relationship of turbidity value of raw water and the dosage of Alum has a relationship of second order polynomial and pH value of raw water and the dosage of Lime have stepwise relationship. 47 Since such relationship is found controlling part became easier and low cost. The main controller, which is PIC16F876, handled A/D converting and stepper motor controlling perfectly. And also MAX 7219 display driver IC is easily interfaced with microcontroller. The MPLAB software is used for developing the system has developed and debugged the source code easily. Considering the practical situation constructing such equipment is low cost. And also it can decrease operational cost, chemical cost, laboratory tests and unnecessary man- hours. 48 References Baba, K., Enbutsu, I., Matuzaki, H. & Nogita, S.,1990. Intelligent support system for water and sewage treatment plants which included past history learning function - coagulation injection guidance system using neural net algorithm. Baxter, C. W., 1998. Full scale artificial neural network modeling of enhanced coagulation. M.Sc. Thesis, University of Alberta Baxter, C.W., Stanley, S.J., Zhang, Q. & Smith, D.W., 2002. Developing artificial neural network models of water treatment processes: A guide for utilities, Engineering Science, p.201-211. Bernazeau, F., Pierrone, P. & Duguet, J.P., 1992. Interest in using a streamline current detector for automatic coagulant dose control. Water Supply, 10 (4), 87-96. BiPOM Electronics, Inc., 2005. Microcontroller interface techniques, [Online].Available at: http://www.bipom.com [accessed June 2007]. Chazal, D., 2006. Controlling oxygen sensors with an automotive microcontroller, Masters Degree Project. Royal Institute of Technology. Dentel, K.S., 1995. Use of streaming current detector in coagulation monitoring and control, Water Sensors and Research and Technologies -Aqua, 44, p.70-79. Emunrud, A., 2002. Programmable logic controllers. Evans, J., Enoch, C., Johnson, M. & Williams, P., 1998. Intelligent based auto coagulation control applied to a water treatment works. In international conference on control. Gagnon, C., Grandjean, B.P.A. & Thibault J., 1997. Modeling of coagulant dosage in a water treatment plant. Global Water Instrumentation Inc., 2007. Turbidity sensor users guide, [Online],Available at: http://www.globalw.com [accessed April 2007] Hydroinformatics Delft, 2000. Use of artificial neural networks and fuzzy logic for integrated water management. 49 Jahan, K., 2003. Measurement of water quality parameters. Juuso, E., Viirret, K. & Piironen, M., 2003. Intelligent methods in dosing control of water treatment. Length counter using pic microcontroller, 2005. (Project report on Arthur C. Clarke institute for modern technologies). Lind, C., 1994. Coagulation control and optimization: Part One. Public Works for October, p.56-57. Lind, C., 1994. Coagulation control and optimization: Part Two. Public Works for Novemberr, p.32-33. Masson, M.H., Grandvalet, Y. & Lyngaard-Jensen, A., 1999. Software sensor design based on empirical data ecological modeling. Microchip, 2006. 8-bit PIC microcontroller so/wrioHs[Online].Available at: http://www.microchip.com [accessed June 2007], Mirsepassi, A., Cathers, B. & Dharmappa, H.B., 1995. Application of artificial neural networks to the real time operation of water treatment plants. In international joint conference on neural networks. Pask, D., 1993. Jar testing: Getting started on a low budget, Technical Brief - spring 2005, Volume 5, Issue I, p.5-10. Trautmann, T. & Denoeux, T., 1995. A constructive algorithm for S.O.M. applied to water quality monitoring. Intelligent engineering systems through artificial neural networks, p. 17-22. Valentin, N., Denoeux, T. & Fotoohi, F., 2000. Modeling of coagulant dosage in a water treatment plant. Valentin, N. & Denoeux, T., 2002. A neural network-based software sensor for coagulation control in a water treatment plant. 50 Jar Test Results and Calculated Values of Dosages in the Field Final Water Quality for Constructed values of Optimum Values of dosing Development of the Source Code Data base for Turbidity, Optimum Dosage and Angle Movement of Stepper Motor 51 Appendix-A Sample Pre Lime Pre Lime Post Lime Post Lime Alum Alum No Turbidity PH (ppm) (l/min) (ppm) (l/min) (ppm) (l/min) 1 4.0 5.8 7 17.5 5 12.5 7 8.75 2 4.0 6.1 5 12.5 5 12.5 7 8 .75 3 4.0 6.4 4 10 5 12.5 7 8 .75 4 4.4 7 0 0 5 12.5 8 10 5 4.92 6.5 3 7.5 5 12.5 8 10 6 5.0 5.9 6 15 6 15 7 8.75 7 5.0 6.2 5 12.5 5 12.5 7 8.75 8 5.0 6.5 3 7.5 5 12.5 7 8.75 9 5.3 6.8 0 0 5 12.5 8 10 10 5.4 6.7 3 7.5 5 12.5 8 10 11 5.66 6.7 0 0 5 12.5 7 8.75 12 5.7 7.3 2 5 5 12.5 9 11.25 13 5.8 6.5 3 7.5 5 12.5 9 11.25 14 5.93 6.6 3 7.5 5 12.5 11 13.75 15 6 6.8 4 10 6 15 9 11.25 16 6.0 6 6 15 6 15 7 8.75 17 6.0 6.3 4 10 5 12.5 7 8.75 18 6.0 6.6 3 7.5 5 12.5 7 8.75 19 6.1 6.6 0 0 5 12.5 8 10 20 6.2 6.4 3 7.5 5 12.5 10 12.5 21 6.2 6.6 3 7.5 5 12.5 8 10 22 6.3 6.5 3 7.5 5 12.5 10 12.5 23 6.4 6.6 3 7.5 5 12.5 8 10 24 6.4 6.6 3 7.5 5 12.5 8 10 25 6.5 6.5 3 7.5 5 12.5 10 12.5 26 6.5 6.5 3 7.5 5 12.5 10 12.5 27 6.6 6.6 3 7.5 5 12.5 9 11.25 28 6.8 7.1 0 0 5 12.5 8 10 29 6.8 6.5 3 7.5 5 12.5 10 12.5 30 6.9 6.5 3 7.5 5 12.5 8 10 31 6.9 6.6 3 7.5 5 12.5 10 12.5 32 6.9 6.7 0 0 5 12.5 8 10 33 6.9 6.6 0 0 5 12.5 8 10 34 7 6.9 0 0 6 15 9 11.25 35 7 6.6 3 7.5 5 12.5 10 12.5 36 7 6.6 3 7.5 5 12.5 8 10 37 7.0 6.1 5 12.5 6 15 7 8.75 38 7.0 6.4 4 10 5 12.5 7 8.75 39 7.0 6.7 2 5 5 12.5 7 8.75 40 7.11 6.7 3 7.5 5 12.5 10 12.5 41 7.2 6.9 3 7.5 5 12.5 10 12.5 42 7.3 6.6 3 7.5 5 12.5 8 10 43 7.3 6.5 0 0 5 12.5 8 10 Sample No T urbidity p Pre Lime P H (ppm) (I re Lime / min) Post Lime Post Lime A (ppm) (l/min) (| Jum A ppm) (I lum /min)| 441 7.3 6 9 3 | 7.5 5 12.5 10 12.51 45 | 7.3 6.9 3 7.5 5 12.5 10 12.5 461 7.3 6 9 3 7.5 5 12.5 10 12.5 471 7.3 6.9 3 7.5 5 12.5 10 12.5] 481 7.37 6 5 0 0 6 15 9 11.25 491 7.4 6.9 3 7.51 5 12.5 10 12.5 501 7.4 6.9 3 7.5 5 12.5 10 12.5 511 7.5 6.9 3 7.5 5 12.5 10 12.5 521 7.5 6.9 3 7.5 5 12.5 10 12.5 531 7.5 6.9 3 7.5 5 12.5 10 12,51 541 7.5 6.9 3 7.5 5 12.5 10 12.5 55 j 7.54 6.5 0 0 6 15 9 11.25 561 7.6 6.4 3 7.5 5 12.5 10 12.5 571 7.6 6.8 3 7.5 5 12.5 10 12.5 581 7.6 6.8 3 7.5 5 12.5 10 12.5 59| 7.6 6.9 3 7.5 5 12.5 10 12.5 60 7.7 6.5 3 7.5 5 12.5 9 11.25 61 7.7 6.8 31 7.5 5 12.5 10 12.5 62 7.7 6.8 3 7.5 5 12.5 10 12.5 63 7.7 6.8 3 7.5 5 12.5 10 12.5 64 7.8 6.5 3 7.5 5 12.5 9 11.25 65 7.8 6.5 3 7.5 5 12.5 10 12.5 66 7.9 6.8 0 0 6 15 9 11.25 67 7.9 6.5 3 7.5 5 12.5 9 | 11.25 68 8.0 6.2 5 12.5 6 15 7 8.75 69 8.0 6.5 3 7.5 5 12.5 7 8.75 70 8.0 6.8 1 2.5 5 12.5 7 8.75 71 8.1 6.5 3 7.5 5 12.5 9 11.25 11.25 72 8.1 6.4 4 10 5 12.5 9 72 5 8.4 6.5 2 7.5 5 12.5 » £ 11.25 7/ U 8.6 6.5 2 1 7.5 5 12.£ > 1C ) 12.5 7£ s 8.e 6.5 i U 10 5 12.£ j 1C ) 12.5 76 3 8.6 3 6.5 5 7.5 5 12.J 5 J 3 11.25 7" 7 8.6 3 6.5 3 7.5 5 12.! 5 S 3 11.25 7f 3 3 6.5 J < 3 7.5 5 12.! 5 1( 3 12.5 7< 3 9.( ") 6.3 | 4 1C 7 17. 5 7\ 8.75 8 3 9. 1 6.6 3 7.5 > 5 12. 5T H 8 .75 8 1 9. 1 6.S > 1 2.E > 5 12. I T 7\ 8 .75 8 2 9.1 1 6.E i 4 1C ) 5 12. 5 3 11.25 8 3 9-1 5 6.£ j 4 1C ) 0 T~ 0 1 1 13.75 8 4 9. 3 6.$ 3 7.J 5 4 1 0 1 0 12.5 8 5 9. 9 6. ' 4 1( 3 6 > 1 5 9 11.25 I 8 61 9.9 8 6.< 41 1( 3| ' )| 12. 5| 1 0 | 12.5| 53 Alum (l/min) Post Lime Alum (l/min) (ppm) im 7 Post Lime ppm) Pre Lime (l/min) Pre Lime Turbidity |pH l(ppm) Sample No 13.75 13.75 13.75 13.75 11 13.75 13.75 13.75 13.75 54 Sample 3re Lime 3re Lime Post Lime 3ost Lime Mum Alum No Turbidity pH (ppm) l/min) (ppm) l/min) (ppm) l/min) 130 14.0 6.1 5 12.5 5 12.5 7 8.75 131 14.3 6.4 4 10 0 0 11 13.75 132 14.5 6.4 4 10 5 12.5 9 11.25 133 14.5 6.4 5 12.5 6 15 10 12.5 134 14.8 6.6 4 10 5 12.5 11 13.75 135 15.0 6.9 1 2.5 7 17.5 7 8.75 136 15.0 5.9 6 15 5 12.5 7 8.75 137 15.0 6.2 5 12.5 5 12.5 7 8.75 138 15.1 6.2 5 12.5 5 12.5 10 12.5 139 15.1 6.4 4 10 5 12.5 11 13.75 140 15.1 6.6 4 10 5 12.5 10 12.5 141 15.3 6.8 3 7.5 5 12.5 10 12.5 142 15.3 6.6 3 7.5 5 12.5 10 12.5 143 15.6 6.2 5 12.5 5 12.5 10 12.5 144 16.0 7 0 0 5 12.5 7 8.75 145 16.0 6 6 15 5 12.5 7 8.75 146 16.0 6.3 4 10 5 12.5 7 8.75 147 17.0 5.8 7 17.5 6 15 7 8.75 148 17.0 6.1 5 12.5 5 12.5 7 8.75 149 17.0 6.4 4 10 5 12.5 7 8.75 150 17.5 6.9 o 3 7.5 5 12.5 12 15 151 17.6 6.4 i 10 5 12.5 11 13.75 152 18 6.3 5 12.5 6 15 10 12.5 153 18.0 5.9 6 15 7 17.5 7 8.75 154 18.0 6.2 5 12.5 5 12.5 7 8.75 155 18.0 6.5 3 7.5 5 12.5 7 8.75 156 18.3 6.4 i. 10 5 12.5 10 12.5 157 18.4 6.3 £. 10 5 12.5 9 11.25 158 18.4 6.4 t. 10 0 0 12 15 159 19.0 6 6 15 6 15 7 8.75 160 19.0 6.3 4 10 5 12.5 7 8.75 161 19.0 6.6 3 7.5 5 12.5 7 8.75 162 19.2 6.5 £ 10 5 12.5 11 13.75 163 19.9 6.2 £ 10 5 12.5 11 13.75 164 20.0 6.1 5 12.5 5 12.5 7 8.75 165 20.0 6.4 4 10 6 15 7 8.75 166 20.0 6.7 2 5 5 12.5 7 8.75 167 20.4 6.4 £ 10 5 12.5 11 13.75 168 20.6 6.4 £ 10 £ 12.5 10 12.5 169 20.8 6.4 12.5 e 15 10 12.5 17C 20.S 6.2 A 1C £ 12.5 10 12.5 171 21 6.4 ^ 1C £ 12.£ 12 15 172 21.C 6.2 c 12.£ £ 12.£ 7 8.75 55 Alum (l/min) Alum (ppm) Post Lime (l/min) Post Lime ppm) Pre Lime l/min) Pre Lime (PPm) Sample No Turbidity 13.75 11 13.75 16.25 13.75 13.75 13.75 13.75 11 13.75 13.75 13.75 13.75 13.75 13.75 13.75 12.51 11 13.75 12.5 11 13.75 12.51 111 13.751 56 Sample |No T urbidity p P H ( re Lime P ppm) (I re Lime P /min) (| ost Lime P apm) (I ost Lime A / min) |( klum A ppm) ( Jum /min) 216 25.4 6.6 4 10 5 12.5 11 13.75 217 25.7 6 6 4 10 5 12.5 11 13.75 218 25.8 6.1 5 12.5 8 20 12 15 219 25.9 6.7 5 12.5 6 15 10 12.5 220 26.0 6 7 2 5 6 15 8 10 221 26.0 7 0 0 5 12.5 8 10 222 26.0 6 6 15 5 12.5 8 10 223 27.0 6.8 1 2.5 6 15 8 10 224 27.0 5.8 7 17.5 5 12.5 8 10 225 27.0 6.1 5 12.5 5 12.5 8 10 226 27.1 6 7 5 12.5 6 15 10 12.5 227 27.2 6.4 4 10 5 12.5 12 15 228 27.4 6 4 4 10 5 12.5 9 11.25 229 28 6.4 4 10 0 0 12 15 230 28.0 6.9 1 2.5 5 12.5 8 10 231 28.0 5.9 6 15 4 10 8 10 232 28.0 6.2 5 12.5 6 15 8 10 233 28.1 6.7 4! 10 5 12.5 11 13.75 234 28.3 6.7 4 10 5 12.5 11 13.75 235 28.5 6.3 5 12.S 5 12.5 12 15 236 29.0 7 0 0 6 15 8 10 237 29.0 6 6 15 6 15 8 10 238 29.0 6.3 4 10 6 15 8 10 239 29.6 6.7 4 10 5 12.5 11 13.75 240 30.0 5.8 7 17.5 6 15 8 10 241 30.0 6.1 5 12.5 6 15 8 10 242 30.0 6 4 4 10 6 15 8 10| 243 30.6 7 4 10 5 12.5 11 13.75 244 30.7 6.E 4 10 £ 12.£ 1C 12.5 245 31 6.2 6 12.£ c 12.£ > £ ) 11.25 246 31 6 2 £ > 12.£ > £ 12.£ ' 1 C ) 12.5 241 31 6.: i ic ) £ 3 12.£ 3 £ 3 11.25 24? 3 31.( 5.< 3 1£ 3 6 3 M 3 6 3 10 24$ 3 31. 3 6.; ? 5 12.J 5 3 1! 5 3 10 25( 3 31. 3 6. i 3 7.! 5 3 1 5 3 10 25 31. ? 6 5 4 1( 3 5 12. 5 1 1 13.75 25 31. 4 6. 3 5 12. 5 3 1 5 1: 2 15 25 3 32. 3 6 6 1 5 T 6 1 5 3 10 25 4 32. 0 6. 3 4 1 o T 5 12. 5 3 10 25 5 32. 0 6. 6 3 7. 5 T 5 12. 5|~ 8l 101 25 6 32. 9 6. 3 5 12. 5 6 1 5 1 2\ 15 | 25 7 33. 0 6. 5 12. 5 6 1 5 8 | 101 25 8 33 0 6 4 41 1 0 6 1 51 8 | 10| 57 I Sample Pre Lime Pre Lime Post Lime Post Lime Alum Alum No Turbidity PH (ppm) (l/min) (ppm) (l/min) (ppm) (l/min) 259 33.0 6.7 2 5 6 15 10 260 34.0 6.2 5 12.5 6 15 10 261 34.0 6.5 3 7.5 6 15 10 262 34.0 6.8 1 2.5 6 15 8 10 263 35.0 6.3 4 10 6 15 10 264 35.0 6.6 3 7.5 6 15 10 265 35.0 6.9 - 2.5 6 15 8 10 266 35.5 6.5 L 10 5 12.5 11 13.75 267 36.0 6.4 4 10 6 15 8 10 268 36.0 6.7 2 5 6 15 8 10 269 36.0 7 0 0 6 15 8 10 270 37.0 6.5 3 7.5 6 15 8 10 271 37.0 6.8 1 2.5 5 12.5 8 10 272 37.0 5.8 7 17.5 7 17.5 8 10 273 37.2 6.5 4 10 5 12.5 11 13.75 274 37.4 6.5 4 10 5 12.5 11 13.75 275 37.8 6.6 5 12.5 5 12.5 12 15 276 38.0 6.6 3 7.5 6 15 8 10 277 38.0 6.9 1 2.5 5 12.5 8 10 278 38.0 5.9 6 15 4 10 8 10 279 38.5 6.5 4 10 5 12.5 11 13.75 280 39.0 6.7 2 5 6 15 8 10 281 39.0 7 0 0 6 15 8 10 282 39.0 6 6 15 5 12.5 8 10 283 40.0 6.8 1 2.5 6 15 8 10 284 40.0 5.8 7 17.5 6 15 8 10 285 40.0 6.1 5 12.5 6 15 8 10 286 40.1 6.5 4 10 5 12.5 11 13.75 287 41.0 6.9 1 2.5 6 15 8 10 288 41.0 5.9 6 15 6 15 8 10 289 41.0 6.2 5 • 12.5 7 17.5 8 10 290 41.2 6.5 4 10 5 12.5 11 13.75 291 41.4 6.5 4 10 5 12.5 11 13.75 292 41.7 6.8 3 7.5 5 12.5 10 12.5 293 41.9 6.7 4 10 5 12.5 11 13.75 294 42.0 7 0 0 6 15 8 10 295 42.0 6 6 15 5 12.5 8 10 296 42.0 6.3 4 10 7 17.5 8 10 297 43.0 6.5 4 10 5 12.5 11 13.75 298 43.0 5.8 7 17.5 6 15 8 10 299 43.0 6.1 5 12.5 5 12.5 8 10 300 43.0 6.4 4 10 7 17.5 8 10 301 43.7 6.5 4 10 5 12.5 11 13.75 58 Sample Pre Lime Pre Lime Post Lime Post Lime Alum Alum No Turbidity pH (ppm) (l/min) (ppm) (l/min) (ppm) (l/min) 302 44.0 5.9 6 15 6 15 8 10 303 44.0 6.2 5 12.5 5 12.5 8 10 304 44.0 6.5 3 7.5 5 12.5 8 10 305 45 6.5 5 12.5 6 15 14 17.5 306 45.0 6 6 15 6 15 8 10 307 45.0 6.3 4 10 5 12.5 8 10 308 45.0 6.6 3 7.5 6 15 8 10 309 45.8 6.5 4 10 5 12.5 11 13.75 310 46 6.5 5 12.5 5 12.5 10 12.5 311 46.0 6.1 5 12.5 6 15 8 10 312 46.0 6.4 4 10 5 12.5 8 10 313 46.0 6.7 2 5 7 17.5 8 10 314 47.0 6.2 5 12.5 6 15 9 11.25 315 47.0 6.5 3 7.5 5 12.5 9 11.25 316 47.0 6.8 1 2.5 6 15 9 11.25 317 48.0 6.3 4 10 6 15 9 11.25 318 48.0 6.6 3 7.5 5 12.5 9 11.25 319 48.0 6.9 1 2.5 5 12.5 9 11.25 320 49.0 6.4 4 10 6 15 9 11.25 321 49.0 6.7 2 5 5 12.5 9 11.25 322 49.0 7 0 0 5 12.5 9 11.25 323 49.3 6.5 4 10 5 12.5 11 13.75 324 50.0 6.5 3 7.5 6 15 9 11.25 325 50.0 6.8 1 2.5 6 15 9 11.25 326 50.0 5.8 7 17.5 5 12.5 9 11.25 327 51.0 6.6 3 7.5 6 15 9 11.25 328 51.0 6.9 1 2.5 6 15 9 11.25 329 51.0 5.9 6 15 6 15 9 11.25 330 52.0 6.7 2 5 6 15 9 11.25 331 52.0 7 0 0 6 15 9 11.25 332 52.0 6 6 15 6 15 9 11.25 333 52.1 6.6 4 10 5 12.5 12 15 334 52.4 6.6 4 10 5 12.5 12 15 335 52.8 6.3 4 10 5 12.5 12 15 336 53.0 6.8 1 2.5 6 15 9 11.25 337 53.0 5.8 7 17.5 6 15 9 11.25 338 53.0 6.1 5 12.5 7 17.5 9 11.25 339 54.0 6.9 1 2.5 6 15 9 11.25 340 54.0 5.9 6 15 6 15 9 11.25 341 54.0 6.2 5 12.5 6 15 9 11.25 342 54.2 6.6 4 10 5 12.5 12 15 343 54.3 6.6 4 10 5 12.5 12 15 344 55.0 6.6 4 10 5 12.5 12 15 59 Sample 3re Lime Pre Lime Post Lime Post Lime Mum Mum No Turbidity pH (ppm) l/min) (ppm) l/min) (ppm) l/min) 345 55.0 7 0 0 6 15 9 11.25 346 55.0 6 6 15 6 15 9 11.25 347 55.0 6.3 4 10 6 15 9 11.25 348 55.4 6.5 4 10 5 12.5 12 15 349 56.0 5.8 7 17.5 7 17.5 9 11.25 350 56.0 6.1 5 12.5 6 15 9 11.25 351 56.0 6.4 4 10 5 12.5 9 11.25 352 57.0 6.5 4 10 5 12.5 11 13.75 353 57.0 5.9 6 15 6 15 9 11.25 354 57.0 6.2 5 12.5 6 15 9 11.25 355 57.0 6.5 3 7.5 6 15 9 11.25 356 57.3 6.8 4 10 5 12.5 11 13.75 357 58.0 6 6 15 6 15 9 11.25 358 58.0 6.3 4 10 6 15 9 11.25 359 58.0 6.6 3 7.5 6 15 9 11.25 360 58.2 6.7 4 10 5 12.5 11 13.75 361 59 6.1 5 12.5 0 0 14 17.5 362 59.0 6.1 5 12.5 5 12.5 9 11.25 363 59.0 6.4 4 10 6 15 9 11.25 364 59.0 6.7 2 5 6 15 9 11.25 365 59.1 6.4 4 10 5 12.5 12 15 366 59.6 6.6 4 10 5 12.5 12 15 367 60.0 6.4 7 17.5 7.0 17.5 18.0 22.5 368 60.0 6.4 7 17.5 7.0 17.5 18.0 22.5 369 60.0 6.4 7 17.5 7.0 17.5 18.0 22.5 370 60.0 6.2 5 12.5 5 12.5 9 11.25 371 60.0 6.5 3 7.5 5 12.5 9 11.25 372 60.0 6.8 1 2.5 6 15 9 11.25 373 61 6.4 10 5 12.5 12 15 374 61.0 6.3 4 10 5 12.5 9 11.25 375 61.0 6.6 3 7.5 5 12.5 9 11.25 376 61.0 6.9 - 2.5 6 15 9 11.25 377 61.6 6.4 10 6 15 12 15 378 62.0 6.4 4 10 5 12.5 9 11.25 379 62.0 6.7 2 5 5 12.5 9 11.25 380 62.0 7 0 0 6 15 9 11.25 381 63.0 6.3 7 17.5 7.0 17.5 18.0 22.5 382 63.0 6.5 3 7.5 5 12.5 9 11.25 383 63.0 6.8 1 2.5 5 12.5 9 11.25 384 63.0 5.8 7 17.5 6 15 9 11.25 385 64.0 6.3 7 17.5 7.0 17.5 18.0 22.5 386 64.0 6.6 3 7.5 6 15 S 11.25 387 64.0 6.S 1 2.5 5 12.5 9 11.25 60 Sample No Pre Lime (ppm) Pre Lime (l/min) Post Lime (ppm) Post Lime (l/min) Alum (ppm Turbidity pH 13.0 16.25 13.75 Alum (l/min 11.25 11.25 12.5 16.25 61 Sample No Turbidity PH Pre Lime (ppm) Pre Lime (l/min) Post Lime (ppm) Post Lime (l/min) Alum (ppm) Alum (l/min) 431 76.0 6.8 1 2.5 5 12.5 10 12.5 432 76.0 5.8 7 17.5 6 15 10 12.5 433 76.1 6.5 10 5 12.5 12 15 434 76.4 6.6 10 5 12.5 13 16.25 435 77 6 7 17.5 7 17.5 14 17.5 436 77.0 6.5 5 12.5 6 15 10 12.5 437 77.0 6.6 3 7.5 0 0 10 12.5 438 77.0 6.9 1 2.5 6 15 10 12.5 439 77.0 5.9 6 15 6 15 10 12.5 440 78.0 6.7 2 5 6 15 10 12.5 441 78.0 7 0 0 6 15 10 12.5 442 78.0 6 6 15 6 15 10 12.5 443 79.0 6.8 1 2.5 6 15 10 12.5 444 79.0 5.8 7 17.5 6 15 10 12.5 445 79.0 6.1 5 12.5 6 15 10 12.5 446 79.2 6.5 4 10 5 12.5 14 17.5 447 80.0 6.9 1 2.5 7 17.5 10 12.5 448 80.0 5.9 6 15 7 17.5 10 12.5 449 80.0 6.2 5 12.5 6 15 10 12.5 450 80.2 6.5 5 12.5 6 15 10 12.5 451 81.0 7 0 0 5 12.5 10 12.5 452 81.0 6 6 15 8 20 10 12.5 453 81.0 6.3 4 10 6 15 10 12.5 454 82.0 5.8 7 17.5 6 15 10 12.5 455 82.0 6.1 5 12.5 5 12.5 10 12.5 456 82.0 6.4 4 10 6 15 10 12.5 457 83.0 5.9 6 15 6 15 10 12.5 458 83.0 6.2 5 12.5 4 10 10 12.5 459 83.0 6.5 3 7.5 6 15 10 12.5 460 84.0 6 6 .15 5 12.5 10 12.5 461 84.0 6.3 4 10 5 12.5 10 12.5 462 84.0 6.6 3 7.5 7 17.5 10 12.5 463 85.0 6.1 5 12.5 7 17.5 10 12.5 464 85.0 6.4 4 10 5 12.5 10 12.5 465 85.0 6.7 2 5 6 15 10 12.5 466 85.7 6.5 5 12.5 6 15 10 12.5 467 86.0 6.3 7 17.5 7.0 17.5 18.0 22.5 468 86.0 6.2 5 12.5 5 12.5 10 12.5 469 86.0 6.5 3 7.5 4 10 10 12.5 470 86.0 6.8 1 2.5 6 15 10 12.5 471 86.4 6.5 4 10 5 12.5 14 17.5 472 87.0 6.3 4 10 6 15 10 12.5 473 87.0 6.6 3 7.5 5 12.5 10 12.5 62 63 Sample No Pre Lime (ppm) Pre Lime (l/min) Post Lime (ppm) Post Lime (l/min) Alum (PPm Alum (l/min Turbidity 13.75 13.75 13.75 13.75 13.75 100.0 13.75 100.0 100.0 13.75 13.75 13.75 13.75 13.75 102.0 13.75 102.0 6.8 102.0 5.8 13.75 13.75 103.0 103.0 13.75 103.0 13.75 104.0 13.75 104.0 13.75 104.0 13.75 105.0 13.75 105.0 11 13.75 105.0 5.8 105.0 6.1 11 13.75 11 13.75 11 13.75 106.0 106.0 13.75 106.0 13.75 107.0 13.75 107.0 13.75 107.0 108.0 108.0 11 13.75 108.0 11 13.75 108.0 11 13.75 109.0 109.0 11 13.75 109.0 11 13.75 109.0 11 13.75 13 16.25 64 65 66 Sample No Turbidity pH Pre Lime (ppm) Pre Lime (l/min) Post Lime (ppm) Post Lime (l/min) Alum (ppm) Alum (l/min) 646 135.0 5.9 6 15 6 15 12 15 647 135.0 6.2 5 12.5 5 12.5 12 15 648 136.0 6.5 i 10 5 12.5 14 17.5 649 136.0 6 6 15 6 15 12 15 650 136.0 6.3 4 10 5 12.5 12 15 651 137.0 6.1 5 12.5 6 15 13 16.25 652 137.0 6.4 4 10 6 15 13 16.25 653 138.0 6.2 5 12.5 5 12.5 13 16.25 654 138.0 6.5 3 7.5 6 15 13 16.25 655 139 6.2 6 15 7 17.5 17 21.25 656 139 6.2 6 15 7 17.5 17 21.25 657 139.0 6.2 7 17.5 7.0 17.5 18.0 22.5 658 139.0 6.4 5 12.5 6 15 15 18.75 659 139.0 6.5 10 5 12.5 11 13.75 660 139.0 6.3 4 10 5 12.5 13 16.25 661 139.0 6.6 3 7.5 6 15 13 16.25 662 140.0 6.4 / 10 5 12.5 13 16.25 663 140.0 6.7 2 5 5 12.5 13 16.25 664 141.0 6.5 3 7.5 5 12.5 13 16.25 665 141.0 6.8 1 2.5 5 12.5 13 16.25 666 142.0 6.5 4 10 5 12.5 11 13.75 667 142.0 6.6 3 7.5 6 15 13 16.25 668 142.0 6.9 1 2.5 5 12.5 13 16.25 669 143 6.5 6 15 5 12.5 14 17 5 670 143 6.5 5 12.5 5 12.5 14.5 18.13 671 143.0 6.7 2 5 6 15 13 16.25 672 143.0 7 0 0 5 12.5 13 16.25 673 144 6.4 6 15 5 12.5 14.5 18.13 674 144.0 6.8 1 2.5 6 15 13 16.25 675 144.0 5.8 7 17.5 5 12.5 13 16.25 676 145 6.3 5 12.5 5 12.5 16 20 677 145.0 6.9 1 2.5 6 15 13 16.25 678 145.0 5.9 6 15 5 12.5 13 16.25 679 146.0 7 0 0 6 15 13 16.25 680 146.0 6 6 15 5 12.5 13 16.25 681 147.0 5.8 7 17.5 6 15 13 16.25 682 147.0 6.1 5 12.5 5 12.5 13 16.25 683 148 6.6 5 12.5 6 15 16 20 684 148 6.3 6 15 5 12.5 16 20 685 148.0 5.9 6 15 6 15 13 16.25 686 148.0 6.2 5 12.5 5 12.5 13 16.25 687 149.0 6 6 15 6 15 13 16.25 688 149.0 6.3 4 10 5 12.5 13 16.25 67 Sample 3re Lime 3re Lime ^ost Lime F 3ost Lime > Mum i Mum No rurbidity DH ppm) min) ppm) ( l/min) ppm) /min)| 689 150 5.8 7 17.5 6 15 14.5 18.13 690 150.0 6.1 5 12.5 6 15 13 16.25 691 150.0 6.4 4 10 5 12.5 13 16.25 692 151.0 6.2 5 12.5 6 15 13 16.25 693 151.0 6.5 3 7.5 5 12.5 13 16.25 694 152.0 6.3 4 10 6 15 13 16.25 695 152.0 6.6 3 7.5 5 12.5 13 16.25 696 153.0 6.4 4 10 6 15 13 16.25 697 153.0 6.7 2 5 5 12.5 13 16.25 698 154.0 6.5 3 7.5 6 15 13 16.25 699 154.0 6.8 1 2.5 5 12.5 13 16.25 700 155 6.4 4 10 5 12.5 14 17.5 701 155.0 6.2 7 17.5 7.0 17.5 18.0 22.5 702 155.0 6.6 3 7.5 6 15 13 16.25 703 155.0 6.9 1 2.5 5 12.5 13 16.25 704 156.0 6.5 4 10 5 12.5 14 17.5 705 156.0 6.7 2 5 6 15 13 16.25 706 156.0 7 0 0 6 15 13 16.25 707 157.0 6.8 1 2.5 6 15 13 16.25 708 157.0 5.8 7 17.5 6 15 13 16.25 709 158 6.6 5 12.5 5 12.5 16 20 710 158.0 6.9 2.5 6 15 13 16.25 711 158.0 5.9 6 15 7 17.5 13 16.25 712 159 6.5 i. 10 5 12.5 14 17.5 713 159.0 6.5 i. 10 5 12.5 14 17.5 714 159.0 6.6 £. 10 6.0 15 14.0 17.5 715 159.0 7 0 0 5 12.5 14 17.5 716 159.0 6 6 15 6 15 14 17.5 717 160.0 5.8 7 17.5 5 12.5 14 17.5 718 160.0 6.1 5 12.5 6 15 14 17.5 719 161.0 5.9 6 15 5 12.5 14 17.5 720 161.0 6.2 5 12.5 7 17.5 14 17.5 721 162.0 6 6 15 5 12.5 14 17.5 722 162.0 6.3 A 1C 7 17.5 14 17.5 723 163. C 6.1 12.5 5 12.£ 14 17.5 72 A 163.C 6.4 A 1C 6 > 1£ 1A 17.5 725 164 6.6 A 1C 5 > 12.£ 14 17.5 726 164.C 6.2 I 12.£ £ > 12.£ 14 17.5 727 164.C 6.f 7.£ 7 17.£ 14 17.5 728 165.C 6.: < 1 1C ) 6 3 1£ 14 17.5 72S 165. C 6.6 3 7.£ 5 5 1£ U 17.5 73C ) 166.C ) 6y * 1( ) ( 3 1£ U 17.5 73 ' 166. ) 6 : 2 5 31 1£ 5 U 17.5] 68 Sample Pre Lime Pre Lime Post Lime Post Lime Alum Alum No Turbidity pH (ppm) (l/min) (ppm) (l/min) (ppm) (l/min) 732 167.0 6.5 3 7.5 7 17.5 14 17.5 733 167.0 6.8 1 2.5 6 15 14 17.5 734 168 6.5 5 12.5 6 15 16 20 735 168.0 6.5 4 10 5 12.5 11 13.75 736 168.0 6.6 3 7.5 7 17.5 14 17.5 737 168.0 6.9 1 2.5 6 15 14 17.5 738 169.0 6.1 7 17.5 7.0 17.5 18.0 22.5 739 169.0 6.4 5 12.5 6 15 15 18.75 740 169.0 6.7 2 5 6 15 14 17.5 741 169.0 7 0 0 5 12.5 14 17.5 742 170.0 6.8 1 2.5 6 15 14 17.5 743 170.0 5.8 7 17.5 5 12.5 14 17.5 744 171 6.4 6 15 5 12.5 16 20 745 171.0 6.9 1 2.5 6 15 14 17.5 746 171.0 5.9 6 15 5 12.5 14 17.5 747 172.0 7 0 0 6 15 14 17.5 748 172.0 6 6 15 5 12.5 14 17.5 749 173 6.3 6 15 5 12.5 18 22.5 750 173.0 5.8 7 17.5 6 15 14 17.5 751 173.0 6.1 5 12.5 5 12.5 14 17.5 752 174.0 5.9 6 15 6 15 14 17.5 753 174.0 6.2 5 12.5 5 12.5 14 17.5 754 175.0 6 6 15 7 17.5 14 17.5 755 175.0 6.3 4 10 5 12.5 14 17.5 756 176 5.9 7 17.5 6 15 14.5 18.13 757 176.0 6.1 5 12.5 7 17.5 14 17.5 758 176.0 6.4 4 10 5 12.5 14 17.5 759 177.0 6.2 5 12.5 7 17.5 14 17.5 760 177.0 6.5 3 7.5 5 12.5 14 17.5 761 178.0 6.3 4 10 5 12.5 14 17.5 762 178.0 6.6 3 • 7.5 5 12.5 14 17.5 763 179.0 6.6 4 10 5 12.5 12 15 764 179.0 6.4 4 10 5 12.5 14 17.5 765 179.0 6.7 2 5 5 12.5 14 17.5 766 180.0 6.5 3 7.5 6 15 14 17.5 767 180.0 6.8 1 2.5 5 12.5 14 17.5 768 181.0 6.6 3 7.5 6 15 15 18.75 769 181.0 6.9 1 2.5 5 12.5 15 18.75 770 182.0 6.2 7 17.5 7.0 17.5 18.0 22.5 771 182.0 6.7 2 5 6 15 15 18.75 772 182.0 7 0 0 5 12.5 15 18.75 773 183.0 6.8 1 2.5 6 15 15 18.75 774 183.0 5.8 7 17.5 5 12.5 15 18.75 69 Sample Pre Lime Pre Lime Post Lime Post Lime Alum Alum No Turbidity PH (ppm) (l/min) (ppm) (l/min) (ppm) (l/min) 775 184.0 6.9 1 2.5 6 15 15 18.75 776 184.0 5.9 6 15 5 12.5 15 18.75 111 185.0 7 0 0 6 15 15 18.75 778 185.0 6 6 15 5 12.5 15 18.75 779 186.0 5.8 7 17.5 6 15 15 18.75 780 186.0 6.1 5 12.5 5 12.5 15 18.75 781 187.0 5.9 6 15 6 15 15 18.75 782 187.0 6.2 5 12.5 5 12.5 15 18.75 783 188.0 6.4 5 12.5 6 15 15 18.75 784 188.0 6 6 15 6 15 15 18.75 785 188.0 6.3 4 10 5 12.5 15 18.75 786 189.0 6.1 5 12.5 6 15 15 18.75 787 189.0 6.4 4 10 5 12.5 15 18.75 788 190.0 6.2 5 12.5 6 15 15 18.75 789 190.0 6.5 3 7.5 5 12.5 15 18.75 790 191 6.2 7 17.5 7 17.5 18 22.5 791 191.0 6.2 7 17.5 7.0 17.5 18.0 22.5 792 191.0 6.3 4 10 6 15 15 18.75 793 191.0 6.6 3 7.5 6 15 15 18.75 794 192.0 6.4 4 10 6 15 15 18.75 795 192.0 6.7 2 5 6 15 15 18.75 796 193.0 6.5 3 7.5 6 15 15 18.75 797 193.0 6.8 1 2.5 6 15 15 18.75 798 194.0 6.6 3 7.5 6 15 15 18.75 799 194.0 6.9 1 2.5 6 15 15 18.75 800 195.0 6.4 5 12.5 6 15 15 18.75 801 195.0 6.7 2 5 6 15 15 18.75 802 195.0 7 0 0 5 12.5 15 18.75 803 196.0 6.8 1 2.5 6 15 15 18.75 804 196.0 5.8 7 17.5 5 12.5 15 18.75 805 197 6.2 5 12.5 6 15 14 17.5 806 197.0 6.9 1 2.5 6 15 15 18.75 807 197.0 5.9 6 15 5 12.5 15 18.75 808 198.0 7 0 0 6 15 15 18.75 809 198.0 6 6 15 5 12.5 15 18.75 810 199.0 5.8 7 17.5 6 15 15 18.75 811 199.0 6.1 5 12.5 5 12.5 15 18.75 812 200 6.5 5 12.5 5 12.5 16 20 813 200.0 6.2 7 17.5 7.0 17.5 18.0 22.5 814 200.0 5.9 6 15 6 15 15 18.75 815 200.0 6.2 5 12.5 5 12.5 15 18.75 816 200.8 6.5 4 10 6 15 11 13.75 817 201.0 6 6 15 6 15 15 18.75 70 Sample Pre Lime Pre Lime Post Lime Post Lime Alum Alum No Turbidity PH (ppm) (l/min) (ppm) (l/min) (ppm) (l/min) 818 201.0 6.3 4 10 5 12.5 15 18.75 819 202.0 6.1 5 12.5 6 15 15 18.75 820 202.0 6.4 4 10 5 12.5 15 18.75 821 203 6.3 6 15 6 15 16 20 822 203.0 6.2 5 12.5 6 15 15 18.75 823 203.0 6.5 3 7.5 5 12.5 15 18.75 824 204.0 6.4 5 12.5 6.0 15 14.5 18.13 825 204.0 6.3 4 10 5 12.5 16 20 826 204.0 6.6 3 7.5 5 12.5 16 20 827 205.0 6.4 4 10 5 12.5 16 20 828 205.0 6.7 2 5 5 12.5 16 20 829 206.0 6.5 3 7.5 5 12.5 16 20 830 206.0 6.8 1 2.5 5 12.5 16 20 831 207.0 6.6 3 7.5 5 12.5 16 20 832 207.0 6.9 1 2.5 5 12.5 16 20 833 208.0 6.7 2 5 7 17.5 16 20 834 208.0 7 0 0 5 12.5 16 20 835 209 6.4 5 12.5 6 15 16 20 836 209.0 6.8 1 2.5 7 17.5 16 20 837 209.0 5.8 7 17.5 5 12.5 16 20 838 210.0 6.9 1 2.5 7 17.5 16 20 839 210.0 5.9 6 15 5 12.5 16 20 840 211.0 7 0 0 7 17.5 16 20 841 211.0 6 6 15 5 12.5 16 20 842 212.0 5.8 7 17.5 6 15 16 20 843 212.0 6.1 5 12.5 5 12.5 16 20 844 213.0 5.9 6 15 5 12.5 16 20 845 213.0 6.2 5 12.5 5 12.5 16 20 846 214.0 6.5 4 10 5 12.5 12 15 847 214.0 6 6 15 7 17.5 16 20 848 214.0 6.3 4 ' 10 5 12.5 16 20 849 215.0 6.1 5 12.5 6 15 16 20 850 215.0 6.4 4 10 5 12.5 16 20 851 216.0 6.4 5 12.5 6.0 15 14.5 18.13 852 216.0 6.2 5 12.5 6 15 16 20 853 216.0 6.5 3 7.5 5 12.5 16 20 854 217.0 6.3 4 10 6 15 16 20 855 217.0 6.6 3 7.5 5 12.5 16 20 856 218.0 6.4 4 10 6 15 16 20 857 218.0 6.7 2 5 5 12.5 16 20 858 219.0 6.5 3 7.5 6 15 16 20 859 219.0 6.8 1 2.5 6.0 15 16 20 860 220.0 6.6 3 7.5 6 15 16 20 71 Sample Pre Lime Pre Lime Post Lime Post Lime Alum Alum No Turbidity pH (ppm) (l/min) (ppm) (l/min) (ppm) (l/min) 861 220.0 6.9 1 2.5 6.0 15 16 20 862 221.0 6.7 2 5 6 15 16 20 863 221.0 7 0 0 6.0 15 16 20 864 222.0 6.4 5 12.5 6.0 15 14.5 18.13 865 222.0 6.8 1 2.5 6 15 16 20 866 222.0 5.8 7 17.5 6.0 15 16 20 867 223.0 6.9 1 2.5 6 15 16 20 868 223.0 5.9 6 15 6.0 15 16 20 869 224.0 6.4 5 12.5 6.0 15 14.5 18.13 870 224.0 7 0 0 6 15 16 20 871 224.0 6 6 15 6.0 15 16 20 872 225 6.3 6 15 5 12.5 17 21.25 873 225.0 5.8 7 17.5 6 15 16 20 874 225.0 6.1 5 12.5 6.0 15 16 20 875 226.0 5.9 6 15 6 15 17 21.25 876 226.0 6.2 5 12.5 7.0 17.5 17 21.25 877 227.0 6 6 15 6 15 17 21.25 878 227.0 6.3 4 10 7.0 17.5 17 21.25 879 228.0 6.1 5 12.5 6 15 17 21.25 880 228.0 6.4 4 10 7.0 17.5 17 21.25 881 229.0 6.2 5 12.5 6 15 17 21.25 882 229.0 6.5 3 7.5 7.0 17.5 17 21.25 883 230 6.2 4 10 5 12.5 14 17.5 884 230.0 6.3 4 10 6 15 17 21.25 885 230.0 6.6 3 7.5 7.0 17.5 17 21.25 886 231.0 6.4 4 10 6 15 17 21.25 887 231.0 6.7 2 5 7.0 17.5 17 21.25 888 232.0 6.5 3 7.5 6 15 17 21.25 889 232.0 6.8 1 2.5 7.0 17.5 17 21.25 890 233.0 6.6 3 7.5 6 15 17 21.25 891 233.0 6.9 1 • 2.5 7.0 17.5 17 21.25 892 234.0 6.3 5 12.5 5 12.5 15 18.75 893 234.0 6.7 2 5 5 12.5 17 21.25 894 234.0 7 0 0 7.0 17.5 17 21.25 895 235.0 6.8 1 2.5 5 12.5 17 21.25 896 235.0 5.8 7 17.5 7.0 17.5 17 21.25 897 236.0 6.9 1 2.5 5 12.5 17 21.25 898 236.0 5.9 6 15 7.0 17.5 17 21.25 899 237.0 7 0 0 5 12.5 17 21.25 900 237.0 6 6 15 7.0 17.5 17 21.25 901 238.0 5.8 7 17.5 6 15 17 21.25 902 238.0 6.1 5 12.5 7.0 17.5 17 21.25 903 239.0 5.9 6 15 6 15 17 21.25 72 Sample No Turbidity pH Pre Lime (ppm) Pre Lime (l/min) Post Lime (ppm) Post Lime (l/min) Alum (ppm) Alum (l/min) 904 239.0 6.2 5 12.5 7.0 17.5 17 21.25 905 240.0 6 6 15 6 15 17 21.25 906 240.0 6.3 4 10 7.0 17.5 17 21.25 907 241.0 6.1 5 12.5 6 15 17 21.25 908 241.0 6.4 4 10 7.0 17.5 17 21.25 909 242.0 6.2 5 12.5 6 15 17 21.25 910 242.0 6.5 3 7.5 7.0 17.5 17 21.25 911 243.0 6.3 4 10 6 15 17 21.25 912 243.0 6.6 3 7.5 5 12.5 17 21.25 913 244.0 6.4 4 10 6 15 17 21.25 914 244.0 6.7 2 5 5 12.5 17 21.25 915 245.0 6.5 3 7.5 6 15 17 21.25 916 245.0 6.8 - 2.5 5 12.5 17 21.25 917 246.0 6.6 3 7.5 6 15 17 21.25 918 246.0 6.9 • 2.5 5 12.5 17 21.25 919 247.0 6.7 2 5 6 15 17 21.25 920 247.0 7 0 0 5 12.5 17 21.25 921 248.0 6.8 1 2.5 6 15 18 22.5 922 248.0 5.8 7 17.5 5 12.5 18 22.5 923 249.0 6.9 1 2.5 6 15 18 22.5 924 249.0 5.9 6 15 5 12.5 18 22.5 925 250.0 7 0 0 . 6 15 18 22.5 926 250.0 6 6 15 5 12.5 18 22.5 927 251.0 6.2 5 12.5 5 12.5 15 18.75 928 251.0 5.8 7 17.5 6 15 18 22.5 929 251.0 6.1 5 12.5 5 12.5 18 22.5 930 252.0 5.9 6 15 6 15 18 22.5 931 252.0 6.2 5 12.5 5 12.5 18 22.5 932 253.0 6 6 15 6 15 18 22.5 933 253.0 6.3 4 10 5 12.5 18 22.5 934 254.0 6.1 5 12.5 6 15 18 22.5 935 254.0 6.4 4 ' 10 5 12.5 18 22.5 936 255.0 6.4 5 12.5 5 12.5 15 18.75 937 255.0 6.2 5 12.5 6 15 18 22.5 938 255.0 6.5 3 7.5 5 12.5 18 22.5 939 256.0 6.3 4 10 6 15 18 22.5 940 256.0 6.6 3 7.5 5 12.5 18 22.5 941 257.0 6.4 4 10 6 15 18 22.5 942 257.0 6.7 2 5 5 12.5 18 22.5 943 258.0 6.4 5 12.5 5 18 15 18.75 944 258.0 6.5 3 7.5 6 15 18 22.5 945 258.0 6.8 1 2.5 5 12.5 18 22.5 946 259.0 6.6 3 7.5 6 15 18 22.5 73 Sample Pre Lime Pre Lime Post Lime Post Lime Alum Alum No Turbidity PH (ppm) (l/min) (ppm) (l/min) (ppm) (l/min) 947 259.0 6.9 1 2.5 5 12.5 18 22.5 948 260.0 6.7 2 5 5 12.5 18 22.5 949 260.0 7 0 0 5 12.5 18 22.5 950 261.0 6.8 1 2.5 5 12.5 18 22.5 951 261.0 5.8 7 17.5 5 12.5 18 22.5 952 262.0 6.9 1 2.5 5 12.5 18 22.5 953 262.0 5.9 6 15 5 12.5 18 22.5 954 263.0 7 0 0 0 0 18 22.5 955 263.0 6 6 15 5 12.5 18 22.5 956 264.0 5.8 7 17.5 7 17.5 18 22.5 957 264.0 6.1 5 12.5 5 12.5 18 22.5 958 265.0 5.9 6 15 7 17.5 18 22.5 959 265.0 6.2 5 12.5 5 12.5 18 22.5 960 266.0 6 6 15 7 17.5 18 22.5 961 266.0 6.3 4 10 5 12.5 18 22.5 962 267.0 6.1 5 12.5 6 15 18 22.5 963 267.0 6.4 4 10 5 12.5 18 22.5 964 268.0 6.2 5 12.5 7 17.5 18 22.5 965 268.0 6.5 3 7.5 5 12.5 18 22.5 966 269.0 6.3 4 10 6 15 18 22.5 967 269.0 6.6 3 7.5 5 12.5 18 22.5 968 270.0 6.4 4 10 5 12.5 18 22.5 969 270.0 6.7 2 5 5 12.5 18 22.5 970 271.0 6.5 3 7.5 5 12.5 19 23.75 971 271.0 6.8 1 2.5 5 12.5 19 23.75 972 272.0 6.6 3 7.5 5 12.5 19 23.75 973 272.0 6.9 1 2.5 5 12.5 19 23.75 974 273.0 6.7 2 5 5 12.5 19 23.75 975 273.0 7 0 0 5 12.5 19 23.75 976 274.0 6.8 1 . 2.5 5 12.5 19 23.75 977 274.0 5.8 7 17.5 6 15 19 23.75 978 275.0 6.9 1 2.5 5 12.5 19 23.75 979 275.0 5.9 6 15 6 15 19 23.75 980 276.0 7 0 0 5 12.5 19 23.75 981 276.0 6 6 15 6 15 19 23.75 982 277.0 5.8 7 17.5 6 15 19 23.75 983 277.0 6.1 5 12.5 6 15 19 23.75 984 278.0 5.9 6 15 6 15 19 23.75 985 278.0 6.2 5 12.5 5 12.5 19 23.75 986 279.0 6 6 15 5 12.5 19 23.75 987 279.0 6.3 4 10 5 12.5 19 23.75 988 280.0 6.1 5 12.5 5 12.5 19 23.75 989 281.0 6.2 5 12.5 5 12.5 19 23.75 74 Sample No Turbidity PH Pre Lime (ppm) Pre Lime (l/min) Post Lime (ppm) Post Lime (l/min) Alum (ppm) Alum (l/min) 990 282.0 6.3 4 10 5 12.5 19 23.75 991 283.0 6.4 4 10 5 12.5 19 23.75 992 284.0 6.5 3 7.5 5 12.5 19 23.75 993 285.0 6.6 3 7.5 5 12.5 19 23.75 994 286.0 6.7 2 5 5 12.5 19 23.75 995 287.0 6.8 1 2.5 5 12.5 19 23.75 996 288.0 6.9 1 2.5 5 12.5 19 23.75 997 289.0 7 0 0 5 12.5 19 23.75 998 290.0 5.8 7 17.5 5 12.5 19 23.75 999 291.0 5.9 6 15 5 12.5 19 23.75 1000 292.0 6 6 15 5 12.5 19 23.75 Note: All Turbidity values are in NTU. 75 A pp en di x- B T dt y PH L im e (l /m in ) A lu m (l /m in ) Q ua li ty o f W at er T dt y PH L im e (l /m in ) A lu m (l /m in ) Se tt le d W at er F il t e re d it er F in al W at er T dt y PH L im e (l /m in ) A lu m (l /m in ) P ul s at or Pu l tu be C fl o ck -1 C fl oc k- 2 P T 1 P T 2 W £ e re d it er SP H K ub ot a T dt y PH L im e (l /m in ) A lu m (l /m in ) T dt y pH T dt j pH T dt y pH T dt y pH T dt y pH T dt i pH T dt y pH T dt y pH R cl T dt y pH R cl 14 .£ 6 . 6 7. 5 11 .0 2 24 .2 6. 6 7. 5 11 .3 4 1. 3 6. 2 2. 2 6. 2 2. C 6. 2 1. 6 6. 2 2. C 6. 2 l.S 6. 2 0. ? 6. 4 O .f 71 1. 1 o. s 72 1 1 23 .4 6. 6 7. 5 11 .3 1 24 .2 6. 6 7. 5 11 .3 4 1. 1 6. 4 2. 0 6. 4 l.S 6. 2 2. 2 6. 2 1. 8 6. 2 2. 1 6. 2 0. 8 6. 4 0. 4 7 1. 0 0. 8 7 2 1 0 24 .8 6. 6 7. 5 11 .3 6 25 .4 6. 6 7. 5 11 .3 8 1. 3 6. 4 1. 8 6. 4 2. 2 6. 4 2. 4 6. 4 1. 8 6. 4 1. 8 6. 4 0. 7 6 4 0. 4 7 1 1. 1 0 7 7 0 8 25 .7 6. 6 7. 5 11 .3 9 23 .5 6. 65 7. 5 11 .3 1 1. 3 6. 4 1. 9 6. 4 2. 3 6. 2 2. 6 6. 2 1. 8 6. 4 1. 7 6. 4 0. 7 6. 4 0. 3 7 0 1 1 1. 0 7 5 1 0 23 .6 6. 65 7. 5 11 .3 2 23 .7 6. 65 7. 5 11 .3 2 1. 05 6. 4 1. 1 6. 4 2. 0 6. 2 2. 4 6. 2 1. 7 6. 2 1. 6 6. 2 0. 7 6. 4 0. 4 7 4 0. 8 0. 9 7 3 1 i 23 .7 6. 6 7. 5 11 .3 2 23 .6 6. 6 7. 5 11 .3 2 1. 4 6. 4 1. 2 6. 4 1. 9 6. 2 2. 2 6. 2 1. 8 6. 4 1. 4 6. 4 0. 7 6. 4 0. 4 7. 1 i n 1. 1 7 7 0 9 23 .6 6. 7 5 11 .3 2 23 .7 6. 7 5 11 .3 2 1. 09 6. 2 3. 7 6. 2 1. 7 6. 2 1. 9 6. 2 3. 2 6. 2 3. 2 6. 2 23 .9 6. 7 5 11 .3 3 0. 4 6. 2 0. 5 7 1 1. 0 0. 7 6. 9 1 0 24 .2 6. 7 5 11 .3 4 1 6. 2 3. 9 6. 2 1. 7 6. 2 1. 8 6. 2 3. 4 6. 2 2. 9 6. 2 24 .6 6. 7 5 11 .3 5 28 .1 6. 7 5 11 .4 7 0. 98 6. 2 2. 9 6. 2 1. 7 6. 2 1. 7 6. 2 3. 6 6. 2 2. 5 6. 2 0. 4 6. 2 0. 5 7 7 0 9 0. 7 7. 0 I 1 28 .3 6. 7 5 11 .4 8 29 .6 6. 7 5 11 .5 2 1. 12 6. 2 3. 3 6. 2 1. 8 6. 2 1. 8 6. 2 3. 3 6. 2 2. 7 6. 2 27 .1 6. 7 5 11 .4 3 0. 4 6. 2 0. 5 7 3 4 0 0. 7 6 9 1 0 25 .9 6. 7 5 11 .3 9 1. 47 6. 8 3. 1 6. 8 1. 9 6. 3 1. 5 6. 3 3. 4 6. 3 2. 8 6. 3 24 .2 6. 7 5 11 .3 4 23 .9 6. 7 5 11 .3 3 1. 56 6. 4 3. 2 '6 .4 2. 1 6. 4 1. 4 6. 4 3. 4 6. 4 3. 0 6. 4 0. 4 6. 4 0. 4 7 4 1. 1 0. 8 7. 0 1 0 59 .6 6. 6 7. 5 12 .6 1 55 .4 6. 5 7. 5 12 .4 5 2. 3 6. 6 3. 8 6. 4 4. 7 6. 6 4. 8 6. 6 4. 9 6. 5 4. 9 6. 5 55 .0 6. 6 7. 5 12 .4 4 1. 1 6. 6 1 0 7 6 1 0 0. 9 7 3 1 0 54 .2 6. 6 7. 5 12 .4 1 1. 78 6. 6 4. 0 6. 5 5. 1 6. 6 4. 5 6. 6 4. 2 6. 5 4. 6 6. 5 52 .4 6. 6 7. 5 12 .3 4 52 .1 6. 6 7. 5 12 .3 3 1. 49 6. 6 4. 2 6. 4 5. 7 6. 6 4. 3 6. 6 3. 7 6. 5 4. 6 6 5 1 1 6 6 1. 0 7 6 1 0 0 9 7 3 1 0 54 .3 6. 6 7. 5 12 .4 1 76 .4 6. 6 7. 5 13 .2 7 1. 73 6. 6 4. 3 6. 4 2. 1 6. 5 2. 2 6. 5 2. 1 6. 5 2. 8 6. 5 1. 2 6. 6 1. 0 7. 6 1. 0 1. 0 7. 3 1. 0 Q ua li ty o f W at er Se tt le d W at er F il te re d W at er F in al W at er A lu m (l /m in ) P ul sa to r T dt y | pH P ul .t ub e T dt y| p H C fl oc k- 1 C fl oc k- 2 T dt y pH T dt y pH 2. 7 6. 5| 2~ 4 6. 5 K ub ot a 20 4. 0 22 4. 0 T dt y PH L im e (l /m in ) A lu m (l /m in ) Q ua li ty o f W at er T dt y PH L im e (l /m in ) A lu m (l /m in ) Se tt le d W at er F il te re d W at er F in al W at er T dt y PH L im e (l /m in ) A lu m (l /m in ) P ul sa to r P ul .t ub e C fl oc k- 1 C fl oc k- 2 P T 1 P T 2 F il te re d W at er SP H K ub ot a T dt y PH L im e (l /m in ) A lu m (l /m in ) T dt y PH T dt y pH T dt y pH T dt y PH T dt y P H T dt y pH T dt y pH T dt y PH R cl T dt y pH R cl 60 .0 6. 4 10 12 .6 3 2. 8 6. 4 3. 4 6. 4 3. 8 6. 4 4. 4 6. 4 4. 4 6. 4 4. 6 6. 4 1. 1 6. 4 1. 2 7. 4 0. 9 0. 7 7. 2 1. 1 7. 6 6. 8 5 10 .7 9 1. 0 6. 5 0. 6 6. 5 3. 7 6. 6 1. 5 6. 6 1. 7 6. 6 1. 9 6. 6 1. 2 6. 7 2. 1 6. 9 0. 8 0. 8 7. 1 0. 8 7. 6 6. 8 5 10 .7 9 7. 7 6. 8 5 10 .7 9 0. 7 6. 5 0. 9 6. 5 1. 2 6. 5 0. 9 6. 6 1. 0 6. 5 1. 4 6. 5 1. 1 6. 7 1. 4 7. 3 0. 9 0. 8 7. 5 0. 9 7. 7 6. 8 5 10 .7 9 7. 7 6. 8 5 10 .7 9 0. 7 6. 5 0. 9 6. 5 1. 6 6. 5 0. 9 6. 6 1. 6 6. 5 1. 4 6. 5 1. 0 6. 7 0. 8 7. 9 0. 9 0. 8 8. 0 0. 9 7. 6 6. 9 2. 5 10 .7 9 7. 5 6. 9 2. 5 10 .7 9 0. 8 6. 5 1. 08 6. 5 1. 8 6. 5 1. 2 6. 6 1. 8 6. 5 2. 2 6. 5 1. 0 6. 7 0. 9 7. 9 0. 9 0. 8 8. 0 0. 9 7. 3 6. 9 2. 5 10 .7 8 7. 3 6. 9 2. 5 10 .7 8 0. 8 6. 5 1. 5 6. 5 1. 8 6. 3 1. 2 6. 6 2. 4 6. 5 2. 7 6. 5 0. 9 0. 7 0. 7 7. 6 0. 9 0. 8 7. 8 0. 9 7. 3 6. 9 2. 5 10 .7 8 7. 4 6. 9 2. 5 10 .7 8 7. 5 6. 9 2. 5 10 .7 9 0. 8 6. 5 1. 5 6. 5 1. 1 6. 5 1. 1 6. 6 2. 2 6. 5 2. 5 6. 5 7. 5 6. 9 2. 5 10 .7 9 0. 9 6. 7 0. 7 7. 8 0. 9 0. 7 7. 4 0. 9 7. 5 6. 9 2. 5 10 .7 9 7. 4 6. 9 2. 5 10 .7 8 0. 8 6. 5 1. 6 6. 5 1. 0 6. 5 1. 0 6. 6 2. 1 6. 5 2. 3 6. 5 0. 8 6. 7 0. 7 7. 8 0. 9 0. 7 7. 4 0. 9 7. 3 6. 9 2. 5 10 .7 8 7. 2 6. 9 2. 5 10 .7 8 0. 8 6. 5 1. 4 6. 5 0. 9 6. 5 1. 0 6. 6 1. 9 6. 5 2. 1 6. 8 0. 8 6. 7 0. 7 7. 8 0. 9 0. 6 7. 3 0. 9 13 .2 6. 5 7. 5 10 .9 7 13 .9 6. 6 7. 5 10 .9 9 1. 6 6. 4 1. 9 6. 4 1. 6 6. 4 1. 6 6. 4 1. 5 6. 4 2. 4 6. 4 15 .1 6. 6 7. 5 11 .0 3 0. 6 7. 8 0. 9 0. 4 7. 7 1. 1 24 .3 6. 7 5 11 .3 4 41 .9 6. 7 5 11 .9 5 57 .3 6. 8 5 12 .5 2 0. 5 8. 0 0. 8 0. 5 7. 7 1. 2 87 .9 6. 8 5 13 .7 4 12 5. 0 6. 7 5 15 .3 6 17 9. 0 6. 6 7. 5 18 .0 2 0. 7 8. 1 0. 8 0. 5 7. 7 1. 0 21 4. 0 6. 5 7. 5 19 .9 3 25 5. 0 6. 4 10 22 .3 6 25 8. 0 6. 4 10 22 .5 4 0. 5 8. 0 0. 80 .8 9 7. 6 0. 8 25 1. 0 6. 2 12 .5 22 .1 1 23 4. 0 6. 3 10 21 .0 9 19 5. 0 6. 4 10 18 .8 8 1. 0 8. 0 0. 9 1. 3 7. 9 1. 1 T dt y pH L im e (l /m in ) A lu m (l /m in ) Q ua li ty o f W at er T dt y pH L im e (l /m in ) A lu m (l /m in ) Se tt le d W at er F il tt r ed te r F in al W at er T dt y pH L im e (l /m in ) A lu m (l /m in ) Pu is a to r P ul .t ub e C fl oc k- 1 C fl oc k- 2 P T 1 P T 2 W a re d te r SP II K ub ot a T dt y pH L im e (l /m in ) A lu m (l /m in ) T dt y pH T dt y pH T dt y pH T dt y pH T dt y pH T dt y pH T dt y pH T dt y PH R cl T dt y pH R cl 13 2. 0 6. 4 10 15 .6 9 12 9. 0 6. 4 10 15 .5 5 12 6. 0 6. 4 10 15 .4 1 12 0. 0 6. 4 10 15 .1 3 98 .0 6. 4 10 14 .1 6 94 .0 6. 4 10 13 .9 9 43 .0 6. 5 7. 5 11 .9 9 40 .1 6. 5 7. 5 11 .8 9 1. 3 6. 2 2. 2 6. 2 2. 0 6. 2 1. 6 6. 2 2. 0 6. 2 1. 9 6. 2 0. 8 6. 4 0. 8 7. 3 1. 1 0. 9 7. 2 1. 1 38 .5 6. 5 7. 5 11 .8 3 37 .4 6. 5 7. 5 11 .7 9 1. 1 6. 4 2. 0 6. 4 1. 9 6. 2 2. 2 6. 2 1. 8 6. 2 2. 1 6. 2 0. 8 6. 4 0. 8 7. 1 1. 0 0. 8 7. 2 1. 0 35 .5 6. 5 7. 5 11 .7 3 41 .2 6. 5 7. 5 11 .9 3 1. 3 6. 4 1. 8 6. 4 2. 2 6. 4 2. 4 6. 4 1. 8 6. 4 1. 8 6. 4 0. 7 6. 4 0. 8 7. 1 1. 1 0. 9 7. 7 0. 8 41 .4 6. 5 7. 5 11 .9 4 49 .3 6. 5 7. 5 12 .2 2 1. 3 6. 4 1. 9 6. 4 2. 3 6. 2 2. 6 6. 2 1. 8 6. 4 1. 7 6. 4 0. 7 6. 4 57 .0 6. 5 7. 5 12 .5 1 0. 9 12 3. 0 6. 5 7. 5 15 .2 7 1. 05 6. 4 1. 1 6. 4 2. 0 6. 2 2. 4 6. 2 1. 7 6. 2 1. 6 6. 2 0. 7 6. 4 13 9. 0 6. 5 7. 5 16 .0 2 16 8. 0 6. 5 7. 5 17 .4 5 1. 4 6. 4 1. 2 6. 4 1. 9 6. 2 2. 2 6. 2 1. 8 6. 4 1. 4 6. 4 0. 7 6. 4 0. 9 7. 1 1. 0 1. 1 7. 2 0. 9 14 2. 0 6. 5 7. 5 16 .1 6 12 8. 0 6. 5 7. 5 15 .5 0 1. 09 6. 2 3. 7 6. 2 1. 7 6. 2 1. 9 6. 2 3. 2 6. 2 3. 2 6. 2 11 8. 0 6. 5 7. 5 15 .0 4 0. 4 6. 2 0. 9 7. 1 1. 0 0. 7 6. 9 1. 0 11 5. 0 6. 5 7. 5 14 .9 1 1 6. 2 3. 9 6. 2 1. 7 6. 2 1. 8 6. 2 3. 4 6. 2 2. 9 6. 2 11 2. 0 6. 5 7. 5 14 .7 7 10 5. 0 6. 5 7. 5 14 .4 7 0. 98 6. 2 2. 9 6. 2 1. 7 6. 2 1. 7 6. 2 3. 6 6. 2 2. 5 6. 2 0. 4 6. 2 0. 9 7. 2 0. 9 0. 7 7. 0 1. 1 10 1. 0 6. 5 7. 5 14 .2 9 45 .8 6. 5 7. 5 12 .1 0 1. 12 6. 2 3. 3 6. 2 1. 8 6. 2 1. 8 6. 2 3. 3 6. 2 2. 7 6. 2 91 .3 6. 5 7. 5 13 .8 8 0. 4 6. 2 0. 9 7. 3 4. 0 0. 7 6. 9 1. 0 85 .7 6. 5 7. 5 13 .6 5 1. 47 6. 8 3. 1 6. 8 1. 9 6. 3 1. 5 6. 3 3. 4 6. 3 2. 8 6. 3 80 .2 6. 5 7. 5 13 .4 2 77 .0 6. 5 7. 5 13 .2 9 1. 56 6. 4 3. 2 6. 4 2. 1 6. 4 1. 4 6. 4 3. 4 6. 4 3. 0 6. 4 0. 4 6. 4 1. 0 7. 4 1. 1 0. 8 7. 0 1. 0 Appendix-C Setting up Peripherals Before writing the setting up code for the devices, all the constants that have to be used in the source code have been defined. Apart from that a set of variables are defined to make it easier to access memory locations. #define up #define down count 0x21 packet 0x22 temp 0x23 digit 1 0x24 digit2 0x25 digit3 0x26 digit4 0x27 digit5 0x28 digit6 0x29 digit7 0x2A digit8 0x2B Status_temp equ 0x2C tl equ 0x2D t2 equ 0x2E t3 equ 0x2F L_byte equ 0x30 H_byte equ 0x31 R0 equ 0x32 R1 equ 0x33 R2 equ 0x34 t4 equ 0x35 t5 equ 0x36 t6 equ 0x37 minimum equ 0x38 maximum equ 0x39 counter equ 0x3A cur_turbidity equ 0x3B set_turbidity equ 0x3C w_t urbidity equ 0x3D 80 time equ Ox3E pclath_turbidity equ 0*3F flag equ 0x40 send_spi macroaddress, no ;macro for SPIsending movlw address call data_send movlw no call data__send endm The include file PIC16F876.inc is included to let the MPLAB compiler to understand which device of the family is being used. include "PIC16F876.inc" _config _cp_off&_WDT_OFF&_BODEN_off&_PWRTE_off&_XT osc list At the beginning of the device the port and variable initialization step starts. The following code fragment depicts what are the registers that have to be initialized in this manner. Reset vector and Interrupt vector originating locations are mentioned with two 'goto' lables. org 0x000 goto start org 0x004 ;timer 1 interrupts used with internal oscillator, MAX7219 display TRISC b'ooooooir TRISC OxFF TRISB TRISA TRIS A, 1 OPTION REG start banksel movlw movwf movlw movwf clrf bsf banksel 81 clrf bsf bsf banksel clrf clrf clrf clrf movlw movlw clrf clrf clrf clrf movlw movwf movlw movwf clrf movlw movwf movwf movwf movwf movwf movwf movwf movwf Initialize banksel turbidity movlw movwf clrf banksel movlw movwf OPTION_REG OPTION_REG,7 PIE 1,0 PORTC PORTC PORTA PORTB ADCONO OxOD T1CON flag TMR1H TMR1H TMR1L 0x02 time OxCO INTCON PIR1 OxOF digit 1 digit2 digit3 digit4 digit5 digit6 digit7 digit8 ADCONO ;RA1 input is the Analog input proportional to 0x49 ADCONO PIR1 ADCON1 0x84 ADCON1 82 clrf ADRESL banksel ADRESH clrf ADRESH clrf H_byte clrf L_byte SPI banksel SSPSTAT clrf SSPSTAT banksel SSPCON movlw 0x30 movwf SSPCON movlw 0x02 movwf packet Start banksel PORTB clrf PORTB movlw B'01000001' banksel O P T I O N R E G movlw B'10000111' movwf O P T I O N R E G movwf ADCONO clrf TRISB movlw B'00001110' movwf ADCON1 banksel PORTB Main Wait ; clear PORTB ; Fosc/8, A/D enabled ; TMRO prescaler, 1:256 (20ns) ; PORTB all outputs ; Left justify, 1 analog channel ; VDD and VSS references btfss goto bcf bsf btfss goto movf movwf INTCON,TOIF Main INTCON,TOIF ADCONO,GO PIR1,ADIF Wait ADRESH,W PORTB ; Wait for TimerO to timeout ; Start A/D conversion ; Wait for conversion to complete ; Write A/D result to PORTB 83 clrf PORTB send_tur movelw andwf movwf swapf movlw andwf movwf movlw andwf movwf movlw andwf btfss goto movlw movwf test_turl movlw andwf btfss goto test_tur2 movelw xorwf btfss goto movlw movwf send_turl movlw call movf call movlw call ; sends current turbidity to the displ; OxOF R2,w digit 1 R2,f OxOF R2,w digit2 OxOF R l , w digits OxFF digit3,l STATUS,2 test_turl OxOF digit3 OxFF digit2,l STATUS,2 send_turl OxOF digit3,0 STATUS,2 send_turl OxOF digit2 0x04 data_send d i g l t 4 ' ° ; digl data data_send 0x03 data send 84 movf call movlw call movf call movlw call movf call return send_initial movelw andwf movwf swapf movlw andwf movwf movlw andwf movwf movlw andwf btfss goto movlw movwf test ini t ia l 1 movlw andwf btfss goto test_initial2 movelw xorwf btfss goto digit3,0 data_send 0x02 data_send digit2,0 data_send 0x01 data_send digit 1,0 data send ; dig2 data ; dig3 data ; digl data ; sends initial turbidity to the display OxOF R2,w digit5 R2,f OxOF R2,w digit6 OxOF Rl ,w digit7 OxFF digit7,l STATUS,2 test ini t ial 1 OxOF digit7 OxFF digit6,l STATUS,2 send_initiall OxOF digit7,0 STATUS,2 send initial 1 85 movlw movwf send_initial 1 movlw call movf call movlw call movf call movlw call movf call movlw call movf call data_send return ADC banksel bsf goto loop oop btfss goto bcf banksel movf movwf rrf banksel movf banksel movwf OxOF digit6 0x08 data_send digit8,0 data_send 0x07 data_send digit7,0 data_send 0x06 data_send digit5,0 data_send 0x05 data_send digit 1,0 ; digl data ; dig2 data ; dig3 data ; digl data ; Analog to digital conversion and current turbidity update ADCONO ADCONO,2 PIR1,6 loop PIR1,6 ADRESH ADRESH,w H_byte H_byte,l ADRESL ADRESL,w L_byte L_byte 86 rrf movlw andwf movf movwf return compare movf subwf btfss goto goto H_byte,l 0x01 H_byte,l L_byte,0 cur tur cur_tur,0 ini-tur,0 STATUS, 1 ON compare ;routine used to compare current turbidity with initial turbidity 87 Appendix-D Turbidity (NTU) Dossage (l/min) Movement (°) Turbidity (NTU) Dossage (l/min) Movement (°) 4 10.20 91.8 54 12.87 115.9 5 10.25 92.3 55 12.93 116.4 6 10.30 92.7 56 12.99 116.9 7 10.35 93.2 57 13.04 117.4 8 10.40 93.6 58 13.10 117.9 9 10.45 94.1 59 13.16 118.4 10 10.51 94.6 60 13.22 118.9 11 10.56 95.0 61 13.27 119.5 12 10.61 95.5 62 13.33 120.0 13 10.66 95.9 63 13.39 120.5 14 10.71 96.4 64 13.45 121.0 15 10.76 96.9 65 13.50 121.5 16 10.82 97.3 66 13.56 122.1 17 10.87 97.8 67 13.62 122.6 18 10.92 98.3 68 13.68 123.1 19 10.97 98.7 69 13.74 123.6 20 11.02 99.2 70 13.79 124.1 21 11.08 99.7 71 13.85 124.7 22 11.13 100.2 72 13.91 125.2 23 11.18 100.6 73 13.97 125.7 24 11.23 101.1 74 14.03 126.3 25 11.29 101.6 75 14.09 126.8 26 11.34 102.1 76 14.15 127.3 27 11.39 102.5 77 14.21 127.9 28 11.45 103.0 78 14.27 128.4 29 11.50 103.5 79 14.32 128.9 30 11.55 104.0 80 14.38 129.5 31 11.61 104.5 81 14.44 130.0 32 11.66 105.0 82 14.50 130.5 33 11.72 105.4 83 14.56 131.1 34 11.77 105.9 84 14.62 131.6 35 11.82 106.4 85 14.68 132.2 36 11.88 106.9 86 14.74 132.7 37 11.93 107.4 87 14.80 133.2 38 11.99 107.9 88 14.86 133.8 39 12.04 108.4 89 14.93 134.3 40 12.10 108.9 90 14.99 134.9 41 12.15 109.4 91 15.05 135.4 42 12.21 109.9 92 15.11 136.0 43 12.26 110.3 93 15.17 136.5 44 12.32 110.8 94 15.23 137.1 45 12.37 111.3 95 15.29 137.6 46 12.43 111.8 96 15.35 138.2 47 12.48 112.3 97 15.41 138.7 48 12.54 112.8 98 15.48 139.3 49 12.59 113.3 99 15.54 139.8 50 12.65 113.9 100 15.60 140.4 51 12.71 114.4 101 15.66 141.0 52 12.76 114.9 102 15.72 141.5 53 12.82 115.4 103 15.79 142.1 | 88 Turbidity (NTU) Dossage (l/min) Movement (°) Turbidity (NTU) Dossage (l/min) Movement (°) 104 15.85 142.6 155 19.19 172.7 105 15.91 143.2 156 19.26 173.3 106 15.97 143.8 157 19.33 174.0 107 16.04 144.3 158 19.40 174.6 108 16.10 144.9 159 19.47 175.2 109 16.16 145.5 160 19.54 175.8 110 16.23 146.0 161 19.61 176.4 111 16.29 146.6 162 19.67 177.1 112 16.35 147.2 163 19.74 177.7 113 16.42 147.7 164 19.81 178.3 114 16.48 148.3 165 19.88 179.0 115 16.54 148.9 166 19.95 179.6 116 16.61 149.5 167 20.02 180.2 117 16.67 150.0 168 20.09 180.8 118 16.74 150.6 169 20.16 181.5 119 16.80 151.2 170 20.23 182.1 120 16.86 151.8 171 20.30 182.7 121 16.93 152.4 172 20.38 183.4 122 16.99 152.9 173 20.45 184.0 123 17.06 153.5 174 20.52 184.6 124 17.12 154.1 175 20.59 185.3 125 17.19 154.7 176 20.66 185.9 126 17.25 155.3 177 20.73 186.6 127 17.32 155.9 178 20.80 187.2 128 17.38 156.4 179 20.87 187.9 129 17.45 157.0 180 20.94 188.5 130 17.51 157.6 181 21.02 189.1 131 17.58 158.2 182 21.09 189.8 132 17.65 158.8 183 21.16 190.4 133 17.71 159.4 184 21.23 191.1 134 17.78 160.0 185 21.30 191.7 135 17.84 160.6 186 21.38 192.4 136 17.91 161.2 187 21.45 193.0 137 17.98 161.8 188 21.52 193.7 138 18.04 162.4 189 21.59 194.3 139 18.11 163.0 190 21.67 195.0 140 18.18 163,6 191 21.74 195.6 141 18.24 164.2 192 21.81 196.3 142 18.31 164.8 193 21.88 197.0 143 18.38 165.4 194 21.96 197.6 144 18.44 166.0 195 22.03 198.3 145 18.51 166.6 196 22.10 198.9 146 18.58 167.2 197 22.18 199.6 147 18.65 167.8 198 22.25 200.3 148 18.71 168.4 199 22.33 200.9 149 18.78 169.0 200 22.40 201.6 150 18.85 169.7 201 22.47 202.3 151 18.92 170.3 202 22.55 202.9 152 18.99 170.9 203 22.62 203.6 153 19.05 171.5 204 22.70 204.3 154 19.12 172.1 205 22.77 204.9 89 Turbidity (NTU) Dossage (l/min) Movement (°) Turbidity (NTU) Dossage (l/min) Movement (°) 206 22.85 205.6 253 26.49 238.4 207 22.92 206.3 254 26.57 239.1 208 23.00 207.0 255 26.65 239.9 209 23.07 207.6 256 26.73 240.6 210 23.15 208.3 257 26.81 241.3 211 23.22 209.0 258 26.89 242.0 212 23.30 209.7 259 26.97 242.8 213 23.37 210.3 260 27.06 243.5 214 23.45 211.0 261 27.14 244.2 215 23.52 211.7 262 27.22 245.0 216 23.60 212.4 263 27.30 245.7 217 23.68 213.1 264 27.38 246.4 218 23.75 213.8 265 27.46 247.2 219 23.83 214.4 266 27.55 247.9 220 23.90 215.1 267 27.63 248.6 221 23.98 215.8 268 27.71 249.4 222 24.06 216.5 269 27.79 250.1 223 24.13 217.2 270 27.87 250.9 224 24.21 217.9 271 27.96 251.6 225 24.29 218.6 272 28.04 252.4 226 24.36 219.3 273 28.12 253.1 227 24.44 220.0 274 28.20 253.8 228 24.52 220.7 275 28.29 254.6 229 24.60 221.4 276 28.37 255.3 230 24.67 222.1 277 28.45 256.1 231 24.75 222.8 278 28.54 256.8 232 24.83 223.5 279 28.62 257.6 233 24.91 224.2 280 28.70 258.3 234 24.99 224.9 281 28.79 259.1 235 25.06 225.6 282 28.87 259.8 236 25.14 226.3 283 28.96 260.6 237 25.22 227.0 284 29.04 261.4 238 25.30 227.7 285 29.12 262.1 239 25.38 228.4 286 29.21 262.9 240 25.46 229.1 287 29.29 263.6 241 25.53 229.8 288 29.38 264.4 242 25.61 230.5 289 29.46 265.2 243 25.69 231.2 290 29.55 265.9 244 25.77 231.9 291 29.63 266.7 245 25.85 232.7 292 29.72 267.4 246 25.93 233.4 293 29.80 268.2 247 26.01 234.1 294 29.89 269.0 248 26.09 234.8 295 29.97 269.7 249 26.17 235.5 296 30.06 270.5 250 26.25 236.3 297 30.14 271.3 251 26.33 237.0 298 30.23 272.1 252 26.41 237.7 299 30.31 272.8