An IoT water level monitor using SIM800L in India solves a very real problem for Indian households, farmers, and industries: knowing when an overhead tank or sump is full or empty — without relying on WiFi. Using a HC-SR04 ultrasonic sensor and SIM800L GSM module, you can build a device that sends SMS alerts directly to any Indian mobile number, works in remote areas, and costs under ₹700 in components. This step-by-step project guide covers everything from circuit wiring to production-ready code.
Why Use SIM800L Instead of WiFi for Water Monitoring?
Most ESP32 or ESP8266 water level projects require a stable WiFi connection. This works perfectly in apartments but fails in several common Indian scenarios:
- Rooftop tanks: The WiFi router rarely reaches the terrace reliably, especially in multi-storey buildings or concrete-heavy construction.
- Agricultural sumps and borewells: Located hundreds of metres from the farmhouse with no WiFi coverage.
- Industrial water storage: Factory water tanks may be in areas with strict network segmentation.
- Village homes: Fibre or broadband may not be available, but Airtel/Jio 2G/4G covers over 96% of India.
The SIM800L module uses standard GSM/GPRS (works on any 2G network), draws minimal current in sleep mode, and can send SMS to any phone number including non-smartphones. A ₹199/month Jio SIM with minimal talk-time balance is enough to receive hundreds of SMS alerts.
Components Required and Cost in India
| Component | Approx. Cost | Notes |
|---|---|---|
| Arduino Nano / Uno | ₹150–₹250 | Nano recommended for compact build |
| SIM800L GSM Module | ₹200–₹350 | Needs 4.2V supply, use LiPo or buck converter |
| HC-SR04 Ultrasonic Sensor | ₹40–₹80 | Range 2cm–400cm, ±3mm accuracy |
| 18650 LiPo Cell + BMS | ₹150–₹200 | For battery backup during power cuts |
| LM7805 or MT3608 Buck Converter | ₹30–₹60 | Regulate supply for Arduino |
| PCB Antenna (SMA/IPEX) | ₹50–₹100 | Improves signal in weak coverage areas |
| Nano SIM Card (Jio/Airtel) | ₹10–₹20 | SIM800L uses Nano SIM (micro-SIM with adapter works too) |
| Total | ₹630–₹1060 | Well under ₹1500 all-in |
Circuit Diagram and Wiring Guide
The most critical aspect of this circuit is powering the SIM800L correctly. The module draws up to 2A peak current during GSM transmission — more than a standard Arduino can supply through its 3.3V or 5V pins. Always power the SIM800L directly from your battery or a dedicated DC supply.
Wiring Table
| SIM800L Pin | Connects To |
|---|---|
| VCC | 3.7–4.2V DC (LiPo or LM317 regulated) |
| GND | Common GND |
| TXD | Arduino D2 (SoftwareSerial RX) |
| RXD | Arduino D3 via 1kΩ+2kΩ voltage divider (5V→3.3V) |
| RST | Arduino D4 (optional hardware reset) |
| HC-SR04 Pin | Connects To |
|---|---|
| VCC | 5V (Arduino) |
| GND | GND |
| TRIG | Arduino D8 |
| ECHO | Arduino D9 |
Important: Add a 100µF capacitor across the SIM800L VCC and GND pins as close to the module as possible. This handles the 2A current spikes during GSM registration and prevents resets.
Arduino Code with SMS Alerts
This sketch reads tank depth every 30 seconds, calculates percentage full, and sends SMS alerts at configurable thresholds. It uses SoftwareSerial for the GSM link so D0/D1 remain free for programming.
#include <SoftwareSerial.h>
SoftwareSerial gsm(2, 3); // RX, TX
// Sensor pins
const int TRIG_PIN = 8;
const int ECHO_PIN = 9;
// Tank configuration (cm)
const float TANK_HEIGHT = 150.0; // Total tank depth
const float SENSOR_OFFSET = 10.0; // Distance from sensor to full-water surface
// Alert thresholds
const int ALERT_FULL_PCT = 90;
const int ALERT_LOW_PCT = 15;
// Your Indian mobile number (with country code)
const char ALERT_NUMBER[] = "+919876543210";
bool alertFull = false;
bool alertLow = false;
void setup() {
Serial.begin(9600);
gsm.begin(9600);
pinMode(TRIG_PIN, OUTPUT);
pinMode(ECHO_PIN, INPUT);
delay(3000); // Wait for SIM800L to register on network
// Set SMS text mode
gsm.println("AT+CMGF=1");
delay(500);
// Use GSM encoding
gsm.println("AT+CSCS="GSM"");
delay(500);
Serial.println("Water Level Monitor Ready");
}
float measureDistanceCm() {
// Take 5 readings and median filter
float readings[5];
for (int i = 0; i < 5; i++) {
digitalWrite(TRIG_PIN, LOW);
delayMicroseconds(2);
digitalWrite(TRIG_PIN, HIGH);
delayMicroseconds(10);
digitalWrite(TRIG_PIN, LOW);
long duration = pulseIn(ECHO_PIN, HIGH, 30000);
readings[i] = (duration == 0) ? 999.0 : duration * 0.034 / 2.0;
delay(60);
}
// Simple sort and return median
for (int i = 0; i < 4; i++)
for (int j = i+1; j < 5; j++)
if (readings[i] > readings[j]) { float t=readings[i]; readings[i]=readings[j]; readings[j]=t; }
return readings[2];
}
void sendSMS(const char* message) {
gsm.print("AT+CMGS="");
gsm.print(ALERT_NUMBER);
gsm.println(""");
delay(500);
gsm.print(message);
gsm.write(26); // Ctrl+Z to send
delay(3000);
Serial.println("SMS Sent!");
}
void loop() {
float distance = measureDistanceCm();
float waterDepth = TANK_HEIGHT - distance + SENSOR_OFFSET;
if (waterDepth < 0) waterDepth = 0;
if (waterDepth > TANK_HEIGHT) waterDepth = TANK_HEIGHT;
int pct = (int)((waterDepth / TANK_HEIGHT) * 100);
Serial.print("Level: "); Serial.print(pct); Serial.println("%");
if (pct >= ALERT_FULL_PCT && !alertFull) {
char msg[80];
sprintf(msg, "TANK FULL: Water level is %d%%. Switch off pump!", pct);
sendSMS(msg);
alertFull = true;
alertLow = false;
}
else if (pct <= ALERT_LOW_PCT && !alertLow) {
char msg[80];
sprintf(msg, "LOW WATER: Tank level is only %d%%. Start pump!", pct);
sendSMS(msg);
alertLow = true;
alertFull = false;
}
else if (pct > ALERT_LOW_PCT + 5 && pct < ALERT_FULL_PCT - 5) {
alertFull = false;
alertLow = false;
}
delay(30000); // Check every 30 seconds
}
Power Supply Tips for Indian Field Deployments
Indian field deployments face two challenges: frequent power cuts and wide voltage fluctuations (180V–250V common in rural areas). Here is how to handle both:
- Battery backup: Use a single 18650 LiPo (3.7V, 2600mAh) with a TP4056 charging module. This gives 8–12 hours of operation during power cuts. The LiPo voltage (3.7–4.2V) also directly matches the SIM800L’s preferred supply range.
- Solar option: A 5W, 6V solar panel with the TP4056 module charges the 18650 cell reliably. Suitable for rooftop or agricultural deployments with no AC mains access.
- Arduino supply: Use an LM7805 or AMS1117-5.0 to regulate 5V for the Arduino from the same battery. Keep current draw under 50mA from Arduino 5V pin.
- Surge protection: Add a TVS diode (P6KE7V5) across the supply rails to suppress voltage spikes common on Indian power grids.
Waterproofing and Enclosure
The HC-SR04 standard module is NOT waterproof. For rooftop or outdoor tank installations in India (especially during monsoon season), follow these steps:
- Mount the HC-SR04 inside an IP65-rated ABS enclosure with a 2cm drain hole at the bottom
- Drill matching holes for the two transducer faces and seal with silicone around the edges
- Alternatively, use a JSN-SR04T waterproof ultrasonic sensor (drop-in replacement, same wiring) for fully outdoor mounting
- Use industrial-grade UV-resistant cable ties and conduit for all wiring runs
- Apply conformal coating (MG Chemicals 422B or similar available at electronics shops) to the PCB
Recommended Modules from Zbotic
15cm 3DBI GSM/GPRS/3G PCB Antenna with IPEX Connector
Upgrade your SIM800L antenna for better GSM signal in rural or basement installations across India. 3 dBi gain, IPEX connector, 15cm flexible cable. Essential for remote deployments.
Adafruit FONA 808 – Mini Cellular GSM + GPS Breakout
Premium GSM + GPS combo module. Send SMS alerts AND log exact GPS coordinates of your water tank or borewell. Perfect for multi-site agricultural monitoring across large farms.
1 Channel 12V 30A Relay Module with Optocoupler
Add automatic pump control to your water level monitor. This heavy-duty 30A relay can directly switch single-phase water pump motors (up to 3HP). Optocoupler isolation protects your Arduino from mains voltage.
0.96 Inch I2C OLED LCD Module (White, SSD1306)
Display live water level percentage on a small OLED screen mounted at the control panel. Works perfectly with Arduino Nano using just 2 wires (SDA/SCL).
DIY GSM/GPRS M590E Module Kit
An alternative to SIM800L — the M590E is a fully integrated GSM module that supports SMS and serial AT commands. Great for custom PCB designs where you need a compact footprint.
Frequently Asked Questions
Which SIM network works best with SIM800L in India?
SIM800L is a 2G (GSM/GPRS) module. Jio does not support 2G — Jio SIMs will NOT work with SIM800L. Use Airtel, BSNL, or Vi (Vodafone-Idea) prepaid nano SIMs. Airtel 2G has the widest rural coverage. BSNL is often the only option in remote hill or forest areas.
Can I use SIM800L with ESP32 instead of Arduino?
Yes. Connect SIM800L TX to ESP32 GPIO16 (RX2) and SIM800L RX to ESP32 GPIO17 (TX2) via the voltage divider. Use Serial2 on the ESP32 at 9600 baud. This gives you WiFi + GSM fallback in one device — very useful for smart home projects.
The SIM800L resets randomly — what is wrong?
Almost always a power supply issue. The SIM800L needs 2A peak current during GSM registration. If your supply cannot deliver this, the module voltage dips below 3.4V and it resets. Add a 100µF electrolytic + 10µF ceramic capacitor close to the VCC/GND pins and use a dedicated 4.2V supply capable of 2A.
How accurate is the HC-SR04 for measuring water level?
HC-SR04 has ±3mm accuracy in ideal conditions. In a tank environment with water vapour, temperature variation (20°C–45°C range in India), and possible condensation, expect ±1–2 cm. This is sufficient for percentage-based alerts. The median filter in the code above removes most outlier readings caused by splashing or foam.
Can this project control the pump automatically without manual SMS reply?
Yes. Add a 30A relay module on the Arduino D5 pin. Use the same threshold logic — when level reaches 90%, turn the relay OFF (stopping the pump); when level drops to 15%, turn the relay ON. Combined with the SMS alert, this gives you fully automatic pump control with manual override capability via SMS.
Build Your IoT Water Monitor Today
Get all the components — SIM800L module, ultrasonic sensor, relay modules, and antennas — shipped fast anywhere in India. No more climbing to the terrace to check the tank!
Add comment