Controlling ceiling fan speed using Arduino Reference: https://arduino.stackexchange.com/a/12000/37585

Based on this post, if I want to control a 120V AC ceiling fan with an Arduino, there's a complicated bit of electronics that needs to be put in place.

There are only 3 wires that go to the ceiling fan itself, load, neutral, and ground. Hooking up a relay in the middle of the connection allows me to turn on and off the fan; cutting the power. This does not allow me to change the fan's speed.

There's a pull-switch inside any 3-speed ceiling fan that lets you alter the speed. Whatever this is doing, it should be able to be replicated. The question is, does it require a 4-channel relay and some extra electronics or does it require converting the 3.3V GPIO to 120V and enabling AC-style PWM? Or is it something completely different?
Or is it something completely different?


fairly easy to do.

approach 1 is phase based, like a typical dimmer. your arduino needs to detect zero crossing and control a triac. fairly common.

approach 2 is simpler but less common: put a mosfet inside a bridge so it can control an ac load. apply pwm to the mosfet and you are done.