Intermediate11 min readWater & Wastewater

Chemical Dosing System for Water & Wastewater

Complete PLC implementation guide for chemical dosing system in water & wastewater settings. Learn control strategies, sensor integration, and best practices.

📊
Complexity
Intermediate
🏭
Industry
Water & Wastewater
Actuators
2
This comprehensive guide covers the implementation of chemical dosing system systems for the water & wastewater industry. Chemical dosing systems inject precise quantities of treatment chemicals (chlorine, pH adjusters, coagulants, corrosion inhibitors) proportional to water flow rates maintaining target concentrations from 0.1-100 ppm in process streams handling 1-10,000 GPM. Modern systems employ peristaltic or diaphragm metering pumps with turndown ratios 100:1 achieving dosing accuracy +/- 1-2% while responding to real-time feedback from online analyzers (pH, ORP, chlorine, conductivity). The PLC implements feed-forward control based on flow measurement and feedback trim from water quality sensors maintaining precise chemical residuals. Applications include municipal water treatment, cooling tower treatment, wastewater neutralization, and industrial process chemical addition. Estimated read time: 11 minutes.

Problem Statement

Water & Wastewater operations require reliable chemical dosing system systems to maintain efficiency, safety, and product quality. Water and wastewater utilities face aging infrastructure requiring modernization with limited budgets, highly variable influent loads from wet weather events straining treatment capacity, increasingly stringent discharge limits for nutrients and emerging contaminants, skilled operator shortage with many approaching retirement, cybersecurity threats against critical infrastructure, energy costs representing 30-40% of operational budget, and public expectation of uninterrupted service 24/7/365. Climate change is increasing frequency and severity of extreme weather events. Asset management requires balancing limited capital budgets across hundreds of distributed assets like pump stations, meters, and treatment facilities.

Automated PLC-based control provides:
• Consistent, repeatable operation
• Real-time monitoring and diagnostics
• Reduced operator workload
• Improved safety and compliance
• Data collection for optimization

This guide addresses the technical challenges of implementing robust chemical dosing system automation in production environments.

System Overview

A typical chemical dosing system system in water & wastewater includes:

• Input Sensors: flow sensors, pH sensors, conductivity sensors
• Output Actuators: dosing pumps, solenoid valves
• Complexity Level: Intermediate
• Control Logic: State-based sequencing with feedback control
• Safety Features: Emergency stops, interlocks, and monitoring
• Communication: Data logging and diagnostics

The system must handle normal operation, fault conditions, and maintenance scenarios while maintaining safety and efficiency.

**Industry Environmental Considerations:** Water and wastewater facilities operate in harsh outdoor environments with temperature extremes from -40°F to 120°F, high humidity causing condensation and corrosion, corrosive gases like hydrogen sulfide and chlorine attacking electronics, lightning exposure in elevated structures like clarifiers and aerators, and flooding risks during storm events. Instrumentation requires specialized materials (Hastelloy, titanium) for chemical resistance. Enclosures must be NEMA 4X rated with heaters and thermostats for temperature control. Explosive atmosphere considerations exist in digesters, wet wells, and other confined spaces.

Controller Configuration

For chemical dosing system systems in water & wastewater, controller selection depends on:

• Discrete Input Count: Sensors for position, status, and alarms
• Discrete Output Count: Actuator control and signaling
• Analog I/O: Pressure, temperature, or flow measurements
• Processing Speed: Typical cycle time of 50-100ms
• Communication: Network requirements for monitoring

**Control Strategy:**
Deploy flow-proportional control calculating chemical dose: Dose (GPH) = Flow (GPM) × Concentration (ppm) × 0.0005 for typical specific gravities. Implement cascaded control with outer loop maintaining water quality parameter (pH 6.5-8.5, chlorine 1.0-3.0 ppm) and inner loop adjusting pump stroke frequency. Use PID trim control: Kp=5-15 (% stroke per unit error), Ki=0.5-2.0, Kd=0.1-0.5 compensating for chemical demand variations from raw water quality changes. Deploy ratio control maintaining multiple chemical balances (e.g., chlorine:ammonia ratio 3:1-5:1 for chloramines). Implement feed-forward dead-time compensation accounting for mixing/reaction time delays (typically 30 seconds-5 minutes). Use alarming for chemical tank levels (refill at 20% remaining), pump failures, and out-of-range water quality with automatic shutdown preventing over/under dosing.

Recommended controller features:
• Fast enough for real-time control
• Sufficient I/O for all sensors and actuators
• Built-in safety functions for critical applications
• Ethernet connectivity for diagnostics

**Regulatory Requirements:** Water and wastewater systems must comply with Clean Water Act discharge permits (NPDES) with strict effluent limits, Safe Drinking Water Act monitoring requirements for public water systems, EPA regulations for biosolids management (40 CFR Part 503), OSHA confined space entry regulations (29 CFR 1910.146), state-specific discharge standards often more stringent than federal requirements, and cross-connection control to prevent contamination of potable water. Cybersecurity requirements under America's Water Infrastructure Act (AWIA) mandate risk assessments and security measures. Discharge monitoring reports (DMRs) require certified data with auditable quality assurance.

Sensor Integration

Effective sensor integration requires:

• Sensor Types: flow sensors, pH sensors, conductivity sensors
• Sampling Rate: 10-100ms depending on process dynamics
• Signal Conditioning: Filtering and scaling for stability
• Fault Detection: Monitoring for sensor failures
• Calibration: Regular verification and adjustment

**Application-Specific Sensor Details:**
• **flow sensors**: [object Object]
• **pH sensors**: [object Object]
• **conductivity sensors**: [object Object]

Key considerations:
• Environmental factors (temperature, humidity, dust)
• Sensor accuracy and repeatability
• Installation location for optimal readings
• Cable routing to minimize noise
• Proper grounding and shielding

PLC Control Logic Example - Water & Wastewater

Basic structured text (ST) example for chemical dosing control: Industry-specific enhancements for Water & Wastewater applications.

PROGRAM PLC_CONTROL_LOGIC_EXAMPLE
VAR
    // Inputs
    start_button : BOOL;
    stop_button : BOOL;
    system_ready : BOOL;
    error_detected : BOOL;

    // Outputs
    motor_run : BOOL;
    alarm_signal : BOOL;

    // Internal State
    system_state : INT := 0; // 0=Idle, 1=Running, 2=Error
    runtime_counter : INT := 0;


    // Flow Measurement & Totalization
    Instantaneous_Flow : REAL;  // m³/h or GPM
    Flow_Total_Daily : REAL;    // Accumulated flow
    Flow_Total_Monthly : REAL;
    Flow_Totalizer : CTU;

    // EPA Compliance Monitoring
    Effluent_pH : REAL;
    Effluent_BOD : REAL;  // Biological Oxygen Demand (mg/L)
    Effluent_TSS : REAL;  // Total Suspended Solids (mg/L)
    Effluent_Chlorine : REAL;  // Residual chlorine (mg/L)
    EPA_Limit_Violation : BOOL;

    // Chemical Dosing Control
    Chlorine_Dosing_Rate : REAL;  // mg/L or ppm
    Polymer_Dosing_Rate : REAL;
    Chemical_Tank_Level : REAL;
    Low_Chemical_Alarm : BOOL;

    // Level & Pressure Control
    Tank_Level_Percent : REAL;
    System_Pressure_PSI : REAL;
    High_Level_Alarm : BOOL;
    Low_Level_Alarm : BOOL;

    // SCADA Integration
    Remote_Start_Command : BOOL;
    Remote_Stop_Command : BOOL;
    SCADA_Communication_OK : BOOL;
    Telemetry_Update_Timer : TON;

    // Regulatory Reporting
    Sample_Collection_Due : BOOL;
    DMR_Report_Due : BOOL;  // Discharge Monitoring Report
    Last_Sample_Time : DATE_AND_TIME;
    Compliance_Status : STRING[20];
END_VAR

// ==========================================
// BASE APPLICATION LOGIC
// ==========================================

CASE system_state OF
    0: // Idle state
        motor_run := FALSE;
        alarm_signal := FALSE;

        IF start_button AND system_ready AND NOT error_detected THEN
            system_state := 1;
        END_IF;

    1: // Running state
        motor_run := TRUE;
        alarm_signal := FALSE;
        runtime_counter := runtime_counter + 1;

        IF stop_button OR error_detected THEN
            system_state := 2;
        END_IF;

    2: // Error state
        motor_run := FALSE;
        alarm_signal := TRUE;

        IF stop_button AND NOT error_detected THEN
            system_state := 0;
            runtime_counter := 0;
        END_IF;
END_CASE;

// ==========================================
// WATER & WASTEWATER SPECIFIC LOGIC
// ==========================================

    // Flow Totalization for Billing & Reporting
    // Convert instantaneous flow to volumetric pulses
    IF Instantaneous_Flow > Min_Flow_Threshold THEN
        Flow_Pulse := TRUE;  // Generate pulse per unit volume
        Flow_Totalizer(CU := Flow_Pulse);
        Flow_Total_Daily := DINT_TO_REAL(Flow_Totalizer.CV) * Flow_K_Factor;
    END_IF;

    // Reset daily totalizer at midnight
    IF Current_Time = TIME#00:00:00 THEN
        Flow_Totalizer(R := TRUE);
        Flow_Total_Monthly := Flow_Total_Monthly + Flow_Total_Daily;
        Flow_Total_Daily := 0.0;
    END_IF;

    // EPA Discharge Limits Monitoring
    // Typical secondary treatment limits
    EPA_Limit_Violation := (Effluent_BOD > 30.0)      // > 30 mg/L
                          OR (Effluent_TSS > 30.0)     // > 30 mg/L
                          OR (Effluent_pH < 6.0)       // pH below range
                          OR (Effluent_pH > 9.0);      // pH above range

    IF EPA_Limit_Violation THEN
        Compliance_Status := 'VIOLATION';
        // Trigger alarm and regulatory notification
        // Log excursion for DMR reporting
    ELSE
        Compliance_Status := 'COMPLIANT';
    END_IF;

    // Proportional Chemical Dosing
    // Dose chlorine based on flow rate for consistent residual
    Chlorine_Dosing_Rate := Instantaneous_Flow * Target_Chlorine_Residual / 1000.0;

    // Polymer dosing for flocculation based on turbidity
    IF Influent_Turbidity > 100.0 THEN
        Polymer_Dosing_Rate := High_Dose_Rate;
    ELSIF Influent_Turbidity > 50.0 THEN
        Polymer_Dosing_Rate := Medium_Dose_Rate;
    ELSE
        Polymer_Dosing_Rate := Low_Dose_Rate;
    END_IF;

    // Chemical Tank Monitoring
    IF Chemical_Tank_Level < 20.0 THEN  // Below 20%
        Low_Chemical_Alarm := TRUE;
        // Alert operator to refill
    END_IF;

    // SCADA Telemetry Updates
    Telemetry_Update_Timer(IN := TRUE, PT := T#10s);

    IF Telemetry_Update_Timer.Q THEN
        // Send data to SCADA master station
        Send_To_SCADA(Flow_Total_Daily,
                      System_Pressure_PSI,
                      Tank_Level_Percent,
                      EPA_Limit_Violation);
        Telemetry_Update_Timer(IN := FALSE);
    END_IF;

    // Remote SCADA Control Integration
    IF SCADA_Communication_OK THEN
        IF Remote_Start_Command THEN
            System_Enable := TRUE;
        END_IF;

        IF Remote_Stop_Command THEN
            System_Enable := FALSE;
        END_IF;
    ELSE
        // Revert to local control if SCADA comm lost
        System_Enable := Local_Start_Button AND NOT Local_Stop_Button;
    END_IF;

    // Regulatory Sampling Schedule
    IF (CURRENT_DATETIME() - Last_Sample_Time) > Sample_Interval THEN
        Sample_Collection_Due := TRUE;
        // Alert lab technician
    END_IF;

// ==========================================
// WATER & WASTEWATER SAFETY INTERLOCKS
// ==========================================

    // Operational Interlocks
    Production_Allowed := NOT High_Level_Alarm
                          AND NOT Low_Level_Alarm
                          AND NOT Low_Chemical_Alarm
                          AND (System_Pressure_PSI > Min_Pressure)
                          AND (System_Pressure_PSI < Max_Pressure);

    // EPA Compliance Interlock
    IF EPA_Limit_Violation THEN
        // Continue operation but alert operator
        // Log violation for regulatory reporting
        Alarm_Active := TRUE;
    END_IF;

    // Emergency Shutdown on Critical Parameters
    IF (Effluent_Chlorine > Max_Safe_Chlorine) OR
       (System_Pressure_PSI > Burst_Pressure) THEN
        Emergency_Shutdown := TRUE;
        All_Pumps_Stop := TRUE;
    END_IF;

Code Explanation:

  • 1.State machine ensures only valid transitions occur
  • 2.Sensor inputs determine allowed state changes
  • 3.Motor runs only in safe conditions
  • 4.Error state requires explicit acknowledgment
  • 5.Counter tracks runtime for predictive maintenance
  • 6.Boolean outputs drive actuators safely
  • 7.
  • 8.--- Water & Wastewater Specific Features ---
  • 9.Flow totalization for billing, reporting, and water accountability
  • 10.EPA NPDES permit compliance monitoring for discharge limits
  • 11.Proportional chemical dosing based on flow and water quality
  • 12.SCADA integration for remote monitoring and control
  • 13.Regulatory reporting support (DMR - Discharge Monitoring Report)
  • 14.Tank level control prevents overflow and dry-run conditions
  • 15.Automatic sampling schedule tracking for compliance
  • 16.Emergency shutdown on critical parameter violations

Implementation Steps

  1. 1Conduct hydraulic modeling to determine retention times and flow rates for treatment stages
  2. 2Design SCADA system with geographic information system (GIS) integration for distributed assets
  3. 3Implement multi-parameter monitoring including pH, dissolved oxygen, turbidity, and chlorine residual
  4. 4Configure aeration basin control with DO optimization to minimize energy consumption
  5. 5Design pump control with alternating duty cycles to equalize wear and prevent deadheading
  6. 6Implement flow equalization to handle wet-weather surge capacity and prevent overflow
  7. 7Configure automated chemical dosing for coagulation, flocculation, and disinfection
  8. 8Design automated backwash sequences for filtration systems with optimization algorithms
  9. 9Implement alarming and notification for regulatory exceedances and equipment failures
  10. 10Configure energy optimization scheduling pumps during off-peak electricity rates
  11. 11Design integration with regulatory reporting systems for discharge monitoring reports
  12. 12Establish predictive maintenance based on run hours, cycle counts, and performance trending

Best Practices

  • Use submersible sensors with automatic cleaning systems to prevent bio-fouling
  • Implement cascade PID control for dissolved oxygen with feedforward from influent load
  • Design redundant critical sensors with automatic switchover on failure or out-of-range readings
  • Use variable frequency drives on aeration blowers with DO trim optimization
  • Implement alternating pump operation with hour meters for balanced equipment wear
  • Log complete operational data for regulatory compliance and optimization studies
  • Use intrinsically safe or submersible-rated instrumentation in hazardous wet-well areas
  • Implement automated composite sampling for lab analysis and compliance monitoring
  • Design energy management with demand limiting to avoid peak electricity charges
  • Use cellular or licensed radio for remote lift stations without wired communication
  • Implement weather data integration for predictive control during storm events
  • Maintain comprehensive asset management database linked to SCADA system

Common Pitfalls to Avoid

  • Inadequate sensor maintenance causing drift and unreliable readings leading to process upsets
  • Failing to implement proper grounding in wet environments causing ground loop interference
  • Poor sensor placement in non-representative locations yielding misleading data
  • Not implementing backup control strategies when sensors fail or go into maintenance
  • Inadequate surge protection on communication lines exposed to lightning strikes
  • Overlooking hydrogen sulfide corrosion requiring special materials in sewer applications
  • Failing to size chemical storage and feed systems for maximum day demands
  • Inadequate backup power sizing based on average load rather than peak demand
  • Not implementing flow verification via multiple methods to detect sensor failures
  • Overlooking freeze protection for outdoor instrumentation in cold climates
  • Inadequate cybersecurity on SCADA systems creating vulnerability to ransomware attacks
  • Failing to calibrate flow meters annually leading to billing and compliance errors
  • Overdosing causing water quality exceedances - Flow meter error or pump calibration drift | Solution: Recalibrate flow meter using bucket test or calibrated reference meter, verify pump output using graduated cylinder over timed interval, check for air in chemical lines causing pulsation, implement high-limit alarms on water quality
  • Chemical feed pump losing prime - Air leaks in suction line or tank level too low | Solution: Pressure test suction piping for leaks (should hold vacuum >20 inches Hg), verify tank level above pump suction inlet, install foot valves preventing siphon break, prime pump and check valve operation
  • pH control oscillating around setpoint - Excessive PID gain or inadequate mixing time | Solution: Reduce proportional gain 30-50%, increase mixing time allowing chemistry to react before measurement (30-60 seconds typical), implement deadband +/- 0.2 pH units, verify sensor response time adequate
  • Inconsistent chemical dose despite constant flow - Pump diaphragm wear or check valve failure | Solution: Inspect pump diaphragm for tears or deterioration (replace typically every 3,000-5,000 hours), test check valves for proper seating preventing backflow, verify chemical viscosity not changed by temperature variations
  • Sensor reading drifting or erratic - Fouling, chemical coating, or electrical interference | Solution: Clean sensor using appropriate method (acid soak for pH electrodes, mechanical cleaning for conductivity cells), verify flow velocity adequate preventing stagnation (>0.5 ft/s minimum), check sensor cable shielding and grounding

Safety Considerations

  • 🛡Implement continuous hydrogen sulfide and methane monitoring in confined spaces like wet wells
  • 🛡Install forced ventilation with gas detection interlocks before entry into pump stations
  • 🛡Use intrinsically safe instruments in classified hazardous areas per NEC Article 500
  • 🛡Implement automated chlorine leak detection with ventilation and neutralization systems
  • 🛡Install fall protection and retrieval systems for confined space entry operations
  • 🛡Use explosion-proof equipment in areas where methane concentrations may exceed 5% LEL
  • 🛡Implement remote pump station monitoring to reduce operator exposure during inspections
  • 🛡Install emergency showers and eyewash stations near chemical feed areas
  • 🛡Use lockout/tagout procedures with confined space permits for all maintenance activities
  • 🛡Implement automated overflow alarming and diversion to prevent environmental releases
  • 🛡Train operators on chlorine emergency response and respiratory protection requirements
  • 🛡Maintain up-to-date safety data sheets for all treatment chemicals including ozone and UV systems
Successful chemical dosing system automation in water & wastewater requires careful attention to control logic, sensor integration, and safety practices. By following these industry-specific guidelines and standards, facilities can achieve reliable, efficient operations with minimal downtime. Remember that every chemical dosing system system is unique—adapt these principles to your specific requirements while maintaining strong fundamentals of state-based control and comprehensive error handling. Pay special attention to water & wastewater-specific requirements including regulatory compliance and environmental challenges unique to this industry.