A complete SCADA simulation project using a graphical Python interface as the TCP server, and a lightweight C++ client for sending control commands.
This project simulates a water tank system with valves, LEDs, emergency states, and step-by-step process visualization — ideal for embedded systems, automation, or industrial SCADA demonstrations.
-
🧠 Python SCADA Server
- Tkinter GUI with tank, valves, LEDs, emergency indicators
- Real-time control and visual feedback
- Sound effects for emergency and valve actions
-
💬 C++ TCP Client
- Command-line interface with retry logic
- Sends tank fill/drain commands
- Displays server acknowledgments
-
🔊 Sound & Visual Effects
- Valve and emergency alarm sounds via
pygame - Image indicators with
PIL.ImageTk
- Valve and emergency alarm sounds via
-
🧪 Step-by-Step Simulation
- Manual "Next Step" control
- Emergency button and reset behavior
- Communication via TCP/IP
- Python 3.x
- Libraries:
tkinter(usually included by default)Pillow(pip install pillow)pygame(pip install pygame)
- Windows OS with:
- MinGW (
g++)
- MinGW (
- Uses:
winsock2.h,ws2tcpip.h,windows.h
Use PyInstaller to create a standalone executable:
pip install pyinstaller
pyinstaller --onefile --noconsole --add-data "resources;resources" scada_simulator.py📁 Output: dist/scada_simulator.exe
Use g++ to create a standalone executable:
export PATH=$PATH:/c/MinGW/bin
g++ main.cpp -o client.exe -lws2_32 -std=c++17 -static-libgcc -static-libstdc++📁 Output: client.exe
- Launch the server (scada_simulator.exe)
- Choose the IP and port (e.g., 127.0.0.1:5000)
- Server waits for TCP connection
- Run the client (client.exe)
- Enter IP and port (the same as server)
- Send commands via the terminal
- Visual SCADA GUI responds in real time (lights, sounds, status)
- 0 → Fill the tank (low-level LED ON, input valve OPEN)
- 1 → Drain the tank (high-level LED ON, output valve OPEN)
- exit → Disconnect client and set RESET on Server Side
- Real-time sensor simulation or plotting
- Modbus or MQTT communication
- Data logging with SQLite or CSV
- GUI-based C++ client
- Multiple client handling
Developed as an educational project to demonstrate:
- Basic SCADA functionality
- Real-time control logic
- Cross-language communication between Python and C++