1
\$\begingroup\$

I'm trying to make a capacitive water level sensor using two enameled copper wires used in transformers. I've used sanitary silicone to insulate the bottoms of the wires. (Coating is insulated by default.) The distance between them is 0.5 cm, they are submerged in a water tank made out of acrylic glass. As the fluid level rises, capacitance should change, the "sensor" is connected to a IC555 timer which is used to generate a square wave with frequency inversely proportional to the capacitance.

Then I'm calculating the time which passes between two rising edges of the pulse using an STM32 microcontroller. I've connected the IC555 timer output to an oscilloscope and when the tank is empty it gives a square wave of a certain frequency, but when the water level rises nothing changes. What did I do wrong? What could be the issue? I'd like to hear someone more experienced on the matter since I'm just a student and I lack experience. Any help would be appreciated, thanks in advance.

\$\endgroup\$
  • 2
    \$\begingroup\$ I read know that silicone conformal coating as well as many seemingly waterproof materials used for insulation) are not suited for submersion since the moisture permeate through eventually. \$\endgroup\$ – Toor Feb 28 at 16:53
  • 2
    \$\begingroup\$ This assembly is probably not sufficiently insulated against leakage to measure the minuscule capacitance, and all but certainly will not remain so even if it is to start. Further it's doubtful that your 555 circuit can see this capacitance, at least not without a huge resistor. But you can probably measure it directly with the STM32 - look up some capacitance meter examples, you may more readily find them for ATmega's but in theory the ideas are portable, especially if an MCU has an analog comparator which can stop a hardware timer, or is fast and has little else to do. \$\endgroup\$ – Chris Stratton Feb 28 at 16:58
  • 1
    \$\begingroup\$ microchip.com/stellent/groups/SiteComm_sg/documents/DeviceDoc/… is a description of the Charge Time Measurement Unit present in Microchip's devices for detecting touch sensing, you describe a similar approach. The currents involved are very small for the small capacitances involved, so care needs to be taken with the design to prevent leakage currents from swamping the measurement. \$\endgroup\$ – Phil G Feb 28 at 17:19
  • 2
    \$\begingroup\$ How deep is the tank? what resolution of distance do you need? have you researched the formula for capacitance between two wires? \$\endgroup\$ – analogsystemsrf Feb 28 at 17:42
  • 1
    \$\begingroup\$ How are you holding the wires in position? If you have a framework that's coming between them (i.e., if you've got them buried in slots in a plastic stick or something like that) then you'll be measuring the permittivity of the framework, not, by far, the changing permittivity of the water/air interface. \$\endgroup\$ – TimWescott Feb 28 at 17:51
1
\$\begingroup\$

I'm trying to make a capacitive water level sensor using two enameled copper wires used in transformers. ... The distance between them is 0.5 cm, they are submerged in a water tank made out of acrylic. As the fluid level arises capacitance should change, the "sensor" is connected to a IC555 timer which is used to generate a square wave with frequency inversely proportional to the capacitance.

Unfortunately the capacitance is miniscule and totally inappropriate for use with a 555 timer based measurement. You are dealing with pF.

There are potentially a range of relatively easy approaches you might take:

  1. Use a sonar acoustic sensor to measure the return from the top of the fluid.
  2. Use a TDR (Time-Domain Reflectometry) measurement of the parallel wires and measure the reflection from the air/fluid transition.
  3. Back the parallel wires with a magnetic strip (fridge edge magnet) and measure the time for a coupled pulse to return from the air/fluid transition (very similar to TDR but much slower wave front speed)
  4. Use stainless steel piano wire and an acoustic signal pulse to measure the time to air/fluid transition (reflection).
  5. Measure the pressure at the bottom of the tank (there are some very sensitive pressure sensors).
  6. Bounce a Laser off the air/fluid interface and use a cheap camera chip to measure the angle.

This might be a good start to you reading on sensors for measuring fluid levels.

\$\endgroup\$
  • \$\begingroup\$ Note that it's fairly simple to measure such a capacitance with an MCU having an analog comparator like an ATmega does. I was frankly amazed that such a simple setup could measures differences of a pf or two. A practical design may need a way to remove the sensor capacitance and self calibrate (is, subtract the stray capacitance of the circuit itself). \$\endgroup\$ – Chris Stratton Feb 28 at 18:21
  • \$\begingroup\$ @ChrisStratton I agree it could be done, but as I said ...inappropriate for a 555 based solution. The difficulty with your proposal is it's unknown what the fluid is, so hard to work out what the capacitive junction looks like. You could also use the capacitance to control an osc frequency, and measure the frequency using an MCU. Not too hard but very sensitive to external stray capacitance. In this case I'd enclose the wires n a tube where at least the tray values are fixed. \$\endgroup\$ – Jack Creasey Feb 28 at 18:41
  • 1
    \$\begingroup\$ @JackCreasey Well, the OP did say water. So I imagine they're using water instead of just using it as a catch-all term for liquids. \$\endgroup\$ – Toor Feb 28 at 18:41
  • \$\begingroup\$ @ChrisStratton Water is a large range of fluids. Distilled water through Sea water. You have no idea of the makeup of 'water' unless the OP defines it. \$\endgroup\$ – Jack Creasey Feb 28 at 18:43
  • \$\begingroup\$ Using tap water. Sorry for not being specific. \$\endgroup\$ – Robert Sabljo Feb 28 at 19:22
0
\$\begingroup\$

Unfortunately no. Several other good answers address the capacitance problem. Another problem is that the lacquer on enamelled copper wire is not guaranteed pinhole free i.e. the insulation is likely not perfect. In winding a transformer or inductor this doesn't matter, since the pinholes are unlikely to coincide and cause a shorted turn. Varnish impregnation after winding also helps to stop corrosion by moisture getting in the pinholes.

In your application, if there is even one pinhole in each wire, and the water conducts any of the signal, this is likely to swamp any capacitive effect.

\$\endgroup\$
0
\$\begingroup\$

Enameled copper wire is a poor choice, both because of insulation issues and because of the small surface area and thus low capacitance.

I have seen very good results by using a plastic straw filled with a conductive fluid (e.g., salt water) as one plate and the water outside (also conductive) as the other plate. A Colpitts oscillator could be used with this capacitor to detect changes in level of a few hundred micrometers (I gave this as a lab assignment, all 30 student teams succeeded doing this).

You need considerable surface area so that the capacitance change becomes significant. In the example I gave what is changing is the size of one of the plates. If you use two conductive 'tubes' instead, what you are changing is the dielectric constant by a factor of 80 if you assume the water is non-conductive, or increasing the size of the plate if the water is conductive (unless you are dealing with deionized water there is always some conductivity present).

But a 555 circuit (a relaxation oscillator) will not give you the precision required for measuring the minuscule changes as parasitic capacitances and switching delays will dominate. Use a tuned LC oscillator instead, in which the water capacitor is a considerable portion of the resonant frequency.

\$\endgroup\$
0
\$\begingroup\$

As already mentioned, capacitance is too low to be sensed. Use rectangular electrodes of size, matched to the size of the tank (as large as possible). Test if timer circuit detects additional capacitance when you connect electrodes (of empty tank). Only in such case the rise of capacitance (caused by water) will also be noticed by the circuit.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.