Liquid Level Capacitive Sensor

by luismorales-navarro in Circuits > Arduino

7839 Views, 65 Favorites, 0 Comments

Liquid Level Capacitive Sensor

IMG_20160705_152709.jpg

Developed @FABLAB VERITAS fablab.veritas.cr

In this tutorial you will learn how to make a capacitive sensor to measure liquid levels. You will need the following:

  1. Arduino UNO
  2. 1M Resistor
  3. Prototyping cables
  4. SVGs of the tubes
  5. 3D Printer
  6. Aluminum foil

Waterproof Concentric Tubes

IMG_20160705_111858.jpg
Screen Shot 2016-07-13 at 16.24.00.png
Screen Shot 2016-07-13 at 16.16.16.png
Screen Shot 2016-07-13 at 16.18.18.png
Screen Shot 2016-07-13 at 16.22.06.png
IMG_20160705_111748.jpg

The sensor works with two pieces of aluminum inside of two waterproof concentric tubes.

You can download the parts and their 3d models to print them here:

Cover the Tubes With Aluminum Foil

IMG_20160705_112828.jpg
IMG_20160705_112415.jpg

Assemble the Tubes and Their Covers

IMG_20160705_152657.jpg
IMG_20160705_152645.jpg
FRP36HWIQL776O9.jpeg

  1. Introduce the inner tube covered in aluminum foil in the inner tube cover.
  2. Introduce the external tube covered in aluminum foil in the external cover.
  3. Introduce the inner tube in the outer tube and glue them together with hot glue.
  4. Make sure that when the tubes under a liquid the liquid does not touch the foil.
  5. Solder a cable to each piece of aluminum foil.

Connect to the Arduino

Untitled drawing (2).png
Esquema sensor de nivel de agua.jpg
IMG_20160705_155355.jpg

Follow the diagrams above to connect the Arduino and then use the Capacitive Sensor Library example.

/* * CapitiveSense Library Demo Sketch * Paul Badger 2008 * Uses a high value resistor e.g. 10M between send pin and receive pin * Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values. * Receive pin is the sensor pin - try different amounts of foil/metal on this pin */ CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2); // 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired void setup() { cs_4_2.set_CS_AutocaL_Millis(0xFFFFFFFF); // turn off autocalibrate on channel 1 - just as an example Serial.begin(9600); } void loop() { long start = millis(); long total1 = cs_4_2.capacitiveSensor(30); Serial.print(millis() - start); // check on performance in milliseconds Serial.print("\t"); // tab character for debug windown spacing Serial.print(total1); // print sensor output 1 Serial.print("\t"); delay(10); // arbitrary delay to limit data to serial port }