Menu Close

ESP8266 ESP-12E/F 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 ESP8266 ESP-12E/F on Arduino IDE. The output is taken on LED, It glows for a second and remain off for a second.

1. Introduction 

ESP-12E/F is designed and developed by Shenzhen Doctors of Intelligence & Technology (SZDOIT) based on the Ultra-low power consumption.ESP12E/F is specially for mobile devices and application of IoT (Internet of Things). Now, ESP-12E/F is widely applied to internet, communication in local area, intelligent home, industrial control, handed-devices, and etc.

The ESP-12E/F 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 Breakout 1
2ESP8266-ESP-12E/F 1
3Breadboard 1
4Male to Female jumper wire 8
5Arduino UNO 1
6LED 1
7Resistor 1K 1
6Male to male jumper wire 1

2.ESP-12E/F interfacing with FTDI

These pins function as follows:

1) The Output – is connected to GND pin of ESP-12E/F

2) The Output + is connected to VIN pin of ESP-12E/F

3) The FTDI board the RXI is connected to TX of ESP12E/F

4) The FTDI board the TX is connected to RX of ESP12E/F

5) The FTDI board the GND is connected to GND of ESP12E/F

3. How to Set Up ESP8266 ESP-12E/F in programming mode

Connect the FTDI to your PC through a USB port. The PWM led of the ESP12E/F module will switch on.

Set the output voltage to 5-7.5v voltage.Than in ESP12E/F follow these steps:-

1) Press the GPIO0 button and keep it pressed

2) Press the reset button and keep it pressed

3) Release the reset button

4) Release the GPIO0 button

If a green light will switch on in LED2 on the ESP-12E/F module, then your ESP-12E/F 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-12E/F Sketch) from here.

// Robo India Tutorial 
// Digital Output on LED 


const int LED = 4; // 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-12E/F 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.

8. 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 support@roboindia.com

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


Leave a Reply