AC fan control speed according to ambient temprature (rise or fix) or surface temperature (rise or fix ))

Hello Guys,
I want to have an idea about the logic and condition to controlling ac fan speed (low,medium and high) according to ambient or surface temperature rising or fix
for exemple what is the condition to use in logic like to jump from low speed up to medium speed and reverse (medium to low ) with a timer in the condition and also to jump from the stat of low to the cooling stat. Please anyone can help me.

Thank you

Whatever you fancy really. One important thing to consider is hysteresis q.v. You don’t want to stress your equipment by changing settings all the time, so often you will have a mechanism to prevent you constantly flipping between low, medium, loops - low, oh no medium etc.

You just need to decide what rules you want and then translate them into code.

A few more details would help, for example if it is a 30 horse 3 phase fan you would probably use a VFD (Variable Frequency Drive). How are you going to sense the temperature? What is the temperature range etc.

You might want to watch some arduino tutorials on programing. Check case, if, then, else, or statements.