Sunteți pe pagina 1din 14

ATS1: Automated Titration System

Frank Bonilla, Noel Mendoza, Olaleye Olayinka, Jonathan Sanchez, BrianSwager, Christopher Tabarez Advisor: Dr. Solomon Oldak California State Polytechnic University, Pomona Department of Electrical and Computer Engineering

Abstract
The objective of this document is to provide a clear and concise instruction manual and summary of the automated pH titration system we designed. The explanation of the control systems operation, software logic implementation, control philosophy, and materials used in the hardware production, as well as highlighting its primary uses and applications in industry will be discussed. Related topics included will be some background on pH control, the materials and equipment applied to the physical construction of the system, its basic function in terms of pH control, the problems encountered along with the solutions, and the control logic concepts and programming used in designing the control system. time period. The design team was charged with the task to build a system that will respond to a changing pH level and maintain stability. The goal of the team was to design a professional and optimal system that enables a user full control locally in the field, in the control room, or even while away from the process. The ATS1 project consists of various design components including a couple of subsystems that were implemented by the ATS1 engineering team. 2. Theory and Experimentation The unit of measure pH is used in determining the acidity or alkalinity of a solution. The pH value of a liquid is determined by the hydrogen ion concentrations in the solution. In the simplest terms, if the solution has an excess of hydrogen ions, it is said to be acidic, and if the solution has a deficit of hydrogen ions, it is said to be alkaline. To ensure successful system design and implementation of a pH control system, a proper understanding of the control loop and the selection of the appropriate control strategy had to be established among our group. Also attainment of designing a successful pH control system relied heavily on the ability to recognize and avoid many potential pitfalls during the specification and installation phase of the control pumps, tubing, mixing equipment, circuit logic, positioning of the reagent tanks and treatment containment, and electrode. For this project, the more we were able to measure any aspect of the control system, the more control we could have over the process. The process variable (PV) for our project is pH, which is the negative logarithm of the hydrogen ion activity in a liquid. For the purposes of this unit of measure, hydrogen activity can be thought of as equivalent to concentration. The lowercase p 1

1. Introduction to pH Control Processes are becoming more automated due to strict regulations by government agencies, the intention to preserve plant equipment such as boilers, and the high demand in being able to monitor and automatically control a certain process. Industries such as petrochemical, water distribution/treatment, manufacturing, and others have leaned towards automated control to reap the benefits of automating a process. Automation reduces error, decreases human dependability and contact, especially if the process is considered dangerous or a health hazard, executes everyday jobs/tasks more precisely and carefully, and can implement 24 hour operations more effectively without worrying about manual labor just to name a few. Our project is an attempt to automate the process of pH titration. The system controls the pH level in which the user can set, monitor, and recordthe process variable (pH) trend for a given

designates the mathematical relationship between the ion and the variable as a power function, while the capital H designates the ion as hydrogen. Therefore the result is a measurement of pH or the power of Hydrogen. Straightforwardly put, the more hydrogen ions there are detected in a liquid (H+), the more acidic the pH is. The more hydroxyl ions (OH-) there are means the more alkaline the liquid is. The standard pH scale is from 0-14 and the neutral point is at 7 at 25 degrees Celsius (known as neutral point on the titration curve, hydrogen ion concentration equals the hydroxyl ion concentration). However, through research we found that concentrated sodium hydroxide can reach a pH of 19 while concentrated sulfuric acid has a pH value of -10. These extremities however, would not allow for pH electrode accuracy, as the actual physical electrode in addition to its accuracy would deteriorate upon contact with those extreme pH levels. Our project did have limitations due to safety issues and reagent availability, as we were able to optimize our system to control within the range of 310 on the pH scale. The system the group designed, is similar to the standard pH control system with the exception of the control logic used (PI for the closed loop control and PWM for the pump motor control versus the more traditional or standard time delay using relays to control pumps on/off with dead band configuration). Our system is comprised of the following: a pH electrode, pH transmitter, feedback controller, agitator, treatment tank, acid and base tanks/ control pumps, discharge/release pump/tank. The reagents used in the project were soda ash for the base reagent and hypochlorous acid or muriatic acid for the acid reagent. Problems such as tube run issues which caused continuous flow (siphoning) due to the absence of control valves were some difficulties we had to overcome by modifying our mounting and placement of tubing and tanks. Chemistry issues such as molar calculations and acid base dissociation for our reagent solution were problems we faced and had to do research to find simple calculations for the chemistry involved. Multiple test and experimentation led to the correct ratio of acid and base reagents solution made by mixing the base and acid powder and plotting the data using different ratios. The realization that the pH electrode could do the calculating of the hydrogen ion concentration/activity was advantageous once

determining the reagents used were based on a 2:1 ratio (strong base weak acid) where the base powder which was at 11 pH was twice as much more effective in bringing down the pH compared to the acid powder which was at around 2.5 pH. 5000 mL of tap water was used for both acid and base reagents. Once this was figured out, the issue was resolved by applying twice as much base in the 5000 mL volume for base tank. Based on the acid and base reagents, a strong base and weak acid was the most implemented system in our experimentation and testing, which led to further compensation of the system by diluting the strong base, to minimize the continuous overshooting of the set point. For example, successful titration was accomplished using four teaspoons of base powder and only two teaspoons of acid powder. Four different systems were available to the group in terms of acid and base configuration. Strong acid and strong base is the first one. This pH system has the maximum slope and range of steep slopes compared to the other three and is symmetrical about the equivalence point. The other systems give different titration curves and are as follows: a weak acid and strong base system, a strong acid and weak base, and a weak acid and weak base. Each one of these systems will give an S curve and acid and base dissociation are usually taken into consideration. However, there was not much thought or consideration to this in detail when designing our control system, which the group probably should have focused more on to obtain even more control of the process. The plan for controlling the flow of the entire process without the use of control valves quickly became one our greatest challenges. We were able to control the flow of the acid and base reagents to the treatment tank as well as the release of the treated liquid by using pumps only, and meticulously constructing the piping to ensure the pumps would control automatically, and thus controlling the pH value inside the treatment tank. The regulation of the reagent flow without the use of control valves was also successful by controlling the flow with PWM logic using LabVIEW software. For example, to change the pH value of water which has a pH value near 7 to a pH of 10(this increases its alkalinity), the base pump which contained a certain concentration of soda ash would need to flow into the treatment tank.

3. Instruments, Materials

Equipment/Tools

and

As with all control systems, the accuracy of the measuring devices and sensory apparatus, and materials are vital to the overall performance of the system. The following is a list of items needed in order to build a similar pH control system. (Note: Items listed do not need to be exact in dimension or other detail since most of these items were chosen for demonstration purposes and chosen due to the availability of resources. For example the pH probe we used was a glass electrode type with temperature compensation and was the most accurate probe available and borrowed for project use. Also instead of using wood, other materials can be used to construct the physical structure.) The cost of the materials are also included if we had to purchase some items. The prices are included just to give an idea of how much it costs to fund the entire project, and are based on the groups resources and means of obtaining them. Some of the components and materials of our project we obtained for free or borrowed and will have a $0 for the cost. o Glass containers for acid tank, base tank, and treatment tank. Glass is preferred for transparency; however any chemical container will work for this same purpose. $0 Wood for structural housing and base for tanks. $30 PVC piping, couplings, elbows and other fittings for the mounting of the tubing and the mounting of the pH sensor and protecting of glass electrode. $10 Plastic tubing 3/8 O.D. (depending on pumps hose size may vary) and 6 to 8 feet long. $6 12VDC Chemical pumps (3). Voltage can vary depending on circuitry. $30 Pool/Spa Acid and Base powder. $20 Router for wireless data acquisition for Android Tablet/Phone and iPad/iPhone. $0 Atmega328P or Arduino board. $25 Laptop with LabVIEW software (Student Version 2011). $0 Various screws, clamps, wiring, and related accessories. $5

o o o o o o o o o o o o o o

o o o o o o o o o

o o

Agitator (motor with magnetic attachment on spindle or air agitator (fish tank oxygenator) . $0 Magnet for motor agitator or if using air agitator, air hose is required. Spray paint for cosmetics. $5 Labels. $0 Various LEDs and resistors. $12 2N222A BJT SMD transistors. $0 TI uA7805Voltage regulator. $0 Various surface mount capacitors. $0 250 ohm resistor. $0 pH probe/pH indicator (Rosemount 56 with 4-20 mA output). $0 Ultrasonic Sensor. $20 Plexi Glass for ultrasonic sensor mounting and circuit board window. $0 Various wire for the wiring up of the pumps and LEDs. $5 Two measuring cups (mL) for chemical acid/base solution.$2 Containers such as 2 Liter soda bottles for storing the acid and base reagents and mixtures. $0 Safety Glasses and gloves. $0 Plastic or metal (non-aluminum) 12 inch stirrer. $0 Modem cable for router. $0 Hinges for the access panel door (the back of structure). $5 Tie wraps for wiring.$5 T/C or RTD temperature sensor if not combined with pH electrode $0 1N4003 SMD Diodes $0 Push button $3 FTDI Breakout Board. $6

Tools
o o o o o o o o Drill/Drill bits Hand saw Jig saw Screw driver, hammer, etc. Multimeter Oscilloscope Leads Variable Power Supply

o o o o o o

4. Important System Equipment 4.1. Agitator


Agitation is a key feature to our project. Stagnate liquid can give false pH readings when sensing pH values with a fixed positioned probe. An agitator will help in mixing the liquid and evenly distributing the acid or base during the titration process. A continuous agitation was implemented to optimize pH sensing. Once acid or base is introduced into the solution and agitation takes place, the added chemical begins to disperse in all directions uniformly all through the solution. This not only prevents pockets of concentration within the solution but it also allows for the added chemical to settle more quickly, in turn, giving a more accurate pH reading. We required a mixer to help circulate the added base and acid reagents. Using an air pump as an agitator initially caused the liquid to bubble when the pH levels were in the higher range of the pH scale. This, in turn, affected our level sensor and we opted for a motor with a magnetic attached to the shaft while another magnet was place on the bottom of the titration tank which rotated along with the motor. This rotating magnet worked much better because the rotation speed could be varied with a pot, and it did not cause the liquid to bubble. The mounting of the motor worked out well with our treatment tank base coincidentally being the same size.

Figure 1 Ultrasonic Sensor

4.3. pH Electrode and pH Meter The pH meter by Rosemount Analytical Model 56 was used along with a glass electrode sensor to provide for an accurate pH value. The sensor is comprised of a RTD element for temperature reading and a glass electrode, reference electrode, and encased liquid buffer. This electrode is very fragile and proper calibration and maintenance was performed throughout the project design. The analog signal was outputted to the Arduino board and shunted with a 250 ohm resistor to provide for the 4-20 mA signal. (1-5 VDC with internal 24 VDC power loop).

4.2. Ultrasonic Level Sensor


Ultrasonic level sensors are utilized for detecting the level of liquids. By emitting high frequency waves and having them reflect back to the transducer, the level of liquid inside a tank can be detected. We positioned this sensor above the treatment tank strategically to allow for level detection of the treatment tank. A permissive control feature was implemented in the code to start and stop the process by detecting a certain level in centimeters water column inside the treatment tank.

Figure 2 pH glass electrode

Figure 3 pH meter

4.4. Control Pumps


The control pumps used in the design were small dosing micro mini 12 VDC chemical pumps. Initially our pumps were rated at a lower voltage, but needed to upgrade the pumps to be submersible and more powerful.

Figure 4 DC Control Pump

5. Software Design 5.1 LabVIEW


Programming the Arduino in LabVIEW is no different than using LabVIEW for any other programming task. The only difference that the LIFA toolkit provides is a set up blocks that allow the user to interface with the I/O specific pins on the Atmega chip. Under the block diagram view of LabVIEW there is an added menu to the functions toolbox called Arduino. We will be using these blocks to initialize ports and set PWM ports later. This groups LabVIEW code was broken up into a seven stage process in order to fully implement the PID controller along with safety measures as well. 5

Stage one is the initial AtmegaI/O pin setup. The first block to be placed is the Arduino/Init block which to that is attach a VISA Resource control which specifies which COM port our Atmega chip is connected on the computer. This Resource connection needs to be daisy chained throughout the rest of the code and to any other Arduino blocks and finally terminated at the end of the loop with an Arduino/close block. The error signal from this resource also needs to be passed through the entire system as well. The next nine blocks from left to right of type Arduino/low level/Set digital Pin are inserted. The blocks one through seven are connected to an Output constant and pins are set as follows: Base (pin 11), Acid (pin 10), Start (pin 9), Drain (pin 8), LED3 (pin 5), LED2 (pin 4), Trig (pin 3). Blocks eight and nine are connected to an Input constant; these are LED1 (pin 7), and Echo (pin 2). In stage two you create a while loop including a wait ms block set to 150ms so that the process doesnt utilize up all the CPU power when running. Inside of this outer while loop are three manual pump controls override processes created by if loops. The first one is for the drain pump; within in this if loop in the true state is a Digital Write Pin and to this a constant of two hundred and fifty five is written to the value input, also a constant with the pin number for that pump is an input. For the false state is the same objects but zero is the value of the constant instead. Within the second if loop which controls the acid pump is two Digital Write Pin blocks. One is for controlling the pump, and the other controls the LED associated with that pump. For the true statement attached to the first write for the pump is the constant of two hundred and fifty five along with pin constant of nine. The third and last if loop controls the base pump and is exactly the same as the acid pump with the exception of changing pin values from the acid to base pin value nine to eleven respectively, and the LED pin value from pin four to pin five. Up to this point the user should have an outer while loop with initializing blocks outside of it and within it then the three manual pump controls in if loops. In stage three, within the outer while loop, there is another if loop that is used for our manual start button control. There is a Digital Read Pin block with an input of the start button pin 7 which reads if the manual start button has been pushed and will output a Boolean value of one or zero. The output is

fed into an or gate with a shared start button variable (which is discussed later in Ipad HMI section) the result of this gate is what controls the if loop to move on with the code. If the user has not pushed the start button to start the process then then the system just stays in a stable loop wait for this event to happen. In stage four, the ultrasonic sensor is polled to see where the level of our main tank is at prior to starting the titration process. In order to have a consistent processes each time we activate the drain pump and remove enough liquid to a level that we have pre-defined from previous tests. Inside of that if loop is a while loop that contains a wait mswith a value of 150 ms to loop through the tank reading procedure. In this while loop is a less than or equal block which compares the desired set point with a local variable from a parallel process that is running constantly checking the tank level (discussed later). Also within this while loop is a local Boolean variable called Titrating which is set to true and is used as an indicator for the rest of the system to know that the titration process has started. Inside this while loop is yet another if loop that waits for the tank level condition to be met. Once it has been met then it sets a local variable called Drain to false which shuts off the drain pump and send a zero to the acid pump using a Digital Write Pin block. Stage five is our main titration loop in which several processes are implemented. These are all within a while loop with a delay ms block set to 250ms. This loop includes the PID controller, the Acid/Base control logic, and the exit logic to exit from the process once it has determined a steady state for a certain length of time. The pH reading from pin 0 is always being read in a parallel loop (discussed later) and being set as a local variable called actual. Our PID control sub VI block consists of a while loop and within it is a Formula Node . This enables us to accept several inputs and to manipulate then with a C programming language instead of needed to do the same process using the native graphical approach of LabVIEW. This block has several inputs; they are as follows: Old Error (olderr), Set Point(sp), Process Variable (pv), Maximum (maxim), Minimum (minim), P,I,D. The outputs are Error (err), pH Comp (co), Proportional (prop), Integral (integ), Derivative (deriv), and finally Error Sum (errsum). The error is calculated by subtracting the pv from the sp. The errsum is just

an accumulation of the error over time. Prop is p times err; integ is i*errsum; derive is d times err minus older divided by the change in time. The max and mins are to set a ceiling and floor value so that the integral value does not fly away. Our input to this block is the desired control from the front panel to the pv input. The Actual local variable goes into pv; the controls pid min and pid max are input into the min and max inputs. Lastly our P, I and D values are input from the front panel layout. Once we have our ph Comp output we then filter it through a round to Int block and then take the absolute value of it. This value is then passed on to the Acid/Base Pump control logic. This control logic starts off with an if loop that checks if the pH error value is within a certain tolerance. This check was accomplished by checking the error that is output from the PID sub VI block feeding that into an In Range and Coerce block, along with the upper and lower error limits desired. We set these as control in the front panel but then didnt display then on the final design. When the error is within this range then in the if loop there are four blocks used. Two Digital Write Pin for the Acid and Base pump to stop the processand two for the Acid and Base LEDs to turn them off. To stop the Acid and Base pumps a zero constant is attached to the input value pin, along with the pin for that pump (i.e. 9 for Acid and 11 for Base). Then continuing through a zero is written to the LED pin 4 which will turn it off. This process is duplicated for the Base pump as well. Local variables for Base and Acid are set to false so the rest of the system is updated. If that if loop condition is false that means that the titration process is still going on and there needs to be logic to turn the correct Acid/Base pump on or off. This is done by having a second if loop within the last one whose case selector is governed by if the error from the PID sub VI is positive or negative. Knowing this sign will then in turn inform us of if the total pH of the system needs to be raised by adding more Base or lowered by adding more Acid. In the true state the Base is turned on by using a Digital Write Pin block on pin 11 with a duty cycle input from the output of the PID filtering. The corresponding LED for this pump is turned on by the same means as before. The local variables for Base are set to true and Acid is set to false. The Opposite is true for the false case the Base is turned off and the acid is turned on. The Arduino Resource connection and error are then

continued outside of the titration while loop and using Digital Write Pin blocks Pins 9 and 4 or set to a zero value which turns the Acid and Base pump along with their corresponding LEDs. Local variables Acid, Base, and Titrating or all set to False. This indicates that the system is done completely. These connections are brought through the overall while loop into an Arduino Close block to terminate the connection to the Atmel chip and then the error value is passed on to a simple error dialog which will display an message box showing any errors that happened for debugging purposes. The last item that is incorporated within the Titration loop is the pH Exit Sub VI. This code determines when the pH value is in a steady state over a certain time period or not. It achieves this by tunneling through the Titration while loop to pass the values needed to populate the array that it uses. Outside the while loop is an initialize array block that initializes the entire array to zero. And there is a control which sets the Array Size. The connections are fed through the while loop and into the sub VI. The sub VI outputs the index incremented and the new array. This logic is based on a circular array in which the pH error variable is compared to a tolerance using a to within Tolerance block if this output is true then a Boolean of true is added to the first element of the array if it is false then a value of zero is added to the array. This process repeats until the entire array is filled. Then within an if loop to check to make sure the array is full then a logical and is performed on the entire contents. If all values are one then the output would be one meaning the pH value is in a stable state for the entire length of the array. The final part of the code to detail is the parallel processes that we incorporated. There are four of them. The first of these is within a while loop below the outer most while loop the tank level is constantly polled. The Echo (pin 2) and Trigger (pin 3) pins are fed into the Ultrasonic Sensorblock, this then outputs the distance in centimeters and is subtracted from the desired distance set point for our tank. The output is passed on to the tank level control, a Tank Level local variable and a Current Level indicator. The stop condition for the while loop is tied directly the Reset local variable that is in the system. If there is any button or process that triggers that reset then

the process will be stopped. The next parallel process is to obtain the pH value from pin 0. An Analog Read Pin block is used to read the analog value of the feedback from the pH probe in mV. The average of this voltage over a five sample range is taken and then divided by a two hundred and fifty ohm resistor to convert the value to mA. This mA value now corresponds to a 4mA to 20 mA range. Lastly we take this range and convert it to an appropriate pH Value reading and output it. This is set in the local variable called Actual. After this resource is then closed with an error handler like before. This is standard practice and is assumed to be practiced throughout the rest of this project. The third processes works in conjunction with the tank level loop. Within this while loop there is a ms delay timer set at 250ms. There is also an if loop that checks to see if the Titrating variable is true if we are titrating then the drain needs to be turned on to lower the tank level to the appropriate level. The last process just constantly loops through polling each local variable and assigning them to a Boolean value to be applied to each LED indicator.

5.2 iPad Human Machine Interface


In order to create an element of portability to this project so that the end user would be able to not only monitor the titration process going on, but also be able to have control over that same process. This team accomplished this by utilizing a program called Data Dashboard for the iPad which is available in the ITunes AppStore for free. After this software is downloaded and installed you can create a dashboard HMI (Human Machine Interface). This is done by simply dragging and dropping each control or indicator that you want to display on your HMI. The group's implementation included a graph to display the current pH value, and text boxes to show numerically the current and desired pH set point. We also implemented a numeric display for the current tank level. Lastly we provided manual overrides for each of the three pumps (Acid, Base, and Drain), along with all the corresponding indicator lights. From this HMI the user is able to remotely start/stop the process, override the pump controls, and set the desired pH value.

gives the end user the option to walk around so they are not tied down to the computer, which in turn means more productivity will get done.

5.3 Arduino Arduino Setup and Supporting Software


In order to control our Automatic Titration System effectively the group decided on utilizing a PID controller to control the pumps through a pulse width modulation signal. By doing the user can control the speed of the motor which will give more control over the entire ntire process. This group decided to us a software package called LabVIEW which is created by National Instruments. The first step that needs to be accomplished is an initial setup phase which will make it able to run LabVIEW code on the Atmega 328 microprocessor. First, the user needs to download a few different software packages and install them. These are as follows: 1. ( Student LabVIEW) 2. (NI Visa Drivers) Required Drivers 3. (VIPM) Virtual Instrument Package Manager LabVIEW 4. (Install LIFA) for Arduino Toolkit 5. (Arduino Software) Figure 6 LabVIEWDatadashboard for iPAD HMI In order for this HMI to work with the LabVIEW VI there are a couple steps that need to be done to the LabVIEW code. The first of these is you need to convert the VI (Virtual Instrument) into a LabVIEW project. Once this is done then you need to create shared red variables for each data member that you want to transmit wirelessly. Lastly you need to have the computer you are running the LabVIEW code on to be connected to the same wireless network that the Ipad is connected to. Once that is done and you know the IP address of the computer you can connect each control or indicator on the HMI to that IP address and it will display a list of the shared variables that are able to be connected to. This remote aspect of our project is a great addition to the project especially specially if it is in a large plant. This feature Once all of the above has been installed then you need to use the Arduino software to program the Arduino chip with the LIFA_BASE.ino file located at C:\Program Files (x86)\National (x86) Instruments\LabVIEW LabVIEW 2011\vi.lib\LabVIEW 2011 Interface for Arduino\Firmware\LIFA_Base\ \LIFA_BASE.INO. Once this is programmed onto the Atmega chip then you will be able to program the Arduino with LabVIEW code and use it as an I/O board for all of the input and outputs needed for this project.

Figure 5 LabVIEW HMI

6. Physical Hardware Design


In approaching the physical structure of our control system, the three things we considered were mounting and routing of the piping process, pump

and probe placement/positioning, access to circuitry and terminals, mobility, and process indication just to name a few aspects. The hardware ardware design played a very important role in the automated titration system. Poor selection of wood results in a short-lived lived frame upholding the titration system especially since liquids are involved. Proper wiring installation ion is also vital as it ensures reliability in the system.

and begins to crumble when wet. Because the automated titration system dealt with liquids, employing this media as the structure to sustain tanks and measuring instruments no longer became a sensible choice. Therefore, as seen in Figure 9 below, sanded plywood became the most practical choice by taking into account its resistance to damage meanwhile remaining economically feasible.

Figure 7 Structural Frame Front View

Figure 9 Structural Frame Front View Since the automated titration system relies heavily on liquid solvents in order to titrate, the plywood employed to uphold the system needed to be protected from damage caused by potential leaks. Oil-based based paint and primer was employed to seal the wood and provide vide a layer of protection to the wooden structure. Water-based Water paint was considered as it also supplies a coat of protection. However, water-based based paint is less effective in repelling water, whereas oil-based based paint provides a superior seal and repels water ter better. Furthermore, cut outs were made on the boards facing the user so as to equip the user with a physical status of components in the system. The first cut out was made on the structure that houses the waste tank. The purpose of this is to allow all the user to physically see and be aware of the real level of the waste tank in order to take necessary measures should the tank level reach near its capacity. The second cut out was below the pH indicator which houses the central printed circuit board as well as other electrical components. The main purpose of the second cut out is to check wiring of the inputs and outputs at a glance.

Figure 8 Structural Frame Rotated Side View

6.1. Structure Material


Lumber was carefully selected in order to prevent structural damage meanwhile retaining an economical advantage. Although particle board is the most economical choice, due to the nature of the project, using particle board would create potential structural tural harm. In detail, particle board expands 9

structures and gave full admission to the control circuitry as well l as the waste tank.

Figure 10 Cut Out For Control Circuitry

Figure 12 Panel Door Access Hinges

7. Printed Circuit Board (PCB)

Figure 11 Cut Out For Waste Tank (Level Gauge) Moreover, easy access was heavily considered throughout the design of the whole structure. A clear objective was that repairs and replacements should be relatively effortless to perform and components for additions ons and installments be easy to access. For this reason, hinges were installed on the rear side of the titration system to have cabinet cabinet-like doors. These were installed on the two largest Figure 13 PC Board In many cases, buying an off-the-shelf off microcontroller development board, such as the Arduino UNO or the Texas Instruments (TI) MSP430 Launchpad, would be good enough to complete almost any project. They provide enough processing power, digital I/O, and analog nalog inputs to complete the task we have set out to achieve. But they do not offer a professional, customized solution for a project, nor 10

an easy solution to getting rid of the clutter when using jumper wires to interface external circuits, built on the breadboard, with these development boards. Often times, these development boards provide unnecessary circuitry and components, which is good at times, but it does add cost. For example, the Arduino UNO had extra ICs and components that we did not need for our purpose, by removing these components, increased space for needed components significantly. Because of the interface issue and the need for other circuitry, we decided to design a custom printed circuit board (PCB), which was sent to manufacture at a company called OSH Park based in Oregon. Making the PCB allowed us to design an all-in-one solution for our project. On the PCB, we included the reduced version of the Arduino, terminal connectors for I/O, pulsewidth modulation (PWM) pump driver circuit, two voltage regulator circuits, a specialized 250 resistor, a 6-Pin male header, and a DC jack. For the Arduino circuit, we reduced the circuit significantly to a few surface mount capacitors, a 16MHz crystal, a reset switch, a resistor, and the actual Atmel ATMega328P IC. In comparison to the development board, the component list was greatly reduced and suitable for what we needed it. Since we used stranded wire to connect panel mount components for our system, such as the start switch, LEDs, pumps, pH probe, and the ultrasonic senor, we decided it was best to utilized screw terminals on the PCB for secure wire termination. Included in the PCB, were three simple BJT pump driver circuits, for the acid, base, and drain pumps that were in our system. Because these pumps needed 12V and each only needed 250mA of current at max load, we decided to use 2N222A BJTs to drive the pumps, which easily met our specification. The circuits designed were basic BJT amplifier circuits, which were controlled by the 5V PWM signals in series with 1k resistors to provide up to 5mA to the base and able to provide our desired current through the pump and transistor. The pumps themselves were connected from VCC to the collector of the transistor and 1N4003 generalpurpose diodes, in a reverse bias configuration, were placed in parallel to the pumps. In the event that power is removed instantly or a power failure occurs, inductive current spikes can possibly occur in the inductive motors and released, which can be

dangerous. The diodes were placed purely for safety to reroute the inductive motor spikes and prevent damage to the board, pumps, or even people. As for power, we needed power to drive the three pumps and supply power for the ATMega328P IC. This required two different voltages, initially 6V for the pumps, later changed to 12V, and 5V for the ATMega328P. Since we decided to use a wall plug to power our board, we utilized the TI uA7805 voltage regulator to step down our input voltage to 5V for the micro-controller IC. Similarly, we utilized the TI LM317 variable voltage regulator to step down our input voltage to 6V for the initial pump voltages requirements. When we upgraded our pumps to 12VDC pumps, we no longer needed the extra regulation circuit, so we left the 6V regulator unpopulated and instead shorted the direct input voltage line and the 6V line. This allowed for the pumps to access the needed higher 12V line. One other feature of the PCB is we included a specialized 250 resistor, to be able to directly convert the 4-20mA signal from the Rosemount 56 unit, to a 1V to 5V signal. Having this resistor was very essential to have in the circuit because this allowed the ATMega328Ps analog to digital converter (ADC), to convert the voltage to a digital value for our program to utilize and interpret the pH values correctly in software. The last thing we implemented in the PCB was a 6-pin male header. This header was very important, as it acted as the interface between the FTDI board, we used for to communicate serially between the computer running LabVIEW, and the Atmel microcontroller. We could have used a proper USB connector for this, but it would have required extra ICs, the USB connector, and space on our board, which would have increased the cost significantly. It was easier to add the 6-pin header and buy the small board for a few dollars and use that. Overall, the board produced was very good and served its purpose well for the final project design.The placing of the components, on the PCB, was grouped by circuit function. The routing of the signals caused many challenges because of the many signals, which lead to needing a double layer PCB shown in the Figure.

11

Figure 14 PCB Routed Signals

8. Test Summary
In summary our pH control system performed as expected. Minor modifications in the code, adjustments to the acid/ base concentration and the installation of a push button to start the process were made to set up the system to complete 4-5 titrations with the volume of acid and base reagent (5000mL for each tank). The time for each titration to be completed depended on the set point and also how concentrated our reagents were. To complete a pH titration would take anywhere between 5 to 7 minutes. Referring back to our experimentation, the best results in terms of a fast settling time and over damped response were when we had a weak base and weak acid system. A strong acid and strong base system would give improved better control over a longer period of time (24 hours or more) with random disturbances resulting in numerous overshooting and oscillations before eventually reaching the pH set point. This system is typically found in many water treatment systems (Intercept and Effluent Out Flow). The pH control system if implemented using larger volume tanks and larger pumps would be able to perform efficiently.

applications it is used for. The stages to follow led to improvements in the LabVIEW code as well as successful debugging of the programming code, while the latter phases of our design resulted in moving towards more quality circuitry implementation with surface mount components and customization, the changing out of the initial pumps to a more appropriate set of pumps that would operate with higher voltage and fit the control logic scheme using PWM, as well as being able to withstand the exposure to our acid and base reagents. Due to acid and contamination and caustic corrosion, the structural design and containers were changed out to glass to improve the overall quality and safety of our design. In the designing of our automated titration system, the group learned more about closed loop control with feedback, pH control theory, chemistry and physics involved in the physical design of our system, designing a Human Machine Interface and Supervisory Control and Data Acquisition using LabVIEW programming, printed circuit board design, troubleshooting circuits, 4 to 20 mA analog process signaling, Arduino programming, and working in a team based environment. With all these things taken into consideration, the group was fortunate to have contributions in each of the different areas which resulted in a successful project.

10. References
[1] A. Michael. (2011, June 5). VISV Getting Started With the LabVIEW Interface for Arduino [Online]. Available:http://vishots.com/gettingstarted-with-the-labview-interface-for-arduino/. [Accessed: 11 December 2012] [2] Getting Started with NI LabVIEW Student Training, National Instruments,[Online] (2010, June 30). Available: http://www.ni.com/whitepaper/7466/en.[Accessed:15 February 2012] [3] Getting Started with the Data Dashboard for LabVIEW, National Instruments [Online] (2013, May 6). Available:http://www.ni.com/whitepaper/13757/en/. [Accessed: 11 May 2012]

9. Conclusion
There were many challenges the group faced from the beginning to the completion of the automated control system project. The preliminary stages of the project involved the group attending workshops and seminars in order to learn a new programming language LabVIEW, to researching pH control applications and reviewing chemistry equations such as the Nernst equation to obtain an improved understand of pH, and how it is measured and what 12

[4] YouTube. Building a PID Controller with LabVIEW and USB Data Acquisition Hardware. Youtube.com. [Online].Available: http://www.youtube.com/watch?v=qMydcfZ_ZSs. [Accessed: 7 April 2012]. [5] Instruction Manual, pH Sensor. [Online].Available.http://www.iccontrols.com. [Accessed: 24 October 2012] [6] ATMega 328P Datasheet, Atmel (2009, October) [Online].Available.http://www.atmel.com/Images/d oc8161.pdf. [Accessed: 5 January 2013] [7] LM317 Datasheet, TI (2013, February) [Online]. Available: http://www.ti.com/lit/ds/symlink/lm317.pdf [Accessed: 5 January 2012] [8] MMBT2222A Datasheet, TI (2010, August) [Online]. Available: http://www.fairchildsemi.com/pf/MM/MMBT2222 A.html. [Accessed: 5 January 2013] [9] MRA4003 Datasheet, TI (2008, September 22) [Online].Available: http://www.eicsemi.com/datasheet/MRA4003_7.pd f. [Accessed: 5 May 2012] [10] Home Depot [Online] Sanded Plywood Board. Available: http://www.homedepot.com/p/15-32-inor-1-2-in-x-4-ft-x-8-ft-4-Ply-BC-Sanded-FirPlywood-475743/100060758#.UbrHjpwqxBR [Accessed: June 13, 2013]. [11] Engineering Design with SolidWorks 2008 David C. Planchard (Author). [12] pH CONTROL. An Independent Learning Module From The Instrument Society of America. 1984 Gregory K. McMillan. (Author).

10.1. Video Link to Automated pH Titration System


https://www.dropbox.com/sh/4a4r3tm2eeqnzag/elT9 3iCRjh

Figure 15 Automated Titration System

13

14

S-ar putea să vă placă și