Smart Plug/Outlet is used for turning on/off electric current and for measuring electricity usage. It uses the solid state relay module connected to NodeMCU ESP8266. The output is displayed using justgate on HTML5. Data exchange between the relay and the HTML5 is performed over the Microgear Library. We need to install one Microgear on ESP8266 and another Microgear on HTML5.

Components

  • NodeMCU ESP8266

  • Power Outlet
  • Solid State Relay SSR Module

Schematic Diagram

NodeMCU pin diagram

Programming

ESP8266 NodeMCU Development Kit

Download Microgear library for esp8266 arduino here

code :

HTML5

Download Microgear library for html5 here

code :

Result

Download Smart Plug’s source code here

Don’t forget to change your ssid, password, APPID, APPKEY and APPSECRET otherwise you may not connect to NETPIE.