Arduino Project Hub

Non-contact Capacitive Liquid Level Sensing using FDC1004 © MIT

We used a TI FDC1004 breakout with an Arduino to measure liquid level in a bottle using the capacitance between two adhesive copper strips.

  • 5,167 views
  • 19 comments
  • 48 respects

Components and supplies

Apps and online services

About this project

Liquid level sensing can be done in several different ways and we have tried several ways too. Sometimes what is required is accurate liquid level measurement without putting anything inside the liquid itself. This is especially preferred in applications such as in the food industry (for level sensing in tanks) and even fuel tank level sensing in automobiles.

We have earlier tried doing this is using a Laser ToF sensor, which is not the optimum way to do this.

What did we do:

We used capacitance to measure the liquid level by sticking two copper tapes on the OUTSIDE wall of the tank to measure the liquid level INSIDE. These two copper tapes measure the capacitance of one of the electrodes with respect to ground.

The TI FDC1004 is an all-in-one chip integrating capacitance measurement and an ADC in one package, calling it a "capacitance to digital converter". The specified applications including proximity detection, gesture recognition and liquid level sensing. ProtoCentral has a breakout board for this chip (ProtoCentral FDC1004 Capacitance Sensor Breakout Board).

The principle behind the use of capacitance for proximity sensing and liquid -level sensing is the same. When two parallel conducting plates are placed at a fixed distance from each other, electric fields are produced. At the edges of these plates, a "fringing" effect is produced. This fringing the key to capacitive sensing applications.

Capacitive sensing for different applications can be done in different ways. In this application, we are using the "parallel fingers" approach to sense the amount of fringe electric field lines being affected by the liquid level. This results in a small change on capacitance which is then measured and calibrated to the liquid level height.

How did we do it?

The actual application was a much larger setup, but for the sake of this article, we demonstrated the same on a small water bottle. We pasted two thin strips of adhesive copper tape (5mm wide) that we purchased from Sparkfun.

We then connected one of the electrodes to system GROUND and the other one to the CIN1 channel of the FDC1004 breakout board. It is best to solder these directly to the electrode itself to avoid any stray capacitance.

The ProtoCentral FDC1004 breakout board connects to an Arduino Uno using the I2C standard interface. This chip is connected to the SCL and SDA pins of the Arduino (for the Arduino Uno, this is A4 and A5). It can be connected to the I2C pins of any controller or platform, but the libraries provided are for Arduino only. If you're using a version of Arduino different from Arduino Uno, please check which pins correspond to the I2C/TWI SDA and SCL lines.

The data is sent through the Arduino's UART over USB to the computer. This data is continuously sent at a rate of 100 SPS and then averaged in the code, this helps in filtering out the noise.

In this example, we have just hard-coded the capacitance to level height conversion into the Arduino code itself, however, calibration can be used to set the same for various heights and liquid types.

We tested the setup using water pumped from another bottle by a peristaltic pump. All the required code is attached in the links below this article.

System in action !

Caveats

Any sensing or engineering mechanism always has it's own set of limitations. For this application, this is what we noticed:

  • Capacitive sensing is prone to external stray capacitance and sometimes it saturates the ADC. This was however fixed using proper shielding.
  • Calibration is key and accurate calibration is very important
  • Environmental factors have a huge effect on the capacitance and they have to be shielded from and/or corrected appropriately.

You can let us know your experiences with capacitive sensing in the comments below.

Schematics

Breakout board schematics and connections
Breakout board schematics and connections

Code

Arduino Code and libraries
Arduino Code and libraries

Comments

Similar projects you might like

NeoMatrix Arduino Pong

Project tutorial by Arduino “having11” Guy

  • 91 views
  • 0 comments
  • 5 respects

Arduino Bluetooth Interfacing

Project tutorial by ADAM PHILIP

  • 561 views
  • 4 comments
  • 12 respects

Arduino Traffic light controller

by ADAM PHILIP

  • 243 views
  • 0 comments
  • 10 respects

Arduino alarm system

by ADAM PHILIP

  • 365 views
  • 0 comments
  • 11 respects

Spideruino

Project showcase by JulienChateau

  • 2,446 views
  • 4 comments
  • 25 respects

Combat Ready LED Light Show

Project showcase by SlinkyMation

  • 216 views
  • 0 comments
  • 5 respects
Add projectSign up / Login