Control a fan 230VAC using arduino with temperature sensor

Hello people!

I want to control a fan AC 230V, the speed of fan depents on how is the temperature.
Once the temperature reaches and exceeds 24 degrees Celsius, the fan should start working at a lower speed.
The speed will increase every 4 degrees Celsius until the temperature becomes equal to 40 degrees Celsius, then the fan will have the maximum speed.
So far I have bought the fan of course, a MOC3021 (Opto-coupler), a temperature sensor, a step-down transformer 230V/9V, a 4N25 (zero crossing detector) and a BT136 TRIAC

I found these components from here, but in the link the user used a potentiometer

I'm confused by this link because I don't know how to use the circuits. e.g. Why does it use 4N25?

Some fans allow speed control and some don't. The AC fans which do can be controlled with a simple triac circuit while some require other means of speed control. So the question becomes exactly which 230 VAC fan motor your fan has and does it allow for speed control and if yes, how?

Ron

This is the fan. But I don't know if the motor speed can be controlled.

Looking at English in the manual it does have buttons for Low, Medium and High speed. Now how those buttons are configured I don't know. Some designs switch capacitors in and out for speed control. Others coil configurations. I really don't know how this fan does it. Hopefully another member has some thoughts?

Ron

For now, let's leave the fan and see the circuit and the code