ESP8266 Led Brightness control using Blynk and Arduino IoT Cloud

(Last Updated On: March 7, 2022)

ESP8266 LED Brightness Control:

ESP8266 Led Brightness control using Blynk and Arduino IoT Cloud- In this article, you will learn how to control the brightness of LED using the Blynk application and Arduino IoT Cloud. First we will do it using the Blynk application and then we will do it with it using the Arduino IoT cloud. Controlling the Brightness of LED! Seriously? You may think of it as a very basic project, but trust me, once you learn how to control the Led brightness then you can control the speed of anything e.g speed of a DC motor, stepper motor, brushless motor, etc.  Since we are using ESP8266 Nodemcu module with Blynk and Arduino IoT Cloud so we can control the LED brightness from anywhere in the world. The reason, I decided to start with the LED is because LEDs can be easily arranged, and moreover, I don’t to complicate things.

  • NodeMCU ESP8266
  • LED


Amazon Links:

Nodemcu ESP8266 WiFi Module:

Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!



Led interfacing with ESP8266 Nodemcu:

Now to make the circuit we will perform the following steps:

  • Connect the anode of the led which is the positive terminal of the led with the digital pin D2. We can also use the built-in led of the NodeMCU which is D0.
  • Connect the cathode of the led which is the negative terminal of the led with the ground.
  • It’s good to use a 330-ohm current limiting resistor with any of the two legs of the LED.

ESP8266 Led brightness control

Designing Blynk app for controlling LED brightness:

First of all we will install the Blynk app in the mobile if it is not installed. Once you have downloaded and installed the Blynk application; then you can open the Blynk application.

Now click on the New Project

ESP8266 Led brightness control

After clicking on the New project we will select the name of the new project which is “Led control”  and in the device select the NodeMCU and in the connection type select the Wi-Fi and click on the create.

ESP8266 Led brightness control

When you click on the Create button an authentication token will be sent on your registered email ide.

ESP8266 Led brightness control


Now after that we will add the slider we can select the horizontal or vertical slider. So we will select the horizontal slider and set its dimensions.

ESP8266 Led brightness control

Now we will add the gauge; again go to the widget box and select the gauge.

ESP8266 Led brightness control

Insert the gauge.

Now click on the slider and select the pin which you are using as we are using the virtual pin so we will select the virtual pin V0 and click on the OK.

ESP8266 Led brightness control


Then set its range from 0 to 255.

ESP8266 Led brightness control

Then select the gauge and select the pin which is virtual pin V1.

ESP8266 Led brightness control

Now again set its value from 0 to 255

ESP8266 Led brightness control

In push select 1 second

ESP8266 Led brightness control

Now our app is completed

ESP8266 Led brightness control


ESP8266 LED brightness control code:

One thing to remember while writing the code the SSID is the name of the Wi-Fi connection or router and pass is the password of the Wi-Fi router.

Complete code:

Then upload the code to the NodeMCU ESP8266, open the Blynk application in the Mobile, and by changing the value of the slider you will be able to change the brightness of the led.



LED brightness control using Arduino IoT Cloud:

Now we will control the same LED brightness using the Arduino IoT cloud. So in order to control the led we will first create the application; so we will perform the following steps:

First we will create the variable of integer type with the name led

ESP8266 Led brightness control

Now the led variable is created and now we will configure the device

ESP8266 Led brightness control

Now, we will select the device so click on the select device and then select the third party device and in the select type device we will select the ESP8266 and select NodeMCU 1.0 and click on the continue button.

ESP8266 Led brightness control

Then we will give a name to the device, in our case we are giving the name My_Node_MCU and click on the next button.

ESP8266 Led brightness control

Now in order to make the device ready to use we will click on the download button and save the security id and secret key which will be used in network connection. If its hard for you to follow the steps then you can read my getting started article on the Arduino IoT Cloud.

After that we will configure the network; so click on the network button to give the SSID which is the name of the Wifi which we are using and give the password and paste the secret key which we have copied in the add device and click on the save button.


Designing the dashboard on Arduino IoT Cloud:

Now we will click on the dashboard and click on the add button to insert the slider and link it with the led variable.

ESP8266 Led brightness control

 

Then insert the gauge and link it with led button.

ESP8266 Led brightness control

Then we will set the limit for slider and gauge just click on the slider and write the minimum and maximum limits which are:

ESP8266 Led brightness control

Finally, our Arduino IoT Cloud Dashboard is ready.

ESP8266 Led brightness control


ESP8266 LED Brightness Control Arduino IoT Cloud Code:

Now in order to upload the code we will click on the sketch to write the code

To upload the code, you will have to select the board type and the port number, I have already talked about this in my previous articles on the Arduino IoT Cloud. So, once you have uploaded the code then you can use the Slider to control the brightness of LED.

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

%d bloggers like this: