Measuring variable impedance (AC)

I have a sensor (EFS-10) with an impedance that changes according to the relative humidity in the air (datasheet). The sensor needs a small AC voltage (1V) with a frequency of 1 kHz.

I am planning to use a function generator to generate a 0-2V square wave with a frequency and create an AC voltage with an AC coupling, see attached image.

What is the best way to measure the impedance of the sensor? I was thinking about a voltage divider and a full wave precision rectifier, but in that case the voltage over the sensor will vary (do not know if that is an issue). Are there other or better techniques that can be used to measure the impedance accurately?

I think you are going down a rabbit hole with no return. The data states:Measuring voltage: 1 V rms, (2.8 Vpp for sinusoidal voltage)
Waveform: AC voltage (without DC offset)

A square wave contains ALL odd multiples of the fundamental frequency, so there is NO way to compute impedance using that signal. You must use a sine wave as it contains only the fundamental frequency.


Thank you for your reply, it felt indeed that way.

My idea was to use a square wave as it would eventually return a ‘‘constant’’ DC voltage which could be measured using the ADC of the arduino. I thought that if you would use a sinusoidal voltage of 1 kHz and measure it with the ADC it would return different values. It takes analogread about 100 microseconds to take a measurement which is smaller than a period of the wave.

Do you have any suggestion on how to measure the impedance if you use a sinusoidal voltage.

Since impedance is the vector sum of capacitive reactance and inductive reactance, you might explore which one changes the most with humidity. Strange there is not more information on your sensor.

The reactance that changes most with humidity changes might be more easily measured. There are many, many links that Google supplies showing how to measure impedance, and reactance. But none can use a square wave, since both equations for reactance have frequency as one variable.


Thank you, I will look into the capacitive reactance and inductive reactance.

Not an expert but I'll throw in a couple of pence worth:
If the impedance changes for a constant AC voltage at a given frequency then the current must change proportionally.
Assuming you have something to provide the AC voltage, A current transformer like this Current Sensing Transformer/Donut Module - Very Simple Arduino Project - YouTube connected to analog input will sense changes in current the sensor is drawing from that voltage. It may be necessary to pass multiple sense loops through the donut, to get a readable value. The on-board opamp helps too. It will of course need calibrating. I have achieved repeatable readings in the order of 10mA this way.

You should be able to use a square wave for that, and measure the current without any regard to phase (I think the AC requirement is just to prevent electrolytic behaviour, similar to LCD drive). You can just rectify and average the current. I really believe the reactive (LC) vector component of this sensor must be very small in relation to the real part (R).

The chart in the data sheet shows about 80k ohms at 25C, 50% humidity. So 1V/80k gives you an idea what the current you have to measure will be.

Note that the readings change dramatically with temperature, so you have to have a good temperature sensor too, this is why the DHT11 and DHT22 and such integrated humidity sensors have both humidity and temperature sensors included.

How do you plan to calibrate it?

Thanks Steve I will take a look at it.

A DC current will indeed destroy the sensor electrochemiccally.

This sensor is a resistive humidity sensor, while the DHT11 and DHT22 are capacitive humidity sensors. I want to compare a resistive humidity sensor with a capacitive humidity sensor as it is subjected to a low vacuum (the only particles in the low pressure are water molecules creating a humidity). Therefore I have chosen this sensor. There are more resistive sensors available but all of them need an AC voltage and impedance measurement.

I have an accurate temperature sensor TSIC 506 (Datasheet), with an accuracy of ±0.1°C. If I can measure the impedance it is possible calculate the corresponding relative humidity afterwards.

The sensor can be calibrated with saturated salt solutions, these create a known constant humidity in a closed environment, for example table salt (NaCl) will create a RH of 75.5% at 20 °C).

You will need to make a divider with either a current source or a fixed resistor, which will translate to a voltage for an analog input. As you probably already know, the two ways of impedance measurement are

  1. Apply a voltage and measure the current.
  2. Apply a current and measure the voltage.

In this case, measurement of such a small current is not that easy. That is why I suggest #2. Maybe some googling can turn up some circuits. It's difficult to say how much functionality could be added by the Arduino input/outputs vs. a dedicated stand alone circuit. Maybe a hybrid?

The circuit you posted (which seems to use method #1) doesn't show the take-off point for the output, also I'm not sure why you put the resistors in parallel.

I am a mechanical engineer so this is not my strongest point and correct me if I am wrong.

My initial idea was to use a voltage divider with a constant resistance and measure the voltage to calculate the impedance. I placed the sensor in parallel to get a square wave of ±1V across the sensor. If I would place it in series, the voltage would be divided over the resistor and sensor. This would be an issue if the impedance would be approximately the same value as the resistor, resulting in a voltage considerably lower than ±1V. But the problem was to measure the impedance.

If I would apply a current it must be really small in order to stay under the limit of ±1V.

Is the idea to read the voltage at an analog pin? I admit, it's much easier to generate a fixed AC voltage reference than a current source. If you do use a voltage divider (which the circuit above is not), then you connect C1 to the sensor and the sensor to R1. If you are rectifying and peak detecting the signal in software, you need to also introduce a DC offset so that the quiescent voltage is in the ADC measurement range, and negative voltages can be measured. I can't think offhand of the entire circuit, in part because a child is pestering me right now. :slight_smile:

This is how the inexpensive sensors work:

Yes, that was my initial idea, that is why I wanted to use a square wave. Maybe if I would use a voltage divider it would be smart to use different resistors to be able to keep the voltage over the sensor approximately 1V?

I am not familiar with peak detecting, but would that not need a really fast ADC or am I going in the wrong direction.

Is it also possible to add a DC offset to the AC signal of the voltage divider in order to measure it with an ADC?

Thanks Stevemann I will look into it and see if I can find out how it works.


Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you take a few moments to Learn How To Use The Forum.
It will help you get the best out of the forum in the future.
Other general help and troubleshooting advice can be found here.

The problem with using different resistors is the error in the switching device. Sure you can multiplex load resistors, but it is certainly a more complicated situation to analyze than a single load resistor. In addition to the error introduced by the internal resistance of the switching device, if you need to extend the range with, say, two resistors 1x and 10x, then the precision of the 10x has to be 10x that of the 1x, I hope that's not too weird. :slight_smile: It can be a problem finding parts and circuits with the desired precision. Instead, it makes more sense to use a single load resistor, and an ADC with much higher input resolution - 16 or 24 bits.

My apologies ballscrewbob. That was not my intention. No one had responded after a week, so I thought I did something wrong, therefore I wanted to go a step back. But you are right, sorry again.

That makes sense, seems to be a lot harder than they would suggest. Thanks for your help, I will look for a high input resolution ADC and see if I could get it working.