6123

Building an Autonomous Water Dispensing System for Rural and Public Installations.


Abstract

Providing safe drinking water in remote and public locations often requires a reliable dispensing system capable of operating without a stable electrical grid. This modern world we see there has so many industries, buildings and other public infrastructures it is essential for purifying water in public places. This project presents a solar-powered water vending machine built around the ESP32 microcontroller.
The system combines Smart Vending Software, RFID authentication, cashless payment support, real-time monitoring, and intelligent power management into a compact embedded platform. 



Introduction


Water vending systems have become increasingly common in public spaces, but many installations depend on continuous AC power and require frequent maintenance. Remote deployments demand an alternative architecture that minimizes power consumption while ensuring reliable operation. This smart vending machine is able to manage the real time inventory system and this vending machine allows users to access it with a web app. 


The objective of this project was to develop an embedded controller capable of:
  • Authenticating users through RFID cards
  • Controlling water dispensing electronically
  • Logging transactions
  • Reporting operational data remotely
  • Reducing maintenance requirements
The ESP32 was selected because it integrates Wi-Fi, sufficient GPIO resources, multiple communication interfaces, and low-power operating modes.

System Architecture


The controller consists of the following functional blocks:
  • RFID Reader (RC522)
  • Solar Charge Controller
  • 12 V Battery Pack
  • Solenoid Valve Driver
  • Relay Module
  • LCD Display
  • Water Flow Control
  • Wi-Fi Communication
  • Cloud Dashboard (MQTT)
The firmware coordinates every subsystem while monitoring battery voltage and communication status.

Hardware Design

The electronics are divided into three primary sections.
Power System
  • PWM/MPPT Charge Controller
  • 12 V Sealed Battery
  • 5 V Buck Converter
  • 3.3 V LDO for ESP32
The battery ensures continuous operation during nighttime or cloudy weather.

User Interface
Users authenticate using an RFID card.
The display shows:
  • Water quantity
  • Dispensing status
  • Error messages
  • Network status
LED indicators provide immediate visual feedback during operation.


Water Dispensing Circuit
A MOSFET-driven relay controls a 12 V solenoid valve connected to the filtration system.
The dispensing duration determines the delivered water quantity.
Optional flow sensors may be integrated for precise volume measurement.

Firmware Design

The firmware follows a modular architecture.
Main software modules include:
  • Payment Interface
  • Display Manager
  • Water Control
  • MQTT Client
  • Wi-Fi Manager
  • Power Monitoring
  • Data Logger
  • OTA Firmware Update
Each module operates independently, simplifying maintenance and future expansion.

Operating Sequence

The vending process follows these steps:


  1. System startup
  2. Initialize peripherals
  3. Connect to Wi-Fi
  4. Wait for RFID authentication
  5. Validate user credentials
  6. Verify payment or account balance
  7. Activate solenoid valve
  8. Dispense programmed water quantity
  9. Store transaction locally
  10. Upload data to cloud server
  11. Return to standby mode

Remote Monitoring

esp-vending.jpg
The ESP32 periodically publishes operational parameters through MQTT.
Typical monitored data includes:
  • Solar charging status
  • Daily water consumption
  • Number of transactions
  • Valve operating time
  • Device uptime
  • Network signal strength
  • System alarms
A cloud dashboard enables maintenance personnel to supervise multiple installations remotely.

Power Optimization

Because the machine relies entirely on solar energy, several power-saving strategies were implemented.
These include:
  • Wi-Fi activation only when required
  • LCD backlight timeout
  • Low-power peripheral management
  • Battery voltage monitoring
These techniques significantly reduce overall energy consumption.

Applications

The controller is suitable for:
  • Schools
  • Industrial facilities
  • Public parks
  • Bus terminals
  • Railway stations
  • Highway rest areas
  • Smart city infrastructure

Future Improvements

Potential enhancements include:
  • UPI integration
  • GSM/LTE communication
  • Water quality monitoring
  • Predictive maintenance
  • Mobile application support
  • Remote firmware updates
  • AI-based usage analytics

Conclusion

This project demonstrates how an ESP32 can serve as the core of a fully autonomous solar-powered water vending system. By integrating RFID authentication, remote monitoring, intelligent power management, and wireless connectivity, the design provides a scalable solution for reliable drinking water distribution in locations where conventional infrastructure is unavailable.

The modular hardware architecture and firmware design also make the controller suitable for future expansion with additional payment methods, environmental sensors, and cloud-based management services, offering a practical embedded solution for modern smart infrastructure.