πŸ”¬ IoT RO Controller

Replace the YL-W113 OEM board. Tier 1: ship in 2 weeks ($286). Tier 3: custom PCB at scale ($43 controller, $193 full system).

$14 ESP32 brain $0/mo cloud (Blynk) $43/unit at 1K scale 2 weeks to first ship

πŸ“ System Architecture

Key insight: The entire Spring Boot + PostgreSQL + Docker + OCI backend is replaced by Blynk's free tier. 5 devices, dashboards, iOS/Android app, OTA firmware updates. Zero infrastructure.

🧠 The Controller β€” $14 Off-the-Shelf

LILYGO TTGO T-Relay

ESP32 + 4 relays on ONE board. No soldering. No PCB design. Flash firmware via USB-C.

$14.00

βœ… Amazon β€” verified Jul 2026

MCUESP32-WROOM-32E, 240MHz dual-core
Relays4 channels, 10A/250VAC each
WiFi/BLEBuilt-in
Input5V DC via USB-C
SizeDIN-rail mountable

What It Replaces

Custom PCB designβœ“ Eliminated
MOSFET driver circuitsβœ“ Built into relays
ADC isolationβœ“ TDS sensor has built-in driver
24Vβ†’5Vβ†’3.3V buckβœ“ On-board regulator
PCB fab + assemblyβœ“ Eliminated

πŸ›’ Bill of Materials β€” $285.80 Prototype

#ItemSourcePriceQtyTotal
1LILYGO TTGO T-Relay ESP32Amazon$14.001$14.00
2Gravity Analog TDS Sensor (with probe)Amazon$11.902$23.80
3YF-S201 Hall Effect Flow MeterAmazon$5.001$5.00
424V DC NC Solenoid Valve 1/4" QCAmazon$8.002$16.00
524V DC RO Booster Pump 100 GPDAliExpress$40.001$40.00
66-Stage RO System Kit (plumbing + filters + membrane + tank + faucet)AliExpress$150.001$150.00
724V DC Power Supply 5AAmazon$15.001$15.00
8Jumper wires, USB-C cable, heat shrinkAmazon$10.001$10.00
9IP65 Plastic EnclosureAmazon$12.001$12.00
TOTAL (1 prototype unit)$285.80
At 100+ quantity (AliExpress sourcing)~$120-150

βœ… All prices verified via live browser navigation, July 2026. SARβ†’USD: 1 SAR β‰ˆ $0.267.

☁️ Cloud Platform β€” Free Tier

πŸ† Blynk (Recommended)

Free tier5 devices, $0/month
Mobile appiOS + Android included
DashboardDrag-and-drop builder
OTA updatesFirmware over-the-air
AutomationsAlert rules engine
Data retention1 week (free tier)
Scale-upStarter $29/mo (10 devices) β†’ Production $199+/mo

What Blynk Replaces

Spring Boot backendβœ“ Eliminated
PostgreSQL databaseβœ“ Eliminated
Docker + CI/CDβœ“ Eliminated
REST API developmentβœ“ Eliminated
iOS/Android app devβœ“ Eliminated
OCI cloud infraβœ“ Eliminated

ThingsBoard CE

Self-hosted Docker. Unlimited devices. Completely free. Run on any $6/mo VPS.

$0 forever

HiveMQ Cloud

Managed MQTT broker. 100 devices, 10 GB/month. No credit card needed.

$0 forever

AWS IoT Core

Free tier for 1 year. Pay-as-you-go after. Best if already in AWS ecosystem.

$0 first year

πŸ’§ Fluid Logic

πŸ”§ Assembly Pipeline β€” 2 Hours/Unit

  1. Unbox RO kit (15 min)
    Mount filters, install membrane, connect color-coded push-fit tubing, mount tank + faucet.
  2. Mount electronics (30 min)
    Screw T-Relay into IP65 enclosure. Wire 24V PSU β†’ relay COM terminals. Pump β†’ Relay 1, inlet solenoid β†’ Relay 2, flush solenoid β†’ Relay 3. TDS probes β†’ ESP32 ADC pins via jumper wires. Flow meter β†’ GPIO.
  3. Flash firmware (5 min)
    USB-C β†’ laptop. pio run --target upload. Device auto-connects to Blynk via QR provisioning.
  4. Configure Blynk (15 min)
    Clone from template: TDS gauges, flow rate, pump status, alert thresholds (TDS>50ppm = warning, rejection<90% = critical).
  5. Test & calibrate (30 min)
    Run water. Verify: raw TDS ~300ppm, pure TDS <20ppm, rejection >95%. Test auto-flush cycle. Verify Blynk alerts fire.
  6. Package & ship (15 min)
    Cable management with zip ties. Quick-start card with QR code. Box and ship.

⚑ Build vs. Buy Decision

Tier 1: Bolt-On Kit

LILYGO + pre-made sensors + pre-made RO kit + Blynk

Dev time2 weeks
Unit cost (100)~$120-150
Upfront cost~$300
RiskVery low

← START HERE

Tier 2: White-Label

Alibaba OEM controller + custom firmware + Blynk

Dev time4-6 weeks
Unit cost (100)~$70-90
Upfront cost~$1,000
RiskMedium

Tier 3: Custom PCB

Our PCB + JLCPCB assembly + ThingsBoard self-hosted

Dev time12-16 weeks
Unit cost (1,000)~$43 (controller only)
Full system~$193
Upfront cost~$15-25k (certs + tooling)
RiskMedium (volume commitment)

Recommendation: Start at Tier 1 immediately. Ship a working unit. Prove demand. Then move to Tier 2 or 3.

🏭 Supply Chain β€” Custom PCB at 1,000 Units

1. PCB Fabrication

JLCPCB β€” Shenzhen. 48-hour turnaround.

Spec2-layer FR4, 100Γ—80mm, 1oz copper, ENIG, green mask
Prototype (5 pcs)$2 + $20 shipping
Small batch (100)~$0.80/pc = $80
Production (1,000)~$0.40/pc = $400
Production (5,000)~$0.25/pc = $1,250

2. Component Sourcing

LCSC via JLCPCB parts library. All passives + ICs.

ESP32-WROOM-32E module$2.50
EC200U LTE Cat 1 modem$10.00
IRLZ44N MOSFET Γ—3$0.90
MP1584EN + AMS1117 + MIC29302$1.40
MCP6002 + DS3231 + passives$3.00
Connectors, terminals, headers$3.00
Total BOM (1,000 pcs)~$20.80

3. SMT Assembly

JLCPCB economic + extended parts. 3-5 day turnaround.

Setup + stencil (one-time)$80
Per-joint cost (~200 joints)~$2.00/pc
Extended parts fee (ESP32 + EC200U)~$7.00/pc
Assembly per board~$9.00

4. Enclosure

Alibaba β€” Shenzhen Shiny Enclosure. Custom ABS IP65.

Size200Γ—160Γ—60mm, wall-mount ears
Custom CNC cutouts + silkscreen logoIncluded
Prototype (1 pc)~$25
Small batch (100 pcs)~$5/pc
Production (1,000 pcs)~$2/pc = $2,000

5. Testing + Flashing Jig

Pogo-pin test jig (one-time)~$200
Firmware flashing (per unit, automated)~$0.50 labor
Functional test (per unit, 15 min)~$2.00 labor
Water test station (one-time setup)~$150

6. Packaging

Custom printed box + foam insert~$1.50/pc
Quick-start card (4-color print)~$0.30/pc
Cable kit (power + sensor wires)~$2.00/pc
QR code sticker (Blynk provisioning)~$0.10/pc
Packaging total~$3.90

7. Certifications (One-Time, Amortized)

CertificationCostTimelineRequired For
FCC Part 15 (intentional radiator)$8,000-15,0004-8 weeksUS market (ESP32 WiFi/BLE + LTE)
CE Mark (EMC + Radio)$3,000-6,0004-6 weeksEU market
RoHS compliance$500-1,5001-2 weeksEU + general export
Water safety (NSF/ANSI 58)$5,000-20,0008-16 weeksUS drinking water (optional, RO kit already certified)
Total certs (budget)~$12,000-22,000Amortize: adds ~$2-4/unit at 5,000 units

8. Per-Unit Cost Summary (1,000 Units)

StageCost/UnitNotes
PCB fabrication$0.40JLCPCB, 2-layer, 100Γ—80mm
Components (BOM)$20.80LCSC, 1,000 pcs pricing
SMT assembly$9.00Including extended parts fee
Enclosure (custom IP65)$2.00Alibaba, 1,000 pcs
Testing + flashing$2.50Pogo-pin jig + automated test
Packaging$3.90Box, foam, manual, cables, QR
Certifications (amortized)$3.00~$15k Γ· 5,000 units
Logistics (sea freight)$1.00Shenzhen β†’ destination port
TOTAL β€” Controller only$42.60At 1,000 units
Add $150 for the 6-stage RO kit (plumbing + filters + membrane + tank + faucet) from AliExpress. Full system BOM: ~$193/unit.

9. Logistics & Lead Time

Timeline (First Batch β€” 100 Units)

  1. PCB fab (JLCPCB) β€” 2-3 days
  2. SMT assembly β€” 3-5 days
  3. Enclosure fabrication β€” 10-14 days (parallel with PCB)
  4. Testing + flashing β€” 2-3 days (10 units/day with 1 tech)
  5. Packaging β€” 1-2 days
  6. Sea freight β€” 15-25 days (Shenzhen β†’ Middle East/EU)

Total: ~6-8 weeks from order to delivery

Scaling (1,000+ Units/Month)

PCB fab~$0.40/pc (volume discount)
Components~$18/pc (bulk LCSC/Mouser)
Assembly~$7/pc (automated line)
Enclosure~$1.50/pc (injection molding)
Testing~$1.50/pc (automated jig)
Total controller~$32/pc
Full system~$182/pc

🚨 Alert Thresholds

ConditionSeverityTriggerAction
Pure TDS > 50 ppm⚠ WARNINGDI resin exhausted or membrane failingNotify user to check DI resin
Rejection < 90%πŸ”΄ CRITICALMembrane needs replacementAuto-initiate flush, notify user
Signal < 10 RSSI⚠ WARNINGPoor LTE connectivityBuffer data locally, retry
Low pressure switch OPENπŸ”΄ CRITICALNo water supplySTOP PUMP immediately
High pressure switch OPENπŸ”΄ CRITICALOverpressureSTOP PUMP immediately

πŸ”Œ Quick Wiring Map

ESP32 GPIOFunctionConnects To
GPIO25Pump PWM (LEDC 5kHz)Relay 1 (NO β†’ Pump +)
GPIO26Inlet SolenoidRelay 2 (NO β†’ Solenoid +)
GPIO27Flush SolenoidRelay 3 (NO β†’ Solenoid +)
GPIO36 (ADC1_CH0)Raw TDS ProbeGravity TDS Sensor signal pin
GPIO39 (ADC1_CH3)Pure TDS ProbeGravity TDS Sensor signal pin
GPIO16Flow Meter Pulse (RISING INT)YF-S201 signal (yellow wire)
GPIO34Low-Pressure Switch (INPUT_PULLUP)NC switch β†’ GND when OK
GPIO35High-Pressure Switch (INPUT_PULLUP)NC switch β†’ GND when OK
GPIO32Tank Full Float SwitchFloat switch (HIGH = full)
24V Power: 24V DC PSU β†’ Relay board COM terminals.
Pump/Solenoid negative: β†’ GND_POWER (star-point with digital GND).

πŸ’° Full System Cost β€” Per Unit

ComponentTier 1 (Bolt-On)Tier 3 (Custom PCB, 1K)
Controller board$14.00 (T-Relay)$0.40 (2-layer PCB)
ComponentsIncluded in T-Relay$20.80 (BOM)
AssemblyNone (off-shelf)$9.00 (SMT)
Enclosure$12.00 (Amazon)$2.00 (Alibaba 1K)
Testing + flashing$0 (DIY)$2.50 (jig + labor)
Packaging$0 (plain box)$3.90 (custom)
TDS sensors Γ—2$23.80$8.00 (LCSC bulk)
Flow meter$5.00$2.50 (bulk)
Solenoids Γ—2$16.00$8.00 (bulk)
Booster pump 24V$40.00$25.00 (wholesale)
24V PSU 5A$15.00$8.00 (bulk)
6-Stage RO kit$150.00$80.00 (container qty)
Certifications (amortized)N/A$3.00
Logistics$0 (DIY)$1.00
FULL SYSTEM TOTAL$285.80$193.10

Key takeaway: Tier 1 ships tomorrow with no upfront cost. Tier 3 saves 32% per unit but requires $15-25k upfront (certifications + tooling). Break-even: ~270 units.