⚠️ 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>


#include 

const int PIN_PROBE = 2;       // Hardware Interrupt Pin (INT0)
const int PIN_OUTPUT = 5;      // Gate switcher array
unsigned long previousTimeMarker = 0;
const long structuralInterval = 250; 
int currentAlertState = LOW;   

// Empty interrupt service routine (ISR). Just used to wake up the MCU.
void wakeUpRoutine() {
  // Keep this empty to resume execution immediately after the sleep command
}

void setup() {
  pinMode(PIN_PROBE, INPUT_PULLUP);
  pinMode(PIN_OUTPUT, OUTPUT);
  digitalWrite(PIN_OUTPUT, LOW);
  
  // Attach interrupt to wake up when PIN_PROBE goes LOW (fluid detected)
  attachInterrupt(digitalPinToInterrupt(PIN_PROBE), wakeUpRoutine, LOW);
}

void loop() {
  // Check if fluid is present
  if (digitalRead(PIN_PROBE) == LOW) {
    unsigned long currentTimeMarker = millis();
    
    // Asynchronous non-blocking toggle for the buzzer/alarm
    if (currentTimeMarker - previousTimeMarker >= structuralInterval) {
      previousTimeMarker = currentTimeMarker;
      
      currentAlertState = (currentAlertState == LOW) ? HIGH : LOW;
      digitalWrite(PIN_OUTPUT, currentAlertState);
    }
  } 
  else {
    // No fluid detected: Shut down output immediately
    digitalWrite(PIN_OUTPUT, LOW);
    currentAlertState = LOW;
    
    // Go into an endless deep sleep. 
    // It will ONLY wake up instantly when PIN_PROBE goes LOW.
    LowPower.powerDown(SLEEP_FOREVER, ADC_OFF, BOD_OFF);
  }
}