the mixing valve control system is an extension of the residential or commercial faucet in that it allows a user to interact with the system . the user can enter his or her desired temperature and the system responds by adjusting the mixing valve so the desired temperature is reached . the basic block diagrams for the mechanical electrical systems are shown in fig1 and fig2 . the microcontroller is the “ brains ” of the system . the microcontroller processes the signals going to the stepper motor and coming from the thermocouple , the position sensor , and the graphical user interface . the signals received from the thermocouple , position sensor and graphical user interface are used in the algorithm to compute the position of the mixing valve . once the mixing valve is in the correct position the desired temperature demanded by the user is reached . before the mixing valve control system becomes operational a calibration sequence must be initiated . the calibration cycle allows the system to adjust to the residential settings the user has and also allows for the creation of a calibration curve which will be used during the operation of the device . the following sequence occurs during calibration . before the operation of this device a calibration cycle must occur . the calibration cycle will allow the system to adjust to the user &# 39 ; s residential hot water heater settings . the hot water heater will affect the temperature of the water leaving the faucet therefore the system must compensate for this through the calibration cycle . the first step in the calibration process is for the installer / user to turn the mixing valve clockwise to the coldest position on the faucet knob . the installer / user must then push the calibrate button on the graphical user interface ( gui ) to begin part 1 of the calibration cycle . the position sensor will now read the position of the mixing valve . this value will then be stored in the microcontroller as p 1 . the temperature will also be stored at this point as tmin . now that tmin has been established the user turns the mixing valve counterclockwise until the maximum position is established . the user again presses the calibrate button to begin part 2 of the calibration cycle . the position sensor as well as the temperature sensor records these values as p 2 and t max respectively . with these values the calibration curve can be established ( see fig3 ). the calibration algorithm gives rise to the calibration curve which can be used during the operation of the faucet . the process diagram shown in fig4 is a visual representation of the calibration algorithm . the basic calibration algorithm does not include the necessary safety cycle to ensure proper operational safety . this would need to be added through vigorous safety testing during product development to ensure that the user does not calibrate this device incorrectly and possibly injure the user . the operation cycle is used to operate the device . once the device has been calibrated successfully the system is now operational . to initiate the operation cycle the user presses a button on the graphical user interface . the button initiates the algorithm . the program has a predetermined set of data gathered during the calibration cycle . the user of the system will input his or her desired temperature which is stored as tuser . the first set of computations can now be performed . using the equation shown in fig5 the program determines the position of the stepper motor : this is the initial position of the mixing valve . this desired valve position is then stored as p . the calibration curve created from calibrating the system will be able to determine the position necessary for the desired temperature . the graph shown in fig6 illustrates this concept . the microcontroller must now read the signal coming from the thermocouple attached to the pipe see fig2 . this measurement is now stored as tfaucet . the microcontroller now calculates the difference between tuser and tfaucet and stores the number as delta . fig7 shows the necessary equation to calculate delta . the program will determine whether delta is positive or negative . if delta is positive the system needs more heat and will signal the stepper motor to rotate counterclockwise . if delta is negative the system needs less heat and will signal the stepper motor to rotate clockwise . to determine how much the motor must turn to achieve the desired affect the following procedures must occur : the system will determine how large delta is . if delta is greater than 0 the system will add 5 % to position p up to pmax . the program now measures t faucet again and compares the value to t user . the program will reevaluate these measurements until the user turns the system off . if the system determines that delta is less than zero the system will decrease position p by 5 % up to pmin . the program will now measure tfaucet again and compare the value to tuser . the program will reevaluate these measurements until the user turns the system off . if the system determines that delta = 0 the position p will remain the same . the program will now measure tfaucet again and compare to tuser . the program will reevaluate these measurements until the system is turned off . the process diagram shown in fig8 is a visual representation the operation algorithm .