March 25, 2026

Automatic Start and Load Transfer for Diesel Generator using Schneider PLC M340

Introduction: -

An Automatic Transfer Switch (ATS) system is an essential part of modern electrical installations that ensure uninterrupted power supply to critical loads. When the main supply (mains) fails, the ATS system automatically detects the failure, starts the diesel generator, waits for it to stabilize, transfers the load to the generator, and returns the load to mains supply once it is restored.

This system integrates electrical control devices such as contactors, relays, timers, and voltage sensors with PLC-based logic control (Schneider M221) to perform a fully automatic transfer operation.

The system comprises three main modules:

Mains monitoring module

Generators start and confirmation module

Load transfer and interlock module

The operation sequence includes mains failure detection, generator start with time delay, load transfer, and auto-return to mains.

Main Components Used: -

The following components are used in the system:

24V DC SMPS (PS1) Provides control power to the PLC, sensors, relays, and indicator lamps.

Schneider M221 PLC – Executes the ATS ladder logic program. Processes inputs and controls outputs automatically.

Voltage Sensor (VS1) – Monitors mains supply voltage and sends a digital signal to PLC input I0.0 when mains is healthy.

Voltage Sensor (VS2) – Monitors generator output voltage and confirms generator is running at rated voltage on PLC input I0.1.

Contactor KM1 (Mains Contactor) – Connects or disconnects the load from mains supply. Controlled by PLC output Q0.1.

Contactor KM2 (Generator Contactor) – Connects or disconnects the load from generator supply. Controlled by PLC output Q0.2.

Electrical Interlock (KM1/KM2) Hardware NC auxiliary contacts ensure KM1 and KM2 can never be energized simultaneously, preventing a short-circuit between mains and generator.

TON Timer (T0 – 3s) – Provides a 3-second delay after mains failure before sending the DG start command, to avoid false starts during brief voltage dips.

TON Timer (T1 – 10s) – Alarm timer. If the generator does not confirm within 10 seconds, alarm output Q0.3 activates.

Alarm Output (HA1 / Q0.3) Buzzer or warning light activated when DG fails to start within the timeout period.

 

MCB QF1, QF2, QF3 – Circuit breakers protecting mains feed, generator feed, and load output respectively.

Selector Switch SA1 (I0.2) – Manual override switch to force the system into manual mode.

Reset Button SB1 (I0.3) Operator push button to reset active alarms.



Diagram: -






























Variable Table: -


































 



HMI Screen: -

Normal State: -



  

Position during switching from mains supply to DG (Diesel Generator): -



  



When the full load is operating on DG (Diesel Generator):-



  










Condition When a fault occurs in the DG (Diesel Generator):-





































Working Sequence of the System: -

The system operates in the following step-by-step sequence:

Step 1: Initial Condition

KM1 (mains contactor) is energized load is running on mains supply.

KM2 (generator contactor) is de-energized.

All PLC internal bits M0 and M1 are FALSE.

DG set is in standby (stopped) condition.

Step 2: Mains Failure Detection

Voltage sensor VS1 detects loss of mains voltage.

PLC input I0.0 (Mains_OK) drops to 0V.

NC contact /I0.0 in Rung 1 closes, energizing internal bit M0 (Mains_Fail = TRUE).

KM1 drops out immediately load is de-energised.

 

Step 3: Start Delay Timer (Rung 2)

M0 being TRUE activates TON timer T0 with a 3-second preset.

This delay prevents false starts due to momentary voltage dips or flickering.

After 3 seconds, T0 output energises Q0.0 (DG_Start command).

 

Step 4: Generator Cranking and Confirmation (Rung 3)

Q0.0 sends a start signal to the DG set engine controller or starter relay KA1.

The diesel engine cranks and starts up.

Once the generator reaches stable voltage, sensor VS2 sends 24V to PLC input I0.1.


Rung 3: Q0.0 AND I0.1 both ON M1 (Gen_Confirmed) = TRUE.

Step 5: Load Transfer to Generator (Rung 4)

Conditions checked: M0=ON, M1=ON, and /Q0.1 NC interlock confirms KM1 is open.

All three conditions met Q0.2 energises KM2 contactor closes.

Load is now supplied by the diesel generator.

Indicator lamp HL2 activates to show generator is feeding the load.


Step 6: Generator Operation (Steady State)

The DG set continues running and supplies the critical load.

KM1 remains open, KM2 remains closed.

PLC continuously monitors I0.0 for mains restoration.

 

Step 7: Mains Restoration and Return Transfer (Rung 6)

When mains voltage is restored, VS1 output goes HIGH I0.0 = ON.

Rung 6 Reset coil fires M0 and M1 are reset to FALSE.

M0=FALSE causes Rung 4 to drop KM2 de-energises generator disconnected from load.

Rung 5 sees I0.0=ON and KM2 interlock clear → Q0.1 energises → KM1 closes.

Load is transferred back to mains. DG start command Q0.0 drops — engine begins cool-down.

 

Step 8: Alarm Generator Failure to Start (Rung 7)

If mains has failed (M0=ON) but generator never confirms (M1=OFF) within 10 seconds:

TON timer T1 (10s) output activates Q0.3 alarm buzzer HA1 sounds.

Operator must manually inspect the DG set and press SB1 to reset the alarm.


Unique Features of This Design: -

Fully automatic mains failure detection and generator start using PLC logic (no manual intervention required).

Hardware electrical interlock between KM1 and KM2 prevents both contactors from closing simultaneously.

Software interlock in PLC ladder logic as a second layer of protection.

Configurable start delay (3 seconds) to avoid false starts on brief voltage fluctuations.

Generator confirmation feedback through VS2 — load is only transferred after stable generator voltage is confirmed.

Automatic return to mains when power is restored — no operator action required.

Alarm with 10-second timeout if generator fails to start ensures operator is alerted.

HMI screen (Vijeo Designer) for live monitoring of contactor status, source voltages, and system state.

 

Applications: -

Hospitals and clinics critical life-support equipment power backup.

Data centers and server rooms preventing downtime on power failure.

Industrial production lines avoiding costly production stoppages.

Telecom towers and communication sites maintaining signal continuity.

Commercial buildings, offices, and shopping centers.

Water treatment and pumping stations — ensuring uninterrupted pumping.

 

Conclusion: -

This Diesel Generator Auto-Start and ATS System demonstrates how voltage sensors, PLC logic (Schneider M221), contactors, and timers can work together to create a fully automatic power backup solution. The system continuously monitors the mains supply and, upon failure, automatically starts the diesel generator, confirms its readiness, and transfers the critical load — all within seconds and without any human intervention.

 

The double interlock design (hardware aux contacts and software logic) ensures electrical safety at all times. The automatic return-to-mains feature and alarm on DG failure make this system reliable, safe, and suitable for real-world industrial and commercial installations.