Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Guides
  3. ›Sensors
  4. ›Liquid Level Sensors

Buying guide · Intermediate · 3 min read

Liquid Level Sensors

Float Switches, Non-Contact, Ultrasonic and Submersible

By Geekobot Learning Team · Updated 29 Oct 2026

I'm using
Wiring, code and the Run it panels follow your board.
On this page
Short answerChoosing a level sensorWiring and electrical notesPump control with two floatsGetting reliable readingsTry itCommon mistakesFAQsParts and next steps
Short answer

The right liquid level sensor depends on whether you need a single trip point or a continuous reading. Float switches are cheap, reliable point sensors. Non-contact capacitive sensors stick to the outside of a plastic or glass tank. Ultrasonic sensors read the distance to the surface from above. Submersible pressure sensors measure depth in tanks and wells. Avoid bare PCB probes in water, because they corrode.

Key specs at a glance

Float switch
Point level; reed switch rated about 10 to 50 VA; mounts vertically or horizontally
Capacitive non-contact
Point level through up to roughly 20 mm of plastic or glass wall
Ultrasonic
Continuous distance, dead zone of 2 to 25 cm depending on the sensor
Submersible pressure
Continuous, 0 to several metres, 4-20 mA, 0.5-4.5 V or RS485 output
Bare conductive probes
Cheap but corrode quickly; use for short tests only
01

Choosing a level sensor

First decide between a point sensor (full, empty or a trip level) and a continuous sensor (percentage full).

TypeReadsProsCons
Float switchOne level per switchCheap, rugged, no electronics, handles pump loads through a relayMoving part can stick; foam and debris interfere
Non-contact capacitive (XKC-Y25 / Y26 style)One level per sensorNo wetted parts; works on plastic and glass tanksFails on metal tanks; position-sensitive; sensitivity tuning
Ultrasonic (from above)Distance to the surfaceNo contact; continuous readingDead zone near the sensor; foam and steam give errors
Submersible pressure transducerDepth from the bottomAccurate; works in wells and deep tanksSits in the liquid; needs cable and an amplifier or 4-20 mA input
Optical / infrared prismOne levelSmall, quick, no moving partsOnly for clean liquids
Bare PCB water-level moduleRough wetnessCheapestElectrodes corrode; best for demos
Float switch
Reads:
One level per switch
Pros:
Cheap, rugged, no electronics, handles pump loads through a relay
Cons:
Moving part can stick; foam and debris interfere
Non-contact capacitive (XKC-Y25 / Y26 style)
Reads:
One level per sensor
Pros:
No wetted parts; works on plastic and glass tanks
Cons:
Fails on metal tanks; position-sensitive; sensitivity tuning
Ultrasonic (from above)
Reads:
Distance to the surface
Pros:
No contact; continuous reading
Cons:
Dead zone near the sensor; foam and steam give errors
Submersible pressure transducer
Reads:
Depth from the bottom
Pros:
Accurate; works in wells and deep tanks
Cons:
Sits in the liquid; needs cable and an amplifier or 4-20 mA input
Optical / infrared prism
Reads:
One level
Pros:
Small, quick, no moving parts
Cons:
Only for clean liquids
Bare PCB water-level module
Reads:
Rough wetness
Pros:
Cheapest
Cons:
Electrodes corrode; best for demos
02

Wiring and electrical notes

Float switches are dry contacts: wire one side to GND and the other to an Arduino pin set to INPUT_PULLUP. Non-contact and optical sensors usually have an NPN or PNP output and need 5 to 24 V; read the datasheet for which level means "liquid present". Never connect a 12 or 24 V output straight to a 3.3 V board; use a divider or an optocoupler.

To switch a pump, drive a relay module from a pin and follow the module's isolation and rating notes. Mains pumps need a proper enclosure and earth.

03

Pump control with two floats

Using a low and a high float gives built-in hysteresis, so the pump does not chatter near one level. The pump starts when water falls below the low float and stops when it reaches the high float.

Fill a tank with two float switches · Arduino C++Verify & upload in Electrolark
const int LOW_SW = 2;    // closes (reads LOW) when water is above the low float
const int HIGH_SW = 3;   // closes (reads LOW) when water reaches the high float
const int PUMP = 8;      // relay module input
bool pumping = false;

void setup() {
  pinMode(LOW_SW, INPUT_PULLUP);
  pinMode(HIGH_SW, INPUT_PULLUP);
  pinMode(PUMP, OUTPUT);
}

void loop() {
  bool aboveLow  = digitalRead(LOW_SW) == LOW;
  bool atHigh    = digitalRead(HIGH_SW) == LOW;
  if (!aboveLow) pumping = true;     // tank is low: start filling
  if (atHigh)    pumping = false;    // tank is full: stop
  digitalWrite(PUMP, pumping ? HIGH : LOW);
  delay(200);
}
04

Getting reliable readings

  • ✓Mount floats away from inlets, where splashes and turbulence make them bounce.
  • ✓For ultrasonic sensors keep clear of tank walls and pipes in the beam, and allow for the dead zone when choosing mounting height.
  • ✓Add a timeout so the pump stops if the tank never fills, which protects a dry-running pump.
  • ✓In tanks with chemicals or hot liquid, check the material and temperature rating of the float or sensor.
05

Try it: Water tank level calculator (ultrasonic sensor to litres)

Change the values and the diagram and results update as you type.

06

Common mistakes to avoid

  • !Using bare PCB probes in a tank for weeks and watching them corrode.
  • !Mounting an ultrasonic sensor inside its dead zone.
  • !Putting a capacitive sensor on a metal tank.
  • !Running a pump from one level with no hysteresis.
  • !Wiring a 24 V sensor output to a 3.3 V pin.
07

Frequently asked questions

What is the best sensor for a water tank?

For on/off pump control, two float switches. For a percent-full display, an ultrasonic sensor or a submersible pressure sensor.

Do non-contact sensors work on metal tanks?

No. Capacitive sensing needs a non-metal wall.

Can I use an HC-SR04 for tank level?

Only for demos. Use a waterproof ultrasonic sensor such as JSN-SR04T for damp tanks.

How do I stop my sensor false-triggering?

Add a delay or debounce time and use hysteresis. Floats in waves can bounce.

NPN or PNP output?

NPN sinks to ground when active; PNP sources voltage. Match your controller input.

Can a float switch run a pump directly?

Only if its current rating exceeds the pump's. Usually the float drives a relay or contactor.

Parts for this guide

  • XKC-Y26 PNP Intelligent Non-Contact Liquid Level Sensor 50CM
    ₹769View
  • ST-70AB Float Switch Water Level Controller – Double Circuit Pump Control
    ₹409View
  • Square Float Switch 4M Cable – IP68 Plastic Housing
    ₹399View
  • DYP A08BNYWB-V1.0 PWM Waterproof Ultrasonic Level Sensor (25~500cm Range)
    ₹4,197View
Shop Water, Liquid Level & Flow Sensors

Terms in this guide

Float switchA level switch with a magnetic float that rises with the liquid and closes or opens a reed contact at a fixed height.Normally closedA switch or relay contact that conducts until it is pressed or energised (NC), the opposite of normally open (NO).HysteresisA deliberate gap between the switch-on and switch-off thresholds of a comparator or thermostat, so a noisy signal does not make the output chatter.UltrasonicSound above human hearing (over 20 kHz); the HC-SR04 uses 40 kHz.OptocouplerA component that passes a signal through light between an LED and a phototransistor, electrically isolating two circuits.IP ratingIngress Protection rating (IEC 60529), such as IP65: the first digit rates protection against dust and solids, the second against water.

Projects that use it

Put this into practice: 14 step-by-step builds in our project library use parts from this guide.

Beginner · 1 hourWater tank low-level float alarmView projectBeginner · 1 hourSump pit overflow alarmView projectBeginner · 1 hourAquarium low water alarmView project
Browse all 14 projects

Keep learning

Component guideBeginnerRain and Water Level Sensor ModulesA rain sensor module is a board of exposed interleaved traces plus a small LM393 comparator board.3 min read · SensorsComponent guideIntermediateWaterproof Ultrasonic SensorsWaterproof ultrasonic sensors such as the JSN-SR04T and A02YYUW put the transducer in a sealed probe on a cable, so they can measure water level in a tank or work outdoors.3 min read · SensorsComponent guideBeginnerWater Flow Sensors (YF-S201)A water flow sensor such as the YF-S201 has a small turbine with a magnet.3 min read · SensorsComponent guideBeginnerRelay ModulesA relay module is an electrically controlled switch that lets a microcontroller turn a separate circuit on or off, such as a 12 V pump or a mains lamp.4 min read · Switches, Relays & InputHow-toBeginnerMini Water Pumps for Arduino ProjectsA mini submersible pump is a small DC motor that pushes water when it sits underwater.3 min read · Motors & Motion

Sources

  • XKC-Y25 and XKC-Y26 manufacturer datasheets
  • Reed switch float sensor datasheets (Celduc, TE Connectivity)
  • DYP and JSN-SR04T ultrasonic datasheets

Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

On this page
Short answerChoosing a level sensorWiring and electrical notesPump control with two floatsGetting reliable readingsTry itCommon mistakesFAQsParts and next steps
Need a hand?Ask Geeko AI which part fits your project, or talk to the Geekobot team.Ask Geeko AIHelp & support

Parts for this guide4 items · ₹5,774

XKC-Y26 PNP Intelligent Non-Contact Liquid Level Sensor 50CM · ST-70AB Float Switch Water Level Controller – Double Circuit Pump Control · Square Float Switch 4M Cable – IP68 Plastic Housing · DYP A08BNYWB-V1.0 PWM Waterproof Ultrasonic Level Sensor (25~500cm Range)

Run itChange the inputs and watch the output

Lower the water and the pump starts at the low float; it stops when water reaches the high float.

Tank50 %
Pump relay OFF
closedLow float
openHigh float

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question