4
\$\begingroup\$

I'm a beginner at electronics and my knowledge is trying to learn!

I'm trying to make the following humidity sensor work with an Arduino. http://www.bitsbox.co.uk/data/sensors/humid_sens.pdf

The actual programming of the Arduino I can handle, but I need some advice in order to reduce the 5V supply from the Arduino to 1V which is the rated voltage of the sensor. I know that if I send it 5V I will likely burn the sensor out.

I guess what I'm asking is: What value resistor do I use on my breadboard?

\$\endgroup\$
  • 1
    \$\begingroup\$ I've never used one myself, but the 1V is for AC so it may be a little more tricky than that, in fact the datasheet mentions avoiding a DC voltage. Wait for a good answer though, I suspect there's a few tricks you could do just using a pair of I/O pins, caps and a resistor divider and/or PWM. \$\endgroup\$ – PeterJ Jan 26 '13 at 9:32
9
\$\begingroup\$

The humidity sensor in the question operates on an AC signal of up to 1 Volt RMS. The datasheet specifically mentions an operating frequency range of 0.5 to 2 KHz, as well.

If the sensor is operated with DC supply, one electrode (the negative one, if I remember correctly) will deteriorate rapidly due to ion migration towards one plate in preference to the other, rendering the part inoperative.

Now, regarding a suitable operating mechanism:

The impedance curve of the device spans a range of anywhere from 1 to 10 Megaohm at 20% relative humidity, down to between 1 and 5 kΩ at 90% RH. The impedance table in the datasheet specifies values from 1.1 kΩ to 7.2 mΩ, too broad a span for a voltage divider to work.

Calculating current through the device for 1 Volt across it, spanning this impedance range to worst-case limits: At 90% RH, for 1 kΩ, I = 100 μA At 20% RH, for 10 MΩ, I = 100 nA

Thus, a very low impedance (100 Ohm or less) AC voltage source would be needed, to drive this sensor suitably, if it is to be operated in voltage driven mode. This shows that a voltage divider would be a very inefficient, and somewhat ineffective, way of driving the sensor.

Instead, a more viable approach would be to drive the sensor using a current source, with the DC blocked using a suitably large capacitor.

There are several current source circuits out there, using bijunction transistors, FETs, or op-amps. Pick one that suits your purpose and budget, gate the current with an input from one pin of your microcontroller being toggled at say 1 KHz, and read the voltage across the sensor using an ADC pin of the MCU.

Note that this will not give very precise results, as such electrode-based humidity sensors are characterized using a bipolar sine wave. Improvements to the solution could include using an RC or LC filter to bypass the higher harmonics of the 1 KHz signal, leaving an approximation of a 1 KHz sine wave.

Actually designing such an AC (near)sine wave, stiff current source is left as an exercise to others less preoccupied than me.

\$\endgroup\$
  • \$\begingroup\$ Thanks for the answer :-) I fear my knowledge of electronics will not yet run to using the component, which is a shame. That'll teach me to go 'cheap' ;-) \$\endgroup\$ – recantha Jan 26 '13 at 10:31
  • \$\begingroup\$ Voted up for an excellently simplified yet comprehensive answer without unnecessary "part-name-dropping" and buzzword overdose. \$\endgroup\$ – Seemingly So Jan 26 '13 at 10:50
5
\$\begingroup\$

You don't need a 1V supply. You need something relatively more complicated than than.

While how much effort it'll take depends on what kind of accuracy you're looking for, let me try to explain whats going on and how you can get your sensor to work.

First, the humidity sensor doesn't work with a DC power supply. It needs a 1KHz sine wave with 0 DC bias and an RMS voltage of about 1V. This translates to a sine wave between about +1.414V and -1.414V. You need a bipolar sine for this, as any DC bias is likely to make the sensor readings incorrect and may even damage it.

Second, what you're measuring isn't the resistance, its the impedance. Impedance is a combination of L, C, and R components of the sensor. You may see this in example circuits called a DUT - Device Under Test. I would guess the sensor uses a change in epsilon (permittivity) and / or mu (permeability) caused by the introduction of a dielectric - moisture. This means that you're actually looking for changes in capacitance and / impedance. (Since water is non-magnetic as far as I remember, its most likely to do only with capacitance, but that's not the point and isn't important).

Further, it looks like only the magnitude of the impedance is important, and not the phase offset. This is probably the only saving grace.

With this 'background', lets see what you'd need for using this sensor.

The sine wave (1V RMS) is best to use as a sine wave because that means the signal has what we call spectral purity. It is made up of only one component in the frequency domain. If the wave is not a pure sine wave, your measurements will start becoming incorrect and the greater the impurity, the less the relevance of their calibration table to whatever data you produce. A square wave is probably a very bad idea.

The best way to generate a sine wave is using a sine wave generator IC like a XR2207, which is easy to use but unfortunately hard to get since its been obsoleted. There may be other options available similar to it. Alternatively, you could use a DDS (Direct Digital Synthesis) IC like Analog Devices AD9833 which can generate high purity sine waves. In this case, since the amplitude and frequency is fixed, it may be simpler and make more sense to build a sine wave oscillator like the Wien Bridge Oscillator. You would have to tune it to a frequency close to 1KHz and an ampltitude close to 1V RMS or 2.818V Pk-Pk, and ensure that there isn't a DC bias in whatever signal you generate. A capacitor in series with the signal can block the DC component. This is called AC Coupling and the capacitor is sometimes called a DC blocking capacitor.

A cheap and easy solution that you can try is to generate a 1KHz square wave from the Arduino, and pass it through one or more low pass filters tuned to about 1.2 or 1.3 KHz. This could block the higher frequency components and turn the square into something like a sine. Note that this won't be ideal and will definitely cause issues with accuracy. As I said, depends on how accurate you want it. In this case, also, you will need to have a DC blocking capacitor in series to get rid of the 2.5V DC bias. The other side of the capacitor, where the sensor is, may need to be biased to ground using a high resistance.

This part lets you excite the sensor. When it comes to measuring what you get, you can't direct send it into an ADC. You first have to convert the AC signal into DC measureables. By AC signal, I mean in this case that you want the AC amplitude (RMS) and the AC current. The AC amplitude you can measure by using a full bridge rectifier and a low pass filter. This would let you send a DC signal into an ADC. There are more accurate circuits for doing this, a search for RMS to DC convertor should let you find one.

To measure AC current, you'd include an additional resistance in series with the sensor and measure the RMS voltage across it using the same technique as above.

Using the AC current and voltage, and the AC excitation voltage (1V RMS), you can calculate the impedance and therefore the humidity based on the datasheet's calibration table.

\$\endgroup\$
1
\$\begingroup\$

Read the datasheet. You first need to generate 1 kHz AC; you can use one of the Arduino's timers for this, and bring its output to an Arduino pin. Then connect Keelan's voltage divider to that pin. 1 kHz is fairly slow so I would connect the sensor directly to an ADC input and make several ADC readings per 1kHz cycle, and use the max and min values to determine the sensor resistance.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.