M03/M04 Water Level Sensor
The MO3/MO4 Water Level Sensor is a non-contact liquid level switch that operates on a capacitive principle to detect the presence or absence of liquid. It is designed to be mounted on the outer wall of a container to detect the liquid level within.
M03
M04
Specifications
| Model | M03 Water Level Detection Module | M04 Water Level Detection Module |
|---|---|---|
| Operating Voltage | 3.3–5 V | 3.3–24 V |
| Quiescent Current | ≈ 0.6 mA | ≈ 3 mA |
| Operating Current | ≈ 2.2 mA | ≈ 3.6 mA |
| Output Type | Push-pull output | NPN output |
| Product Size (L × W) | 31.5 × 12 mm | 31.5 × 12 mm |
| Sensitivity Adjustment | Change capacitor C4 | Change capacitor C4 |
| Detection Distance | 3–4 mm | 3–4 mm |
| Detection Material | Non-metal | Non-metal |
| Note | All current data measured under 5 V supply. | |
| Pin | Description |
|---|---|
| GND | Connect to the ground of the power supply. |
| VCC | Connect to a 3.3V to 5V power supply. |
| OUT | Connect to the input port of a microcontroller or other device to receive the output signal. |
Operation:
When the sensor detects the presence of liquid, it will output a low level signal.
When no liquid is detected, the sensor will output a high level signal.
Applications
- Liquid level monitoring in pipelines
- Overflow prevention in containers
- Industrial liquid level sensing
- Non-contact liquid level detection in household appliances
Schematic
Mounted on a container’s outer wall, the sensor’s surface forms an equivalent capacitor with the external medium (e.g., air or liquid). As liquid nears, the dielectric constant rises, increasing the capacitance. The chip converts this capacitance change into a voltage, which an internal comparator then measures against a set threshold. Based on this, it outputs a high or low signal to indicate whether water is present.
M03 VS M04
| Parameter | M03 | M04 |
|---|---|---|
| Power Supply | 5 V (see PCB silk print) | Wide voltage +VIN (typically 6–36 V), onboard LDO converts to 5 V |
| Output Characteristics | Push-pull / quasi push-pull digital output (OUT direct) | Open-collector output (only pulls down, does not pull up) |
| Compatible MCU | Arduino / ESP / STM32 etc. | PLC, relay modules, 24 V systems, or MCU input compatible |
| External Components | None required | Needs external pull-up resistor or relay load |
| Typical Output Logic | Logic version: Water = High level | Logic version: Water = Low level (effective low) |
Arduino code
// M03 Non-Contact Water Level Sensor - Basic Test (Push-Pull Output / Direct Connection)
// Compatible with: Arduino UNO / Nano / ESP32 / ESP8266 (just rename pins as needed)
const int PIN_SENSOR = 2; // Sensor OUT connected to D2
const int SAMPLE_N = 10; // Debounce sample count
const int SAMPLE_US = 1000; // Sampling interval (microseconds) 1ms
// Define the "trigger level" according to your module
// Most M03 modules: liquid detected or close → OUT = HIGH; no liquid → LOW
const int TRIGGER_LEVEL = HIGH;
void setup() {
Serial.begin(115200);
pinMode(PIN_SENSOR, INPUT); // Push-pull output, just use INPUT
// If you find signal floating/noise, you may try INPUT_PULLDOWN/INPUT_PULLUP (supported on ESP32);
// UNO has no PULLDOWN option.
Serial.println(F("M03 Water Level Sensor Test (digital)"));
}
bool readDebounced(int pin) {
int ones = 0;
for (int i = 0; i < SAMPLE_N; i++) {
ones += digitalRead(pin);
delayMicroseconds(SAMPLE_US);
}
// Majority voting: if HIGH counts exceed half, treat as HIGH
return (ones >= (SAMPLE_N + 1) / 2);
}
void loop() {
bool level = readDebounced(PIN_SENSOR);
if (level == (TRIGGER_LEVEL == HIGH)) {
Serial.println(F("DETECTED: Water level / liquid detected ✔"));
} else {
Serial.println(F("CLEAR: No liquid detected ✖"));
}
delay(200);
}
FAQ
Q1: If I use the M04 model with a 12V input, how do I connect a pull-up resistor?
A1: It depends on the device you are connecting to. If you are only connecting to a microcontroller port, you can pull it up to 5V or 3.3V as needed.
Q2: Can I connect it to a microcontroller? Is an Arduino compatible?
A2: Yes. The output is open-collector/open-drain, allowing it to interface with devices like PLCs or drive other components directly. The MO3 model can be connected directly to an Arduino. However, the MO4 model requires an external pull-up resistor because its open-drain output can only be in a high-impedance or low-level state.
Q3: What is the working principle?
A3: It outputs a low logic level when liquid is present and a high logic level when it is absent.
Q4: Can it be used to control a relay?
A4: Yes.
Q5: How do I use it?
A5: Attach the sensor directly to the container wall. When the sensor detects liquid, the indicator light will turn on, and the “OUT” pin will output a low logic level. When no liquid is detected, the light will be off, and the “OUT” pin will output a high logic level. The “OUT” pin can be connected to a microcontroller or used to control a relay.
Q6: Does the container have to be transparent? Can it be made of metal?
A6: Transparency does not matter, but the container wall thickness must be between 3mm and 4.5mm. Metal containers generally do not work because the metal will shield the electric field. For metal containers, you would need to create an observation window or switch to a contact-based sensor solution.
Q7: Can it detect substances like alcohol or oil?
A7: Yes, it can. However, it may be less sensitive (“slower to respond”) when detecting liquids with a low dielectric constant, especially if the container wall is thick. This can be compensated for by ensuring a tighter fit to the container, using a larger electrode area, or increasing the debounce time in your code.
Shipping Cost
We only ship to the United States. Shipping costs are calculated based on the total order amount.
Shipping Method And Delivery Time
All orders will be processed and shipped within 72 hours of placing the order (excluding weekends and holidays). They will ship from Shenzhen, China, primarily via 4PX logistics. Depending on the destination and logistics conditions, other carriers such as DHL, FedEx, UPS, USPS, etc., may also handle the delivery. Estimated shipping time is 7-12 business days, with actual delivery occurring in 10-17 business days, depending on logistics conditions.
Payment:
We accept Visa, Master card, Maestro, American Express, JCB, Dinner's Club, Discover, Paypal, Apple Pay, Google Pay .

Reviews
There are no reviews yet.