My project aims at finding x-coordinate of point of contact of finger and water surface using a rectangle-base box containing water with metal plate electrodes on both ends of the water.I am using the Arduino Uno R3.
So to minimize electrolysis even further and to get more real-time data,I will constantly swap the polarity of the voltage across the water and I need to increase the frequency of the pulse to match ADC sampling frequency / 12 (12=4 phases in 1 cycle * 3 analog inputs). But what is the ADC sampling frequency?. The page analogRead() says "so the maximum reading rate is about 10,000 times a second."To increase sampling frequency ,I decided that Arduino only prints raw analog data to my laptop and let my Java app do the rest calculation.I'll have to use Java to find the frequency at which Arduino prints analog data and then ,accordingly, decide the pulse frequency (injected into water).
Code:
void setup(){
Serial.begin(115200);
analogReference(INTERNAL); // 1.1V
}
void loop(){
Serial.println(analogRead(2));
Serial.println(analogRead(3));
Serial.println(analogRead(4));
}
20cm * (dA4-dA3) / (dA2-dA3) .Here, dA2, dA3, dA4 denotes difference in the analog readings taken in the 1st and 2nd phase of the input pulse. This is the distance from right end(refer schematic).
So, in the 3rd and 4th phase of the input pulse the voltage at both ends of the water drops to -0.3V(to account for the skin generating bio-voltage of order 10mV<<0.3V) that must read as 0 at A4 and then rises up to 2V that must read as 1023 ,when the finger is dipped in water. When finger is outside the water it is very unlikely for A4 to read every 3rd and 4th input as 0 and 1023, in that same order, with that same frequency(due to noise, bio-voltages , etc). That detects whether finger is dipped even slightly or not.
Just that dipping my fingers depper into water changes skin impedance and hence the analog reading. Any way round this can you suggest?