In this Instructables, we will use a Particle Photon (Arduino compatible) microcontroller coupled with a 315MHz RF Transmitter to send commands to a Harbor Breeze ceiling fan. We will then learn how to use an Amazon Echo and Alexa to activate our fan using voice commands. The ultimate goal is to be able to turn on the fan by saying: "Alexa, trigger fan on".


Reverse Engineer RF Remote Controller for IoT! by veggiebenz

RF 315/433 MHz Transmitter-receiver Module and Arduino by Mohannad Rawashdeh

Home Automation using Particle and Amazon Echo by Krishnaraj Varma

Step 1: You Will Need...

<p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/WHK2YXaA7CM" width="500"></iframe></p><p>I hacked the remote, using relays to 'activate the buttons' more brute force, but same results :)<br><br>Great job!</p>
<p>After compiling a few times it works. Works well thank you. Do you know how to shut light off?</p>
<p>Congrats! For the light, it is just a matter of sending &quot;light&quot; instead of &quot;2&quot; when creating the DO button. Take a look at the fantControl function in the fantastic.ino file for the complete list:</p><p>&quot;light&quot;<br>&quot;off&quot;<br>&quot;0&quot;<br>&quot;1&quot;<br>&quot;2&quot;<br>&quot;3&quot;<br>&quot;4&quot;<br>&quot;5&quot;<br>&quot;6&quot;<br>&quot;random_fan&quot;<br>&quot;random_light&quot;<br>&quot;delay&quot;<br>&quot;2H&quot;<br>&quot;4H&quot;<br>&quot;8H&quot;<br>&quot;summer&quot;<br>&quot;winter&quot;</p>
<p>Yes when light is sent it does turn on at lowest brightness, every time light is sent the light gets brighter. But no way to turn light off. If you send off it just stops the fan. So I am guessing the light signal you have is for the light to turn on and then add 1 to the brightness.</p>
<p>I have started this project and get the following code errors:</p><p>In file included from fantastic.cpp:3:0:</p><pre>fantypes.h:4:5: error: 'boolean' does not name a type<br> boolean power;<br> ^</pre><br><pre>fantypes.h:10:35: error: too many initializers for 'const signal'<br> const signal SHORT_ON { true, 400 };<br> ^</pre><br><pre>fantypes.h:11:37: error: too many initializers for 'const signal'<br> const signal SHORT_OFF { false, 500 };<br> ^</pre><br><pre>fantypes.h:12:34: error: too many initializers for 'const signal'<br> const signal LONG_ON { true, 850 };<br> ^</pre><br><pre>fantypes.h:13:36: error: too many initializers for 'const signal'<br> const signal LONG_OFF { false, 950 };<br> ^</pre><pre>fantastic.cpp: In function 'void transmit(signal*)':<br></pre><pre>fantastic.cpp:17:52: error: 'struct signal' has no member named 'power'<br> <br> ^</pre><br><pre>fantastic.cpp:21:45: error: 'struct signal' has no member named 'power'<br> void transmit(signal array[16] = sig_preamble) {<br> ^</pre><br><pre>fantastic.cpp:24:39: error: 'const struct signal' has no member named 'power'<br> for (int pre = 0; pre &lt; 32; ++pre) { // Preamble<br> ^</pre><br><pre>fantastic.cpp:26:40: error: 'const struct signal' has no member named 'power'<br> delayMicroseconds (sig_preamble[pre].duration);<br> ^</pre>
<p>is there an easy way to clone the RF signal from the remote? </p>
<p>Do you know if any other resources for fan frequencies and data for the fans? I tried &quot;decoding&quot; my signals, but it seems too difficult for my brain/time schedule. </p>
<p>Beyond veggiebenz's Instructable, I do not. But you still have the option of controlling your remote using the microcontroller and sending the signals that way. Good luck!</p>
This is very cool!

About This Instructable




More by tareker:Voice Control of a Ceiling Fan with Alexa Controlling your Photon device with SmartThings and Alexa Feedme, an Electric Vehicle Plug In Reminder 
Add instructable to: