Requirement
Hello guys welcome to my blog so in this tutorial we will learn to make a Simulink model which controls water pump and alarm according to water level and for that we will keep in mind some conditions as given below:
- Pump ON Condition โ If water level is < 20%, then pump will turn ON. It will stay on until it is turned OFF manually or logically.
- Pump OFF Condition โ If water level is > 95%, then pump will turn OFF.
- Alarm Condition โ Alarm will turn ON only when water level is between 90% and 91%.
Logic Design

Pump Set

Alarm Status

- So here you can see that the water level input is compared with thresholds (20% and 95%) using relational operators.
- For Pump Control we added two condition as shown below.
- < 20% โ Pump_ON signal set.
- > 95% โ Pump_OFF signal set.
- Here pump status is maintained using logical gates to ensure whether it is ON until the OFF condition is met.
- For Alarm Control we added two condition as shown below.
- So here Alarm will turns ON only if water level โฅ 90% and โค 91%.
- Logical AND block ensures both conditions are met simultaneously.
Graph Explanation

- Water Level Plot: It shows the water filling from below 20% to above 95%.
- Pump Status Plot: Pump turns ON when water level is below 20% and turns OFF when it crosses 95%.
- Alarm Status Plot: Alarm activates only in the narrow band between 90% and 91% water level, then turns OFF.
Result
The simulation results match with the requirement:
- So here pump starts at water level < 20% and stops when water level reach > 95%.
- Alarm activates only when water level is between 90% and 91%.
