Skip to content

Installation and Setup

Albin Varghese edited this page Nov 18, 2024 · 2 revisions

HydroLink Plus Installation & Setup Guide

Table of Contents

  1. Introduction
  2. Prerequisites
  3. Hardware Setup
  4. Firmware Setup
  5. Server Configuration
  6. Portal and Mobile App Setup
  7. Testing and Calibration
  8. Conclusion

Introduction

This guide provides a step-by-step walkthrough to set up the HydroLink Plus system, including hardware assembly, firmware installation, server setup, and testing. Detailed diagrams and configuration instructions ensure a seamless setup.


Prerequisites

Hardware Requirements

  • ESP32 Development Board
  • pH Sensor
  • Turbidity Sensor
  • Water Flow Sensor
  • Motorized Valve
  • Solar Panel (5V, 2W)
  • 12V 2200mAh Li-ion Battery
  • CN3791 MPPT Solar Charger Module
  • Mini 360 Buck Converter
  • OLED Display (optional)

Software Requirements

  • ESP-IDF Framework
  • Python 3.x
  • Git
  • Laravel for Authority Server
  • React Native for Mobile App
  • MySQL Database
  • FastAPI for Controller Backend

Hardware Setup

Assembling the Module

The hardware components are assembled into a compact, 3D-printed case.

Assembly Diagram

graph TD;
    A[ESP32 Microcontroller] -->|Connects to| B[pH Sensor];
    A --> C[Water Flow Sensor];
    A --> D[Turbidity Sensor];
    A --> E[Motorized Valve];
    F[Solar Panel] -->|Powers| G[MPPT Charger Module];
    G -->|12V Output| H[Li-ion Battery];
    H -->|Step Down| I[Mini 360 Buck Converter];
    I -->|3.3V/5V Output| A;
Loading

Connecting Sensors and Actuators

  • Sensor Connections:
    • pH Sensor: Connect to GPIO34 for ADC input.
    • Turbidity Sensor: Connect to GPIO35 for ADC input.
    • Water Flow Sensor: Connect to GPIO18 for digital pulse input.
  • Valve Control:
    • Motorized valve control pin connects to GPIO32.
  • Power Wiring:
    • Solar panel connects to MPPT input.
    • MPPT module charges the 12V battery.
    • Buck converter steps voltage down for ESP32 and sensors.

Power Supply Setup

Ensure the system is properly powered for continuous operation.

Power Flow Diagram

graph TD;
    A[Solar Panel] -->|5V Input| B[MPPT Charger Module];
    B -->|12V Output| C[Li-ion Battery];
    C -->|12V Input| D[Mini 360 Buck Converter];
    D -->|3.3V/5V Output| E[ESP32 and Sensors];
Loading
  • Use appropriate connectors to ensure secure wiring.
  • Test solar panel output under sunlight for optimal efficiency.

Firmware Setup

Installing ESP-IDF

  1. Install ESP-IDF from the official ESP32 documentation.
  2. Configure the environment:
    export IDF_PATH=~/esp/esp-idf
    export PATH=$IDF_PATH/tools:$PATH

Screenshot of ESP-IDF Setup

(Include an image showing the successful ESP-IDF environment setup in a terminal window.)

Building and Flashing the Firmware

  1. Clone the HydroLink Plus firmware repository:

    git clone https://github.com/your-repo/hydrolink-firmware.git
    cd hydrolink-firmware
  2. Configure the firmware:

    idf.py menuconfig
    • Example menu options:
      • Wi-Fi SSID: your-SSID
      • Wi-Fi Password: your-password
    • Pin mappings for sensors and actuators.
  3. Build and flash the firmware:

    idf.py build
    idf.py flash

Gantt Chart for Task Scheduling

gantt
    title Firmware Task Scheduling
    section Tasks
    Sensor Data Collection :active, a1, 2024-11-18, 10s
    Valve Control          :a2, after a1, 5s
    Data Transmission      :a3, after a2, 10s
    Power Monitoring       :a4, after a3, 5s
Loading

Server Configuration

Authority Server Setup

  1. Clone and deploy the Laravel-based server:

    git clone https://github.com/your-repo/hydrolink-server.git
    cd hydrolink-server
    composer install
  2. Configure .env for database access:

    DB_CONNECTION=mysql
    DB_HOST=localhost
    DB_PORT=3306
    DB_DATABASE=hydrolink
    DB_USERNAME=root
    DB_PASSWORD=yourpassword
  3. Run migrations and start the server:

    php artisan migrate
    php artisan serve

Portal and Mobile App Setup

  1. Portal:
    • Deploy the Next.js portal:
      npm install
      npm run build
      npm start
  2. Mobile App:
    • Clone the React Native app repository:
      git clone https://github.com/your-repo/hydrolink-app.git
      npm install
      npx react-native run-android

Testing and Calibration

  1. Sensor Calibration:
    • Use provided calibration scripts for pH and turbidity sensors.
    • Verify accuracy using known reference solutions.
  2. Leak Detection Testing:
    • Simulate a leak by manipulating flow rates and verify system responses.
  3. Solar Power Test:
    • Measure battery charging under different sunlight conditions.

Real-Time Data Flow Diagram

graph TD;
    A[Sensor Data] --> B[Firmware Preprocessing];
    B --> C[Wi-Fi Transmission];
    C --> D[Authority Server];
    D --> E[User Portal and Mobile App];
Loading
HydroLink Plus ©2024

Clone this wiki locally