$7.25 - Add Voice Control to Any Ceiling Fan

In this Instructable, I'll walk you through the very simple process to automate your ceiling fan so you can control it with voice commands using an Alexa device. You can use these instructions to control other electronic devices (lights, fan, TV, etc). For my example, I will be using an Amazon Dot, an existing ceiling fan, and a $7.25 Sonoff Wifi Switch.

Step 1: Voice Commands

Our ceiling fan had wireless built in but sometimes I couldn't find the remote when I wanted to turn on or off the fan (or I was too lazy to go grab it). Now I can control this fan just by asking Alexa.

Step 2: Wiring the Sonoff

First, remove the canopy cover from the top of the ceiling fan to expose the electrical wiring. The fan I have has a wireless control (blue box) which was wired in-line between the electrical feed coming out of the ceiling and the fan motor. I looked at the wiring diagram on this wireless control to see which wires I needed to use.

The white (neutral) wire came down from the ceiling and tied directly together with the white wire from the fan's motor and the white wire from the wireless controller. All three were twisted together with a wire nut. I cut the white wire going from this wire nut to the motor. Then I stripped the wires ends and placed the white wire from the nut side into the input of the Sonoff and the white wire from the motor side in the output of the Sonoff.

For the "hot" feed, I could see the yellow wire came out of the wireless control and was tied to the black coming out of the fan motor. I just removed this wire nut and placed the Sonoff in-line between the yellow (input side) and black (output side) wires.

Now the Sonoff Wifi switch was wired in but not getting any power since the fan was turned off. I switched the fan on and the green light of the Sonoff came on....good sign.

Step 3: Program the Sonoff

Now I had to program the Sonoff and add this to Alexa.

I downloaded the eWeLink Sonoff app from the app store and added my device. I first had to set up this app and add my wifi information. Next, I push the + symbol to add a new device. Hold down the link button on the Sonoff and pair the device.

Once this was paired I went into the Alexa app on my phone, then under Skills I searched for the eWeLink skill and enabled this skill. Now in the Alexa app, I opened 'Smart Home' and added a new device naming it "Ceiling Fan".

That's it! Drum roll.....

Step 4: Test and Button Up

Now it was just a matter of testing and I was done. I can turn this on or off using the Device in the Alexa app. To use the voice commands I can just say "Alexa, turn on ceiling fan" or "Alexa, turn off ceiling fan".

The hardest part of the whole project was stuffing everything back into the ceiling and getting the fan's canopy cover back up there. It was very tight with all the wiring and these two controls boxes but I managed (after some colorful language) to get it all back together.

I do have to leave the fan in the "ON" position at all times and this switch just controls when the motor is powered. If I want to speed up or slow down the fan I still have to use the remote. Also, if I was to use the light on the fan, it is controlled only through the remote. I could have added a second Sonoff to the light but there was no room. I could have also wired the fan motor and light in together so they both come on at once but.....that's just crazy.

Bottom line, it took about one hour and cost $7.25 to enable the voice control and I couldn't be happier so I wanted to share it with you all. Please let me know if you use this and what projects you use it on.

Share

    Recommendations

    • PCB Contest

      PCB Contest
    • First Time Author

      First Time Author
    • Big and Small Contest

      Big and Small Contest

    3 Discussions

    0
    None
    IiinasL

    26 days ago

    Thanks! That helps a lot.

    0
    None
    IiinasL

    Question 27 days ago on Introduction

    Hi chris,

    great article, i have been looking for instructions if the sonoff basic switch is possible as fan controller. My question is, do you think it is possible that i will mount the sonoff to a wall junction box (for accessibility) and have a longer output wire from the wall to the ceiling fan, do you think the electrical current/signal will still carry through because of the long output wire, i say around 8-10ft.

    And another one is, if you have to go on a vacation and turn off the fan (so sonoff will be switch off) once you turn it on again, do you need to set it up again? Or the sonoff will just reconnect to the router?

    Thanks and great project!

    ivan

    1 more answer
    0
    None
    Chris WeatherfordIiinasL

    Answer 26 days ago

    Thanks for the comment and support. I'm not an electrician but that seems like it should work to me. Like you said, that would make it much more accessible if you ever did need to remove or replace this in the future.

    Turning the Sonoff off does not reset this device. You can just power it back on and then it will work as expected. We have lost power to the house and then it was just working when the power was restored. Never for any length of time but I don't see why that would matter.

    Good luck, let me know.
    Chris