Menu Close

ESP-01(ESP8266) Digital Output – LED Blinking on Arduino IDE

This tutorial of Robo India explains the basics of input and output programming in physical computing world. This tutorial teaches how to take digital output from  ESP-01(ESP8266) on Arduino IDE. The output is taken on LED, It glows for a second and remain off for a second.

1. Introduction 

This is a breakout board for popular ESP-01(ESP8266) module operated at 5 Volt.

The ESP8266 is designed by a Chinese company Espressif .It is a simple application and they easy add a connectivity to another microcontroller, which is very limited number of exposed pins

The ESP-01(Esp8266) is a basic tutorial for digital input and output in physical computing. Here we are taking digital output on a LED. This LED remains ON for one second and OFF for another, this loop runs for an infinite time.

 1.2 Hardware required

S.No.ItemQuantity
1FTDI Basic 1
2ESP8266 ESP-01 Breakout Board 1
3Breadboard 1
4LED 1
5Resistor 1k 1
6Jumper Male to male 4

Users can buy ESP-01(ESP8266) from Robo India Shop: https://roboindia.com/store/esp8266-esp01-breakout-board

2. Features

These pins function as follows:

1) Can be programmed using standard 5v FTDI Module.

2) Separate Pin Out for mounting on Breadboard.

3) On board flash and Reset switch.

4) Inbuilt 3.3v Voltage Regulator.

3. How to set up ESP-01(ESP8266) in programming mode

Connect the FTDI to your PC through a USB port. The red led of the ESP module will switch on.

The button on the side of the breadboard is reset button, while the other button is the is GPIO0.

1) Press the reset button and keep it pressed

2) Press the GPIO0 button and keep it pressed.

3) Release the reset button

4) Release the GPIO0 button

If a blue light will switch on momentarily on the ESP module, then your ESP is in programming mode

4. Connections

5. Programming:

Once we are done with circuit part, here is our programme to this circuit.

You may download this code (ESP-01 Sketch) from here.

// Robo India Tutorial 
// Digital Output on LED 


const int LED = 0; // Assigning Pin 4 as the name LED
void setup ()  
{
     pinMode (LED, OUTPUT); // Declaring LED pin as an output.
}
void loop () // Code under this loop runs forever.
{
    digitalWrite (LED, HIGH); // Making LED High.
    delay(1000);              // Some Delay
    digitalWrite (LED, LOW);  // Making LED LOW.
    delay(1000);              // Some Delay
}

6.Upload Your Sketch

1) Open the Arduino IDE.In the Arduino IDE, under Tools –> Board, select “Generic ESP8266 Module”.

2) Select the port in which the ESP module is connected.

3) Than copy and paste the code in Arduino IDE

7. Output

After successful uploading of the code, the execution of the code makes the LED on for one second and off for another one second. This happens in an infinite loop. Thus the LED keeps blinking.

7. Troubleshooting

LED is not glowing: Try changing polarity of LED, Pull it out, rotate it by 180 degree and insert bit again.
Code uploading error: The code will only be uploaded when there is no error in the code. Try removing error, if any.
General error: Never keep open circuit on a metallic surface. It may shorten the circuit.

If you have any query please write us at info@roboindia.com

Thanks and Regards
Content Development Team 
Robo India
https://roboindia.com

Leave a Reply