# pressure sensure

#### tunde1

##### New Member
I'm tryin to design a circuit that will display volume of liquid in a horizontal cylindrical tank, i need a pressure sensor to determine the depth of the liquid level. i'm open to suggestions

#### philba

##### New Member
is there a reason why it has to be a pressure sensor? there are certainly other ways to sense the depth of a fluid.

Capacitance is a very effective approach. make a probe that has 2 parallel "plates". the deeper it is immersed in the fluid, the higher the capacitance. Using RC rise time, you can determine the level to a fairly high degree of accuracy. With a microcontroller, you can directly measure the rise time or you can create an oscillator (use a 555) and measure the period.

#### tunde1

##### New Member
capacitance probe

philba said:
is there a reason why it has to be a pressure sensor? there are certainly other ways to sense the depth of a fluid.

Capacitance is a very effective approach. make a probe that has 2 parallel "plates". the deeper it is immersed in the fluid, the higher the capacitance...

Thanks, i think i like the idea of the prode, but u need to break it down a little, measuring rise time, RC rise time, all sound a little complex.
still open to suggestions.

#### Hero999

##### Banned
The easiest way of doinf this is just use an astable 555 timer with the capaciive prope as the timing capacitor. The frequency of the pulses will indicate the liquid level.

#### penoy_balut

##### New Member
if you really want that simple then buy a ready made fuel gage (used in cars) with matching float, connect the gage in series with the float and you will have a meter indicating liquid level

#### philba

##### New Member
I've done it both with an oscillator (measure period) or time the actual rise with a micro.

the trick with the micro is to use a pull up resistor (1%). cap to gnd, pull-up to other side of the cap. Top of the cap to I/O pin on micro. set the pin as output and output a zero to discharge the cap. After a predetermined time (I used 5RC with C = max possible, R = 1 but it can be smaller), switch the pin to input and start a timer. The pull-up will charge the probe. I used a PIC with a comparator with an external Vref.

the biggest drawback of either method is it needs calibration. You just put the probe in a tank. note the reading empty (but wet), fill it up and note the reading again. I'd add 2 buttons, cal-hi and cal-low. these would cause a reading to taken and stored in eeprom. Those become you hi/lo interpolation values. I think you can get away with out actually using a comparator as long as your Vcc is pretty stable.

I think to increase accuracy (er, repeatability), I'd use a Vref for charging the probe as well.

Last edited:

#### stevez

##### Active Member
I do not understand the intended design/operation of the capacitance probes that have been suggested. I do agree that two parallel conductive plates are a capacitor but once immersed in fluid I am concerned about it's behavior. I don't know what fluid will be and it may affect the plates.

You could make a capacitor that is at the bottom of the tank. It could be a plate that will deflect slightly as the tank fills. Add another parallel plate with air as the dielectric. The plate that is exposed to fluid could be coated on the interior - or be made of a material that will tolerate the fluid.

#### philba

##### New Member
if the fluid is reactive use a coating that doesn't react or use a probe material that is non-reactive (like stainless steel). if the fluid is conductive you will also need insulation. Mine is for water so I use 2 loops of 28 ga teflon coated wire. I use a PVC pipe as a holder to keep the loops parallel about 1/2" apart. I also put some tension on the loops so they don't move. I discovered you have to keep the wire away from the surface of the pipe because there is a wicking effect that keeps water on the wires longer. I drilled holes in the pipe at the top and bottom to let the water in and out.

I'm not sure how well the deflection sensor you suggested would perform over the long run.

#### tunde1

##### New Member
microcontroller type

philba said:
is there a reason why it has to be a pressure sensor? there are certainly other ways to sense the depth of a fluid.

With a microcontroller, you can directly measure the rise time or you can create an oscillator (use a 555) and measure the period.
thanks for this suggestion, but i really need to know what type of microcontroller i could employ, is is going to be an ATMEL or PIC,? if PIC what NOS.
Thanks

#### philba

##### New Member
Just about any micro will do the job but I'd pick one with a comparator. That doesn't really narrow it very much, though! You should think about other aspects of your project like communication, display, power needs, etc. I would design the overall features of your project first and then us that to drive MCU selection.

I've used PICs for this - 16F628A and 16F88. The 16F88 is particularly nice in that you can install a boot loader and update the firmware in the your packaging. The atmel series has lots of viable choices as well.

by the way, I would also look at packaging early in your design process, at least when you get to PCB layout. it's a lot easier to design your board to fit the box than it is to find a box after the board is done.

#### tunde1

##### New Member
project design

philba said:
I would design the overall features of your project first and then us that to drive MCU selection.

I've used PICs for this - 16F628A and 16F88. The 16F88 is particularly nice
hello Philbia, thanks for the advice so far, have you designed the features you talked about? i will love to see the design, it could help me in modifing mine. u could send it to my email, twalk2k@yahoo.com. Thanks