Hello everyone and welcome to MAE Learning – My Automobile Engineering. In this tutorial, we will learn to develop wiper speed control logic using MATLAB Simulink.

What is the main purpose?
This Simulink model is made to control car wipers using a rain sensor. The wipers should work in different ways based on how much rain is coming. There are three modes:
- Intermittent (wiper wipes slowly with gap)
- Low speed (wiper wipes slowly without gap)
- High speed (wiper wipes fast without gap)
Requirement
- If rain is less than 40%, wipers go in intermittent mode (slow with gap).
- If rain is between 40% and 70%, wipers go in low speed (continuous slow).
- If rain is more than 70%, wipers go in high speed (continuous fast).
- If rain is 0%, wipers stay off.
What blocks did I use in Simulink?
- Signal Builder – this block gives changing RainPercent values with time.
- Constant – gives fixed values 40 and 70 for comparison.
- Relational Operator – checks if rain is more/less than 40 or 70.
- Logical Operator (AND) – finds if rain is between 40 and 70.
- Switch – chooses which wiper mode to use: Off, Intermittent, Low, or High.
- Scope – shows graphs (one for rain, one for wiper).
Step-by-step working logic
- Read RainPercent
The Signal Builder gives RainPercent (value from 0 to 100) for each time point. - Check rain < 40
Use Relational Operator block to see if rain is less than 40. If yes, wiper should be in intermittent mode. - Check rain between 40 and 70
Use two Relational Operators:- One checks rain >= 40
- One checks rain <= 70
Combine both with AND block to know if rain is in this range.
If yes, wiper should be in low mode.
- Check rain > 70
Use Relational Operator block to check if rain is more than 70. If yes, wiper goes to high mode.
Mode selection using Switch blocks
- The first Switch checks if high mode should work (rain > 70). If not, pass to next Switch.
- Second Switch checks for low mode (rain between 40 and 70). If not, pass to next Switch.
- Third Switch checks for intermittent mode (rain < 40). If not, wiper is Off.
Mode number mapping:
- 0 = Off
- 1 = Intermittent
- 2 = Low
- 3 = High
5. View results using Scope
Scope block shows how RainPercent and WiperMode change with time.


High

Low

Inter

What input did I use for testing?
Used Signal Builder to give different rain values at different times (example table):
Time RainPercent
0 10
1 10
2 10
3 30
4 30
5 45
6 45
7 60
8 60
9 75
10 75
11 80
12 80
13 65
14 65
15 55
16 55
17 35
18 35
19 20
20 20
21 10
22 10
23 50
24 50
25 72
26 72
27 38
28 38
29 15
30 15
- Results from Graph

- The upper graph line (red) shows rain sensor input changing over time.
- The lower line (green) shows wiper mode:
- Green line is low — means intermittent mode (for less than 40% rain).
- Middle height — low speed (when rain is from 40% to 70%).
- Top height — high speed (for more than 70% rain).
Conclusion
Logic in the blocks matches the output in the graph:
- Intermittent mode for rain less than 40%
- Low speed for rain between 40% and 70%
- High speed for rain greater than 70%
This matches the logic used in the model perfectly.
7. Why Logic and Graph Match
The blocks used in the logic help in correct decision-making:
- Relational blocks check if the rain level crosses set points (40 and 70).
So, when rain goes above or below these points, the mode changes right away. - AND block ensures that Low mode only works when both conditions are true. Rain must be greater than or equal to 40. It also needs to be less than or equal to 70.
- Switch block order gives priority to modes in the right order:
first High, then Low, and finally Intermittent.
