NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Basic Electronics » Measuring Capacitance

October 20, 2011
by Etbauer
Etbauer's Avatar

I am working on a project and would like to use the HS1101 humidity sensor. In order to do so I have been testing capacitance measurement on the breadboard using the technique in the halloween project. I used the same pinout and setup with a 270K resistor in parallel with a few different known capacitors.

In doing so, I took a few measurements:

pf      Clock Ticks

560      3550
220      1600
150      1124
68       594
10       224

while each measurement was very consistent over several tries, I'm finding the measurements between each measurement is sort of inconsistent.

using Vc = Vs * e^(-t/RC) and t = cycles * 1/14745600

Assuming Vs = 5v (verified using multimeter) and Vc = 1.1v I determined the following:

cycles    pf    whereas    Test pf    Expected cycles

3550     589                560        3376
1600     266                220        1326
1124     187                150        904
594      99                 68         410
224      37                 10         60

In other words, I realize there exists stray capacitance in the breadboard, but the difference in calculated capacitance between each capacitor varies from 46 to 27, so it doesn't seem to be the problem, and the variation in clock cycles varies from 164 to 274 which seems like too much to attribute to processing delay, so I am trying to figure out what I am missing.

It strikes me as I am writing this that I didnt take care to ensure that each pin went into the same hole on each rail, but to my understanding, that shouldn't matter.

So anyway, any illumination on the subject would be appreciated :) thank you all.

October 21, 2011
by Ralphxyz
Ralphxyz's Avatar

Hi Etbauer, are you building a weather station?

I cannot answer your question it's kinda over my head but I am wondering why you are focusing on capacitance measurement?

Besides just learning.

The HS1101 humidity sensor has a "PROPORTIONAL VOLTAGE OUTPUT CIRCUIT" that would feed directly to the mcu ADC and also a "FREQUENCY OUTPUT CIRCUITS" that the mcu could monitor.

You do not need to measure capacitance so I am just wondering what exactly are you focusing on.

It's very easy to get off on a tangent in this business.

Ralph

October 21, 2011
by Etbauer
Etbauer's Avatar

Hey Ralph, thanks for the reply, I am actually trying to build an incubator for chicken eggs.

If I understand the datasheet correctly, the Proportional voltage can be generated through a seperate circuit which would require building a few oscillators, a low pass filter etc, so it seems much simpler and more economical to measure the capacitance directly. While I would be interested in learning more about how to measure the capacitance with proportional oscillators and frequency output circuits, I am mostly concerned at this point with what is wrong with my assumptions using the current design.

October 22, 2011
by Ralphxyz
Ralphxyz's Avatar

In looking at parallex specsheet quickly I thought you could just use the proportional voltage without external components.

This specsheet from Jameco is a little better and actually gives you a useable circuit.

All you would need is a counter on the mcu, you would not need a oscillator (555) just count the RCTIME pulse (frequency).

It is strange but I think Vss would be 5v + to the Ground pin.

Amongst my many project I have been working on is a weather station and I blew my I2C humidity sensor and need to replace it so maybe this would work.

Ralph

October 22, 2011
by Etbauer
Etbauer's Avatar

Hey Ralph, yeah this is actually what i was doing, my circuit is the same (and same as the pumpkin circuit here on NK). The only difference is that I don't have the 220 resistor, and the 10M resistor is a 270k.

Vss is the ground, it is referencing the source voltage of an n-channel FET.

i got a hygrometer today, and using that i can sort of calibrate and go from there, i still wonder where that variation is coming from, it would be nice to be able to calculate mathematically where the humidity is. Though for this project I really only need a small range of humidity sensing.

October 22, 2011
by Ralphxyz
Ralphxyz's Avatar

One of these days I'll have to look at the pumpkin circuit, right now I am lost on what is the power source if Vss is ground and the mcu is reading frequency.

Maybe I'd understand the 555 circuit better.

Ralph

October 22, 2011
by Etbauer
Etbauer's Avatar

well the power source would be Vdd, for the drain, if you look at the capacitor in the circuit, you can see that the positive side is connected to the pin, and the negative side has to be connected to the ground, essentially you turn the pin on and fill the capacitor, then turn it off and set it to an input then time how long until the voltage drops below teh input threshold

October 23, 2011
by BobaMosfet
BobaMosfet's Avatar

yep- essentially a clever way to make a 1 cycle oscillation. There's no magic here, it's a capacitor.

BM

October 24, 2011
by Ralphxyz
Ralphxyz's Avatar

essentially you turn the pin on and fill the capacitor, then turn it off and set it to an input

Now that's neat!!

I was having problems powering the circuit now that makes sense.

Of course I want to see the code that does that.

Ralph

Post a Reply

Please log in to post a reply.

Did you know that first-order systems have a exponentially decaying response to step inputs? Learn more...