⚠️ ECO-SYSTEM NOTIFICATION: PRODUCTION LOG UPGRADED TO NON-BLOCKING STATE VIA RIKECOCODE-PRO MATRIX
SYSTEM ID: SYS-019 • PRODUCTION STATUS LIVE

RikAquaShield-Pro: Value-Engineered Solar Fluid Monitor

An ultra-low-cost, battery-optimized tank overflow and dry-run protector built for extreme environmental field endurance. Built entirely on an open-source framework by RikMakersHub.

SYSTEM SCHEMATIC & WIRING MATRIX

Hardware routing map for interconnecting the low-power sensing loop, battery regulation, and alerting hardware.

Solar Panel (5V)
18650 Battery
Pro Mini VCC
Piezo Alert (+)

📍 PIN 2 ➔ Stainless Probe A

📍 GND ➔ Stainless Probe B

📍 PIN 5 ➔ [1kΩ] ➔ BC547 Base

BC547 Collector ➔ Piezo Alert (-)

BC547 Emitter ➔ System GND Plane

💡 Core Wiring Diagnostics:

  • GND Bus: Ensure a shared, solid common ground between the Pro Mini, the BC547 emitter, and the 18650 negative terminal.
  • Hardware Pull-up: Pin 2 relies on the ATmega328P's internal 20kΩ pull-up resistor. No physical external resistor is required on the probe lines.
  • Flyback Protection: If modifying this design to use a mechanical relay instead of a piezo buzzer, place a 1N4007 diode across the relay coil to clip inductive voltage spikes.

BILL OF MATERIALS (BOM) • COST ANALYSIS

Value-engineered hardware matrix targeting an active field deployment cost under ₹500 ($5.80 USD).

Component Name Specification / Type Cost (₹500) Primary Operational Function
Microcontroller Unit Arduino Pro Mini (3.3V / 8MHz ATmega328P) ₹180 Core logic execution loop. Onboard trace cuts isolate and remove the power indicator LED.
Energy Reservoir Upcycled 18650 Li-Ion Cell + 5V Mini Epoxy Solar Panel ₹70 Autonomous, off-grid power management loop. Completely bypasses household grid lines.
Sensing Infrastructure Marine-Grade Stainless Steel Screws (x2) ₹15 Replaces fragile ultrasonic modules. Uses liquid continuity to pull GPIO Pin 2 to a LOW state.
Switching & Alerts BC547 NPN Transistor + 1kΩ Resistor + 5V Piezo Buzzer ₹45 Isolates processing pin from direct load demands. Drives high-frequency acoustic pulsing alerts.
System Shielding IP65 Weatherproof Electrical PVC Junction Box ₹40 Protects core processing traces from intense monsoon downpours and thermal field degradation.
Total Value-Engineered Build Cost ₹350 / $4.25 USD (Success)

CORE FIRMWARE SOURCE REFACTOR

Watchdog-gated production script optimized via RikEcoCode-Pro computational analytics to remove blocking delay() lines.

aquashield_optimized.ino
#include <LowPower.h>

const int PIN_PROBE = 2;   // Structural liquid trace
const int PIN_OUTPUT = 5;  // Gate switcher array

unsigned long previousTimeMarker = 0;
const long structuralInterval = 250; // Dynamic non-blocking baseline
int currentAlertState = LOW;         // Tracks the buzzer toggle position

void setup() {
  pinMode(PIN_PROBE, INPUT_PULLUP);
  pinMode(PIN_OUTPUT, OUTPUT);
  digitalWrite(PIN_OUTPUT, LOW);
}

void loop() {
  // Check if fluid has bridged the sensor path (Active LOW)
  if (digitalRead(PIN_PROBE) == LOW) {
    unsigned long currentTimeMarker = millis(); // Background tracking stopwatch

    // Asynchronous non-blocking task condition block instead of hard delay()
    if (currentTimeMarker - previousTimeMarker >= structuralInterval) {
      previousTimeMarker = currentTimeMarker; // Balance baseline reference point
      
      // Toggle output state between HIGH and LOW every 250ms natively
      if (currentAlertState == LOW) {
        currentAlertState = HIGH;
      } else {
        currentAlertState = LOW;
      }
      digitalWrite(PIN_OUTPUT, currentAlertState);
    }
  } else {
    // Force direct shutdown of alarm line before sleeping
    digitalWrite(PIN_OUTPUT, LOW);
    currentAlertState = LOW;
    
    // Drop execution completely into deep sleep for 8-second cycles to hit sub-20µA
    LowPower.powerDown(SLEEP_8S, ADC_OFF, BOD_OFF);
  }
}