Blink an external led with ESP8266

Overview

Teaching: 0 min
Exercises: 0 min
Questions
  • How to use an external led with an ESP8266?

  • How to write a program to blink an external led?

Objectives
  • Become familar with ESP8266

  • Create a circuit with an external led and ESP8266

  • Write a program to blink an external led with an ESP8266

Now that your ESP8266 is fully installed and working on your laptop, we can start to add an external led and control it via a program.

Using GPIOs of the ESP8266

Before using an available GPIO (General Purpose Input/Output) from our ESP8266 board, let’s have a look at them:

ESP8266-12 GPIOs

LED (light-Emitting Diode)

A LED is an electronic component which glows when a voltage is applied.

ESP8266-12 GPIOs

Be careful the led has to be connected in the correct direction otherwise it will be damaged.

The correct direction is:

In our example, a 220 Ohm will be used (I = U / R = 3.3 / 220 = 0.015 A = 15 mA).

Use the breadboard and the wires to connect the resistor, the LED and the ESP8266 together as follow:

ESP8266-12 GPIOs

ESP8266-12 GPIOs

ESP8266-12 GPIOs

ESP8266-12 GPIOs

Tips for the breadboard

Breadboards consist of tiny “holes” in which the leads of the component connect into.

ESP8266-12 GPIOs

But holes are not all connected to each others.

breadbord connections

More information can be found here

Check your electronic circuit before running your programm.

Run your program

If everything is OK, your LED should blink!

Key Points

  • Use a breadboard and an external led

  • Write and run a program to blink an external led