10
calibration of conductivity sensors living with the lab

Calibration of conductivity sensors living with the lab

Embed Size (px)

Citation preview

Page 1: Calibration of conductivity sensors living with the lab

calibration of conductivity sensors

living with the lab

Page 2: Calibration of conductivity sensors living with the lab

2

The content of this presentation is for informational purposes only and is intended only for students attending Louisiana Tech University.

The author of this information does not make any claims as to the validity or accuracy of the information or methods presented.

Any procedures demonstrated here are potentially dangerous and could result in injury or damage.

Louisiana Tech University and the State of Louisiana, their officers, employees, agents or volunteers, are not liable or responsible for any injuries, illness, damage or losses which may result from your using the materials or ideas, or from your performing the experiments or procedures depicted in this presentation.

If you do not agree, then do not view this content.

The copyright label, the Louisiana Tech logo, and the “living with the lab” identifier should not be removed from this presentation.

You may modify this work for your own purposes as long as attribution is clearly provided.

DISCLAIMER & USAGE

living with the lab

Page 3: Calibration of conductivity sensors living with the lab

living with the lab

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

Page 4: Calibration of conductivity sensors living with the lab

living with the lab

The Basic Idea• Adding salt to the water will increase the availability of Cl- ions at the anode• More ions at the anode will increase the rate at which chemical reactions can occur• The “electrical resistance” of the salt water will decrease as more salt is added to the water• The analog voltage on the + side of the 10kΩ resistor will increase as more salt is added• Correlating this voltage with the salt concentration will allow us to “calibrate” the conductivity sensor

e-

5V

e-

10 kΩ

e-

Cl-

Cl

Cl

Cl2

Cl-

e-

Cl-

e -

e-

OH-

H2O

H2OOH-

H

He-

e-

anode – oxidation(loss of electrons)

cathode – reduction(gain of electrons)

Cl-

Cl-

Cl-

Cl-

Na+

Na+

Na+

Na+

Na+

Na+

Cl-

Cl-

Cl-

Cl-

Na+

Na+

Na+

Na+

Na+

Cl-

ion migration

Na+

Na+ is a spectator ion

Page 5: Calibration of conductivity sensors living with the lab

living with the lab

The Circuit and Sketch

10 kΩ

pin 3 = 5V when HIGH(set high periodically to measure conductivity)

analog input 0(measures voltage across 10kΩ resistor)

void setup() Serial.begin(9600); // use a baud rate of 9600 bps pinMode(1,OUTPUT); // set pin1 as an output (pin1=TX) Serial. write(12); // clear screen & move to top left position Serial. write(128); // move cursor to row 0, position 1 Serial. write("Conductivity Sensor"); // print a text string starting at (0,1) Serial. write(152); // move cursor to row 1, position 4 Serial. write("Calibration"); // print a text string starting at (1,4) Serial. write(189); // move cursor to row 3, position 1 Serial. write("analog input="); // print text string at (3,1) Serial. write(22); // turn cursor off to keep screen clean pinMode(3, OUTPUT);

void loop() digitalWrite(3,HIGH); // apply 5V to the conductivity sensor delay(100); // hold the voltage at pin 3 for 0.1s int analogS=analogRead(0); // read voltage on + side of 10kohm resistor digitalWrite(3,LOW); // turn off power to the conductivity sensor Serial.write(202); // move cursor to row 3, position 14 Serial.print(analogS); // print the analog input reading (0 to 1023) Serial.write(" "); // overwrite previously printed numbers delay(1000); // delay 1 second between measurements

Page 6: Calibration of conductivity sensors living with the lab

living with the lab

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

Page 7: Calibration of conductivity sensors living with the lab

living with the lab

Steps1. Configure your flow loop as required for homework2. Implement the conductivity sensor circuit on your breadboard3. Flush tank with DI water.

a. Pour enough DI water into your fishtank to fill the flow loopb. 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 draind. Turn the three-way valve toward the drain to flush the systeme. Repeat to completely clean the system

4. Fill the system with DI water5. 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 water7. Collect calibration data for 0.05wt% salt water8. Repeat steps 6 and 7 for 0.10 wt% salt water and 0.15 wt% salt water

salt concentration (%wt) output to LCD

0.00

0.05

0.10

0.15

collect this data

Page 8: Calibration of conductivity sensors living with the lab

living with the lab

Fit Output of Sensor to Salt Concentration

Page 9: Calibration of conductivity sensors living with the lab

living with the lab

Determine Equation for Salinity Control

460 470 480 490 500 510 520 530 540 5500.00

0.02

0.04

0.06

0.08

0.10

0.12

0.14

0.16

f(x) = 4.40071631021979E-05 exp( 0.0151241988554312 x )R² = 0.999861357339341

salt concentration vs. output

Output of Conductivity Sensor

salt

con

cent

ratio

n (%

wt)

• 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.

Swap dependent and independent variable when performing linear regression

the end

Page 10: Calibration of conductivity sensors living with the lab

living with the lab

The Circuit and Sketch (for old IDE)

10 kΩ

pin 3 = 5V when HIGH(set high periodically to measure conductivity)

analog input 0(measures voltage across 10kΩ resistor)

void setup() Serial.begin(9600); // use a baud rate of 9600 bps pinMode(1,OUTPUT); // set pin1 as an output (pin1=TX) Serial.print(12, BYTE); // clear screen & move to top left position Serial.print(128,BYTE); // move cursor to row 0, position 1 Serial.print("Conductivity Sensor"); // print a text string starting at (0,1) Serial.print(152,BYTE); // move cursor to row 1, position 4 Serial.print("Calibration"); // print a text string starting at (1,4) Serial.print(189,BYTE); // move cursor to row 3, position 1 Serial.print("analog input="); // print text string at (3,1) Serial.print(22,BYTE); // turn cursor off to keep screen clean pinMode(3, OUTPUT);

void loop() digitalWrite(3,HIGH); // apply 5V to the conductivity sensor delay(100); // hold the voltage at pin 3 for 0.1s int analogS=analogRead(0); // read voltage on + side of 10kohm resistor digitalWrite(3,LOW); // turn off power to the conductivity sensor Serial.print(202,BYTE); // move cursor to row 3, position 14 Serial.print(analogS); // print the analog input reading (0 to 1023) Serial.print(" "); // overwrite previously printed numbers delay(1000); // delay 1 second between measurements

If you haven’t downloaded the Arduino Integrated Development Environment (IDE) in a while, then try program below.