A smart ceiling fan controller for India lets you control fan speed via a smartphone app or Alexa voice commands without replacing your existing Havells, Usha, Orient, or Crompton fan. Indian fans run on 230V AC 50Hz with capacitor-based speed regulation, and this DIY project uses a TRIAC phase-cut dimmer with ESP8266 to replace that capacitor bank with WiFi-controllable speed steps.
Table of Contents
- Understanding Indian Ceiling Fan Speed Control
- Hardware: TRIAC, MOC3021, and Zero-Cross Detection
- Circuit Design for 230V Indian Mains
- ESP8266 Firmware with Alexa (SinricPro)
- App Control via Blynk or Home Assistant
- Safety Guidelines for 230V AC Projects
- Ready-Made Smart Fan Regulators in India
- Frequently Asked Questions
Understanding Indian Ceiling Fan Speed Control
Indian ceiling fans (BEE 5-star rated, typically 50-75W) use one of two speed control methods:
- Resistive/capacitor regulators: Older fans use discrete capacitors (2.25uF, 3uF, 3.85uF) for speed steps. Waste energy as heat at low speeds.
- Electronic regulators: Modern fans use TRIAC-based solid-state regulators, 90%+ efficient at all speeds. This is what we replicate with ESP8266.
Retrofitting your existing Rs 1,500 fan with a Rs 600 ESP8266 TRIAC circuit costs far less than buying a new Rs 3,000-8,000 smart fan.
Recommended: UNO WiFi R3 (ATmega328P + ESP8266)
The UNO WiFi R3 with built-in ESP8266 serves as the brains of your smart fan controller, handling TRIAC firing angle calculations, zero-cross interrupts, and WiFi connectivity all in one board.
Hardware: TRIAC, MOC3021, and Zero-Cross Detection
Components with India prices (2025):
- BTA16-600B TRIAC (Rs 25) – rated 16A 600V, well above 230V needs
- MOC3021 optocoupler (Rs 8) – for TRIAC gate driver
- 4N35 optocoupler (Rs 8) – for zero-cross detection
- HLK-PM01 230V to 5V 3W SMPS module (Rs 120) – isolated power supply
- ESP-12E/ESP-12F module (Rs 180)
- Resistors and snubber capacitor (Rs 20)
- Total BOM approximately Rs 400
Circuit Design for 230V Indian Mains
WARNING: This circuit operates at 230V AC mains voltage. Lethal if mishandled. Always work with mains disconnected. Use an isolation transformer during testing.
Zero-Cross Detection:
230V Live -> 220kohm -> 4N35 anode
4N35 cathode -> Neutral
4N35 collector -> 3.3V via 10kohm -> ESP8266 GPIO4 (interrupt)
TRIAC Gate Driver:
ESP8266 GPIO5 -> 470ohm -> MOC3021 LED anode
MOC3021 -> BTA16 Gate via 39ohm
BTA16 MT2 -> Fan Live terminal
Snubber: 47ohm + 0.01uF across BTA16 MT1-MT2
void ICACHE_RAM_ATTR zeroCrossISR() {
int delay_us = map(fanSpeed, 0, 100, 100, 8000);
timer1_write(delay_us * 5); // 5MHz timer
}
void ICACHE_RAM_ATTR timerISR() {
if (fanSpeed > 0) {
digitalWrite(TRIAC_PIN, HIGH);
delayMicroseconds(100);
digitalWrite(TRIAC_PIN, LOW);
}
}
ESP8266 Firmware with Alexa (SinricPro)
SinricPro provides free Alexa/Google Home integration for ESP8266/ESP32:
#include <SinricPro.h>
#include <SinricProFanUS.h>
bool onRangeValue(const String& id, int& value) {
int speedMap[] = {0, 30, 60, 100};
fanSpeed = speedMap[constrain(value, 0, 3)];
return true;
}
void setup() {
SinricProFanUS& fan = SinricPro[FAN_ID];
fan.onRangeValue(onRangeValue);
SinricPro.begin(APP_KEY, APP_SECRET);
}
Enable the SinricPro Alexa skill. You can then say “Alexa, set fan to speed 2” or “Alexa, turn off fan”.
Recommended: Mega WiFi R3 (ATmega2560 + ESP8266)
For whole-home fan automation across bedroom, living room, and kitchen, the Mega WiFi R3 handles multiple TRIAC channels simultaneously. Control up to 4 fans from one board via Home Assistant.
App Control via Blynk or Home Assistant
#include <BlynkSimpleEsp8266.h>
BLYNK_WRITE(V1) { // Slider 0-100
fanSpeed = param.asInt();
}
BLYNK_WRITE(V2) { // Power button
fanSpeed = param.asInt() ? 70 : 0;
}
In Blynk app, add a Slider widget (V1, 0-100) and a Button (V2). For Home Assistant, add an MQTT Fan entity mapping percentage 0-100% to fanSpeed directly.
Safety Guidelines for 230V AC Projects
- Earthing: Always connect fan motor frame to earth. Indian residential earthing is often unreliable in older buildings – test with a multimeter before proceeding.
- Isolation: The HLK-PM01 SMPS provides safety isolation between mains and ESP8266. Never power ESP from mains through a resistor-capacitor dropper.
- MCB protection: Ensure your fan circuit has a 6A MCB upstream. TRIAC failures typically cause short circuits.
- BLDC fans warning: Do NOT use TRIAC phase cutting with BLDC motor fans (Atomberg, Superfan). They use internal inverters incompatible with phase cutting.
Recommended: 12V 1-Channel Relay Module (RS485/Modbus)
Add this isolated relay module alongside your fan TRIAC circuit for switching other loads such as a smart night lamp, exhaust fan, or bedroom light, all from the same Home Assistant dashboard.
Ready-Made Smart Fan Regulators in India
- Atomberg Renesa Smart+: Rs 3,499 – built-in WiFi, Alexa/Google, 5-star BEE rated (28W)
- Orient Electric Aeroslate i+: Rs 3,299 – Alexa and Google Assistant, remote and app control
- Syska Smart Fan Regulator: Rs 699 – retrofits existing fan, WiFi control, basic app – closest to DIY approach
Frequently Asked Questions
- Will this work with 3-speed capacitor fans (old Khaitan style)?
- No. Capacitor-based speed fans use discrete capacitor values for speed selection. TRIAC phase cutting bypasses this entirely. Wire the TRIAC across the fan live and motor winding terminal, removing the capacitor regulator.
- Does TRIAC phase cutting damage fan motors?
- Long-term at very low phase angles (under 30%) can increase motor heating. For regular home use at 30-100% speed, there is no significant damage risk.
- Does Alexa control require internet?
- Yes, Alexa commands go through Amazon’s cloud. For fully local control use Home Assistant with local MQTT integration – no internet needed after initial setup.
- What is the minimum fan wattage this handles?
- The BTA16 handles down to ~10W loads. Standard Indian ceiling fans (50-75W) are well within range.
- Can I control this via Google Home as well?
- Yes, SinricPro supports both Alexa and Google Home. Enable both skills in their respective apps for voice control from either platform.
Add comment