ESP8266/Arduino SmartThings Relay for Christmas Lights

by johnnyfrx in Circuits > Microcontrollers

7879 Views, 22 Favorites, 0 Comments

ESP8266/Arduino SmartThings Relay for Christmas Lights

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!!

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

ESP8266 12 NodeMCU_1.jpg
relay_wiring_cropped.jpg
half breadboard.JPG
jumpers.jpg
Extension Cord.jpg
SEA_boxesHub.94.jpg
IMG_20171206_095253472-800x600.jpg
  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

What You'll Need - Software

arduino.png
Nm_ide_loginscreen.jpg
rsi-lmt-SmartThingsPhoneScreenFill-708-SmartThings-063016.jpg
logo-github-fe55a081ff239877f791f5882f9c3cddc371653c88d9b06f504ea10f453996ed.jpg

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

  1. Arduino IDE
  2. Samsung SmartThings IDE
  3. SmartThings Android App
  4. GITHub

Hardware Setup & Electrical

extension_cord_Cut.jpg
IMG_20171206_094819495-800x600.jpg

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

Software Setup - All of It - Final Step

ScreenHunter 117.jpg
Ogiewon_SmartThings_App.PNG
IMG_20171206_095242367-600x800.jpg
IMG_20171206_094830320-800x600.jpg

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.