Site Loader
Get APP
Zlatiborska 10a

 

Why you should make your own smart sockets?

  • Because it’s fun and you’ll learn something new.
  • Because you’ll be able to automate your home and do lots of cool things with it.
  • Because it’s cheaper than commercial alternatives, especially if you want to own multiple ones. I make mine under 10$.

 

Gathering Materials

 

  • Isolated switch power supply module AC-DC – link
  • ESP8266 5V WiFi Relay Module – link
  • Wall socket – link (i use different from local store)

 

 

Programming your ESP8266

 

JSON:

 

Code Walkthrough: IoT Device

For controlling device over the internet we add the code that allows us to connect to our local Wi-Fi network, and run a simple webserver.  In the setup() function, we configure the pin as an OUTPUT, use the WiFi object to connect to our local Wi-Fi network, and print out the assigned IP address.  Then, we use the server object to create 2 routes to our ESP8266 application.  We want to print out a “usage message” (in JSON format) when a user navigates to the top level path “/”, and we want to toggle the relay on and off when a user navigates to the “/rel=on” or “/rel=off” path.

Controlling this device is over ESP8266 Home android application. You can install this application or read manual

 

 



 

If you like my work 🙂


 

Also my code is free but my time not, so if you need talk with me put 5$ on

Post Author: Admin

Leave a Reply

Your email address will not be published. Required fields are marked *