Introduction: Controlling a Relay From Your Phone Using Blynk

About: If you enjoy my projects, consider becoming my Patreon:

In this instructable I will show you how you can turn on/off a relay from your smart phone

Step 1: Materials

For this you will need:

-Node MCU(or other wifi enabled developing boards)

-A relay

-Some wires(I used a breadboard to connect everything but you can solder the wires for a more "permanent" solution)

Step 2: The App

For controlling the Node MCU,I will be using Blynk.You will need to download Blynk on your phone.

After opening the app,you will need to register.After registration,create a new project.The auth token will be send to your e-mail adress(you will need it later)

Now,from the plus icon(The widget box) you will need a button to control the relay.After dragging the button,click on it.Press on the button called "PIN" and select the pin you will placing the S(signal) of the relay.In my case,it is D0.Also make sure that the button is in the "Switch" position not in the "Button" position.

If you have been able to set up the app,let's get to the code

Step 3: The Code

You will need to download the blynk library:

1.Download the latest release .zip file by clicking HERE.

2.Unzip it. You will notice that archive contains several folders and several libraries.

3.Copy all these libraries to your_sketchbook_folder of Arduino IDE. To find the location of your_sketchbook_folder, go to top menu in Arduino IDE: File -> Preferences (if you are using Mac OS - go to Arduino → Preferences)

After you installed the libraries,go to examples > Blynk > Boards_WiFi > Node MCU(or what board you are using)

You will need to put your wifi ssid and password and the auth token send by Blink in your e-mail.

MAKE SURE that before uploading the code,you hold down the flash button(located beside the usb port).

Step 4: Done

After uploading the code,open the Blynk app and press the button.The relay should turn on.

If you liked this instructable,check out my YouTube chanel: Ferferite