Skip to main content

Boiler Controller Application

Overview

The Boiler Controller Application is a Python-based simulation of an industrial boiler startup system. It models real-world boiler behavior including state transitions, safety interlocks, timed startup sequences, error handling, and persistent event logging.

The system is designed with a modular architecture to ensure maintainability, scalability, and testability. It begins in a safe Lockout state and provides a console-based interface for user interaction.

Features

Boiler Lifecycle Simulation

The application simulates a full boiler lifecycle with the following states:

  • Lockout
  • Ready
  • Pre-Purge
  • Ignition
  • Operational
  • Stopped

The startup sequence includes timed phases:

  • Pre-Purge: 10 seconds
  • Ignition: 10 seconds

Safety Interlock System

  • Run Interlock switch supports Open and Closed states
  • Boiler operations are permitted only when the interlock is Closed
  • Each toggle is logged as a system event

Event Logging System

  • All significant system events are logged to disk
  • Logs are stored in CSV format
  • Each entry contains:
    • Timestamp
    • Event
  • Log file location:
boiler_event_log_file/event_log.csv

Error Handling

  • Simulated errors can occur during operation
  • On error, system transitions to Lockout state
  • All errors are logged with timestamps and descriptions
  • Invalid operations are handled gracefully with user feedback

Console Interface

The application provides a menu-driven interface with the following options:

  • Start Boiler Sequence
  • Stop Boiler Sequence
  • Simulate Boiler Error
  • Toggle Run Interlock Switch
  • Reset Lockout
  • View Event Log
  • Exit Application

Project Structure

The project is organized in a modular, package-based structure, where each folder represents a clear functional responsibility.

boiler_controller_app/
│
├── __pycache__/                     # Python bytecode cache
├── .venv/                           # Virtual environment
│
├── boiler/
│   ├── __pycache__/
│   ├── __init__.py
│   └── boiler.py                    # Core boiler control logic
│
├── boiler_event_log_file/
│   └── event_log.csv                # CSV file storing boiler events
│
├── boiler_state/
│   ├── __pycache__/
│   ├── __init__.py
│   └── boiler_state.py              # Boiler state enumeration
│
├── boiler_terminal_app/
│   ├── __pycache__/
│   ├── __init__.py
│   ├── abstract_terminal_app.py     # Abstract base class for terminal apps
│   └── boiler_terminal_app.py       # Terminal-based boiler UI
│
├── event_logger/
│   ├── __pycache__/
│   ├── __init__.py
│   └── event_logger.py              # Event logging to CSV
│
├── interlock_switch/
│   ├── __pycache__/
│   ├── __init__.py
│   └── interlock_switch.py          # Safety interlock logic
│
├── menu_options/
│   ├── __pycache__/
│   ├── __init__.py
│   └── menu.py                      # Menu options enum
│
├── __init__.py                      # Root package initializer
├── main.py                          # Application entry point
├── main.spec                        # Build specification file
├── pyproject.toml                   # Project and dependency configuration
├── uv.lock                          # Dependency lock file
└── README.md                        # Project documentation

Installation

The package is available on PyPI at

https://pypi.org/project/boiler-controller-app/0.1.3/

You can install it using pip:

pip install boiler-controller-app

Ensure you are using Python 3.8 or above.

Running the Application

After installing the package from PyPI, you can start the application using the CLI command:

boiler-controller

This command launches the Boiler Controller application and initializes the system.

On startup, you will see:

Boiler Controller Initialized.

The system will then begin in the Lockout state with the interlock switch set to Open.

Usage Guide

Start Boiler Sequence

  • Requires interlock switch to be Closed
  • System transitions through:
    • Pre-Purge (10 seconds)
    • Ignition (10 seconds)
    • Operational state

Stop Boiler Sequence

  • Stops operation safely
  • Returns system to Lockout state

Simulate Boiler Error

  • Available only in Operational state
  • Forces system into Lockout state
  • Logs error event

Toggle Run Interlock Switch

  • Switch toggles between Open and Closed
  • Each change is logged

Reset Lockout

  • Transitions system from Lockout to Ready
  • Requires interlock switch to be Closed

View Event Log

  • Displays contents of event_log.csv in readable format

Exit Application

  • Terminates the program safely

Event Log Specification

File Format

  • CSV (Comma Separated Values)

File Header

Timestamp, Event

Example Log Entry

2026-04-22 10:15:30, Boiler Initialized, System started successfully
2026-04-22 10:16:00, Interlock Switch toggled to Closed
2026-04-22 10:16:10, Pre-Purge completed

Error Handling

The system ensures:

  • Graceful handling of invalid user input
  • Safe state transitions only
  • Automatic transition to Lockout on failure
  • Clear error messages displayed to the user
  • All errors are logged with timestamps

Example error message:

Error: Ignition failure detected. System in Lockout.

Testing

Unit tests are designed to validate:

  • Boiler state transitions
  • Interlock switch behavior
  • Event logging functionality
  • Error handling mechanisms

Run tests using:

pytest

Design Principles

  • Modular architecture with clear separation of concerns
  • State-driven boiler control system
  • Safety-first design using interlock enforcement
  • Extensible structure for future enhancements
  • Persistent event logging for traceability

Future Enhancements

  • Graphical user interface for boiler control
  • Real-time monitoring dashboard
  • Configurable timing for simulation phases
  • Database-backed logging system
  • Remote control capabilities via API

License

This project is intended for educational and simulation purposes only.

Release files for boiler-controller-app 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for boiler-controller-app 0.1.3
File Size Uploaded
boiler_controller_app-0.1.3.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for boiler-controller-app 0.1.3
File Interpreter ABI Platform
boiler_controller_app-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / boiler_controller_app-0.1.3.tar.gz

Download URL boiler_controller_app-0.1.3.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f5c436b09988f19d6d04ac08705507b90e14a95c6975b5b8eae046fc2a762059
BLAKE2b-256 checksum
How to use checksums
6c01e37ef6f77d37f69f05b2caa8f84f60c0ef8130299dd10c442e61b9c251c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / boiler_controller_app-0.1.3-py3-none-any.whl

Download URL boiler_controller_app-0.1.3-py3-none-any.whl
Size 10.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3cb745b400e7e9a9013dbd836a63a9b70dd388ef14a675ed67fb587b7db20be2
BLAKE2b-256 checksum
How to use checksums
9f9713da63f4a72a62ba34d0f70b16175f576f172938bf97f9693332c762e2d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page