PDA

View Full Version : 'POT' issues with long cable



ardhuru
- 18th July 2009, 13:26
I have designed a circuit around the 16F887, with a resistor/capacitor combination on PortA.6 being read with the 'pot' command.

Earlier, I had these connected to PortA.5, had wierd results, and realised that that pin was a Schmitt input.

Now, things are fine on the workbench. However, the capacitor is to be located remotely as a sensor (about 50 meters), and when I did this using a standard non-shielded 2 core wire, the readings are no more consistent.

My question, before I buy the cable, is would shielded cable perhaps help?

Or would co-ax cable, the kind used for cable TV be even better?

Or neither, I need to look at another solution altogether?

Also, if I use either of the above, can this cable be run in close proximity of the mains without the readings going haywire again?

Any advice would be highly appreciated, folks!

Regards,

Anand Dhuru

mackrackit
- 18th July 2009, 13:55
I think you need another solution. The long wire will have capacitance of it's own.

But, the same setup may work using the ADC on your chip.

Capacitor as a sensor? What exactly are you doing?

ardhuru
- 18th July 2009, 14:15
I think you need another solution. The long wire will have capacitance of it's own.


Yes, I thought of that. But this shouldnt be a problem, I can calibrate the unit once to compensate for the cable capacitance.

Its actually a string of 10 capacitors in series immersed in a water tank. The water shunts out each capacitor as the level rises.

I did have an earlier version with the resistance being a variable, using the ADC, but this tends to get corroded within a few weeks.

The capacitive version seems to work well, but for this problem; and seems to have no corrosion issues either. Would be a pity to have to abandon this design.

Any other ideas?

Anand

aratti
- 18th July 2009, 16:18
I did have an earlier version with the resistance being a variable, using the ADC, but this tends to get corroded within a few weeks.

You can tray with stainless still electrodes if you will use AISI 316 type you will not see any corrosion whatever liquid you will use.

The sensor could be designed as per the attached example.

Al.

ardhuru
- 18th July 2009, 17:34
Al, how did you manage to connect the resistor(s) to the stainless rods? I couldnt figure that out, short of using specially tooled terminals, which was the only reason I couldnt continue with my DC model.

BTW, since you seem to have worked on a similar technique, did you find the readings highly non linear over the range? At times it is difficult to resolve the levels, especially at the lower end.

Regards,

Anand

aratti
- 18th July 2009, 18:15
how did you manage to connect the resistor(s) to the stainless rods

You thread one end of the rod and use 2 nuts and two washers to hold the resistors wires.


did you find the readings highly non linear over the range? At times it is difficult to resolve the levels, especially at the lower end

Linearity depends on the liquid in use (how many ions you have in suspention) but don't expect very high linearity from it.

You can always correct the reading via software knowing the real values taken on the bench shorting the electrodes one by one.

Al.

Archangel
- 18th July 2009, 20:56
Hi ardhuru,
All that stuff you mentioned in Post 1 sounds pretty expensive, and Al's SS Rods do too. So using Al's Idea a little differently, suspend 4 copper stiff wires or rods vertically at different lengths, which you can adjust easily to fit your needs. You can Solder the resistors or Potentiometers to those wires, and install a PIC circuit there, powered by a couple of solar cells easily removed from 2 cheapie Yard Lights, and yes use the nicads that come in those too, then send some form of slow serial data using relatively inexpensive wire, TV lead in, sprinkler wire, twisted doorbell wire . . . to another PIC . Compared to shielded wire and fancy Stainless steel rods this should be cheap. You could put the wire array in a piece of plastic pipe and insert it vertically into the Well, sump, or whatever it is you are checking.

Melanie
- 18th July 2009, 21:04
I did have an earlier version with the resistance being a variable, using the ADC, but this tends to get corroded within a few weeks.

The secret is to have AC excitation at the probes... electrolyis is then minimal if not completely eradicated. 1kHz HPWM through say a 100nF Capacitor is just perfect for the source probe.

mackrackit
- 18th July 2009, 21:44
Go to your local welding shop and talk them out of a piece or two of SS tig wire.
And with a little practice and some silver solder you can make the connections that way.

ardhuru
- 19th July 2009, 04:48
Hi ardhuru,
All that stuff you mentioned in Post 1 sounds pretty expensive, and Al's SS Rods do too.

Actually, its not. I just use 10 0.1 uf capacitors strung (stringed?) together in series. A bit of labour involved, but the material cost is nothing.


Hi ardhuru,
and install a PIC circuit there, powered by a couple of solar cells easily removed from 2 cheapie Yard Lights, and yes use the nicads that come in those too, then send some form of slow serial data using relatively inexpensive wire, TV lead in, sprinkler wire, twisted doorbell wire . . .

I was also toying with the separate-pic-for-the sensor idea. In fact, I thought I would use Melanie's trick of data-over-power from an earlier thread to be able to do this over just 2 wires. Wasnt sure how reliable the serial comms would be with my already laid twisted, non-shielded cable.

Will give this a try.

ardhuru
- 19th July 2009, 04:53
The secret is to have AC excitation at the probes... electrolyis is then minimal if not completely eradicated. 1kHz HPWM through say a 100nF Capacitor is just perfect for the source probe.

This would be the best, easiest to adapt/incorporate in my earlier design, with a minimal of hardware/code change if I can get it to work for my app. I didnt realise I could use a PWM'ed signal in conjunction with ADC.

I just hope I am able to resolve the 10 steps I'd like to have in the sensor reliably.

Anand

Archangel
- 19th July 2009, 05:43
Hi Adhuru,
Curiosity has got me, what are you trying to keep track of the water level in ? Have you considered using a float and some switching method like hall effect or optical ? How deep of a cistern, sump, creek, pool . . . , 1 meter, 10 meter . . . does this have anything to do with fresh potable drinking water for people or animals, or vegetables to be eaten by people or animals? I have to ask that question because the way we might measure waste water is somewhat less critical than how one must treat fresh water in terms of chemical and metal exposure. Is there power available in the area where the sensor goes? Is radio telemetry an option? This thread has many useful possibilities for people around the globe, and I am betting many are interested. So I just HAVE to say . . . GOOD SUBJECT !

ardhuru
- 19th July 2009, 07:23
Hi Adhuru,
Curiosity has got me, what are you trying to keep track of the water level in ? Have you considered using a float and some switching method like hall effect or optical ?

Basically 3 tanks 2K to 5K litre capacity, non-metallic, heights 6 to 8 feet. Having got a quantitative reading from all 3 tanks, there's logic that also controls a pump to keep the levels at a required level.

Unfortunately, yes, I did look at the alternatives you mention and had to discard them for various reasons:

Floats (I assume you mean the kind that is anchored, and has a float connected to a pot): would be difficult to get movement thruought the height of the tank. Also, the ambient humidity would junk it in a short time.

Hall effect or optical would be good, but I need to sense 10 levels in each tank; would be complex/expensive. I even considered an IR scheme with the technique Bruce describes on his site for distance measurement. Not to mention optical encoders with a float.


Is there power available in the area where the sensor goes? Is radio telemetry an option?

Yes, power is available, but I think if i could get away with data-over-the-Vcc-line, that would be more elegant. And cheaper than RF.

But first, I'm going to try out Melanie's suggestion about PWM and ADC;


This thread has many useful possibilities for people around the globe, and I am betting many are interested. So I just HAVE to say . . . GOOD SUBJECT !

Thanks; I've been trying to achieve this for a long time. If there's any interest on this subject, I'll keep posting my observations on this thread.

Melanie
- 19th July 2009, 07:49
I've done heaps on water-level sensing over the years... and my conclusions are that anything you put in the water will corrode and die eventually if it's not encapsulated and sealed or it's Stainless Steel.

A Capacitive solution is fine - providing those Capacitors do not touch the liquid... If you use the water-level as a dielectric, the Capacitance between two immersed probes will change - but you MUST use AC excitation for your probe circuitry. (Ardhuru - you MUST use shielded cable where the cores are individually sheilded, because across 50m of cable the Excitation Core will start inducing a signal into the Sensor Core - and you MUST capacitively couple BOTH the outgoing and the return core. Remember also that the return is high impedance). Everyone uses Resistance measurement, but that can change so much depending on the water purity. Go up into the mountains of Scotland, and some of the water coming out of the ground there is so pure that it's in the tens of Megohms with probes only a centimetre apart! Never mind bottling drinking water for humans (which is what the Scots are doing), I'd be bottling 'distilled' water for lead-acid cells and selling it at ten times the price! Hmmm great idea, time to Google for properties for sale in Scotland...

Another method is to use a low level RF tuned circuit with your coil as the probe (this is actually a Melanie invention). The water level rising up the encapsulated coil changes the tuned frequency (it would do since you are adding external Capacitance)... kinda like putting your fingers close to the LO of a Superhet Receiver changes the frequency. This is best in steel Tanks, but you have to watch the RF field level isn't too great otherwise you'll have your local FCC on your case!

Honeywell do some lovely optical Sensors... but you will need to mount ten of them and they are quite pricey each (around $15) - but they are favourites of mine as they have no moving parts the way floats or reed switches do. I'm not sure, but I do recall a multi-level magnetic reed switch (the reeds are mounted in the central column which is fully encapsulated, and there is a ring magnet on a float that travells up and down the central shaft). Danfoss is the manufacturer that spings to mind - but I may be mistaken.

Mind you, even with seven years playing with liquids there's still some level-sensing applications I can't get my head around to solving properly...

Archangel
- 19th July 2009, 08:25
I've done heaps on water-level sensing over the years... and my conclusions are that anything you put in the water will corrode and die eventually if it's not encapsulated and sealed or it's Stainless Steel.


That's it in a nutshell, either or. The key here is eventually. Copper pipes last 40 + years in water, but Eventually fail. Stainless steel is a pain in the . . . eye to work with without a machine shop, and cobalt or carbide tooling. Plastic on the other hand is very user friendly (encapsulated). The reed switch idea is good, and cheap, and could be easily encapsulated in plastic or a glass tube, a magnet on a float ring on the outside. Again it would be helpful to know the range we are measuring, how long it needs to last, 5 months, 5 years, 500 years . . . when selecting a method.

Melanie
- 19th July 2009, 08:37
Joe, Copper is fine if it is 'inert' like a length of pipework... but as soon as you start applying any sort of voltage to it (even if it's micro-volts) it causes electrolysis which speeds up it's demise. I'm not talking about the total destruction of your probe into a heap of debris at the bottom of your tank... think about it... if you are measuring Capacitance or Resistance, the smallest change of just the surface of your probe makes massive changes in your measurements rendering the probe useless - that can happen after only a few days of service!!

ardhuru
- 19th July 2009, 09:02
Some years ago, I had come across a page that advertised a plastic coated tape one could buy in any length; when immersed vertically, the pressure applied on the tape would change its resistance, depending on how much of it was submerged.

Unfortunately, I hadnt saved the URL, and cant seem to locate it now, however much I googled.

Archangel
- 19th July 2009, 09:10
Joe, Copper is fine if it is 'inert' like a length of pipework... but as soon as you start applying any sort of voltage to it (even if it's micro-volts) it causes electrolysis which speeds up it's demise.
I am well aware of electrolysis and DC electricity, as you stated:


The secret is to have AC excitation at the probes... electrolyis is then minimal if not completely eradicated. . .


I'm not talking about the total destruction of your probe into a heap of debris at the bottom of your tank... think about it... if you are measuring Capacitance or Resistance, the smallest change of just the surface of your probe makes massive changes in your measurements rendering the probe useless - that can happen after only a few days of service!! Yeah . . . that's the principle behind electrolytic capacitors, makes them smaller. Again, isn't this a DC problem? I think HIS solution is dependent upon His situation. Is there DC current IN the solution? Is the DC current on constantly, as in a constant monitoring situation? Or is it a check the level once or twice a day situation? How much money is he willing to spend? I have a motor home which has a galvanized steel water tank which has a wire probe to sense the water level, hooked to an analogue meter. this camper is a 1967 model year, and it still works and is not S.S. . The key is it only works when you push the button. I work with stainless steel on an ongoing basis, in a machine shop, and some of it is truly evil to work with. My argument is, unless this is a Life Critical, or very well paid for project which must last for many many years, then there may be alternatives to the highest priced solution. Then as for copper pipe not having electricity you might not be aware in the US the mains are usually grounded to the water supply. Your tank type water heater has a Magnesium sacrificial anode inside to handle electrolysis.

Archangel
- 19th July 2009, 09:23
Some years ago, I had come across a page that advertised a plastic coated tape one could buy in any length; when immersed vertically, the pressure applied on the tape would change its resistance, depending on how much of it was submerged.

Unfortunately, I hadnt saved the URL, and cant seem to locate it now, however much I googled.
You can "roll your own" 2 wires, some conductive foam, some heat shrink tubing, seal the end which is immersed . . . HOW DEEP is the water ?

aratti
- 19th July 2009, 09:41
10 stainless still screws (M3) with 20 nuts and 20 washers will cost no more than 1 $. they will be in AISI 304 not 316 but since we are dealing with water, they are ok.

Than he can use a resistive or capacitive solution as he prefer, having the resistors or caps perfectly sealed into a plastic tube.

Where is the problem?

Al.

Archangel
- 19th July 2009, 09:55
10 stainless still screws (M3) with 20 nuts and 20 washers will cost no more than 1 $. they will be in AISI 304 not 316 but since we are dealing with water, they are ok.

Than he can use a resistive or capacitive solution as he prefer, having the resistors or caps perfectly sealed into a plastic tube.

Where is the problem?

Al.
I like that better than submerged rods, and it will not require a machine shop, wires are in the pipe (encapsulated) great! See, that's some of that great engineering and design found in Ferrari, Alfa Romeo, I like it.

Byte_Butcher
- 19th July 2009, 19:31
Basically 3 tanks 2K to 5K litre capacity, non-metallic, heights 6 to 8 feet. Having got a quantitative reading from all 3 tanks, there's logic that also controls a pump to keep the levels at a required level..


I have a similar project I need to build, but haven't had the time yet.
Same type of deal... need to read the water level in two 11,000+ liter (3000 gallon) tanks and one 1200 gallon (4600 liter) tank.

I was thinking of using a 16F726 at each tank and using the built in capacitive sensing module. I would use small strips or squares of copper tape stuck to the outside of the tank at 10 different levels. That would sense the water level directly, with each square of foil being one capacitor plate, the water being the other, and the plastic tank wall the dielectric.

Water level data from each PIC would be transmitted down the hill (about 500 feet) through Cat5 cable to a "master controller" PIC located here at the house.

I'll be curious to see what solution you come up with and how well it works.


steve

steve

Darrel Taylor
- 19th July 2009, 19:46
How about an ultrasonic transducer like the parallax Ping.

Put a vertical PVC pipe in the tank, open at both ends, with a float in the middle.
At the top is the Ping measuring the distance down the pipe to the float.

Then you have a continuous level sensor.
<br>

Byte_Butcher
- 19th July 2009, 20:30
The Ping is cute. And its 3 meter range would be just enough for my tallest tank.

The $30 each price tag is a little tough to swallow since I'd need 3 of them.
But it would only require a pipe up the side of the tank with a ping pong ball floating in it.

Hmmm....




steve

Darrel Taylor
- 19th July 2009, 20:45
With the pipe acting as a "wave guide", the range is much further than it would be in open air.

I think even the previous ideas of submerged capcitors etc. would cost at least $30 in man-hours alone building it.
You can mount a pipe in a few minutes.

And you could always "roll your own" with an ultrasonic sensor @ $5.00, if the $30 is too much, but then there's that time vs. money problem again ...
http://www.sparkfun.com/commerce/product_info.php?products_id=8505
<br>

ardhuru
- 20th July 2009, 05:28
Sounds good, Darrel.

However, I wonder about 2 things; (a) how would the ambient humidity in a tank (or even that inside the pipe column) affect the transducer's life, and (b) how would the sound of water splashing about, especially when the tank fills up affect the readings?

comwarrior
- 20th July 2009, 05:49
Would it not be far more acurite to use a cheep pic at the tank with 'digital' probes and then comm lines back to main pic?

Other than that, i'm wondering why your using cap/resister solution...
Would two rods running all the way down the tank, one charged with say 5V DC and the other connected to a analogue port... as the water rises the resistance between the two rods changes and therefor the voltage on the analogue port would rise...

Just a thaught...

Sphere
- 20th July 2009, 17:36
Why not use a pressure switch like the kind you find in a washing machine, you can use the switch to turn the pumps on and once the required pressure is reached the pumps will cut off.

Sphere.

Darrel Taylor
- 20th July 2009, 18:27
Hmmm, yup pressure works good too.

12 Ft/head = ~5 PSI if I remember right?

Maybe an MPX???? (tube version) with some scalerobotics code. :)
Feet of head, instead of altitude. ??

Altimeter : up to 16 bit altimeter solution
http://sites.picbasic.net/component/option,com_uhp2/Itemid,6/task,viewpage/user_id,91/pageid,81/


MPX4115A Datasheet (http://www.freescale.com/files/sensors/doc/data_sheet/MPX4115A.pdf?fpsp=1&WT_TYPE=Data Sheets&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=pdf&WT_ASSET=Documentation) (up to 16 PSI)
<br>

Byte_Butcher
- 21st July 2009, 01:03
I was looking at pressure transducer options too.
Like these...
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=MSP6800-ND

But they're just as pricey as the "Ping" and I wonder how well they would like water inside them.



steve

aratti
- 21st July 2009, 07:28
I wonder how well they would like water inside them

Generally air pressure sensor hate water. But in this case the sensor can be located far away from water tank. All you need is a tube (the larger it is the best resolution you get) with the top end sealled and connected via a small plastic tube to your sensor. The open side of the tube is deeped into water so that if the level increase the space, inside the immersed tube will decrease and as a conseguence the air pressure will increase. The only problem with this method is that Pressure = volume * temperature (gas equation). So if temperature double also the pressure inside the tube will double without any change in water level. This to warn you to use also a temperature sensor and compensate the pressure reading for the temperature change.

Al.

Archangel
- 21st July 2009, 08:29
There is another downside to the air filled tube with a pressure sensor. The water will absorb the air and you will have a water filled tube. Now a sealed bladder would work.

Archangel
- 21st July 2009, 09:19
Basically 3 tanks 2K to 5K litre capacity, non-metallic, heights 6 to 8 feet. Having got a quantitative reading from all 3 tanks, there's logic that also controls a pump to keep the levels at a required level.

Unfortunately, yes, I did look at the alternatives you mention and had to discard them for various reasons:

Floats (I assume you mean the kind that is anchored, and has a float connected to a pot): would be difficult to get movement thruought the height of the tank. Also, the ambient humidity would junk it in a short time.

Hall effect or optical would be good, but I need to sense 10 levels in each tank; would be complex/expensive. I even considered an IR scheme with the technique Bruce describes on his site for distance measurement. Not to mention optical encoders with a float.


Yes, power is available, but I think if i could get away with data-over-the-Vcc-line, that would be more elegant. And cheaper than RF.

But first, I'm going to try out Melanie's suggestion about PWM and ADC;



Thanks; I've been trying to achieve this for a long time. If there's any interest on this subject, I'll keep posting my observations on this thread.
I do not know how I missed this post .. . Here is an optical method. Water is a pretty good difuser of light, way better than air, if you make up a vertical pipe with clear lucite pins penetrating the pipe and covered on the pipes inside with black tubing so light will not penetrate from their sides, when they are covered with water the light should be able to enter through the ends, or just use fiber optics. Please, pay no heed to the fact I misspelled TUBES as Tubs in the picture.

mackrackit
- 21st July 2009, 10:41
Hey Joe,
That is a good idea, I am going to give it a try.
For years I have had a similar problem but with hot sulfuric acid under pressure. Sonar and radar sensors work for a time, but sooner or later everything fails in that environment.
I never thought to use fiber optics.
Thanks!!!

ardhuru
- 21st July 2009, 14:53
.. . Here is an optical method. Water is a pretty good difuser of light, way better than air, if you make up a vertical pipe with clear lucite pins penetrating the pipe and covered on the pipes inside with black tubing so light will not penetrate from their sides, when they are covered with water the light should be able to enter through the ends, or just use fiber optics.

Looks good. In fact, I guess one could use IR detectors directly in place of the lucite pins, of course covered with black tubing so that only a small aperture at the tip is open.

Need to try this approach.

aratti
- 21st July 2009, 16:17
Detecting water level with optical system has one big enemy : The algas growth!

Al.

mackrackit
- 21st July 2009, 19:19
Use Ultraviolet light :)

Archangel
- 21st July 2009, 21:05
Detecting water level with optical system has one big enemy : The algas growth!

Al.
:D Hi Al,
I was pretty sure You would mention that one, and prepared for it:D
Illuminate the tube only while checking level. A 2000 liter tank level is not likely to change very much in an hour, so check intervals do not need to occur too often, still EVENTUALLY algae is likely to occur. Perhaps make the sensor rods screw in for cleaning. Dave's UV light would work, but is expensive.

mackrackit
- 21st July 2009, 21:17
A little shot of chlorine down the tube once and a while....

aratti
- 21st July 2009, 22:11
Hi Joe and Dave, going this way it could happen that this thread will come up with the best water level sensor ever invented.

Al.

mackrackit
- 22nd July 2009, 01:21
Hi Joe and Dave, going this way it could happen that this thread will come up with the best water level sensor ever invented.

Al.
Yep, kind of makes your signature line hold true.

I was googlin around earlier for fiber optics and saw a site advertising "side glow" fiber. It appeared to light up like a neon tube.

My thought. It it would receive light into the edge ? If so then maybe the more of less exposed would change the intinsity of light at the end? Make it work backwards.

Anyone played with this stuff?
http://www.fiberopticproducts.com/Sideglow.htm
they talk about a very bright like to make it glow, so maybe it would not work...

I have not played with optics much. What would happen it a glass rod had a flat side?