Design a Water Pump PLC Program using CX-Programmer

Learn to design a water pump PLC program using CX-Programmer with dual modes: RTC activation and sensor-based control.

Water Pump PLC Program

This PLC article discusses creating an automatic water pump PLC program that has 2 modes. In the first mode, the water pump will be ON every day at a certain time to fill the water tank using the RTC (Real Time Clock) function.

In the second mode, the system does not use the RTC function but uses 2 sensors (Low and High). When the tank is empty then the water pump will be ON and the pump will be OFF when the tank is full.

Addressing Memory RTC in CX-Programmer

In the CX-Programmer, RTC data processing is allocated to Word Memory addresses A351-A354, each Word Memory address contains two RTC time units which are divided into 8-bits each in the form of BCD (Binary Code Decimal) Data Type and displayed in Hexadecimal units. RTC can calculate time units from seconds to years.

The table below contains the distribution of RTC Word Memory data.

Word Memory AreaBit AreaFunctionRange TimeData Type
A351A351.00 – A351.07Seconds00 – 59BCD
A351.08 – A351.15Minutes00 – 59BCD
A352A352.00 – A352.07Hours00 – 23BCD
A352.08 – A351.15Date0 – 31BCD
A353A353.00 – A353.07Month01 – 12BCD
A353.08 – A353.15Year00 – 99BCD
A354A354.00 – A354.07Day of the Week00 – 06 (Sunday  Saturday)BCD
Not used   

How The PLC Program Works?

Water Pump Program

This PLC Program uses 3 main buttons, the START(0.00) button is used to turn ON the system, the STOP (0.01) button is used to turn OFF the system, and the Mode (0.02) button is used for system mode selection.

By default, when the Mode (0.02) switch is in the OFF state then the system will use Mode 1, and when the Mode (0.02) is in the ON state then the system will use Mode 2.  We can only use either Mode 1 or Mode 2 at a time.

In the first Mode, when the Mode (0.02) switch is in OFF state, the time parameter needs to be set to the Word memory allocation SET_ON_DAILY_TIME (D0-D1) and SET_OFF_DAILY_TIME (D5-D6).

Memory allocation Word SET_ON_DAILY_TIME (D0-D1) is used to Set the Active Time of the water pump. Memory allocation Word SET_OFF_DAILY_TIME (D5-D6) is sued to Set the OFF time of the water pump. In this Mode, when the instruction condition is met then the Output WATER_PUMP (100.00) will be Active.

In the second Mode, when the mode (0.02) switch is in ON state and when the water tank is empty, the SENS_LOW contact (0.03) will be Active and turns ON the WATER_PUMP Output (100.00). Output WATER_PUMP (100.00) will be OFF when SENS_HIGH (0.04) is ON. Output WATER_PUMP (100.00) will only be ON when the water tank is empty.

I/O List

Addressing Input, Output, TIM, Bit Memory, and Word Memory details as follows.

CommentInput (I)Output(Q)Word MemoryMemory Bits
START0.00   
STOP0.01   
Mode0.02   
SENS_LOW0.03   
SENS_HIGH0.04   
SYSTEM_ON   W0.00
Mode_1   W0.01
Mode_2   W0.02
WATER PUMP 100.00  
RTC_HOUR_MINUTE_SECOND  A351 
SET_ON_DAILY_TIME  D0 – D1 
SET_OFF_DAILY_TIME  D5 – D6 

PLC Programming

Automatic Water Pump PLC Program Using CX-Programmer

The image above shows the conditions when the system has been Activated. After the START button (0.00) is pressed (for a moment), the SYSTEM_ON Bit memory output (W0.00) will be Active. Because of the latching function, the SYSTEM_ON Bit memory output (W0.00) remains Active even though the START contact (0.00) has been Disabled.

In Rung-1, it can be seen that the system has been running because of the contact NC (Normally Close) Mode (0.02). Because the time Parameter in Word memory allocation SET_ON_DAILY_TIME (D0-D1) and SET_OFF_DAILY_TIME (D5-D6) has not been Set, the memory Output Bit Mode_1 (W0.01) cannot be Active.

Omron PLC Water Pump Program

The figure above shows the condition when the memory Output Bit Mode_1 (W0.01) has been Active. In the pop-up window, time parameters have been set to Active at “14.52” seconds “00” and will be Disabled when the clock “14.56” seconds “00” in the PLC memory.

Because the time of the RTC has been in accordance with the instruction parameters, the memory Output bit Mode_1 (W0.01) is Active.

Omron PLC Example

In Rung-3, it can be seen that the Output WATER PUMP (100.00) is ON because the Contact NO (Normally Open) Mode_1 (W0.01) is ON.

Water Pump Control with PLC

The figure above shows the condition when the RTC time has passed “14.56” hours, the memory output Bit Mode-1 (W0.01) and the WATER PUMP Output (100.00) become OFF.

Design a Water Pump PLC Program

The picture above shows the system has been changed to the second mode because the Mode (0.02) switch is in the ON state. Because the water tank is empty, the NC (Normally Close) contact SENS_LOW (0.03) Activates the KEEP instruction which has bit memory address Mode_2 (W0.02).

In Rung-3, it can be seen contact NO (Normally Open) of Memory Address bit Mode_2 (W0.02) is in ON state so that the Output WATER PUMP (100.00) is ON.

Water Level in the PLC Ladder Logic Program

Because the water tank is full, the NC (Normally Close) SENS_LOW (0.03) contact changes to the OFF state. The KEEP instruction becomes Disabled because the Contact NO (Normally Open) of SENS_HIGH (0.04) has been Enabled. In Rung-3, it can be seen that the Output WATER PUMP (100.00) turns OFF.

If you liked this article, please subscribe to our YouTube Channel for PLC and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address

Leave a Comment