Liquid Level Capacitive Sensor




Introduction: Liquid Level Capacitive Sensor


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

Step 1: Waterproof Concentric Tubes

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:

Step 2: Cover the Tubes With Aluminum Foil

Step 3: Assemble the Tubes and Their Covers

  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.

Step 4: Connect to the Arduino

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 }

Be the First to Share


    • Remote Control Contest

      Remote Control Contest
    • Digital Fabrication Student Design Challenge

      Digital Fabrication Student Design Challenge
    • Build a Tool Contest

      Build a Tool Contest



    5 years ago

    Just about 6pF, first try in dry air.

    C = E0 * Er * O / d
    E0 = 8.854 E-12
    Er = ~ 78 (water) but not here, it's more 10-12 times, here.
    O = Length * Width (Length in tube = diam * 3,14)
    d = distance between the "Plates"

    Would giv' 6pF in water ~72pF


    5 years ago

    Does it works with oils?


    5 years ago

    Just curious, have you measured the actual capacitance range of your sensor? I just constructed a capacitive fluid sensor, a really quick and dirty one using a strip of 3mm coroplast, aluminium foil tape and some waterproof sealing tape. I did this as a proof of concept, the sensor is 18" long, the capacitance measures 0.3 nF when dry and just over 2.0 nF in 9" of water. I'm wondering how that compares to a sensor like yours.

    This instructable motivated me to get started with this. Thanks.