The objective of this tutorial is to light up an LED by the ESP32 board.
ESP32
ESP32 is a series of low-cost, low-power system-on-a-chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series of microcontrollers is developed by Espressif Systems, a Chinese company based in Shanghai.
The ESP32 is designed for use in a wide range of applications, including Internet of Things (IoT) devices, home automation systems, and wearable electronics. It features a dual-core processor, 4MB of flash memory, and 520KB of SRAM. It also includes a number of peripheral interfaces, such as SPI, I2C, UART, and PWM, as well as a built-in touch sensor and Hall effect sensor.
The ESP32 also supports a range of wireless connectivity options, including Wi-Fi (IEEE 802.11b/g/n), Bluetooth 4.2 and 5.0, and Bluetooth Low Energy (BLE). The Wi-Fi module supports both station and access point modes, making it easy to connect to existing networks or create your own.
The ESP32 can be programmed using the Arduino IDE, the ESP-IDF, or the MicroPython firmware. It also supports OTA(over the air) firmware updates, making it easy to update the device’s firmware without having to physically access it.
Overall, the ESP32 is a powerful, low-cost, and versatile microcontroller that can be used for a wide range of applications.
1 LED
An LED, or light-emitting diode, is a type of semiconductor device that emits light when a current is passed through it. LEDs are widely used in a variety of applications, including electronic devices, automotive lighting, and traffic signals.
LEDs are made up of a semiconductor material, such as silicon or gallium arsenide, that forms a diode. When a voltage is applied to the diode, electrons are able to recombine with holes, which releases energy in the form of light. The color of the light emitted by an LED depends on the materials used to make the diode. For example, red LEDs are made from gallium arsenide phosphide, while blue and green LEDs are made from gallium nitride.
LEDs are known for their energy efficiency, long lifespan, and fast switching speeds. They use less power than traditional incandescent bulbs, and last for tens of thousands of hours. They also have the ability to switch on and off very quickly, which makes them ideal for use in high-speed communication systems and digital displays.
LEDs are very versatile, they can be used in different ways and forms, they can be used in single or multiple units, they can be used in different voltages and currents. And they can be controlled by a microcontroller like the ESP32, to create different effects.
resistance of 220Ω
Resistance is the property of a material that opposes the flow of electric current through it. It is measured in units of ohms (Ω). The resistance of a material is determined by its composition and the temperature at which it is operating.
In the case of an LED, using a current-limiting resistor is important to protect the LED from damage and to ensure that it operates within its safe range of forward current and voltage.
Connecting wires
Connecting wires refers to the process of physically connecting wires or cables to a device or circuit in order to establish an electrical connection. This can be done by using various connectors such as plugs, sockets, or terminal blocks. The wires are typically color-coded to indicate their function, such as red for power, black for ground, and yellow for signals.
Test plate
A test plate is a type of circuit board that is used to test electronic components. It typically consists of a flat board made of a non-conductive material, such as plastic or fiberglass, with a number of holes or pads that are used to connect electronic components. The test plate allows you to connect electronic components and test them easily.
As for mounting, it is easy to connect LEDs to ESP32.
We connect pin D23 of the ESP32 card to the resistor tab
Then, we connect the second leg of the resistor to the anode (+ terminal) of the LED
Finally we connect the cathode (terminal -) of LED to the GND of the ESP32 board.
1 2 3 4 5 |
from machine import Pin led=Pin(23,Pin.OUT) # Règle la broche D23 de la carte ESP32 en mode sortie while True: led.value(1) # Allumer la LED |