# Help! Reading AC Voltage (sine wave) with Arduino

#### akazemian

Joined Feb 12, 2016
4
Hi guys! I'm trying to build a device to measure 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 (Sin waves- Frequency 1 kHz- Voltage(peak to peak)= 10 V) and two inner probes should measure the potential difference (usually it is between 1V to 3V). Then the resistivity could be calculated by a formula. I cannot change these since this is standard test procedure..Please take a look at pictures attached.
I managed to apply the desired AC signals, but the issue is about reading the potential difference (two inner probes) by Arduino. When I use a oscilloscope I see clean sin waves (frequency still 1kHz) and I read some values (voltage) which should be correct. Then I use Arduino to read the voltage and again I get another totally different reading. I cannot see why! I have to use Arduino since I want to add more functionalities to the setup later.
WHAT I DO: I connect one of the two inner probes to Arduino ground pin, and the other probe to analogue pin (A0) to read values, convert it to voltage ( float voltage = sensorValue * (5.0 / 1023.0); ) and print it to serial monitor. I programmed Arduino to read values 2000 times during a second and report the maximum value only. This is an example of what I get: Oscope: 2.5V, Multimeter: 0.7V, Arduino: 1.55V
Could anyone suggest any modification to make to get correct values with Arduino? I would really appreciate any help!

#### #12

Joined Nov 30, 2010
18,216
If you can't teach the Ardunio to read the peak values, use this.

#### Attachments

• 8.5 KB Views: 38

#### KL7AJ

Joined Nov 4, 2008
2,229
Hi guys! I'm trying to build a device to measure 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 (Sin waves- Frequency 1 kHz- Voltage(peak to peak)= 10 V) and two inner probes should measure the potential difference (usually it is between 1V to 3V). Then the resistivity could be calculated by a formula. I cannot change these since this is standard test procedure..Please take a look at pictures attached.
I managed to apply the desired AC signals, but the issue is about reading the potential difference (two inner probes) by Arduino. When I use a oscilloscope I see clean sin waves (frequency still 1kHz) and I read some values (voltage) which should be correct. Then I use Arduino to read the voltage and again I get another totally different reading. I cannot see why! I have to use Arduino since I want to add more functionalities to the setup later.
WHAT I DO: I connect one of the two inner probes to Arduino ground pin, and the other probe to analogue pin (A0) to read values, convert it to voltage ( float voltage = sensorValue * (5.0 / 1023.0); ) and print it to serial monitor. I programmed Arduino to read values 2000 times during a second and report the maximum value only. This is an example of what I get: Oscope: 2.5V, Multimeter: 0.7V, Arduino: 1.55V
Could anyone suggest any modification to make to get correct values with Arduino? I would really appreciate any help!

View attachment 100574 View attachment 100575 View attachment 100576
I suspect that your arduino cannot sample fast enough to give you an accurate reading. You might try 50-100 Hz. Volume resistivity measurements are commonly used with 60 Hz driving signals.

eric

#### akazemian

Joined Feb 12, 2016
4
I suspect that your arduino cannot sample fast enough to give you an accurate reading. You might try 50-100 Hz. Volume resistivity measurements are commonly used with 60 Hz driving signals.

eric
Thanks Eric... the input ACV has a 1kHz frequency (this is the test standard procedure) and my sampling rate is 2000 times per second.. You still think that is not enough? I tried it many times and not even once arduino gave me sth consistent with oscope or MM...

#### KL7AJ

Joined Nov 4, 2008
2,229
Thanks Eric... the input ACV has a 1kHz frequency (this is the test standard procedure) and my sampling rate is 2000 times per second.. You still think that is not enough? I tried it many times and not even once arduino gave me sth consistent with oscope or MM...
Which model arduino are you using?