A real-time water tank simulation and control system built with C++ demonstrating advanced Object-Oriented Programming concepts and system automation.
This project simulates an automated water tank management system with intelligent pump control, water level monitoring, and manual override capabilities.
- 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 Pump Control: Direct ON/OFF pump operation
- Override Mode: Disable automatic control for maintenance or testing
- Cycle Control: Run single or multiple simulation cycles
- Low water threshold detection (< 30%)
- High water threshold detection (> 90%)
- Critical level alerts with visual warnings
- Overflow prevention mechanism
- C++
- Object-Oriented Programming (OOP)
- System Simulation & Control Logic
- Random Event Generation
SystemComponent (Base Class)
├── WaterSensor
├── PumpControl
└── Controller
- 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
- Water Sensor: Monitors water level (0-100%)
- Pump Control: Manages pump state (ON/OFF) with override capability
- Controller: Coordinates sensor data and pump operations
- 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
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
g++ water_tank_simulation.cpp -o water_tank
./water_tank[Water Sensor] Level: 65%
[Pump Control] Pump is OFF
[Water Sensor] Level: 28%
[Pump Control] Pump is ON
!!! ALERT: Water critically low !!!
- Understanding automated control systems
- Learning OOP design patterns
- System simulation and modeling
- IoT device control logic practice
Developed as part of Object-Oriented Programming coursework, demonstrating practical application of OOP principles in system automation and control.
- Multiple tank support
- GUI interface
- Data logging and analytics
- Network connectivity for remote monitoring
- Predictive maintenance alerts