Hi guys!
I’m trying to build a device measuring the electrical resistivity of a paste (cementitious materials) using Arduino Uno. Four steel probes are put inside the paste (jumper wires attached to them). Two outer probes apply AC signals (Square signals- Frequency 1 kHz- Voltage(peak to peak)= 14 V) and two inner probes should measure the potential difference. Then the resistivity could be calculated by a formula (I cannot change this test setup). Please see the photos attached.
I managed to apply the desired AC signals, but the issue is with reading the potential difference (two inner probes) by Arduino. When I use a multimeter (set to AC mode) I read some values (voltage) which should be correct, but using Arduino as the same time I read different values! I cannot see why!
I use Arduino analogue pin (A0) to read values (other inner steel probe connected to the Arduino ground), convert it to voltage ( float voltage = sensorValue * (5.0 / 1023.0); ) and print it to serial monitor. I programmed Arduino to read values 10 times during a second and report the maximum value only. There is not even a relationship between values of Arduino and multimeter (Examples: (Multimeter: 0.712 V, Arduino: 1.15 V)-(Multimeter: 0.68V, Arduino: 1.10V)-(Multimeter: 0.67V, Arduino: 1.03V)). Can anyone tell me what modification to do to get correct value from Arduino?
I would really appreciate any help !
UPDATE:
To clarify what is happening I got an oscilloscope and repeated the test this time with sin waves (instead of square wave) with Vp-p = 10V… I modified the Arduino code to sample 2500 times during a second and report the maximum value… Now Oscope, MM, and Arduino give me three different numbers: Oscope(Vp-p): 2.5V, Multimeter: 0.7V, Arduino: 1.55V
The circuit is simple and I have attached the scheme. I will be grateful if you can comment on this and how these values are related. Thanks.
Arduino Code:
/*
ReadAnalogVoltage
Reads an analog input on pin 0, converts it to voltage, and prints the result to the serial monitor.
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
*/
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (5.0 / 1023.0);
// print out the value you read:
float max_volt = voltage;
for (int i=0; i<2500;i++)
{
sensorValue = analogRead(A0);
voltage = sensorValue * (5.0 / 1023.0);
if (voltage > max_volt)
{
max_volt = voltage;
}
delayMicroseconds(5);
}
Serial.print(max_volt);
Serial.println(" V");
delay(1000);
}