Progress Review

Wireless BLE Rain Monitoring & Simulation System

Engineer Name: Nabihah
Target Hardware: Arduino Nano 33 BLE & Waveshare ESP32-S3 AMOLED 1.75
Last Update: 9 October 2026
01 Overall Project Progress
# Workstream Status Scope
01 Wireless BLE Rain Simulator ● Complete Generate simulated rain events
02 BLE Rain Monitoring System ● Complete Transmit and monitor rain events
03 Tipping-Bucket Tip Calculation ● In Progress Calculate simulated tips on Arduino Nano 33 BLE
04 Real-Time Tipping Bucket Counting ● Next Development Physical prototype + real water + TinyML
02 Workstream 01: Wireless BLE Rain Simulator

Wireless BLE Rain Simulator

Status: Complete | Domain: Embedded Firmware & PC DSP Software
● Complete

Established the baseline point-to-point wireless link between an Arduino Nano 33 BLE and a PC. Computes simulated raindrop acoustic parameters in software on the MCU and broadcasts GATT notifications to a real-time Python audio listener.

▸ View System Architecture Hide System Architecture Diagram • Tap to view
Workstream 01 • System Architecture & Data Pipeline
Topology: Point-to-Point PHY: BLE 5.0 (2.4 GHz RF) Role: Peripheral → Central
Arduino Nano 33 BLE
Nordic nRF52840 • Adv: Nano33_Rain
BLE Peripheral
  • ●
    Internal Rain Sound Generator: Simulates droplet acoustics & timing in C++ firmware without external sensors.
  • ●
    Non-Blocking Visual Pulse: 100ms LED blink on every rain event using millis() scheduling.
  • ●
    Tuned Keep-Alives: Low-latency parameters to prevent link drops:
    Conn Interval: 40–80 ms • Timeout: 6.0 s
  • ●
    GATT Server Stack: Hosts custom 128-bit Rain Service with Notify & Read capabilities.
BLE (Wireless)
2.4 GHz RF / GATT
SVC: 19B10000-E8F2-537E-4F6C-D104768A1214
CHR: 19B10001-E8F2-537E-4F6C-D104768A1214
Payload: uint32 Drop Count
PC / Laptop
Bleak Client • Python 3.10+ DSP
BLE Central
  • ●
    Real-Time Audio Listener: Python async daemon subscribing to GATT drop notifications via Bleak.
  • ●
    Real-Time Acoustic Synthesizer: Physics-based drop synthesis using NumPy (downward frequency chirp 800–2200 Hz).
  • ●
    Continuous Audio Stream: sounddevice.OutputStream callback avoids DAC sleep latency & clipping.
  • ●
    Active Link Maintenance: 10-second active GATT heartbeat ping prevents OS connection teardown.
Key Engineering Implementations
  • Arduino Nano 33 BLE Firmware: Nordic nRF52840 implementation using ArduinoBLE. Advertises as Nano33_Rain with custom Rain Service UUID and 32-bit unsigned drop counter characteristic.
  • Software Droplet Acoustics: Computes randomized pitch (800–2200 Hz) and volume intensity (50–100%) at natural intervals (2–4 seconds).
  • Real-Time Python Synthesizer: Physics-based acoustic synthesizer using sounddevice and numpy. Features downward frequency sweep, exponential decay envelope, and spatial stereo panning.
  • Continuous Stream Engine: Replaced blocking sound calls with a continuous audio callback stream (`sounddevice.OutputStream`), completely eliminating DAC sleep latency and droplet clipping.
  • Multi-Mode Architecture: Supports wireless BLE Central mode, wired USB Serial mode (115200 baud), and an offline standalone Demo mode.
Evidence & Media Gallery
📷 Photo ⤢ View Hardware & PC Terminal Setup
Hardware & PC Setup
Nano 33 BLE • Python listener
▶ Video ⤢ Watch
▶
Wireless BLE Rain Simulator Demonstration
Simulation Demo
Drive Video ↗ • Audio DSP
Development Iterations 3 Iterations
Debugging Activities 1 Major Activity
Testing / Validation 3 Verified Runs
Final State Stable Wireless Link
03 Workstream 02: BLE Rain Monitoring System

BLE Rain Monitoring System

Status: Complete | Domain: Multi-Node IoT Embedded Firmware & PC Client
● Complete

Expanded from a single point-to-point link into a true multi-node wireless IoT monitoring hub. The Arduino Nano 33 BLE concurrently broadcasts live droplet events to both an ESP32-S3 round AMOLED smart display and a PC Python listener simultaneously.

▸ View System Architecture Hide System Architecture Diagram • Tap to view
Workstream 02 • Multi-Node IoT Broadcast Architecture
Topology: Multi-Central Broadcast Dual Wireless Links Sync: Real-Time Event Fan-Out
Arduino Nano 33 BLE
Nordic nRF52840 • Adv: Nano33_Rain
Multi-Central Peripheral
  • ●
    Software Acoustic Generator: Simulates rainfall events & generates drop counter with randomized pitch trigger.
  • ●
    Multi-Central Broadcast Server: Maintains persistent advertising after Central 1 connects to admit Central 2 concurrently.
  • ●
    Organic Distribution & Low-Latency Timing:
    Interval: 15–35 ms • Natural Spacing: 50% 0.8–1.7s | 35% 1.7–2.9s | 15% 2.9–4.5s
  • ●
    Non-Blocking Keep-Alive Loop: Reliable concurrent event notifications across multiple connected centrals.
Concurrent Broadcast • Service: 19B10000-... • Char: 19B10001-... (Notify)
📡 Arduino Nano 33 BLE → BLE → ESP32-S3 AMOLED
📡 Arduino Nano 33 BLE → BLE → PC/Laptop
↓ Arduino Nano 33 BLE → BLE → ESP32-S3 AMOLED
↓ Arduino Nano 33 BLE → BLE → PC / Laptop
Waveshare ESP32-S3 AMOLED 1.75
ESP32-S3 Dual-Core 240MHz • Watch Prototype
BLE Central 1
  • ●
    Round 466x466 AMOLED Display: CO5300 driver via Arduino_GFX_Library with vibrant 220 brightness UI.
  • ●
    Live UI Dashboard: Real-time RAIN: <count> display with custom droplet animation frame updates.
  • ●
    Onboard ES8311 I2S Codec + Speaker: Hardware audio DAC & NS4150 amplifier with precomputed 256-sample sine wave.
  • ●
    Sequential Event Catch-Up Queue:
    while (lastProcessedCount < targetRainCount)
    Eliminates missed counts & guarantees full sound playback even during RF bursts.
  • ●
    Auto-Scan & Connection: Autonomous BLE discovery and pairing with Nano33_Rain peripheral.
PC / Laptop
Bleak Python 3.10+ • Terminal & Audio DSP
BLE Central 2
  • ●
    Real-Time Python Audio Listener: Concurrent background BLE client running unbuffered async event loops.
  • ●
    Timestamped Event Logging: Real-time drop counter in terminal with elapsed session timestamps:
    [HH:MM:SS] per event log
  • ●
    High-Fidelity Acoustic Synthesizer: Physics-based downward frequency chirp (800–2200 Hz) with stereo panning.
  • ●
    Continuous Output Stream: sounddevice.OutputStream callback eliminates buffer under-runs and DAC clicks.
  • ●
    Multi-Node Verification: Proves exact drop count synchrony with the AMOLED display in real time.
Multi-Node Hardware & Firmware Architecture
  • Multi-Client BLE Hub: Configured Nano 33 BLE to maintain persistent advertising after Central #1 connects, allowing Central #2 to establish a simultaneous link without dropping the active session.
  • Waveshare ESP32-S3 Touch AMOLED 1.75: Driver integration using Arduino_GFX_Library for the round CO5300 466x466 AMOLED panel (offset parameters 6, 0, 0, 0, brightness 220).
  • Onboard I2S Speaker Synthesis: Direct hardware driver for onboard ES8311 codec and GPIO 46 power amplifier, synthesizing raindrop acoustics directly on the watch-style board.
  • Sequential Droplet Catch-Up Queue: Eliminated missed counts by replacing simple boolean flags with an event catch-up loop (while (lastProcessedCount < targetRainCount)). Every drop sound is played and counted even under RF delays.
  • Organic Rainfall Distribution: Replaced metronomic intervals with tiered natural distribution (50% 800–1700ms, 35% 1700–2900ms, 15% 2900–4500ms).
  • Timestamped Event Logging: Integrated elapsed session timestamps ([HH:MM:SS]) across the Python listener matching the requested management format.
Evidence & Media Gallery
📷 Photo ⤢ View Multi-Node Synchrony Setup
Multi-Node Synchrony
AMOLED • PC (Drop #834)
▶ Video ⤢ Watch
▶
Multi-Node BLE Demonstration
Multi-Node Demo
Drive Video ↗ • AMOLED Audio
Development Iterations 4 Iterations
Debugging Activities 3 Major Activities
Testing / Validation 4 Verified Runs
Final State Multi-Node In Sync
04 Workstream 03: Tipping-Bucket Enhancement

Tipping-Bucket Enhancement

Status: In Progress / Not Started Yet | Domain: Firmware Mathematics & Display UI Enhancement
● In Progress

This workstream will enhance the existing monitoring system to translate simulated or acoustic droplet events into standard meteorological tipping-bucket rainfall metrics.

Target Mathematical Specification

The conversion ratio is formally defined as:

1 Tip = 126 Water Drops

Standard physical tipping-bucket rain gauges tip after accumulating a precise volume of water (typically 0.2 mm or 0.1 mm of precipitation). Translating 126 acoustic droplets into 1 mechanical tip bridges micro-droplet detection to macro-level rainfall depth.

Planned Implementation Tasks (Upcoming)
  • Firmware Metric Computation: Implement accumulator logic in Nano 33 BLE to calculate total tips = floor(dropCount / 126) and remaining drops = dropCount % 126.
  • Dual-Counter AMOLED UI: Update the round AMOLED graphical interface to display both live drops and accumulated tips simultaneously (e.g. TIPS: 3 | DROPS: 42).
  • Python Analytics Display: Extend the PC listener terminal output to report bucket tips and estimated precipitation accumulation in millimeters.
Specification & Concept Gallery
📐 Spec ⤢ View Tipping Bucket Math Specification: 1 Tip = 126 Drops
Accumulator Ratio
1 Tip = 126 Drops Spec
Mathematical Ratio 1 Tip = 126 Drops
Accumulator Target Nano 33 Firmware
Display Integration AMOLED Dual-UI
Planned Execution Sprint Phase 3
05 Workstream 04: Real-Time Tipping Bucket Counting

Real-Time Tipping Bucket Counting

Status: Next Development | Domain: Physical Hardware Prototyping & Sensor Calibration
● Next Development
Current & Planned Hardware Activities
  • a. ESP32-S3 AMOLED Prototype / Clamp: In Progress
    Fabricating a physical enclosure and mounting clamp to secure the Waveshare ESP32-S3 AMOLED 1.75 board onto physical field apparatus. (Details on 3D printing learning below).
  • b. Edge Impulse / TinyML Integration: Planned
    Training an embedded TinyML acoustic classifier using Edge Impulse to recognize actual physical droplet impacts and mechanical bucket tips against ambient noise.
  • c. Real Water-Drop Testing: Planned
    Deploying an actual physical water drip apparatus and calibrated tipping bucket to validate physical counting accuracy against the software simulation baseline.
Physical Prototype Evidence Gallery
📷 Photo ⤢ View ESP32-S3 AMOLED Enclosure
Target Design
Rain Gauge Enclosure
📷 Photo ⤢ View ESP32-S3 AMOLED Enclosure
3D Printed
ESP32-S3 AMOLED Enclosure
06 Roadmap

The project follows a rigorous phased progression: starting with pure software simulation, establishing robust wireless telemetry, expanding into multi-node edge IoT, prototyping physical enclosures, and finally transitioning to real-world TinyML physical sensing.

Click to view details ▾ Click to collapse details ▴
1. Software Rain Simulation & Synthesis Completed Firmware
Mathematical modeling of acoustic raindrops (frequency glides, splash noise, exponential decay) entirely in MCU firmware without requiring audio clips.
2. Wireless BLE Hub & PC Listener Completed Firmware & Python
Arduino Nano 33 BLE GATT notify implementation paired with real-time Python audio listener (`sounddevice` + `bleak`) and Windows keep-alive stability tuning.
3. Multi-Node IoT Monitoring System (AMOLED + PC) Completed IoT Network
Simultaneous multi-central broadcast from Nano 33 BLE to both Waveshare ESP32-S3 AMOLED round display and PC listener. Event catch-up queue and DMA audio optimizations.
4. Physical Prototype & Casing Fabrication In Progress 3D Fabrication
Adaptation of MakerWorld reference 3D model and 3D printing of the ESP32-S3 AMOLED mounting clamp on a personal 3D printer.
5. Tipping-Bucket Enhancement (1 Tip = 126 Drops) Not Started Upcoming Software
Algorithm to accumulate micro-droplets and calculate physical tipping events and precipitation accumulation depth in millimeters.
6. Edge AI / TinyML Acoustic Classification Planned Embedded ML
Training an on-device machine learning model with Edge Impulse to filter background noise from genuine droplet acoustic vibrations.
7. Real-Time Physical Rain Measurement Planned Field Testbed
Validating the complete physical assembly against real outdoor rainfall or laboratory drip apparatus.
07 Engineering Debugging & Problem-Solving

The following entries reflect real, documented engineering issues encountered during development, verified from commit logs, video frame-by-frame analysis, and terminal debugging.

Click to view details ▾ Click to collapse details ▴
Issue 1: AMOLED Screen Lag & Skipped Droplet Sounds (Workstream 02) Resolved in Commit 520eed9
Investigation: Frame-by-frame analysis of vid1_delay.mp4 showed PC at Drop #21 while AMOLED was lagging at #13. Incoming BLE notifications only set a boolean flag newRainEvent = true. When drop #22 arrived while #21 was still computing audio, the event flag was overwritten and lost. Furthermore, i2s_zero_dma_buffer() was abruptly cutting off the audio tail mid-DMA transfer.
Engineering Fix: (1) Replaced the boolean flag with an event catch-up queue: while (lastProcessedCount < targetRainCount). (2) Pre-computed a 256-sample sine wave lookup table (sineTable[256]) in setup() to eliminate heavy floating-point math during audio loop. (3) Increased I2S DMA buffers to 8 and removed i2s_zero_dma_buffer(), allowing hardware DMA auto-clearing without clipping. (4) Replaced periodic 2-second advertising restarts on Nano 33 BLE with event-driven advertising so active central packets are never disrupted.
Verified Result: AMOLED and PC counters synchronized perfectly in real-time. Zero skipped counts, zero dropped audio events, and verified sequential serial notifications on COM8.
Issue 2: Windows BLE Host Power-Saving Disconnections (Workstream 01) Resolved in Commit 0fcb3f7
Investigation: The PC Python BLE listener was disconnecting after 1–2 minutes of streaming. Windows Bluetooth power-management was putting the BLE adapter to sleep due to perceived inactivity on purely inbound notify streams. In addition, PortAudio's default STA thread clashed with WinRT BLE callbacks.
Engineering Fix: (1) Explicitly initialized Windows COM as Multi-Threaded Apartment (ctypes.windll.ole32.CoInitializeEx(None, 0x0)) before loading audio libraries. (2) Added an active 10-second periodic bidirectional GATT heartbeat ping (read_gatt_char) in the Python loop to keep the Windows BLE scheduler active. (3) Configured connection interval (40–80ms) and supervision timeout (6.0s) on Nano 33 BLE.
Verified Result: Windows BLE connection maintained continuous, uninterrupted streaming.
Issue 3: Initial Connection Jump to 100+ Drops (Workstream 02) Resolved in Commit 5daae69
Investigation: When powering on the Nano 33 BLE before connecting the AMOLED or PC, the internal simulated rain generator ran unchecked. Upon connection, the AMOLED display immediately jumped to 100+ drops instead of starting cleanly.
Engineering Fix: Added a central connection guard to handleRainGeneration() in Nano 33 BLE firmware (if (!isConnected) return;). Droplets are only generated when at least one central is actively connected.
Verified Result: Both receivers start cleanly at drop 1 upon establishing their connection.
08 Key Learnings

Practical hands-on experience in 3D enclosure prototyping adapted from a MakerWorld reference model, alongside foundational competencies developed in multi-central BLE, real-time audio DSP, and embedded AMOLED displays.

Click to view details ▾ Click to collapse details ▴
🖨️

First Hands-On Experience with 3D Printing & Enclosure Prototyping

This project marked my first time working with 3D CAD model files and physical 3D printing. Rather than designing the complex circular snap-fit enclosure completely from scratch, I leveraged an existing community design on MakerWorld as an engineering reference model.

I studied the model's dimensions, adapted it to our project requirements, sliced the file, and successfully printed the physical prototype monitor clamp using my personal 3D printer. This provided invaluable practical experience in tolerance fit, FDM printing layer orientation, and physical device packaging.

🔗 Reference Model: MakerWorld #3190305 — Waveshare ESP32-S3 AMOLED 1.75 Monitor Holder ↗
Core Engineering Competencies Developed
📡

Multi-Central BLE Topology

Mastered Nordic nRF52840 connection parameter negotiation, multi-peer advertising re-arming, and low-latency GATT throughput (15–35ms).

⚡

Real-Time Audio DSP

Implemented real-time software acoustic droplet synthesis across both high-level Python (continuous stream) and bare-metal ESP32-S3 (ES8311 I2S DMA).

🖥️

AMOLED Display Integration

Successfully driven the round 466x466 CO5300 AMOLED panel over QSPI with Moon On Our Nation's GFX library, implementing zero-flicker partial updates.

⚙️

Iterative Systems Engineering

Applied structured rapid engineering cycles for firmware architecture, root-cause diagnosis of RF synchronization bottlenecks, and disciplined GitLab version control workflows.

09 Next Development Roadmap

The immediate next steps focus on completing Workstream 03 (software tipping-bucket calculation) and executing physical hardware testing for Workstream 04.

Click to view details ▾ Click to collapse details ▴
1
Start Tipping-Bucket Software Enhancement

Initiate development for Workstream 03 in firmware and PC listener.

2
Implement 1 Tip = 126 Drops Conversion Logic

Code the accumulator and modulo mathematics to convert raw drops into mechanical tips.

3
Finalize 3D-Printed AMOLED Clamp Enclosure

Complete physical assembly of the printed holder and mount onto test apparatus.

4
Explore Edge Impulse / TinyML Machine Learning

Collect acoustic/vibration datasets of physical water droplets to train an embedded classifier.

5
Conduct Real Water-Drop Calibration Tests

Test physical water dropper rates against simulated droplet acoustic baselines.