Author Topic: Low-cost liquid level sensing  (Read 845 times)

0 Members and 1 Guest are viewing this topic.

Offline jp430bbTopic starter

  • Contributor
  • Posts: 44
  • Country: us
Low-cost liquid level sensing
« on: August 06, 2019, 01:49:23 am »
I'd like to share a little experiment.  I have an MSP430G2553 MCU with a long U-shaped loop of PVC-insulated wire (indicated by white arrow) attached to one pin.  The loop runs vertically about 60cm into my basement sump pit.  The TI CapTIvate capacitive touch-sensing feature sets up a relaxation oscillator on the pin and measures shifts in frequency when the capacitance changes.  Increasing water level increases the capacitance, which shows up as a slow drop in counts in the plot below.  When the sump pump runs, the water level drops in a few seconds, and the counts rise quickly. 

This setup has been going since October, 2018.  It's satisfied my curiosity about how often the pump runs, how quickly the pit refills, etc. The shoulders on the profile during refilling seem to be real; I recorded video of a few refills and could see the water level rise quickly then slowly then quickly again. 

I definitely wouldn't count on this sensor to sound an alarm or control the pump.  I've had better luck with it than I had with an ultrasound sensor pointed at the water surface, though. 
 
The following users thanked this post: electrode, ledtester

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 8490
  • Country: ca
Re: Low-cost liquid level sensing
« Reply #1 on: August 07, 2019, 05:06:25 am »
Interesting experiment  :-+ thanks for posting. With a bit of work, it could be good enough for pump control.

It looks like the sense electrode needs more (metal) area to get larger counts and more range. The wire's PVC insulation must be a factor, PVC dielectric constant is ~3 compared to water ~80, acting like an air gap is around the wire's conductor, so the capacitance is much less. Maybe more than one U-loop. That's my theory but I would have to model it or do the physic's math.
A bare stainless steel rod or tube (with a coupling capacitor to prevent any electrolysis) would be worth trying.

The graphs can predict failure of the pump, or float switch, drain hose etc.
Although I had a start capacitor short and the pump was locked-rotor staying powered up, and heated up the sump water quite a bit. That was a weird failure. Another was the outlet drain hose popped off and water dumped right close to the foundation wall, and cycle time was crazy short. Every 10 minutes the pump was on but it wasn't raining out.
You really need a high-high level alarm, pump run timer, as part of an embedded solution.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf