loading

This is my first project on instructable ...

This project uses ESP8266-12 to turn on and turn off wireless outlets, without any changes, using the app Blynk library Rc-switch

Step 1:

Step 2: Materials

ESP8266-12 or ( ESP8266-07 , ...., ESP8266-12e)

RF 433 MHz Transmitter

3 wirelless remote control outlets

antenna 433mhz ( https://www.instructables.com/id/433-MHz-Coil-loaded-antenna/ )

Step 4: Sketch

change the sketch in the following lines with your data:


  • char auth[] = "xxxxxxxxxx"; //insert here your token generated by Blynk app
  • Blynk.begin(auth, "ssid", "password"); //insert here your SSID and password
  • mySwitch.switchOn(1, 1); // insert here your code outlets

rc-switch (follow the prompts to set the transmission code of your outlets remote control)

Step 5: Connections

ESP8266-12

VCC +3,3v

CH-PD +3,3v (new version ESP8266-12e pin EN)

GND ground

GPIO15 ground

GPIO13 ---------- pin ATAD (transmitter 433mhz )


transmitter 433mhz

ATAD ----- GPIO13 (ESP8266-12)

VCC +5v

GND ground

<p>thankyou for this i had to use the tristate of my code for my sockets</p><p>works great thankyou </p><p>/**************************************************************<br> * Blynk is a platform with iOS and Android apps to control<br> * <br> * <a href="https://www.instructables.com/id/ESP8266-12-standalone-blynk-control-outlets-wirele/step4/Sketch/" rel="nofollow"> https://www.instructables.com/id/ESP8266-12-standa...</a><br> * Arduino, Raspberry Pi and the likes over the Internet.<br> * You can easily build graphic interfaces for all your<br> * projects by simply dragging and dropping widgets.<br> *<br> * Downloads, docs, tutorials: <a href="http://www.blynk.cc" rel="nofollow"> http://www.blynk.cc</a><br> * Blynk community: <a href="http://community.blynk.cc" rel="nofollow"> http://community.blynk.cc</a><br> * Social networks: <a href="https://www.fb.com/blynkapp" rel="nofollow"> https://www.fb.com/blynkapp</a><br> * <a href="http://twitter.com/blynk_app" rel="nofollow"> http://twitter.com/blynk_app</a><br> *<br> * Blynk library is licensed under MIT license<br> * This example code is in public domain.<br> *<br> **************************************************************<br> * This example runs directly on ESP8266 chip.<br> *<br> * You need to install this for ESP8266 development:<br> * <a href="https://github.com/esp8266/Arduino" rel="nofollow"> https://github.com/esp8266/Arduino</a><br> *<br> * Change WiFi ssid, pass, and Blynk auth token to run :)<br> *<br> **************************************************************/<br><br>#define BLYNK_PRINT Serial // Comment this out to disable prints and save space<br>#include &lt;ESP8266WiFi.h&gt;<br>#include &lt;BlynkSimpleEsp8266.h&gt;<br><br>//-------- rcswitch------<br>#include &lt;RCSwitch.h&gt;<br>RCSwitch mySwitch = RCSwitch();<br><br>char* socket1TriStateOn = &quot;0FFFF0FFFF0F&quot;;<br>char* socket1TriStateOff = &quot;0FFFF0FFFFF0&quot;;<br>char* socket2TriStateOn = &quot;0FFFFFF0FF0F&quot;;<br>char* socket2TriStateOff = &quot;0FFFFFF0FFF0&quot;;<br>char* socket3TriStateOn = &quot;0FFFFF0FFF0F&quot;;<br>char* socket3TriStateOff = &quot;0FFFFF0FFFF0&quot;;<br><br>// You should get Auth Token in the Blynk App.<br>// Go to the Project Settings (nut icon).<br>char auth[] = &quot;own token from Blynk&quot;; //insert here your token generated by Blynk<br><br>void setup()<br>{<br> Serial.begin(9600);<br> Blynk.begin(auth, &quot;SSID&quot;, Pass&quot;); //insert here your SSID and password<br><br> mySwitch.enableTransmit(2); // pin d4<br> <br>}<br><br>void loop()<br>{<br> Blynk.run();<br>}<br><br>//-------rcswitch------<br>BLYNK_WRITE(0) { //virtual pin 0<br><br>mySwitch.sendTriState(socket1TriStateOn);// insert here your code outlets<br>}<br><br>BLYNK_WRITE(1) {<br> mySwitch.sendTriState(socket1TriStateOff); <br>}<br><br>BLYNK_WRITE(2) { <br> mySwitch.sendTriState(socket2TriStateOn);<br>}<br><br>BLYNK_WRITE(3) {<br>mySwitch.sendTriState(socket2TriStateOff);<br>}<br>BLYNK_WRITE(4) {<br>mySwitch.sendTriState(socket3TriStateOn);<br><br>}<br>BLYNK_WRITE(5) {<br> mySwitch.sendTriState(socket3TriStateOff);<br>}</p>
<p>I made it for the ESP-01. It turns my Christmas tree lights on and off. Tip: If your Arduino IDE compiler freezes - check for odd characters in the RCswitch.h file.</p>
<p>Hi RoccoM1</p><p>it should work, but I do not have it tested</p>
<p>How do we know if this works with different outlets brand? I mean for example, is it possible to use this: http://www.brennenstuhl.com/en-DE/multi-way-extensions-und-plug-in-appliances/remote-control-set/remote-control-set-rcs-1000-n-comfort-1.html#wp_features ?</p>
<p>Hi OlivierD2</p><p>try entering the sketch</p><p>mySwitch.switchOn(&quot;100010&quot;, &quot;101001&quot;);</p><p>or</p><p>mySwitch.switchOn(100010101001);</p>
<p>Thx I will try ;)</p>
<p>How do you insert the code outlets, what is the syntax exactly ?</p><p>BLYNK_WRITE(0) { //virtual pin 0</p><p> mySwitch.switchOn(1, 1); // insert here your code outlets</p><p>}</p><p>If my outlet code is for example 100010101001, how is the syntax of the Arduino code just after mySwitch.switchOn(1,1); ?</p><p>thx for your reply</p>
<p>thanks Seamster</p>
<p>Nice work, and I love the dancing robot gif! So cool!</p>

About This Instructable

23,249views

73favorites

License:

More by catoplepa:ESP8266-12 blynk wireless simple virtual led ESP8266-12 blynk wireless temperature LM35 sensor ESP8266-12 blynk wireless temperature, humidity DHT22 sensor 
Add instructable to: