Introduction: ESP8266/Arduino SmartThings Relay for Christmas Lights

SmartPlugs SmartPlugs Everywhere...except when you run out of them and Wifey wants the 'Motorized and Lighted Santa Scene' she just bought to fire up with the rest of the Christmas lights and tree at the same time. ENTER ESP8266 and ARDUINO!! (And a few other technologies).

We have a Samsung SmartThings Hub controlling lights and plugs all over the house already. I also have TONS of ESP's and Arduino goodies stockpiled and always ready for action. For this project, an ESP8266 ESP12E, Single channel relay, a modified extension cord, and some SmartThings expertise saved me a trip to the hardware store for a new SmartPlug.

Check out this Video of it in action and the steps ahead to start building.

HAPPY HOLIDAYS EVERYONE!

If you are new to the Arduino world, check out Programming Electronics Academy. This is where I got started blinking by first LED and HELLO WORLD!!

Step 1: What You'll Need - Hardware (Tailored for ESP8266-ESP12E...others WILL Work!)

Picture of What You'll Need - Hardware (Tailored for ESP8266-ESP12E...others WILL Work!)

  1. ESP8266 ESP12E NodeMCU1.0
  2. Single Channel Relay
  3. Mini Breadboard
  4. Jumpers
  5. Generic household extension cord
  6. Container to hold components
  7. Samsung SmartThings 2.0 Hub

Step 2: What You'll Need - Software

Picture of What You'll Need - Software

ASSUMPTIONS: Comfortable working with Arduino IDE, Libraries, SmartThings IDE and GITHub.

  1. Aduino IDE
  2. Samsungs SmartThings IDE
  3. SmartThings Android App
  4. GITHub

Step 3: Hardware Setup & Electrical

Picture of Hardware Setup & Electrical

Extension Cord Modification:

  1. Split the 2 wires of the cord apart with a utility knife or similar. Choose a location along the length that makes sense for your setup/configuration.
  2. Look at your extension cord’s plug: one prong is larger than the other. Cut the wire that runs to the smaller prong, and strip 1" off each side.

CUT TIP: The correct wire is the one without ridges running along its length.

For more detailed steps on this step, take a look here. It got me on the right track with using relays in such a manner.

Controller/Relay Connections:

ESP8266----------------------Relay--------------------Cord--------------------Appliance
5V--------------------------------5V

Grd-------------------------------Grd

D1--------------------------------Data

Common--------------Thin_Blade Cut_1 NC or NO-------------Thin_Blade Cut_2

Wide_Blade-------------Plug

Step 4: Software Setup - All of It - Final Step

Picture of Software Setup - All of It - Final Step

ASSUMPTIONS: Comfortable working with Arduino IDE, Libraries, SmartThings IDE and GITHub.

I connected the relay to the D1 pin ON THE ESP, and use the (switch1) device in the SmartThings App. It has been added without issue to SmartThings rules and scenes. The pic attached shows some of the devices added when using his included sketch ST_Anything_Multiples_ESP8266WiFi

Use one of the many Arduino starter kit plastic boxes you probably have laying around as a container for it. It worked for me...another pic attached to see it.

I know there is a lot of information and configuration but it is worth it. PLEASE feel free to ask any questions you may have along the way. In addition, the SmartThings Forum for this project is a GREAT place for tips and advice.

Comments

About This Instructable

661views

12favorites

License:

More by johnnyfrx:ESP8266/ESP-01 Arduino Powered MQTT Leak Detector & Remote Alarm ReceiverESP8266/ESP-01 Arduino Powered Leak DetectorESP8266/Arduino SmartThings Relay for Christmas Lights
Add instructable to: