ESP8266 Board LED by using Adafruit MQTT Broker

ESP8266 Board LED by using Adafruit MQTT Broker 25

ESP8266 Board LED by using Adafruit MQTT BrokerIn this article we are going to learn how to use Adafruit MQTT broker and turn ON/OFF ESP8266 LED. And if you want to know how to install Adafruit and how to use it then read this article till the end. I hope this article help you in your project.


Requirement for this project is

  1. ESP8266 board
  2. Adafruit MQTT broker
  3. and rest of the work is done by coding.


Adafruit MQTT broker

We need to create an account on Adafruit. click on this to open Adafruit Website. If you want know what is the Adafruit MQTT broker then Click on this link. A step by step tutorial for beginner

Follow the following steps to create an account on Adafruit MQTT broker.

  1. Create an account by click on sign in

Adafruit MQTT broker


  1. Create an account here or if you have already an account just sign it.


Adafruit MQTT broker2



  1. After that, this window will appear on your screen. Click on the Actions>>Create a New Dashboard


Adafruit MQTT broker


  1. After that a new window will appear on the screen. You can create dashboard name here. Give a friendly name. Description is optional you can either skip it or fill it. Then click on create.


Adafruit MQTT broker



  1. This will create a new dashboard by using name workstation.


  1. Now you can create block by using the plus sign. Then click on this plus sign. A new window will pop up on your screen.

pop up on your screen.

ON/OFF— ESP8266 Board LED by using Adafruit MQTT Broker

Here you have got a lot of option but for this project we need ON-OFF block. This is very reliable you can change it according to you project.

  1. Choose your feed name. In this project we name it as “onoff”. And then click on  create. And follow the next step.

  1. After that you can modify your block. Create a block title and button name Here:
  • 1 means ON
  • 0 means OFF


Then click on create block.


  1. Finally, you successfully create a block in Adafruit MQTT Broker. You can make changes whenever you like by clicking on setting button.


  1. Now move on the coding.





Copy the given code.








#Here is code


You should add network credentials. Type your Wi-Fi router name and password.

Next you need to insert block user name and regenerate key.  You get it through Adafruit. just click on Adafruit IO Key on the top right corner f the screen.




Copy these two keys and put it in your code.


This part is subscribing on the interested topic by using payload. Low means power off and high means power on.










Finally Upload the code.

As you can see that when we click on the 0 LED turn off and when we click on 1 the LED turn on.


ESP8266 Board LED by using Adafruit MQTT BrokerThis is the basic phenomena of how to turn LED OFF and ON y using Adafruit MQTT broker.


Let us know if you have any issue related to this topic in the below comment section. We’ll feel grateful to solve your issue. Thank you!


nodemcu esp8266 library for proteus

ESP8266 Adafruit MQTT Broker




ESP8266 Board LED by using Adafruit MQTT Broker


Leave a Reply

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