Capacitive water level sensor interference? - Page 1
Forum section: electronics / beginners

author: e100
author_rank: Frequent Contributor
timestamp: December 06, 2015, 12:37:51 pm
content: I've built a capacitive level sensor using the RC oscillator in a 4060 oscillator/divider. I use 2 insulated electrodes about 5mm apart which gives a capacitance of about 50pF when dry and much higher when wet. The charge/discharge resistor is 10k.The oscillation frequency is very stable with the electrodes in air, or in a bucket of water, but becomes unstable when measuring the level in a 5x2x2m fibreglass water tank.Application notes for commercial sensors usually show the fluid (or powder) inside a metal tank with the conductive wall of the tank forming one electrode and the other electrode suspended in the middle. Concentric electrodes are commonly used for non conductive fluids such as oil or fuel.Have I hit some fundamental limitation of capacitive sensors when used in tank with a conductive fluid that has no capacitive shielding from outside interference?

author: mikerj
author_rank: Super Contributor
timestamp: December 06, 2015, 02:18:05 pm
content: Are you getting any leakage currents between your electrodes in the large tank? Maybe try measuring resistance with a DMM.Another possibility is that you have added significant inductance into the RC circuit with long connecting wires.

author: Ian.M
author_rank: Super Contributor
timestamp: December 06, 2015, 02:32:46 pm
content: I assume you have a large value low leakage cap in series with the sensing electrode so it can tolerate a little insulation leakage.Another possibility if it worked initially but has become unstable is that a conductive biofilm has formed on the sensor's insulation. How are the electrodes mounted and separated?You also have to avoid using unscreened electrodes if there is a strong local AM radio transmitter. The 4060 with a 210K resistor and a 50pF capacitor will have an oscillator frequency of about 900KHz so if there is a local transmitter in the lower half of the medium wave band, I would expect issues.

author: e100
author_rank: Frequent Contributor
timestamp: December 06, 2015, 03:08:27 pm
content: The 4060 and the electrodes are 5cm apart. The whole thing is encapsulated in epoxy/silica sand with re-entrant silicone gel at the top for the wiring connections. The goal was to make something that could survive rain or being accidentally dropped into the tank. The signal (divided by 1024) is exported via a max485 down 45m of non-twisted, non-screened "alarm" type cable. The 4060 and the max485 each have their own voltage regulators and decoupling caps, but aren't optically isolated from each other.The electrodes are 5mm wide interleaved tracks on a fibreglass PCB with a 1mm thick fibreglass epoxy insulation layer with a 2mm insulation margin around the edges. The overall dimensions are 30cm x 7cm. I haven't done leakage tests and I didn't use a add a cap to guard against insulation leakage. It's new so there's no biofilm. In a bucket its stable, in a big tank it isn't.About 10km away theres a radio mast broadcasting 10 kW on 585 kHz, 20 kW on 810 kHz and 50 kW on 720 kHz.

author: SeanB
author_rank: Super Contributor
timestamp: December 06, 2015, 03:22:20 pm
content: Plastic or steel tank? If plastic get some stainless steel mesh and make a screen for the sensor, basically a cylinder with a stainless steel wire running up to connect to the common ground of the supply cable and a wire leading down to a grounding rod next to the tank. If it is a steel tank add the grounding rod and see if using screened Cat5 network cable, about the same price as the alarm cable, and available in a direct ground buriable version as well, otherwise conduit or nylon air line works well. You very likely have RF interference, so need to have a grounded shield on the cable and sensor. Try as well orientation, line the thin side of the board so it faces the transmitter antenna to reduce pick up.

author: Ian.M
author_rank: Super Contributor
timestamp: December 06, 2015, 03:32:57 pm
content: The bucket is isolated from ground, the big tank isn't due to its plumbing connections. Try a test, battery powering it so its fully floating and check the output with a multimeter on frequency or similar to avoid introducing a ground or significant capacitance to ground. If that fixes the issue, you'll have to add an isolated DC-DC converter to power the 4060 and optoisolation between it and the line driver.Where did you do the bucket test? If the tank is high up and you did the bucket test at ground level, RF could be affecting it in the tank but be insignificant in the bucket.Is the tank's plumbing metal or plastic?@SeanB: the O.P. stated its a "5x2x2mfibreglasswater tank" initially.

author: SeanB
author_rank: Super Contributor
timestamp: December 06, 2015, 04:11:34 pm
content: So the sensor likely will need the mesh screen, preferably all round to make a reasonable Faraday cage, and use some ferrite toroids on the cable to reduce the RF coupling into the cage.

author: e100
author_rank: Frequent Contributor
timestamp: December 06, 2015, 04:21:17 pm
content: Quote from: Ian.M on December 06, 2015, 03:32:57 pmThe test setup uses a 9v isolated bench power supply and an oscilloscope running from an isolation transformer.The tank and bucket are at ground level. The tank plumbing is UPVC plastic, the tank is fibreglass.

author: Ian.M
author_rank: Super Contributor
timestamp: December 06, 2015, 04:25:53 pm
content: Make up a cable with a good sized bare metal electrode on each end. Dip one in the tank. If the problem reappears when you dip the other in the bucket its a grounding issue.

author: e100
author_rank: Frequent Contributor
timestamp: December 06, 2015, 05:04:35 pm
content: Quote from: SeanB on December 06, 2015, 04:11:34 pmDoes the Faraday cage need to be in electrical contact with the water, or would grounded plastic coated wire mesh still work?

author: e100
author_rank: Frequent Contributor
timestamp: December 06, 2015, 05:05:26 pm
content: Quote from: Ian.M on December 06, 2015, 04:25:53 pmI'll try that tomorrow.

author: SeanB
author_rank: Super Contributor
timestamp: December 06, 2015, 05:13:18 pm
content: Just needs to be grounded, and as plastic coated mesh typically will have pinholes that rust I would go with some 316l stainless steel mesh, which can be welded using TIG welding to a stainless steel rod extending out of the water and then ground that. Fine so long as you do not have salt water, it will last a long time, and a coarse mesh works well and will not clog with biofilm.60 to 120 mesh will work, just is a pain to cut and weld, though I have done it inb the past, though I use it to make filter screens, so I buy it by the roll. Normally get a few hundred punctures fitting the screen onto the round framing and tensioning it. Just making a round cylinder, then a plate spot welded to the seam, should do a lot to screen the sensor. You can even make a well that fits the top hole, so the sensor lowers into it, that is deep enough to hold the sensor, so you do not have to do any welding just do a 2 turn mesh sleeve.

author: briselec
author_rank: Regular Contributor
timestamp: December 06, 2015, 10:39:22 pm
content: I've had a bit of experience with off the shelf floatless level switches. They are quite handy and can be used for other things then detecting liquid levels.Never had a problem with interference including with the high sensitivity ones I've used for detecting steam condensate.Never needed to use a mesh. Just bare electrodes work fine, usually 2 for detecting high and low levels to get clean switching of the output and either a third electrode or connected to a conductive tank.Best thing for mounting the electrodes is those things that look like spark plugs that you can extend with threaded rod and coupling nuts. Can't remember what they are called.Looking at an Omron model, it doesn't have an oscillator. The electrodes are connected to an 8V secondary on a mains fed transformer.

author: briselec
author_rank: Regular Contributor
timestamp: December 06, 2015, 11:17:25 pm
content: Omron BS1 electrode holder. No wonder I couldn't remember what it is called. Derp!This datasheethttp://www.omron.com.au/data_pdf/cat/61f-g__ds_e_4_2_csm3.pdf?id=244shows the internal circutry. There's not much to them.

author: e100
author_rank: Frequent Contributor
timestamp: December 07, 2015, 05:31:04 am
content: I did some more experiments.1) With the sensor in a bucket, running a wire from the bucket into the tank made it unstable.2) With the sensor in a bucket, running a wire from the power supply ground into the bucket stopped the oscillation completely.3) Likewise, with the sensor in the tank, running a wire from the power supply ground into the tank stopped the oscillation completely.

author: Ian.M
author_rank: Super Contributor
timestamp: December 07, 2015, 05:59:25 am
content: That's NOT GOOD as it indicates there may be a voltage difference between PSU ground and the water in the tank. Got a scope? If so, disconnect the tank wire from PSU ground and see what AC and DC voltages are present on it. If not, do the best you can with a multimeter, and the largest non-polarised cap you have handy for the AC measurement.If there is a significant voltage, you'd get electrolytic corrosion of either your screen, or worse, some metal fitting elsewhere in the system, which would put potentially toxic metal salts into the water, and increase the risk of a catastrophic leak.

author: e100
author_rank: Frequent Contributor
timestamp: December 07, 2015, 06:28:22 am
content: Quote from: Ian.M on December 07, 2015, 05:59:25 amThe power supply (and scope) are isolated except for a single PSU ground wire running to the tank (or bucket). The oscillation stops in both cases.

author: Ian.M
author_rank: Super Contributor
timestamp: December 07, 2015, 07:06:26 am
content: What AC current do you measure between PSU 0V and a good earth?I suspect you've got capacitive coupling to the mains supply.

author: e100
author_rank: Frequent Contributor
timestamp: December 07, 2015, 07:23:17 am
content: Quote from: Ian.M on December 07, 2015, 07:06:26 am0.4mA AC to mains protective earth.Correction, 0.01 mA AC to mains protective earth.

author: Ian.M
author_rank: Super Contributor
timestamp: December 07, 2015, 07:29:50 am
content: That's not too bad. Try connecting the PSU 0V to earth and see if the problem also goes away.

author: e100
author_rank: Frequent Contributor
timestamp: December 07, 2015, 07:41:58 am
content: Quote from: Ian.M on December 07, 2015, 07:29:50 amOscillation still stops.

author: Ian.M
author_rank: Super Contributor
timestamp: December 07, 2015, 10:35:26 am
content: In that case, you are FUBARed and will need to redesign either your sensor, your oscillator or both.

author: e100
author_rank: Frequent Contributor
timestamp: December 07, 2015, 11:17:36 am
content: Doing some more tests in the workshop with just a bucket and 5m of cable.I added a spray coat of PCB lacquer just in case there were pin holes in the sensor insulation.With the bucket connected to the power supply ground, I can lower part of the sensor area into the water and watch the frequency decrease as expected. Once a third of the sensor is submerged the oscillation suddenly stops, no instability at all, it just stops oscillating. Removing the sensor starts the oscillation again.With the sensor 1/4 submerged, removing the wire to the power supply ground from the bucket causes the oscillator to double in frequency. I'm not sure if that is expected or not?

author: Ian.M
author_rank: Super Contributor
timestamp: December 07, 2015, 11:51:21 am
content: The first thing I'd try would be a new sensor with the earthy side uninsulated.Take straight lengths of 22mm and 8 or 10 mm copper pipe. Cover the small pipe in heatshrink, and plug up one end with hot glue to make it watertight. Put three nylon cable ties equally spaced around it at each end as a spider to keep it centred, put it in the 22 mm pipe and cross drill the top end for a nylon bolt right through to hold it vertically.Connect it with 1uF non electrolytic between each electrode and the circuit, and use the outer electrode for ground.You might do better applying HF through a capacitor of 10% of the sensor's fully immersed capacitance to the active electrode, and rectifying the voltage across the sensor with a Schottky diode voltage doubler rather than trying to make it self-oscillating. If you need a pulse output, use that to modulate the control voltage of a 555.