Building a Capacitive Liquid Sensor

 by VadimS
Featured
     A capacitive liquid sponsor relies on the fact the the capacitance or charge between 2 metal plates will change (in this case increase) depending on what material is between them.
     This allows us to create a level sensor that is safe for use with any liquid, this one will be used in a buggy with gasoline (petrol).

One plate is hooked to ground. The other connects to pin 23. There is a 820K ohm resistor from pin 22 to 23. The sensor works by charging the capacitor (the water bottle) and measuring how long it takes to drain through the resistor.
 
Remove these adsRemove these ads by Signing Up

Step 1: Parts

1. A solder-less bread board is strictly not needed but make it a lot easier, especially if you plan to add other stuff later.
2. Arduino, I'm using an Arduino mega but a standard one should have just enough pins.
3. LCD character display.
4. Some odds and ends including some wire and a 1MΩ resistor.
5. A computer, you know, that thing your using to read my instructable with.
6. Patience.
pelrun says: Dec 7, 2009. 8:08 PM
Sweet 'ible, but can you elaborate more on exactly how the bottle is wired up? It's rather brief and ambiguous at the moment...
VadimS (author) in reply to pelrunDec 7, 2009. 10:17 PM
I just got lazy. I intend to add more after I test it on a real gas tank (Tonight or Thursday night).
bill.schuller in reply to VadimSFeb 8, 2012. 6:35 PM
How'd it go now that Thursday night was a year and a half ago?
VadimS (author) in reply to VadimSDec 7, 2009. 10:25 PM
I answered your specific question, hope it helps.
29guitarman says: Mar 31, 2011. 4:40 AM
hey yeah, how did you connect the wires aswell? can you explain further on how you set the bottle out?
Cheers
VadimS (author) in reply to 29guitarmanMar 31, 2011. 12:49 PM
2 pieces of aluminum foil on aether side. One wire soldered to each.

One acts as a ground, the other sens.
doesn't matter witch way around you set it up.

The sheets should go from the bottom to top of the container.

It's a bit of a pain to solder aluminum foil but can be done. otherwise anything conductive.
lw119 says: Nov 29, 2010. 5:55 PM
This is pretty clever. I think I am going to try something similar.

I have pet cockatiels that love to backwash in their water dish. It doesn't take long for the water to get kinda nasty. I wonder if something like this could be used to alert me when their water needs a change out.

Have you ever noticed a significant reaction to the electrolyte getting contaminated? Any tips you can offer would be much appreciated.

Thanks for the inspiration.
VadimS (author) in reply to lw119Nov 29, 2010. 6:21 PM
Hmm, never tried. I don't think it would be able to tell the difference between a change in water lvl and stuff in the water.

Using an infrared led on one side and a receiver on the other could be used to detect when impuritys where in the water.

lw119 in reply to VadimSNov 29, 2010. 6:55 PM
I have a float that maintains the water level so I don't think that would be an issue.

I considered the infrared idea but they like to bathe in the water too, so that might trip it. Plus, they like to break things, so I was hoping some submerged concentric metals tubes would be beak proof.

I guess it's a trivial problem but a fun challenge.

Thanks for the reply.
Hunter601 says: Oct 14, 2010. 3:18 AM
Hmm.. I'm trying to figure out if this would be the right way to measure the qty of Heating oil left in a 1000 Liter plastic tank, which is about 160 cm high and the other dimensions about 80 cm each.
I haven't noticed (or have overlooked) any max practical size for your setup but I assume it might not work out for my requirements, right?

Could anyone point me in the right direction? Maybe sink a pressure sensor to the bottom of the tank and read out the static pressure, using an Arduino?
VadimS (author) in reply to Hunter601Oct 14, 2010. 6:46 AM
The accuracy decreases when you move the plates away from each-other.

Your best bet would be to use a couple metal pipes. one inside the other making shire they don't touch.

Then use this setup to measure the capacitance between them.


Another option is a simple float inside a tube, with a small magnet attached to it. Then put some read switches along the length of the pipe.

Hunter601 in reply to VadimSOct 14, 2010. 7:23 AM
Ok, concentric tubes makes good sense. Thanks for the tip.
TheBestJohn says: May 25, 2010. 11:11 AM
 2 questions and a comment.

1: so the two aluminum sheets sit outside the container? one on either side of it?

2: would there not be a risk of the capacitor discharging and creating a spark?

Comment: NO METAL CONTAINERS!? I guess a keg level sensor is out of the picture lol.
VadimS (author) in reply to TheBestJohnJul 16, 2010. 8:43 AM
Kind of lait, but anyway. The plates only run at 5v so a spark is extremely unlikely. You can build one to go in a keg using a metal rod and a metal pipe but you would have to modify the keg and re-weld it when you're done (not so easy on aluminum. Yes the sheets sit on the outside. Thay can be put on the inside but need to be electrically isolated from the licqwid.
linkthewise says: May 7, 2010. 12:56 AM
 Hey I one question did you cut the aTinFoil in two pieces and you put them in the sides of the conteiner?. 
zoltzerino says: Apr 9, 2010. 4:49 PM
 Good Instructable, nice XKCD reference...it's so true ;-)
MomentumV says: Feb 2, 2010. 8:09 AM
how well did this work with petrol instead of water?
VadimS (author) in reply to MomentumVFeb 17, 2010. 12:42 PM
We broke a few things on the buggy so it hasn't bean installed yet. But I did test it with gasoline (petrol) and it works, it's accuracy is down a bit at about 10%, with water it was within 5%.
makkan says: Jan 28, 2010. 11:44 PM
Just what I have been looking for to measure the coffee level in the office coffee machine.
bullzebub says: Dec 9, 2009. 3:16 AM
how are you going to handle the odd shapes of a gas tank?
it would be nice to have someting that shows a realistic approximation on whats left in the tank.... not like most car systems
VadimS (author) in reply to bullzebubDec 9, 2009. 1:36 PM
It was built for a specific tank from a 10 hp brigs attached to a buggy.
lemonie says: Dec 8, 2009. 12:20 PM
The permittivity of water is about 80x that of air, the permittivity of gasoline is about 2x. Are you confident this will be sensitive enough on a gas-tank?

L
VadimS (author) in reply to lemonieDec 8, 2009. 1:35 PM
I originally thought that gasoline would be smiler to water.
But I'll find out for sure Thursday night.

I might just use the howl tank as in plate, plastic tank, plate.

lemonie in reply to VadimSDec 8, 2009. 1:38 PM
No, it's much more similar to air, water is more polarised / ionic. But do let us know how it works out.

L
jam BD says: Dec 7, 2009. 7:51 PM
nicely done =D

Erik Lindemann says: Dec 7, 2009. 7:34 PM
Favoriting this. I love the logic that went into this homebrew liquid level sensor.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!