user55944: I'm trying to control my ~230 V fan from the Arduino.
Can anyone say the best possible ways to design a fan regulator that can be controlled by the Arduino using a low cost design. 

user55239: Its not exactly what you are looking for but it will help Arduino-controlled-light-dimmer-The-circuit.
Here is the sample project in which TRIAC is used with arduino for controlling the flow of current to the light. In your case Light or better we can say load is FAN. This will help you in controlling the FAN Speed. Relay only act as switch and it won't control FAN Speed.

user55944: Finally i found it as a product available here
with the thyristor circuit and electrical-contactless servo (PWM or ANALOG input) motor ( to drive the input) will helps to drive the output from 0 to 220V. smooth fan regulator can also do this with servo motor and without any external electrical component requirement . If it is not efficient way with low cost design command or answer your way.  :-).

user55219: There is also the issue of isolation here, to keep the controller side from being connected to the mains for reasons of noise and safety.  The previous posters' comments about doing this with triacs or mosfets, and phase angle control are all true.  It is nearly impossible to control the speed of a single phase induction motor.   Anyway, the most elegant solution is to get a 3 phase fan motor and a variable frequency drive with low-voltage DC control input.  Run the pwm output from the Arduino through an opto-isolator (drive the internal led).  Use the DC reference on the speed control to power the output of the opto-isolator.  Run that through an rc lowpass filter to the speed control voltage input.  I think you could get out of this for around 200$US. Check surpluscenter.com.  there are many motors and drives out there.
-Hugh

user37622: To control AC power for inductive load (motor) a Triac is used. The concept is called phase cutting. It works for a resistive load (heater) too.
This module is designed for phase cutting. It contains a zero crossing detector and a Triac. The control is done in MCU. The zero crossing detector is wired to an interrupt pin. The control signal for the Triac is wired to an output pin. In external interrupt function you set a timer interrupt to send a pulse to the Triac after some microseconds. Longer off time results in less power for the motor.

At 50 Hz AC, one pulse is 10 milliseconds. To cut a part of AC wave out, activate the Triac gate for 20 microseconds after 0 to 10 milliseconds. Triac turns self off the AC line at next zero crossing.
Robotdyn has a library for the module.
EDIT:
I bought the Robotdyn AC dimmer module to use it in my AC heater regulation project and I tested it with a incandescent light bulb and a fan. (video on youtube)
The library by Robotdyn works, but it is designed to control many dimmers and uses a timer interrupt every 12 microseconds (yes, micros). The library sets the interrupts over MCU registers.
I wrote an arduino fade-in/out sketch using TimerOne library to demonstrate phase cutting with this module.
#include <TimerOne.h>

const byte INTERRUPT_PIN = 2;
const byte TRIAC_PIN = 4;
const byte TRIAC_PULSE_MICROS = 30;

const int FADE_MAX = 9800;
const int FADE_MIN = 2000;

volatile bool triacOn;
volatile int period = FADE_MIN; // microseconds cut out from AC pulse

int fadeAmount = 10;

void zeroCrossing() {
  triacOn = false; // triac tuns off self at zero crossing
  Timer1.setPeriod(period); // to call triacPulse() after off period
}

void triacPulse() {
  if (triacOn) { // stop pulse
    digitalWrite(TRIAC_PIN, LOW);
    Timer1.stop();
  } else { // start pulse
    digitalWrite(TRIAC_PIN, HIGH);
    triacOn = true;
    Timer1.setPeriod(TRIAC_PULSE_MICROS);
  }
}

void setup() {
  pinMode(TRIAC_PIN, OUTPUT);
  attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), zeroCrossing, RISING);
  Timer1.initialize();
  Timer1.attachInterrupt(triacPulse);
}

void loop() {
  period = period + fadeAmount;
  if (period <= FADE_MIN || period >= FADE_MAX) {
    fadeAmount = -fadeAmount;
  }
  delay(25);
}

EDIT 2 version with triac activated by 'pwm' pin
const byte TRIAC_PIN = 9;
const byte ZC_EI_PIN = 2;

unsigned long topMicroseconds = 9700; // 10000 micros is between zero crossings
int prescaler = 8;
byte prescalerBits = _BV(CS11); // 8

void zeroCrossing() {
  TCNT1 = 0; // reset the timer counter
}

void setup() {
  Serial.begin(115200);
  Serial.println("START");

  attachInterrupt(digitalPinToInterrupt(ZC_EI_PIN), zeroCrossing, RISING);

  pinMode(TRIAC_PIN, OUTPUT);
  uint32_t topPeriod = ((F_CPU / 1000000)* topMicroseconds) / prescaler ;
  ICR1 = topPeriod;
  OCR1A = topPeriod + 1; // full off
  // WGM mode 14 - Fast PWM w/TOP=ICR1 
  TCCR1A = _BV(WGM11) | _BV(COM1A0) | _BV(COM1A1);
  TCCR1B = _BV(WGM13) | _BV(WGM12) | prescalerBits;
}

void loop() {
  if (Serial.available()) {
    unsigned long microseconds = Serial.parseInt();
    Serial.find("\n");
    uint32_t period = ((F_CPU / 1000000)* microseconds) / prescaler ;
    OCR1A = period;
  }
}

on SAMD it is possible to setup this to start the timer on external interrupt over event, without an interrupt function. then the CPU of the MCU is not involved in phase cutting after the initial configuration of the peripherals
EDIT 3:
The TriacDimmer library version 1.1.0 for AVR Arduinos available in Library Manager works good with this dimmer. Fun fact: It uses timer1's input capture on pin 8 instead of external interrupt on pin 2 or 3.

55944: <p>I'm trying to control my ~230&nbsp;V fan from the Arduino.</p>

<p>Can anyone say the best possible ways to design a fan regulator that can be controlled by the Arduino using a low cost design. </p>
 55239: <p>Its not exactly what you are looking for but it will help <a href="https://www.instructables.com/id/Arduino-controlled-light-dimmer-The-circuit/" rel="nofollow noreferrer">Arduino-controlled-light-dimmer-The-circuit</a>.</p>

<p>Here is the sample project in which TRIAC is used with arduino for controlling the flow of current to the light. In your case Light or better we can say load is FAN. This will help you in controlling the FAN Speed. Relay only act as switch and it won't control FAN Speed.</p>
 55944: <p>Finally i found it as a product available <a href="https://robu.in/product/3000w-thyristor-scr-voltage-regulator-temperature-dimmer-speed-light-ac-220v/?gclid=Cj0KCQjw4-XlBRDuARIsAK96p3DJsjbkwTyPaNCDEJwJh2sTK-GFBiYKZua3WaEDRh4wZRD5LO1xS1kaAhuWEALw_wcB" rel="nofollow noreferrer">here</a>
with the thyristor circuit and <em>electrical-contactless</em> <strong><em>servo (PWM or ANALOG input) motor</em></strong> ( to drive the input) will helps to drive the output from 0 to 220V. <strong>smooth fan regulator can also do this with servo motor and without any external electrical component requirement</strong> . If it is not efficient way with low cost design command or answer your way.  :-).</p>
 55219: <p>There is also the issue of isolation here, to keep the controller side from being connected to the mains for reasons of noise and safety.  The previous posters' comments about doing this with triacs or mosfets, and phase angle control are all true.  It is nearly impossible to control the speed of a single phase induction motor.   Anyway, the most elegant solution is to get a 3 phase fan motor and a variable frequency drive with low-voltage DC control input.  Run the pwm output from the Arduino through an opto-isolator (drive the internal led).  Use the DC reference on the speed control to power the output of the opto-isolator.  Run that through an rc lowpass filter to the speed control voltage input.  I think you could get out of this for around 200$US. Check surpluscenter.com.  there are many motors and drives out there.
-Hugh</p>
 37622: <p>To control AC power for inductive load (motor) a Triac is used. The concept is called <a href="https://en.wikipedia.org/wiki/Phase-fired_controller" rel="nofollow noreferrer">phase cutting</a>. It works for a resistive load (heater) too.</p>
<p><a href="https://robotdyn.com/ac-light-dimmer-module-1-channel-3-3v-5v-logic-ac-50-60hz-220v-110v.html" rel="nofollow noreferrer">This module</a> is designed for phase cutting. It contains a zero crossing detector and a Triac. The control is done in MCU. The zero crossing detector is wired to an interrupt pin. The control signal for the Triac is wired to an output pin. In external interrupt function you set a timer interrupt to send a pulse to the Triac after some microseconds. Longer off time results in less power for the motor.</p>
<p><a href="https://i.stack.imgur.com/PMHdv.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PMHdv.gif" alt="enter image description here" /></a></p>
<p>At 50 Hz AC, one pulse is 10 milliseconds. To cut a part of AC wave out, activate the Triac gate for 20 microseconds after 0 to 10 milliseconds. Triac turns self off the AC line at next zero crossing.</p>
<p>Robotdyn has <a href="https://github.com/RobotDyn/AC-Light-Dimmer-Module-1-Channel-3.3V-5V-logic-AC-50-60hz-220V-110V" rel="nofollow noreferrer">a library</a> for the module.</p>
<p><strong>EDIT</strong>:</p>
<p>I bought the Robotdyn AC dimmer module to use it in my AC heater regulation project and I tested it with a incandescent light bulb and a fan. (<a href="https://www.youtube.com/watch?v=3gH2Eg5rLE0" rel="nofollow noreferrer">video on youtube</a>)</p>
<p>The library by Robotdyn works, but it is designed to control many dimmers and uses a timer interrupt every 12 microseconds (yes, micros). The library sets the interrupts over MCU registers.</p>
<p>I wrote an arduino fade-in/out sketch using TimerOne library to demonstrate phase cutting with this module.</p>
<pre><code>#include &lt;TimerOne.h&gt;

const byte INTERRUPT_PIN = 2;
const byte TRIAC_PIN = 4;
const byte TRIAC_PULSE_MICROS = 30;

const int FADE_MAX = 9800;
const int FADE_MIN = 2000;

volatile bool triacOn;
volatile int period = FADE_MIN; // microseconds cut out from AC pulse

int fadeAmount = 10;

void zeroCrossing() {
  triacOn = false; // triac tuns off self at zero crossing
  Timer1.setPeriod(period); // to call triacPulse() after off period
}

void triacPulse() {
  if (triacOn) { // stop pulse
    digitalWrite(TRIAC_PIN, LOW);
    Timer1.stop();
  } else { // start pulse
    digitalWrite(TRIAC_PIN, HIGH);
    triacOn = true;
    Timer1.setPeriod(TRIAC_PULSE_MICROS);
  }
}

void setup() {
  pinMode(TRIAC_PIN, OUTPUT);
  attachInterrupt(digitalPinToInterrupt(INTERRUPT_PIN), zeroCrossing, RISING);
  Timer1.initialize();
  Timer1.attachInterrupt(triacPulse);
}

void loop() {
  period = period + fadeAmount;
  if (period &lt;= FADE_MIN || period &gt;= FADE_MAX) {
    fadeAmount = -fadeAmount;
  }
  delay(25);
}
</code></pre>
<p><strong>EDIT 2</strong> version with triac activated by 'pwm' pin</p>
<pre><code>const byte TRIAC_PIN = 9;
const byte ZC_EI_PIN = 2;

unsigned long topMicroseconds = 9700; // 10000 micros is between zero crossings
int prescaler = 8;
byte prescalerBits = _BV(CS11); // 8

void zeroCrossing() {
  TCNT1 = 0; // reset the timer counter
}

void setup() {
  Serial.begin(115200);
  Serial.println(&quot;START&quot;);

  attachInterrupt(digitalPinToInterrupt(ZC_EI_PIN), zeroCrossing, RISING);

  pinMode(TRIAC_PIN, OUTPUT);
  uint32_t topPeriod = ((F_CPU / 1000000)* topMicroseconds) / prescaler ;
  ICR1 = topPeriod;
  OCR1A = topPeriod + 1; // full off
  // WGM mode 14 - Fast PWM w/TOP=ICR1 
  TCCR1A = _BV(WGM11) | _BV(COM1A0) | _BV(COM1A1);
  TCCR1B = _BV(WGM13) | _BV(WGM12) | prescalerBits;
}

void loop() {
  if (Serial.available()) {
    unsigned long microseconds = Serial.parseInt();
    Serial.find(&quot;\n&quot;);
    uint32_t period = ((F_CPU / 1000000)* microseconds) / prescaler ;
    OCR1A = period;
  }
}
</code></pre>
<p>on SAMD it is possible to setup this to start the timer on external interrupt over event, without an interrupt function. then the CPU of the MCU is not involved in phase cutting after the initial configuration of the peripherals</p>
<p><strong>EDIT 3:</strong></p>
<p>The TriacDimmer library version 1.1.0 for AVR Arduinos available in Library Manager works good with this dimmer. Fun fact: It uses timer1's input capture on pin 8 instead of external interrupt on pin 2 or 3.</p>
