Skip to content

A real-time water tank simulation and control system built with C++ demonstrating automated pump control, water level monitoring, and manual override capabilities using OOP principles.

Notifications You must be signed in to change notification settings

bijoyverse/Water-Tank-Control-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Water Tank Control System

A real-time water tank simulation and control system built with C++ demonstrating advanced Object-Oriented Programming concepts and system automation.

Overview

This project simulates an automated water tank management system with intelligent pump control, water level monitoring, and manual override capabilities.

Features

Automated Control

  • Smart Pump Management: Automatic pump activation/deactivation based on water levels
  • Real-time Monitoring: Continuous water level tracking with percentage display
  • Alert System: Critical alerts for low water (< 10%) and overflow risk (> 95%)
  • Simulation Engine: Random water consumption pattern for realistic testing

Manual Control

  • Manual Pump Control: Direct ON/OFF pump operation
  • Override Mode: Disable automatic control for maintenance or testing
  • Cycle Control: Run single or multiple simulation cycles

Safety Features

  • Low water threshold detection (< 30%)
  • High water threshold detection (> 90%)
  • Critical level alerts with visual warnings
  • Overflow prevention mechanism

Technologies Used

  • C++
  • Object-Oriented Programming (OOP)
  • System Simulation & Control Logic
  • Random Event Generation

OOP Concepts Implemented

Inheritance

SystemComponent (Base Class)
    ├── WaterSensor
    ├── PumpControl
    └── Controller

Key OOP Principles

  • Abstraction: Pure virtual function in SystemComponent base class
  • Inheritance: All components inherit from SystemComponent
  • Polymorphism: Virtual displayStatus() method overridden by each component
  • Encapsulation: Private data members with controlled access
  • Composition: Controller contains WaterSensor and PumpControl objects

How It Works

  1. Water Sensor: Monitors water level (0-100%)
  2. Pump Control: Manages pump state (ON/OFF) with override capability
  3. Controller: Coordinates sensor data and pump operations
  4. Automation Logic:
    • Level < 30%: Pump turns ON
    • Level > 90%: Pump turns OFF
    • Pump adds 5% water per cycle when ON
    • Random consumption: 0-2% per cycle

Menu Options

1. View Status          - Display current water level and pump state
2. Run 1 Cycle         - Execute one simulation cycle
3. Run 10 Cycles       - Execute 10 consecutive cycles
4. Manual Pump ON      - Turn pump on manually
5. Manual Pump OFF     - Turn pump off manually
6. Enable Override     - Disable automatic control
7. Disable Override    - Re-enable automatic control
0. Exit                - Quit program

How to Run

g++ water_tank_simulation.cpp -o water_tank
./water_tank

Sample Output

[Water Sensor] Level: 65%
[Pump Control] Pump is OFF

[Water Sensor] Level: 28%
[Pump Control] Pump is ON

!!! ALERT: Water critically low !!!

Use Cases

  • Understanding automated control systems
  • Learning OOP design patterns
  • System simulation and modeling
  • IoT device control logic practice

Academic Project

Developed as part of Object-Oriented Programming coursework, demonstrating practical application of OOP principles in system automation and control.

Future Enhancements

  • Multiple tank support
  • GUI interface
  • Data logging and analytics
  • Network connectivity for remote monitoring
  • Predictive maintenance alerts

About

A real-time water tank simulation and control system built with C++ demonstrating automated pump control, water level monitoring, and manual override capabilities using OOP principles.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages