HVAC PLC Programming: An AHU Ladder Logic Example
HVAC PLC Programming: An AHU Ladder Logic Example
An HVAC PLC program reads space temperature and humidity, proves the supply fan is running, then modulates heating and cooling to hold the setpoint inside a deadband — and switches to free cooling with the economizer dampers whenever the outside air is suitable. Once you can sketch that control loop for a single air handling unit (AHU), the same pattern scales to rooftop units, fan coils and chilled-water plants.
This guide walks through a practical AHU PLC programming example: the I/O architecture, the fan-start and proving rung, deadband temperature control, heating versus cooling logic, and the occupancy and economizer sequence. Everything here is plain ladder logic you can wire up and test yourself.

What a PLC controls on an AHU
A typical single-zone air handling unit gives the PLC a handful of analog inputs, a few discrete inputs, and a mix of discrete and analog outputs. Map them out before you write a single rung.
The inputs tell the PLC what the air is doing; the outputs let it respond. On the input side you usually have a supply-air temperature sensor, a return or space temperature sensor, a humidity sensor, and a differential-pressure or current switch that proves the fan is actually moving air. On the output side you drive the supply fan, a heating valve or stage, a cooling valve or stage, and the outside-air and return-air dampers.
Start the fan — and prove it
Nothing else in an HVAC PLC program should run until the fan is confirmed running. If you call for heating while the fan is off, you bake the heating coil and trip a high-limit. So the very first rung starts the fan, and a second rung uses a proving switch to confirm airflow.
The pattern is a seal-in rung: an Occupied or Run command latches the fan output, and a stop or fault contact drops it. A short on-delay timer on the proving switch stops nuisance faults during fan ramp-up — if the proving switch has not made within, say, 30 seconds of the fan command, you raise an airflow fault and inhibit heating and cooling. Read the proving (done) bit, not the raw command, before you allow any temperature control to act.
Hold the setpoint with a deadband
The heart of the program is temperature control. You never command heating and cooling at the same time, so you split the setpoint with a deadband — a neutral band where neither is called. Below the band, call heat; above it, call cool; inside it, do nothing.
A worked example: setpoint 22 degrees C with a 2-degree deadband. Heating is called when space temperature drops below 21; cooling is called when it rises above 23; between 21 and 23 both outputs stay off. The deadband stops the AHU short-cycling between heat and cool around a single threshold, which wastes energy and wears out actuators.
For a finer-grained version of this loop using a continuous PID output instead of simple on/off staging, see PLC temperature control.
Heating mode vs cooling mode
The two modes are mirror images, but the details matter — the comparison below keeps you from accidentally driving a valve the wrong way.
In heating mode the heating valve opens (or stages energize) as the error grows, the cooling output is forced closed, and the outside-air damper sits at its minimum ventilation position. In cooling mode the cooling valve opens, heating is forced closed, and — crucially — the economizer may override the minimum damper position if free cooling is available. Interlocking the two outputs so they can never both be active is the single most important safety rule in AHU PLC programming.
Occupancy and economizer sequence
Two higher-level decisions wrap the temperature loop: is the building occupied, and can we cool for free with outside air. Walk the sequence top to bottom.
When the schedule says unoccupied, the AHU normally shuts down and only runs in a night-setback mode to hold a wide temperature band. When occupied, the fan starts, minimum outside air is introduced for ventilation, and the temperature loop takes over. The economizer check sits inside cooling: if outside-air temperature (or enthalpy) is below return-air, the PLC modulates the dampers open for free cooling before it opens the mechanical cooling valve.
Economizer damper control
The economizer is just another modulating loop, but it shares the outside-air damper with the minimum-ventilation requirement, so the logic has to respect a floor.
The PLC compares outside-air and return-air conditions, and when free cooling is allowed it modulates the outside-air damper open and the return-air damper closed in tandem to chase the mixed-air temperature setpoint. The outside-air damper is clamped so it never falls below the minimum-ventilation position while the building is occupied, and it parks fully closed when the AHU stops.
On/off vs modulating control
How "fine" your control is depends on your outputs. Small units often use simple staged on/off heating and cooling; larger units use modulating valves and variable-speed fans for tight, efficient control. The PLC logic differs accordingly.
On/off control is cheap and easy to program but cycles more and holds a looser band. Modulating control needs analog outputs and a PID loop but delivers a steadier space temperature and lower energy use. Many real AHUs mix both — a modulating valve for cooling and staged electric heat, for instance.
HVAC control best practices
Before you call an AHU program finished, run it against this checklist.
Most field problems on an HVAC PLC come down to one of these: a missing fan-proving interlock, heat and cool not being mutually exclusive, or a deadband that is too narrow and short-cycles the equipment.
Build and test it in your browser
The fastest way to make AHU logic stick is to wire it up and watch the temperature chase the setpoint. You can build this whole control loop — analog inputs, deadband logic, timers and modulating outputs — in the free browser PLC simulator, then run process scenarios to test heating, cooling and economizer behaviour without touching real hardware.
FAQ
What does a PLC do in an HVAC system? A PLC reads temperature, humidity and pressure sensors, then controls the supply fan, heating and cooling valves or stages, and the outside-air dampers to hold the space at setpoint while meeting ventilation requirements.
How do you write an AHU PLC program? Start by mapping the AHU I/O, then build the rungs in order: start and prove the supply fan, hold the temperature setpoint with a deadband, interlock heating against cooling, and add the occupancy schedule and economizer free-cooling sequence on top.
What is a deadband in HVAC PLC programming? A deadband is a neutral temperature band around the setpoint where neither heating nor cooling is called. It stops the AHU from short-cycling between heat and cool, saving energy and reducing actuator wear.
What is an economizer in an AHU? An economizer uses the outside-air and return-air dampers to provide free cooling. When outside air is cooler (or has lower enthalpy) than return air, the PLC opens the dampers to cool the space before staging on mechanical cooling.