Picture of Building a Capacitive Liquid Sensor
     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

Picture of 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.

Step 2: Connecting the LCD and letting your creation talk to the world.

Picture of Connecting the LCD and letting your creation talk to the world.
Like every step in this instructable there are many ways to do this. I will show you my favorite.

    Your lcd has 16 throe hole solder pads so the first thing is to attach some pins. If your patent then I recommend purchasing a header like this But if you want to get done as fast as possible (like me) then you can use wire.
    Simple cut 16 pieces of wire at about 1/2" (13mm (longer is okay)). Then solder them to the board.

Step 3: Connecting the LCD Continued.

Picture of Connecting the LCD Continued.
Sins I'm using special characters I will be connecting all the wires.

Pin 1 Ground
Pin 2 +5 Volt
Pin 3 Contrast adjust
Pin 4 RS
Pin 5 R/W Goes to Ground
Pin 6-14 Data
Pin 15 Back-light Power
Pin 16 Back-light Ground

Step 4: Data Lines

Picture of Data Lines
Now you need to connect the Arduino to the lcd.
It doesn't mater what pins you use, but I recommend following the schematic.

1-40 of 41Next »
HarshalS14 days ago

Hi !

Could you please explain in detail, how to make the capacitor. I didnt got the exact idea behind it.

Akshay183523 months ago

hi i am trying to build a fuel sensor based on the above schematic using an arduino UNO. the sensor works fine with water but it does no work with petrol(gasoline). i think this is because petrol has a lesser dielectric constant compared to water. presently i am winding the foil on the opposite sides of the tank. please suggest me a method to increase the sensitivity of the sensor.

i cannot do anything from inside the tank so please suggest alternatives which can be implemented externally


victor.leroy14 months ago

Hi !

You said this project could be done with a standard Arduino board but i am wondering whether an Arduino Uno would serve the purpose, as it does not have send/receive pins. What do you think ?

how the resistor and the ground are connect to the arduino?

syedzeyad7 months ago

what is the material used in capacitence

gustavo_bf11 months ago

Hi. First of all, congratulations for your experiment.

I just did not understand what ''fuel = fuel - 7200'' and the ''fuel = fuel/93'' do.

Thank you!

VadimS (author)  gustavo_bf11 months ago

7200 is the capcitence without liquide. It's you're zero adjust.

93 is the adjustment for a full tank.

jimsims1 year ago

Excellent structable. I am interested in measuring and logging the tide
level in a saltwater canal. Do you think your concept would work for that? I would use stainless steel for the probe. I had planned to use pressure differential but I think I like the capacitance idea better.

VadimS (author)  jimsims1 year ago

A ss tube and ss rod in the middle would work, but you'll need to insulate it somehow. A thick player of polyurethane (it's the clear used with automotive paint) might do.

jimsims VadimS1 year ago
Thanks so much. I was thinking more like coating with the rubber liquid that is used for tool handles. Would I have to coat only the rod or both the rod and the tube?
VadimS (author)  jimsims1 year ago

Only the rod, the tube would be grounded. That setup would be a lot more
linear then what I built. so calibration would probably be easier.
Just need a reading with it above the water, and one all the way in.

mjbedford1 year ago
Agree, interesting project. I just tried it and it works pretty good! However, I have some comments/thoughts and was wondering if anybody could provide some feedback.
1. Since temperature could change the result, I was wondering if a temperature sensor was implemented, could this keep it calibrated? I assume the liquid temperature would be most important. I was thinking a temperature sensor attached to the water bottle at the lowest point.
2. The instructions mentioned that shielded cable would work better. Would you put the shield to the ground piece of foil and the center wire to the other foil (sense)? I did notice that the results we jumpy and that my hand would throw it off. I wonder if the shielded cable would help the result be more consistent and prevent the noise (from my hand).
3. I see in the image of the water bottle that the wire is soldered to the foil and then wrapped around the bottle a few times. It also appears you twisted the lead back. Are these important steps as well? Would they help with the noise? Would they be required if you are using shielded wire?

I also saw another writeup on this method and it mentions using an insulator over the foil and then another layer all the way around that is a ground plane.

VadimS (author)  mjbedford1 year ago
1: The best you can hope for is +- 5%, it's not vary accurate, and impurities in the water will affect the result far more then temperature.
2: Two conductor shielded cable. The shield should not be used as a conductor.
3: It's not wrapped around the bottle? The cable I used at the time was a twisted pair from an Ethernet cable.
4: An insulator and extra layer of foil would act as a shield

A far better option is a float attached to a potentiometer. I only used this because I could not put anything inside the tank.
match09271 year ago
It is an interesting project. Just be wondering what is the capacitance value in your measurement? A few pF or tens of pF? I will be having a similar project to go.

You mentioned “The sensor works by charging the capacitor (the water bottle) and measuring how long it takes to drain through the resistor.” Can you be a bit more specific on the process?

29guitarman4 years ago
hey yeah, how did you connect the wires aswell? can you explain further on how you set the bottle out?
VadimS (author)  29guitarman4 years ago
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.
Sorry to barge in so late after the initial post but there is an easy trick to this problem in fact! In electronics we love using aluminium tape to connect pieces of a frame to each other for EMC and grounding reasons. But copper tape also exists, and it's as easy to solder as regular wire. So you just slap a piece of copper tape on the aluminium and solder your wire to that. Saves you a lot of headaches.
pelrun5 years ago
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)  pelrun5 years ago
I just got lazy. I intend to add more after I test it on a real gas tank (Tonight or Thursday night).
How'd it go now that Thursday night was a year and a half ago?
VadimS (author)  VadimS5 years ago
I answered your specific question, hope it helps.
lw1194 years ago
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)  lw1194 years ago
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 VadimS4 years ago
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.
Hunter6014 years ago
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)  Hunter6014 years ago
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.

Ok, concentric tubes makes good sense. Thanks for the tip.
TheBestJohn4 years ago
 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)  TheBestJohn4 years ago
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.
linkthewise4 years ago
 Hey I one question did you cut the aTinFoil in two pieces and you put them in the sides of the conteiner?. 
zoltzerino4 years ago
 Good Instructable, nice XKCD's so true ;-)
MomentumV5 years ago
how well did this work with petrol instead of water?
VadimS (author)  MomentumV5 years ago
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%.
makkan5 years ago
Just what I have been looking for to measure the coffee level in the office coffee machine.
bullzebub5 years ago
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)  bullzebub5 years ago
It was built for a specific tank from a 10 hp brigs attached to a buggy.
lemonie5 years ago
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?

VadimS (author)  lemonie5 years ago
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 VadimS5 years ago
No, it's much more similar to air, water is more polarised / ionic. But do let us know how it works out.

jam BD5 years ago
nicely done =D

1-40 of 41Next »