Measure resistance on an AC circuit

I found out how to make my own moisture sensor, but it needs to run on AC, to avoid electrolysis.

I also figured out I need a precision rectifier to be able to measure the resistance over the moisture sensor.

The problem is that I'm a little confused how the ground works with respect to the AC source(some sort of adapter).

So I connect a PICAXE through a capacitor and a rectifier to the AC source. Then I put AC on the sensor, and connect that through an precision rectifier(and a capacitor?) to the PICAXE input.

But how?
 
Hm, sorry, I didn't exactly find what I was looking for.

The thread you linked to seems to use a PWM signal, which goes between 0 and x, not between x and -x, which brings me to the other thing I found: If you just measure a short pulse occasionally, you wont degrade your probe that fast.

However, I can;t say I really understand this zener diode part:Screen Shot 2012-03-26 at 12.44.36 PM.png

What I did not find(or recognize?) is how to connect AC stuff to a PICAXE.
 

Reloadron

Senior Member
Those are not zener diodes but rather Schottky barrier diodes. They are configured as a voltage doubler to effectively double the voltage of the return signal(s) from the probes. This sort of voltage doubler is very common. Can you provide a schematic or link to what the circuit is your original post is based on?

Ron
 

hippy

Ex-Staff (retired)
What I did not find(or recognize?) is how to connect AC stuff to a PICAXE.
Remember that AC really is "Alternating Current", does not necessarily involve alternating (negative then positive ) voltages.

How best to connect to a PICAXE, or the circuit to use, really depends on what the component or sensor you are using requires.
 

BeanieBots

Moderator
Do it in the same way you would if it were DC except only measure during the positive cycle.
As Hippy points out, it the CURRENT through your probe that is the important bit.
Voltage is all RELATIVE.
 

fernando_g

Senior Member
The soulution to your problem is very simple, see attached -and very simplified schematic. I've used it in the past, because as you describe, true AC requires to be applied to the sensor, otherwise it will corrode. A pulsed waveform does contain an AC component superimposed on a DC component, and this DC component will still cause corrosion.

The trick is to use a 4053 type switch, and drive it with a 50% PWM from your PIcaxe. And the good thing is that you don't need a precision rectifier, as the ADC input is taken from the junction where it is still DC.

I'm in a little hurry now, but I can explain further the circuit later.
 
Amazing, thanks! I have a lot of experience with the 4053, I used it in all(1) of my projects so far.

It's amazing to do something you don't know much about. I learn new things practically every other message. My only fear is that I annoy people ;)
 
This one seems simple to make: http://www.picaxeforum.co.uk/showthread.php?3854-ac-half-bridge-datalogger-instruction&p=24144&viewfull=1#post24144

So basically what he describes is this, right?



I named the pins PWM, because it seems to me that half-bridge hpwm is ideal for this job.

When output 1 is high, output 0 is low and the probe has current flowing through it via the resistor.
I should clearly study how voltage and current actually, and exactly relate to each other. Clearly, my path-of-least resistance model is wrong, because I don't see why anything would want to go through another resistor(probe), rather than to the ADC input.
 

hippy

Ex-Staff (retired)
I should clearly study how voltage and current actually, and exactly relate to each other. Clearly, my path-of-least resistance model is wrong, because I don't see why anything would want to go through another resistor(probe), rather than to the ADC input.
The path of least resistance isn't through the ADC input pin. In this case it should be taken that an ADC input has an infinitely high resistance so does not affect things at all.

Obviously there is some resistance but try to ignore that !

With PWM1 high (+5V) and PWM2 low (0V) the resistor/probe is no different to a traditional potential divider being read by ADC.
 

Goeytex

Senior Member
I bread boarded and tested this circuit about 6 months ago using a cheap resistive humidity sensor. If I recall correctly, the circuit was provided by Humirel. It works very well. Test code for an 08M2 is included with the diagram. I would not bother with using PWM.

It is important to note that resistive type humidity sensors have a min / max requency range that must be adhered to in order to give consistent and accurate results. This should be in the datasheet.

I wrote the code to provide the correct frequency and a 50% high/low ratio.
 

Attachments

Last edited:
Amazing, thanks! One last question, where can I find the datsheet for my to-be-home-made gypsum block? ;) I'll just experiment some, can anything go wrong if I take the wrong type of resistor? It's basically just to make some current flow, right? Will I offset the AC current if I have the wrong value? If so, wouldn't that mean that the AC value is always offset, depending on the humidity? Questions, questions, questions… I'll have a look at how my Gypsum block is doing.
 

Michael 2727

Senior Member
Hi Pepi,
You may find some useful info in the text of this page,
or you may just get a headache.
http://www.sowacs.com/sensors/gypsum.html#gypsum_meter
Link on the page - sowacs FEATURE ARTICLE
http://www.sowacs.com/feature/mea/mea.html

I never tried the Gypsum Block method, was always on the "To Do List".
I only ever used 3mm Stainless Probes, spaced 20mm to 25mm apart.

From what I remember, the blocks were soaked in water then placed in the
ground where they eventually setteled to match the surrounding soils
moisture content over a few days or so.

Gypsum Blocks help to reduce the effects of PH on soil measurements
but not Salinity. Gypsum Blocks also degrade over time ( 2 yrs from memory )

Stray Ions from copper, aluminium or steel that are spread into the Block from
electrolysis will greatly impact on your readings, hence the use of an AC signal
and Stainless Steel in the construction of the blocks.

As I said in the Link posting, Soil Moisture and Measurement is a science in itself.

Anyway the Links should provide you with at least 10 mins of entertainment ~ ;o)

Michael
 
Top