Proyecto Institucional · EIUM · 2025–2026

Hydraulic Monitoring System with ML

EIUM Institutional Project — Flow control and prediction using sensors, Arduino Nano and Random Forest

View progress
Arduino Nano · Random Forest · 5× ZJ-S201

About the Project

Real-time hydraulic flow monitoring and prediction system, based on five ZJ-S201 sensors, Arduino Nano control, and a Random Forest machine learning model. The project integrates embedded hardware, signal processing, and artificial intelligence to optimize water resource control in educational and industrial environments.

Arduino Nano ZJ-S201 Random Forest Python 3.11 IBT-2 PWM Serial 115200 PySerial scikit-learn
1

Monitor hydraulic flow in real time with 5 Hall-effect sensors

2

Control 4 valves and an IBT-2 pump via PWM signals

3

Predict flow levels with a trained Random Forest model

4

Provide an interactive educational interface with AI assistant

Physical System

Click on any component to view technical specifications

Arduino NanoATmega328PS. EntradaZJ-S201S. Salida V1ZJ-S201S. Salida V2ZJ-S201S. Salida V3ZJ-S201S. Salida V4ZJ-S201Válvula 1Relé 5VVálvula 2Relé 5VVálvula 3Relé 5VVálvula 4Relé 5VBomba IBT-2PWM

Click any component to see its specifications

Methodology

Click on each stage for details

System methodology

System Data (Simulation)

Real-time visualization of 5 flow sensors (L/h)

Live · Simulation

Simulated data · Real system range: 350–700 L/h per channel

Project Progress

Fase 1: Hardware design and selection

2025-09

Physical system definition: ZJ-S201 sensors, relays, IBT-2 pump, Arduino Nano microcontroller.

Completed

Fase 2: Physical system implementation

2025-11

Hydraulic circuit assembly, Arduino firmware and Python/Tkinter control panel.

Completed

Fase 3: ML model development

2026-02

Sensor data collection, Random Forest model training, metrics evaluation.

In progress

Fase 4: Educational interface and AI chatbot

2026-04

Development of the educational interface with visualizations and virtual learning assistant.

In progress

Fase 5: Validation and testing

2026-08

Integration tests, model validation under real conditions, fine tuning.

Pending

Fase 6: Publication and documentation

2026-12

Final paper writing, conference presentation, results publication.

Pending

Technology Stack

🔌

Hardware

  • Arduino Nano (ATmega328P · 16MHz)
  • 5× Sensor ZJ-S201 (1–60 L/min)
  • 4× Módulo relé 5V (10A/250VAC)
  • Driver IBT-2 (PWM H-bridge)
  • Fuente 12V DC
💻

Software

  • Python 3.11
  • PySerial (comunicación serial)
  • Tkinter + Matplotlib (GUI)
  • joblib (carga de modelos)
🧠

Machine Learning

  • scikit-learn RandomForestRegressor
  • NumPy / Pandas (preprocesamiento)
  • Ventana deslizante 10 muestras
  • 50 features de entrada · <50ms latencia

Arduino Firmware (excerpt)

firmware.ino
// ZJ-S201 — lectura de pulsos por interrupción
volatile uint32_t pulsos[5] = {0};
float lph[5] = {0};

ISR(sensor_entrada) { pulsos[0]++; }
ISR(sensor_v1)      { pulsos[1]++; }

void loop() {
  if (millis() - lastSend >= 1000) {
    // Convertir pulsos a L/h: (pulsos/7.5) * 60
    for (int i = 0; i < 5; i++) {
      noInterrupts();
      uint32_t p = pulsos[i]; pulsos[i] = 0;
      interrupts();
      lph[i] = (p / 7.5f) * 60.0f;
    }
    // Enviar trama: F:val0,val1,val2,val3,val4
    Serial.print("F:");
    for (int i = 0; i < 5; i++) {
      Serial.print(lph[i], 1);
      if (i < 4) Serial.print(",");
    }
    Serial.println();
    lastSend = millis();
  }
}

Results and screenshots

Results

Results

Random Forest

Random Forest

Interface

Interface

Tutor Chatbot

Tutor Chatbot