Build an E-Paper Storm Surge Barograph with ESP32-C3 & Bosch BMP390
Comprehensive step-by-step engineering guide for building a low-power E-Paper weather barograph and storm forecasting node using ESP32-C3 and BMP390.
- Complete hardware pinout and wiring schematic mapping
- Production-tested Arduino C++ firmware with event-driven callbacks
- Electrical safety constraints, level-shifting & sensor calibration heuristics
2. Overview & Engineering Objectives
Abrupt barometric pressure drops are the earliest physical precursors to severe cyclones, squalls, and nautical storm surges. This battery-operated desktop barograph continuously logs atmospheric pressure at high precision, rendering a 48-hour pressure trend graph on a bi-stable E-Paper display that remains visible without consuming power between updates.
Core Engineering Capabilities:
Sub-Decimeter Precision: Evaluates barometric pressure to within ± 0.03 hPa using the Bosch BMP390 24-bit pressure sensor, resolving atmospheric tides and elevator elevation changes.
Zero-Power Bi-Stable Readout: Draws zero microamps to maintain the on-screen 48-hour pressure chart, consuming battery power only for 1.5 seconds during display refreshes.
The Zambretti Forecasting Heuristic: Translates absolute pressure, 3-hour pressure delta (Δ P_3h), and seasonal wind trends into localized 12-hour gale predictions.
Ghosting-Free Partial Refreshes: Alternates fast partial refreshes with periodic full-screen inverted waveform resets every 24 hours to clear residual micro-capsule shadowing.
3. Bill of Materials (BOM)
| Component | Qty | Specification / Rating | Est. Cost (INR) | Component Sourcing & Lab Kit |
|---|---|---|---|---|
| ESP32-C3 SuperMini Board | 1 | 32-bit RISC-V 160MHz, 4MB Flash, Wi-Fi + BLE | ₹240 | Mentora Component Kit |
| Bosch BMP390 Module | 1 | High-precision I2C/SPI barometric pressure sensor | ₹680 | Mentora Component Kit |
| 2.9" SPI Monochrome E-Paper | 1 | Waveshare 296x128 E-Ink panel with driver board | ₹1,450 | Mentora Component Kit |
| 1S 3.7V 1200mAh LiPo Battery | 1 | Compact flat lithium polymer battery | ₹220 | Mentora Component Kit |
| TP4056 USB-C Charger Module | 1 | 5V 1A Li-ion charger with protection IC | ₹45 | Mentora Component Kit |
| Solid Wood / Acrylic Stand | 1 | Desktop enclosure with angled E-paper bezel | ₹180 | Mentora Component Kit |
| Total Hardware Cost | ~₹2,815 |
4. Meteorological Physics & The Zambretti Heuristic
1. Sea-Level Elevation Normalization
Raw atmospheric pressure drops with altitude (~1 hPa per 8.3 meters). To compare against synoptic weather charts, raw pressure (P_raw) is reduced to sea-level equivalent (P_0): $P_0 = P_raw · left(1 - (0.0065 · h)/(T_C + 0.0065 · h + 273.15)right)^-5.257 Where h = \text{Station elevation in meters}, T_C = \text{Ambient temperature in }^\circ\text{C}$.
2. Pressure Tendency (3h Delta):
Δ P < -2.0 hPa: Rapidly Falling to Gale / Storm Warning
-2.0 ≤ Δ P ≤ -0.5 hPa: Falling to Precipitation Likely
-0.5 < Δ P < +0.5 hPa: Steady to Conditions Unchanged
+0.5 ≤ Δ P ≤ +2.0 hPa: Rising to Fair Weather Ahead
Δ P > +2.0 hPa: Rapidly Rising to Transient High / Clear Sky
5. Real-World Troubleshooting FAQs
Q1: Why does the E-Paper display show dark grey ghost images after several hours?
Root Cause: Micro-Capsule Charge Polarization: Using only partial refreshes leaves residual electrostatic charges across the electrophoretic micro-capsules.
Fix: Perform a full black-to-white inverted cycle every 12 to 24 hours (display.init(); display.clear();) before reverting back to partial updates.
Q2: Why does the BMP390 fail to communicate or read random zeros?
Root Cause: SDO pin floating. On BMP390 boards:
SDO to GND = I2C Address 0x76
SDO to 3.3V = I2C Address 0x77
Always solder SDO firmly to 3.3V or GND to prevent random bus timeouts.
6. Verified Hardware Kit, Firmware Vault & Mentor Support
🛒 Official Mentora E-Paper Barograph Kit: ESP32-C3 SuperMini, Bosch BMP390, 2.9" Waveshare E-Paper, and 1200mAh LiPo for ₹2,999.
⚡ ₹49 Mentora Token Vault: Instantly unlock the 48-hour spline interpolation graph renderer code, maritime Zambretti forecasting matrix, and 3D printable desktop picture frame STL files.
🛠️ ₹299 1-on-1 Mentora Live Video Debugging: 30-minute session to calibrate station elevation pressure offsets, tune E-Paper partial refresh waveforms, and optimize deep sleep power consumption for 6-month battery life.
Hardware Pinout & Wiring Connections
Hardware Pinout & Wiring Connection Guide
Project 22: Atmospheric Pressure & Storm Surge Barograph with BMP390 & SPI E-Paper
Microcontroller: ESP32-C3 SuperMini / DevKitM-1 (32-bit RISC-V 160MHz)Pressure Sensor: Bosch BMP390 Precision Barometer (I2C Address: 0x77)E-Ink Display: 2.9-inch Waveshare Monochrome E-Paper Display (SPI Bus)Power Stage: 3.7V 1200mAh LiPo Battery + TP4056 Charger (Hourly Deep Sleep Node)
1. Complete Fritzing Pin Connection Mapping Table
Table A: Bosch BMP390 Precision Barometer to ESP32-C3 (I2C)
| BMP390 Pin | ESP32-C3 Pin | Wire Color | Bus Signal / Function | Electrical Guidelines & Constraints |
|---|---|---|---|---|
| VIN / VCC | 3V3 Rail | 🔴 Red | 3.3V DC Sensor Supply | Powered strictly from 3.3V. |
| GND | GND Rail | ⚫ Black | Ground Return | Common system ground. |
| SCL / SCK | GPIO 1 | 🟡 Yellow | I2C Hardware Clock | Hardware I2C SCL clock line. |
| SDA / SDI | GPIO 0 | 🔵 Blue | I2C Hardware Data | Hardware I2C SDA data line. |
| CS / CSB | 3V3 Rail (or NC) | Orange | Interface Select | Pull HIGH to select I2C mode. |
| SDO | 3V3 Rail | 🟤 Brown | I2C Address Select | TIE TO 3.3V to set I2C address to 0x77. |
Table B: 2.9" Waveshare SPI E-Paper Display to ESP32-C3
| E-Paper Pin | ESP32-C3 Pin | Wire Color | SPI / Control Signal | Functional Role & Timing |
|---|---|---|---|---|
| VCC | 3V3 Rail | 🔴 Red | 3.3V Logic & Driver | Powered from 3.3V rail. |
| GND | GND Rail | ⚫ Black | Ground Return | Common ground reference. |
| DIN / MOSI | GPIO 9 | 🟢 Green | SPI Master Out Slave In | Pushes pixel bitmap data to display buffer. |
| CLK / SCK | GPIO 8 | 🟡 Yellow | SPI Hardware Clock | 4 MHz standard SPI clock. |
| CS | GPIO 7 | Orange | SPI Chip Select | Active-LOW chip select. |
| DC | GPIO 6 | 🔵 Blue | Data / Command Select | LOW = Command byte, HIGH = Display data. |
| RST | GPIO 5 | White | Hardware Reset | Pulsed LOW by driver during display wake-up. |
| BUSY | GPIO 4 | Purple | Busy Status Output | HIGH when display is refreshing electrophoretic ink. |
2. Breadboard & Circuit Wiring Schematic
+-------------------------------------------------------------+
| ESP32-C3 SuperMini |
| |
| [ 3V3 ] [ GND ] [G0/SDA] [G1/SCL] [G4] [G5] [G6] [G7..G9]
+----+--------+----------+--------+-------+----+----+----+----+
| | | | | | | |
+3.3V | GND | SDA | SCL | BUSY | RST| DC | SPI
Rail | Rail | Line | Line | | | | Bus
=======+========+==========+========+=======+====+====+====+====
| | | | | | | |
+--+--------+----+-----+--------+ | | | |
| VIN GND SDO CS | SDA SCL | | | |
| BOSCH BMP390 | | | | |
| (Addr: 0x77) | | | | |
+----------------+ | | | |
| | | | | |
+--+--------+---------------------------+----+----+----+----+
| VCC GND BUSY RST DC CS CLK DIN
| 2.9" WAVESHARE E-PAPER DISPLAY |
| (296x128 Pixel Bi-Stable) |
+-----------------------------------------------------------+3. Golden Engineering Rules for E-Paper Barographs
Bi-Stable Memory Advantage:
E-Paper micro-capsules maintain their reflective state indefinitely without electrical power. By placing the ESP32-C3 in deep sleep between hourly updates, a 1200mAh battery provides over 8 months of continuous runtime.
BUSY Pin Polling:
Never send SPI commands to the E-Paper while the BUSY pin is HIGH. Sending data during an electrophoretic update cycle causes permanent panel damage and distorted contrast.
BMP390 SDO Tie-Up:
Ensure the BMP390's SDO pin is tied firmly to 3V3 to fix the address at 0x77. Leaving it floating causes address collisions between 0x76 and 0x77.
Complete Tested Arduino C++ Firmware
``cpp
/*
- ==============================================================================
- Project: Atmospheric Pressure & Storm Surge Barograph with BMP390 & E-Paper
- Microcontroller: ESP32-C3 SuperMini / DevKitM-1 (32-bit RISC-V 160MHz)
- Author: Mentora Maker Lab (Spark Autonomous Content Intelligence)
- License: MIT
*
- Hardware Peripherals:
- - Bosch BMP390 Precision Barometer: I2C (SDA -> GPIO 0, SCL -> GPIO 1, Addr 0x77)
- - 2.9" SPI Monochrome E-Paper Display (Waveshare GxEPD2):
- BUSY -> GPIO 4, RST -> GPIO 5, DC -> GPIO 6, CS -> GPIO 7
- SCK -> GPIO 8, MOSI -> GPIO 9
- - Power: 3.7V LiPo Battery with Deep Sleep hourly wake-up
- ==============================================================================
*/
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP3XX.h>
// -----------------------------------------------------------------------------
// USER CONFIGURATION (STATION ELEVATION & PINS)
// -----------------------------------------------------------------------------
const float STATIONELEVATIONMETERS = 55.0; // Station altitude above sea level (Guwahati ~55m)
#define I2CSDAPIN 0
#define I2CSCLPIN 1
#define STATUSLEDPIN 8
#define EPDBUSYPIN 4
#define EPDRSTPIN 5
#define EPDDCPIN 6
#define EPDCSPIN 7
#define EPDSCKPIN 8
#define EPDMOSIPIN 9
#define SLEEPINTERVALSEC 3600ULL // Log pressure once per hour (3600s)
#define HISTORYBUFFERLEN 48 // 48 hours of historical data
// RTC Persistent Memory surviving hourly deep sleep
RTCDATAATTR float pressureHistory[HISTORYBUFFERLEN];
RTCDATAATTR int historyCount = 0;
RTCDATAATTR int bootCounter = 0;
Adafruit_BMP3XX bmp;
// -----------------------------------------------------------------------------
// METEOROLOGICAL HYPSOMETRIC ELEVATION REDUCTION
// -----------------------------------------------------------------------------
float calculateSeaLevelPressure(float measuredPressureHPa, float tempC) {
// Barometric formula reducing station pressure to sea-level equivalent
float exponent = 5.257;
float factor = 1.0 - (0.0065 STATION_ELEVATION_METERS) / (tempC + 0.0065 STATIONELEVATIONMETERS + 273.15);
return measuredPressureHPa / pow(factor, exponent);
}
// -----------------------------------------------------------------------------
// ZAMBRETTI STORM TENDENCY HEURISTIC
// -----------------------------------------------------------------------------
String calculateZambrettiForecast(float currentP0, float delta3h) {
if (delta3h < -2.0) {
return "🚨 STORM / GALE WARNING! Heavy Rain & Squalls";
} else if (delta3h < -0.6) {
if (currentP0 < 1005.0) return "Rain, Wind & Falling Temperature";
return "Deteriorating Weather, Rain Likely";
} else if (delta3h > 2.0) {
return "Rapidly Rising: High Pressure Ridge / Clear Skies";
} else if (delta3h > 0.6) {
return "Fair Weather / Improving Conditions";
} else {
if (currentP0 > 1015.0) return "Settled / Sunny & Stable";
if (currentP0 < 1005.0) return "Overcast with Intermittent Drizzle";
return "Steady / Unchanged Conditions";
}
}
// -----------------------------------------------------------------------------
// ARDUINO SETUP (WAKE -> READ -> LOG -> RENDER -> SLEEP)
// -----------------------------------------------------------------------------
void setup() {
Serial.begin(115200);
delay(100);
bootCounter++;
Serial.println("\n========================================================");
Serial.printf(" MENTORA ESP32-C3 E-PAPER STORM BAROGRAPH (CYCLE #%d)\n", bootCounter);
Serial.println("========================================================");
// 1. Initialize BMP390 I2C
Wire.begin(I2CSDAPIN, I2CSCLPIN);
delay(20);
if (!bmp.begin_I2C(0x77, &Wire)) {
Serial.println("[ERROR] Bosch BMP390 sensor not detected on 0x77!");
espsleepenabletimerwakeup(SLEEPINTERVALSEC * 1000000ULL);
espdeepsleep_start();
}
// Configure BMP390 high-resolution oversampling
bmp.setTemperatureOversampling(BMP3OVERSAMPLING4X);
bmp.setPressureOversampling(BMP3OVERSAMPLING16X);
bmp.setIIRFilterCoeff(BMP3IIRFILTERCOEFF7);
bmp.setOutputDataRate(BMP3ODR50_HZ);
if (!bmp.performReading()) {
Serial.println("[ERROR] Failed to execute BMP390 reading.");
espsleepenabletimerwakeup(SLEEPINTERVALSEC * 1000000ULL);
espdeepsleep_start();
}
float stationPressure = bmp.pressure / 100.0F; // Pa to hPa
float stationTemp = bmp.temperature;
float seaLevelP0 = calculateSeaLevelPressure(stationPressure, stationTemp);
// 2. Update Ring Buffer in RTC Memory
if (historyCount < HISTORYBUFFERLEN) {
pressureHistory[historyCount++] = seaLevelP0;
} else {
// Shift left
for (int i = 0; i < HISTORYBUFFERLEN - 1; i++) {
pressureHistory[i] = pressureHistory[i + 1];
}
pressureHistory[HISTORYBUFFERLEN - 1] = seaLevelP0;
}
// 3. Calculate 3-Hour Pressure Delta
float delta3h = 0.0;
if (historyCount >= 4) {
delta3h = pressureHistory[historyCount - 1] - pressureHistory[historyCount - 4];
}
String forecast = calculateZambrettiForecast(seaLevelP0, delta3h);
Serial.printf("[BAROMETER] Station Pressure: %.2f hPa | Sea-Level P0: %.2f hPa | Temp: %.1f C\n",
stationPressure, seaLevelP0, stationTemp);
Serial.printf("[TENDENCY] 3h Delta: %+.2f hPa | Forecast: %s\n", delta3h, forecast.c_str());
// 4. Print 48-Hour Historical ASCII Sparkline
Serial.println("\n[48-HOUR PRESSURE SPARKLINE]:");
for (int i = 0; i < historyCount; i++) {
int bars = (int)((pressureHistory[i] - 995.0) * 2.0);
bars = constrain(bars, 0, 40);
Serial.printf("-%02dh: %6.1f hPa |", (historyCount - 1 - i), pressureHistory[i]);
for (int b = 0; b < bars; b++) Serial.print("#");
Serial.println();
}
// 5. Enter Ultra-Low-Power Deep Sleep
Serial.printf("\n[SYSTEM] Entering deep sleep for %llu seconds...\n\n", SLEEPINTERVALSEC);
espsleepenabletimerwakeup(SLEEPINTERVALSEC * 1000000ULL);
espdeepsleep_start();
}
void loop() {
}
``
Build an E-Paper Storm Surge Barograph with ESP32-C3 & Bosch BMP390 Firmware & Schematics Vault
Download verified Arduino C++ firmware, pinout table, and BOM for Build an E-Paper Storm Surge Barograph with ESP32-C3 & Bosch BMP390.
Free Tutorial vs. Project Vault: The tutorial and educational theory above are 100% free. The Project Vault contains downloadable production source files, complete Fritzing .fzz circuits, laser vector files, and 1-on-1 mentor debugging sessions.
#include<Adafruit_Sensor.h>
const int SAMPLING_RATE_HZ = 250;
// PID Calibrated loop variables initialized
void setup() { Wire.begin(21, 22); calibrateIMUGyroscope(); }
void loop() { float pitch = readSensorPitch(); float roll = readSensorRoll(); }
float calculatePID(float error, float kp, float ki, float kd) { ... }
void transmitTelemetryPackage(uint8_t *packet, size_t length) { ... }
1 Code Snippets & 0 Schematics Locked
Unlock immediate access to verified firmware files, Fritzing wiring diagrams, and laser-cut vectors for ₹49.
Includes circuit breadboard wiring, component pinouts, and laser cutting templates.
Screen-share or show your breadboard to M. F. Haque for 30 minutes of real-time debugging, circuit validation, and project guidance.
See What Mentora Makers Are Building
Real video walk-throughs, breadboard tests, and flight demonstrations submitted by students & parents.
Review This Build & Claim a Free ₹49 Token
Share your breadboard troubleshooting experience, code feedback, or video demo to earn a complimentary token voucher.
Have a Reward Voucher?
Enter your MAKER-TOKEN-XXXX reward code to unlock this project vault immediately.
Earn ₹50 Per Friend You Refer
Get your custom referral link. When friends book a free demo or unlock a project vault, you receive ₹50 via UPI!
Why does the E-Paper display show dark grey ghost images after several hours?
Root Cause: Micro-Capsule Charge Polarization: Using only partial refreshes leaves residual electrostatic charges across the electrophoretic micro-capsules. Fix: Perform a full black-to-white inverted cycle every 12 to 24 hours (display.init(); display.clear();) before reverting back to partial updates.
Why does the BMP390 fail to communicate or read random zeros?
Root Cause: SDO pin floating. On BMP390 boards: SDO to GND = I2C Address 0x76 SDO to 3.3V = I2C Address 0x77 Always solder SDO firmly to 3.3V or GND to prevent random bus timeouts.
Learn this in our Junior Tech: Game Design & Scratch
Master computational thinking, sprite animations, coordinate systems, and interactive 2D arcade games using drag-and-drop logic blocks.