Professional Documents
Culture Documents
cal i brate [kal-uh-breyt] -verb (used with object), -brat ed, -brat ing. 1. to determine, check, or rectify the graduation of (any instrument giving quantitative measurements).
Calibration
Associate sensor output with salt concentration Relate sensor output and salt concentration using an equation (linear regression) The goal is to be able to compute the salt concentration based on sensor output
5V
ee-
10 k
anode oxidation
(loss of electrons) eClCl2 ClCl Cl ClClClClNa+ ClClNa+ Na+ Na+ is a spectator ion ClClion migration Na+ Na+ Na+ Na+ ClNa+ Na+ ClNa+ Na+ eeH2O H2O OHOHH H e-
cathode reduction
(gain of electrons)
Na+
void loop() { digitalWrite(3,HIGH); delay(100); int analogS=analogRead(0); digitalWrite(3,LOW); Serial.write(202); Serial.print(analogS); Serial.write(" "); delay(1000); }
// apply 5V to the conductivity sensor // hold the voltage at pin 3 for 0.1s // read voltage on + side of 10kohm resistor // turn off power to the conductivity sensor // move cursor to row 3, position 14 // print the analog input reading (0 to 1023) // overwrite previously printed numbers // delay 1 second between measurements
10 k
Salt Concentrations
Each group of students should put about 1.5 inches of water in four bottles The four bottles should contain . . . DI water 0.05% weight NaCl 0.10% weight NaCl 0.15% weight NaCl Please take ONLY the amount that you will need to use TODAY Be sure to label your water bottles Swish a small amount of DI water around in your bottle to wash out impurities before filling with calibration water
Steps
1. Configure your flow loop as required for homework 2. Implement the conductivity sensor circuit on your breadboard 3. Flush tank with DI water. a. Pour enough DI water into your fishtank to fill the flow loop b. Turn on the pump to run the flow loop for about a minute to wash out the impurities. c. Prime the pump if necessary by switching the three-way valve to the drain d. Turn the three-way valve toward the drain to flush the system e. Repeat to completely clean the system 4. Fill the system with DI water 5. Collect calibration data for DI water 6. Fill the system with 0.05 wt% salt water. Flush once, and refill with 0.05 wt% salt water 7. Collect calibration data for 0.05wt% salt water 8. Repeat steps 6 and 7 for 0.10 wt% salt water and 0.15 wt% salt water
0.05
0.10 0.15
0.12 0.10 0.08 0.06 0.04 0.02 0.00 460 480 500 520 540 560 Output of Conductivity Sensor y = 0.00004401e0.01512420x R = 0.99986136
An equation like this will be used to predict %wt salt based on sensor output. Try polynomial and power fits too to see how they compare. We will discuss the best form of the equation to use later we write our Arduino program to control salinity.
the end
If you havent downloaded the Arduino Integrated Development Environment (IDE) in a while, then try program below.
void setup() { Serial.begin(9600); pinMode(1,OUTPUT); Serial.print(12, BYTE); Serial.print(128,BYTE); Serial.print("Conductivity Sensor"); Serial.print(152,BYTE); Serial.print("Calibration"); Serial.print(189,BYTE); Serial.print("analog input="); Serial.print(22,BYTE); pinMode(3, OUTPUT); } void loop() { digitalWrite(3,HIGH); delay(100); int analogS=analogRead(0); digitalWrite(3,LOW); Serial.print(202,BYTE); Serial.print(analogS); Serial.print(" "); delay(1000); } // use a baud rate of 9600 bps // set pin1 as an output (pin1=TX) // clear screen & move to top left position pin 3 = 5V when HIGH // move cursor to row 0, position 1 (set high periodically to measure conductivity) // print a text string starting at (0,1) // move cursor to row 1, position 4 // print a text string starting at (1,4) // move cursor to row 3, position 1 // print text string at (3,1) // turn cursor off to keep screen clean
analog input 0
(measures voltage across 10k resistor)
// apply 5V to the conductivity sensor // hold the voltage at pin 3 for 0.1s // read voltage on + side of 10kohm resistor // turn off power to the conductivity sensor // move cursor to row 3, position 14 // print the analog input reading (0 to 1023) // overwrite previously printed numbers // delay 1 second between measurements
10 k