Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Weather & Environmental Monitoring

Weather Alert System: SMS Notification with ESP32 and SIM800

Weather Alert System: SMS Notification with ESP32 and SIM800

March 11, 2026 /Posted byJayesh Jain / 0

A weather alert SMS notification system using ESP32 and SIM800 sends automated text messages when critical environmental conditions are detected — ideal for farms, remote monitoring stations, and Indian households in areas with frequent extreme weather events. Unlike Wi-Fi-based notification systems, a GSM-based alert works anywhere with mobile network coverage, making it perfect for agricultural land in rural India where internet connectivity is often unreliable but Jio and BSNL 2G coverage is nearly universal. This tutorial builds a complete weather alert system from scratch.

Table of Contents

  • Components Required
  • Understanding the SIM800L Module
  • Wiring ESP32, SIM800L, and BME280
  • Power Supply for SIM800L
  • Complete Arduino Code
  • Designing Alert Logic
  • SMS Costs and Optimisation in India
  • Frequently Asked Questions

Components Required

  • ESP32 development board
  • SIM800L GSM/GPRS module
  • SIM card (Jio, Airtel, BSNL, or Vi) with SMS pack
  • BME280 temperature, humidity, pressure sensor
  • 3.7V LiPo battery 2000mAh (for SIM800L power)
  • IP65 enclosure
  • Jumper wires
  • 470µF capacitor (for SIM800L power spike suppression)

Total cost estimate: ₹800-1,500 (excluding SIM card). The SIM800L module costs ₹150-350 from Indian electronics suppliers and is the most affordable GSM module available for Arduino/ESP32 projects. A Jio SIM card with the ₹15 SMS pack provides 200 SMS valid for 30 days — more than sufficient for alert-only applications.

Recommended: GY-BME280-3.3 Precision Atmospheric Pressure Sensor — Compact BME280 for weather alert systems; rapid pressure drops indicate approaching storms and trigger advance SMS warnings.

Understanding the SIM800L Module

The SIM800L is a quad-band GSM/GPRS module supporting 850/900/1800/1900 MHz frequencies. In India, it works on:

  • Jio: 900 MHz GSM (voice/SMS only on JioPhone, 4G only for smartphones — Jio is VoLTE only; SIM800L 2G may not work on Jio)
  • Airtel: 900/1800 MHz GSM — SIM800L works reliably
  • BSNL: 900/1800 MHz GSM — SIM800L works reliably, good rural coverage
  • Vi (Vodafone Idea): 900/1800 MHz GSM — SIM800L works reliably

Important: Jio has discontinued 2G/3G service and operates VoLTE only. The SIM800L is a 2G GSM module and will NOT work with Jio SIM cards for SMS. Use Airtel, BSNL, or Vi SIM cards for SIM800L-based projects in India.

The SIM800L communicates via AT commands over UART at 9600 baud. Key AT commands for SMS:

  • AT — check module response
  • AT+CMGF=1 — set text mode (vs PDU mode)
  • AT+CMGS=”+91xxxxxxxxxx” — start SMS to number
  • Message text + Ctrl+Z (ASCII 26) — send the message

Wiring ESP32, SIM800L, and BME280

Component Pin ESP32 GPIO
SIM800L TXD GPIO 16 (RX2)
SIM800L RXD GPIO 17 (TX2)
SIM800L VCC 3.7V LiPo directly
SIM800L GND GND (common)
BME280 SDA GPIO 21
BME280 SCL GPIO 22

Critical power note: The SIM800L requires up to 2A peak current during GSM transmission. Never power it from the ESP32’s 3.3V or 5V pin — these cannot supply sufficient current. Power the SIM800L directly from a LiPo battery or a dedicated regulated supply. Add a 470µF capacitor between SIM800L VCC and GND to smooth current spikes that cause module resets.

Power Supply for SIM800L

The SIM800L operates on 3.4-4.4V, making it perfectly compatible with a 3.7V LiPo battery. Power both the ESP32 and SIM800L from the LiPo through separate voltage regulators:

  • SIM800L: Connect directly to LiPo 3.7V output (voltage is within spec, current is sufficient)
  • ESP32: Use an AMS1117-3.3 or LDO regulator to generate 3.3V from the LiPo
  • Add a TP4056 USB charging circuit to charge the LiPo via 5V USB

A 2000mAh LiPo with the system checking sensors every 10 minutes and sending SMS only on alerts will last approximately 5-7 days before recharging. For solar-powered remote deployments, a 6W solar panel with TP4056 provides continuous operation in most Indian sunlight conditions.

Complete Arduino Code

#include <Wire.h>
#include <Adafruit_BME280.h>
#include <HardwareSerial.h>

HardwareSerial gsmSerial(2);
Adafruit_BME280 bme;

// Alert thresholds - adjust for your location
const float TEMP_HIGH = 40.0;     // °C
const float TEMP_LOW  = 5.0;      // °C (frost warning)
const float HUMIDITY_HIGH = 90.0; // %
const float PRESSURE_DROP = 5.0;  // hPa drop in 1 hour = storm approaching

const String ALERT_NUMBER = "+919876543210";  // Replace with your number
float lastPressure = 0;
unsigned long lastCheckTime = 0;
bool alertSent = false;

void sendSMS(String message) {
  gsmSerial.println("AT+CMGF=1");
  delay(500);
  gsmSerial.println("AT+CMGS="" + ALERT_NUMBER + """);
  delay(500);
  gsmSerial.print(message);
  delay(100);
  gsmSerial.write(26);  // Ctrl+Z
  delay(3000);
  Serial.println("SMS sent: " + message);
}

bool initGSM() {
  gsmSerial.println("AT");
  delay(1000);
  gsmSerial.println("AT+CMGF=1");
  delay(500);
  return true;  // Add error checking in production code
}

void setup() {
  Serial.begin(115200);
  Wire.begin();
  gsmSerial.begin(9600, SERIAL_8N1, 16, 17);
  
  bme.begin(0x76);
  initGSM();
  
  lastPressure = bme.readPressure() / 100.0F;
  lastCheckTime = millis();
  Serial.println("Weather Alert System started");
}

void loop() {
  float temp = bme.readTemperature();
  float humidity = bme.readHumidity();
  float pressure = bme.readPressure() / 100.0F;
  
  String alert = "";
  
  if (temp > TEMP_HIGH)
    alert += "HIGH TEMP: " + String(temp, 1) + "C. ";
  if (temp  HUMIDITY_HIGH)
    alert += "HIGH HUMIDITY: " + String(humidity, 0) + "%. ";
  
  // Check pressure drop (storm approaching)
  if (millis() - lastCheckTime >= 3600000) {  // Every hour
    float pressureDrop = lastPressure - pressure;
    if (pressureDrop > PRESSURE_DROP)
      alert += "STORM WARNING: Pressure dropped " + String(pressureDrop, 1) + "hPa. ";
    lastPressure = pressure;
    lastCheckTime = millis();
    alertSent = false;  // Reset to allow new alerts after each hourly check
  }
  
  if (alert.length() > 0 && !alertSent) {
    sendSMS("WEATHER ALERT: " + alert + "T=" + String(temp,1) + "C H=" + String(humidity,0) + "% P=" + String(pressure,1) + "hPa");
    alertSent = true;
  }
  
  Serial.printf("T:%.1f H:%.1f P:%.1f
", temp, humidity, pressure);
  delay(300000);  // Check every 5 minutes
}

Designing Alert Logic

Good alert logic prevents SMS flooding (which wastes your SMS balance) while ensuring critical events are not missed:

  • Hysteresis: Set different thresholds for alert trigger and alert reset. Example: alert when temperature exceeds 40°C, reset alert state when it drops below 37°C. This prevents repeated alerts while temperature hovers near the threshold.
  • Minimum alert interval: Add a minimum 30-minute interval between repeated alerts for the same condition. Persistent conditions should send a reminder every 2 hours, not every 5 minutes.
  • Alert escalation: Send one SMS for moderate conditions, two SMS for severe conditions (to ensure receipt), and also initiate a phone call (AT+ATD command) for critical emergencies like freezing temperatures at a remote agricultural location.
  • Daily status SMS: Send a once-daily summary SMS at 7 AM with current conditions — useful for remote monitoring where no news is good news but a daily check-in is reassuring.

SMS Costs and Optimisation in India

SMS costs in India are minimal — Airtel and BSNL charge approximately ₹0.10-0.50 per SMS. Most prepaid plans include free SMS allowances. To minimise costs and battery drain:

  • Use alert-only mode — only send SMS when thresholds are exceeded
  • Combine multiple alerts into a single SMS
  • Avoid polling sensors more frequently than needed — 5-minute intervals are sufficient for weather monitoring
  • Use deep sleep between sensor readings to reduce battery consumption by 90%

For daily status reports, schedule a fixed-time SMS rather than regular uploads (which would require GPRS data). One SMS per day plus alerts on exceptions uses fewer than 50 SMS per month in most agricultural monitoring scenarios.

Recommended: Waveshare BME280 Environmental Sensor — Reliable BME280 for weather alert systems; fast 1-second response time ensures alerts are triggered within seconds of threshold breach.

Frequently Asked Questions

Why does my SIM800L keep resetting during SMS transmission?

This is almost always a power supply issue. The SIM800L draws up to 2A during GSM transmission. If powered from the ESP32’s 5V pin (which can supply only 500-800mA), the voltage drops below 3.4V and the module resets. Solution: power from a dedicated 3.7V LiPo with a 470µF capacitor, or use a 5V power supply with a minimum 2A rating feeding through an LDO regulator to 4.2V for the SIM800L.

Can SIM800L send WhatsApp messages instead of SMS?

The SIM800L itself cannot send WhatsApp messages (WhatsApp requires a smartphone or API integration). However, you can send WhatsApp messages from ESP32 using Callmebot API (free, sends via WhatsApp) or Twilio WhatsApp API (paid). For these alternatives, the ESP32 needs internet access via Wi-Fi or GPRS through SIM800L’s HTTP commands. This is a more complex setup but WhatsApp notifications are free (no SMS charges) once configured.

How do I test my SIM800L AT commands before writing code?

Use the Arduino serial monitor with a simple pass-through sketch that forwards data between the Arduino’s serial monitor and the SIM800L’s serial port. Type AT commands directly and see responses. Alternatively, connect the SIM800L to a USB-UART adapter and use PuTTY or RealTerm terminal software at 9600 baud to send AT commands manually. This debugging step is essential before integrating into your main code.

What happens if the GSM network is unavailable when an alert should be sent?

If the SIM800L cannot register to the network, AT+CMGS will return an error. Add retry logic in your code — attempt to send 3 times with 30-second delays between attempts. Store failed alerts in ESP32 SPIFFS (flash filesystem) and retry when network is restored. Check network registration with AT+CREG before attempting to send SMS: the response should include 0,1 (registered) or 0,5 (roaming).

Can I receive SMS commands to control my weather station remotely?

Yes. The SIM800L can receive SMS using AT+CNMI to get new message notifications and AT+CMGR to read stored messages. Parse incoming SMS for command keywords like “STATUS” (send current readings), “THRES HIGH 45” (change high temperature threshold), or “RESET” (restart the system). This two-way communication turns your weather station into a remotely manageable monitoring system — valuable for large farms or properties in rural India.

Shop ESP32 and Weather Monitoring at Zbotic →

Tags: BME280, ESP32, GSM, SIM800, SMS notification, Weather Alert
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Photoelectric Sensor Wiring: N...
blog photoelectric sensor wiring npn vs pnp output types 598582
blog esp32 s2 vs esp32 s3 vs c3 which to use for iot india 598592
ESP32 S2 vs ESP32 S3 vs C3: Wh...

Related posts

Svg%3E
Read more

Climate Education Kit: Build and Learn About Weather

April 1, 2026 0
Table of Contents Weather Education in Indian Schools Designing a STEM Weather Kit Sensor Experiments for Students Curriculum-Aligned Activities Arduino... Continue reading
Svg%3E
Read more

Citizen Science Weather: Contribute Data to IITM Pune

April 1, 2026 0
Table of Contents Citizen Science Weather in India Data Quality Standards for Contribution Setting Up a WMO-Compatible Station Calibration and... Continue reading
Svg%3E
Read more

Weather Station Network: Multiple Stations with Gateway

April 1, 2026 0
Table of Contents Why Build a Weather Station Network LoRa Communication for Sensor Nodes Gateway Design with Raspberry Pi Sensor... Continue reading
Svg%3E
Read more

Cyclone Tracker Display: Real-Time IMD Data on Screen

April 1, 2026 0
Table of Contents Cyclone Tracking in India IMD Cyclone Data Sources ESP32 and TFT Display Setup Fetching and Parsing Cyclone... Continue reading
Svg%3E
Read more

Monsoon Onset Predictor: Historical Data Analysis India

April 1, 2026 0
Table of Contents Understanding Monsoon Onset in India Key Indicators for Monsoon Prediction Sensor Package for Monsoon Monitoring Collecting Baseline... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now