A number of my projects use an ESP microcontroller. And in those projects, I show wiring diagrams and talk about things like GPIO pins, power options, etc. but if you are new to the ESP boards, you might be wondering why I make some of the decisions that I do or want to know more about the ESPx so that you can start designing and building your own projects. This article will provide an introduction and overview of the ESP family of microcontrollers.
ESP Chips vs. Development Boards
To begin, it is important to understand some common terminology. Generally, when someone (myself included) speaks about using an ESP8266 or an ESP32, they are normally referring to the ESP System-on-a-Chip (SoC) installed on some sort of breakout or development board.
 |
The same ESP "chip" on two different development boards |
The ESP chip itself has anywhere from 24 to 48 "pins" that can be connected. If you look closely at the images above, you can see these "pins" closely packed around 3 sides of the ESP32. However, these are surface-mount and very close together, making it very difficult to solder connections to the chip.
As a beginner, and even as an intermediate, you likely will not work directly with the ESP chip itself, but will instead use a breakout or development (dev) board. These boards breakout those "pins" into more convenient connections. Most boards also provide additional features, like a power regulator, boot button(s) and a USB connection for both power and programming.
When I (and most others) say that their project uses an ESP8266 or ESP32, unless specifically stated otherwise, it refers to the ESP8266 or ESP32 installed on some sort of development board. In many cases, different styles of dev boards can be substituted for one another as long as the type of ESP chip is the same. In other cases, some dev boards may not make the same pins available. Check a project's documentation to see what types of chips and boards it supports. If creating your own project, determine the number and types of pins (and other features) you will need and select your development board based on those needs.
The Espressif Family
The ESP SoC family consists of two major "categories"... the ESP8266 and the ESP32.
The ESP8266
Originally released in the fall of 2014 by AI-Thinker as the ESP-01 module, the ESP8266 was the first ESP controller that was picked up by the maker community. Numerous other development boards would follow. A big features of the ESP8266 included built-in WiFi and a TCP/IP networking stack.
Over the next couple of years, a few revisions of the original WROOM would be released and numerous "modules", from the first ESP-01 through ESP-14 would be released as well. Combine these with different styles of breakout or dev boards and there were dozens and dozens of different ESP8266 options.
The ESP32
The first ESP32 module was released in August, 2016 by Espressif as the ESP-WROOM-32. It was designed as the successor to the ESP8266, having a substantially improved core processor speed, more memory, more configurable pins and bluetooth onboard. Since the original release, a number of additional "series" of ESP32 chips have been released. These include the S-series, H-series, C-Series and the recently announced P-series.
Unlike the ESP8266, these different "series" of ESP32 chips offer significantly different features, with some having support for WiFi-6 and others without WiFi. Even the original ESP32 chip has various revisions, with the most common being WROOM and WROVER. Combine all these with the various dev board styles and you can literally find hundreds of different ESP32 models for your DIY project. In most cases, unless you have special needs or requirements, any of the standard dev boards using an ESP32-WROOMx or ESP32-WROVERx will work for your project.
ESP8266 or ESP32?
So, given all the various models available, how do your select the proper ESP and dev board for your project? Just a couple of years ago, I always recommended that you use an ESP8266 instead of the ESP32 unless you needed the extra processing power or features (like Bluetooth, touch-enabled pins, etc.) only found on the ESP32.
At that time, an ESP32 was 3-4 times more expensive than an ESP8266. If you were doing something like just connecting a few sensors, then the extra horsepower of the ESP32 simply wasn't needed and was a waste of money. However, ESP32 boards have fallen in price, and while still slightly more expensive than an ESP8266, the gap isn't as large. But the biggest issue is that the ESP8266 is nearing end-of-life.
ESP8266 End of Life
The ESP8266 was released in 2014. Espressif has pledge support and development for each of its chips for a minimum period of 12 years. This means that future development for the ESP8266 may stop in 2026 (update: Support for the ESP8266 and original ESP32 has been extended for an additional 3 years, for a total of 15 years). In addition, you are seeing other projects and firmware, such as WLED, moving towards the ESP32 with the ESP8266 no longer recommended.
While the ESP8266 will continue to function and will still be able to be programmed, the future is with the ESP32 so I now recommend use of the ESP32 unless you have a simple project or a certain need for an ESP8266.
For this reason, the remainder of this article will focus on the ESP32, but many of the details and options apply to both families and I'll try to note any major differences below.
Primary Components
While there is a wide variety in types of dev boards, most will have these common components.
 |
Click to enlarge |
ESP32 Chip
The ESP32 chip is obviously the primary component here. This particular board/chip has an integrated WiFi antenna which is the small black area on the right edge of the board. Other types of dev boards may contain a connection for an external antenna.
Voltage Regulator
The ESP32 chip itself requires a consistent 3.3V to operate. Yet USB ports operate at 5V. The voltage regulator "steps down" a higher voltage to a consistent 3.3V for powering the chip. The two most common regulators for the ESP32 are the LM317 and the AMS/LM1117x. These chips can actually take voltages above 5V and still safely supply 3.3V to the ESP32. This means it is possible to use something like 4 AA batteries in series (6V) or even a 9V battery to power the board. Do note that most regulators are limited to a maximum of 1A of current. More on powering the board is provided below.
Note: Some cheaper dev board "clones" may substitute a lower cost regulator. This can cause power issues or even damage the ESP32 if too much voltage is fed into the board. Always check the specs before attempting to power your dev board with anything more than 5V.
USB-to-UART
This IC "translates" communications from USB to serial (or UART). Serial communication is used to flash firmware or otherwise communicate directly with the ESP32 chip. The most common chip for the ESP32 is the CP210x series. ESP8266 and a few ESP32 dev boards may make use of the CH340 chip. Either generally work, but you must have the appropriate drivers installed on your machine that will be used to flash or upload code to the ESP32. More on code later.
Onboard LED(s)
Most dev boards contain at least one, and many may have two or more) LEDs. Often these LEDs are a single color (red, blue, etc.) but some dev boards may contain RGB LEDs. One LED generally shows when power is supplied to the board. But these LEDs are also normally connected to a GPIO pin so they can be controlled via your firmware or code (or even via an external component).
USB Port
Older boards almost exclusively used a microUSB connection. But some newer boards have switch to USB-C for the connector. Regardless, the USB port can be used to supply 5V power to the board in addition to flashing code or firmware to the ESP32 chip.
Enable Button/EN Pin
This button is used to reset or restart the ESP32. Some dev boards also provide an EN pin.
This is called the 'enable' button because it enables or disables the onboard voltage regulator. When the button is pressed, the voltage regulator is pulled to ground, effectively cutting off power to the ESP32. When released, power is restored and the ESP32 restarts.
The EN pin (if provided) can also be used to pull the voltage regulator to ground and reset the board. For example, you could connect a push button that when pressed would connect the EN pin to ground. You could then use this external button to restart the board.
Boot Button / GPIO0
This button, if present, may need to be pressed and held to put the ESP32 into 'bootloader' or flashing mode. The button is normally connected to GPIO0 and if broken out, the board can also be placed into flashing mode by pulling this pin to ground when power is supplied.
Not every board needs to manually be placed into bootloader mode. Many dev boards will accept a signal from the flashing software. But if you have problems establishing a connection when attempting to flash, then you may need to use the BOOT (bootloader) button. You can do this by either holding down the BOOT button when plugging in the USB cable (applying power) or you can apply power, press and hold the BOOT button followed by pressing and releasing the EN button (reboots the board). The BOOT button can then be released.
GPIO Pins
GPIO, or General Purpose Input/Output pins, are used to connect external components to the ESP board. A standard ESP32 has up to 48 pins available, while the ESP8266 only has 17 usable pins. Some of these pins are reserved and not every development board breaks out all available pins for use. For example:
Typical Dev Board
|
‘Available’ Pins*
|
ESP8266 NodeMCU
|
30
|
ESP8266 D1 Mini
|
16
|
|
|
ESP32 ‘NodeMCU’
|
36
|
ESP32 ‘Mini’
|
40
|
*Not all available pins are usable for GPIO/firmware use. Some pins are for power/ground connections and others are reserved and cannot be used. In addition, some dev boards may have multiple power and ground connection pins, which allow peripheral connections but really aren't pins that can be used for input/output.
As a general rule, the GPIO pin use on the ESP32 is much more flexible than the ESP8266, which has predefined pins use for many of its GPIO functions. For example, the ESP8266 only has a single analog input pin, generally labeled 'A0'. This pin can only be used for analog input. The ESP32 on the other hand has up to 18 different channels for analog input (all 18 may not be broken out on every dev board). But these pins can also be defined for digital I/O in addition to use as analog input.
And not every pin that is broken out can be used for general I/O and other pins have to be used with caution, as they are part of the boot or startup process.
So how do you know which pins can be used and that the types of pins for your particular project are available? For this, you need to look at the pin out for your particular development board.
 |
Click to enlarge |
Your board may come with its own documentation on the GPIO pins, but if not then the Random Nerd Tutorials website has substantial information on both the ESP8266 and ESP32 pinouts and is an excellent reference source when it comes to both GPIO pins and how to use different types of peripherals with the ESP board. In addition, there are great charts for both the ESP32 and ESP8266 on recommend pin use (and which to avoid for certain functions).
A chart like this is invaluable when first starting out and trying to determine which GPIO pin to use for a particular peripheral. GPIO pins marked with a red X should be avoided. Those marked in yellow should be used with caution. For example, note that GPIO12 above is marked with a yellow OK for input. The notes also state that this is a "strapping pin" meaning it is used as part of the boot process. If you connect an input component that holds this pin "high" (e.g. the pin is raised up to 3.3V), then the board will fail to boot when power is applied.
Also note that some boards (like the ESP8266 D1 Mini) use a different numbering scheme for the GPIO pins. While many boards simply label the pins with the actual GPIO number, boards like the D1 Mini use "D" letter/number designations that don't necessarily align with the GPIO number.
As you can see from the above pinout diagram, the 'D4' pin is actually GPIO2 and the 'D2' pin is actually GPIO4! This is why it is important to check the documentation/pinout of the actual board you are using so that you are making a connection to the GPIO pin you think you are connecting to!
The ESP32 generally has much more flexibility in how GPIO pins are defined and used. The ESP8266, for example, only has one analog input pin, A0, and this pin can only be used for analog input. The ESP32 on the other hand has up to 16 different pins that can be used for analog input. But these same pins can also be used for digital I/O as well. This doesn't necessarily mean that you can use any pin for any function. For example, 10 of these pins on the ESP32 are labeled ADC2. The ADC2 pins cannot be used for analog input at the same time as WiFi. This is why it is important to check the documentation for the particular types of pins, and which ones, to use based on your project. I'll leave links to the Random Nerd Tutorial site for both the ESP8266 and ESP32 at the end of this article.
Power and Power Pins
As mentioned above, the ESP chip itself is powered by 3.3V yet most development boards are powered by 5V. An onboard voltage regulator handles the incoming 5V and steps it down to the 3.3V needed. This gives you multiple ways to power your ESP board.
While there are multiple ways to power your development board, there is one very important caveat. Never power the board by more than one power source at a time! For example, do not connect the board to a USB power source at the same time that power is applied via the VIN or 3.3V pin (normally labeled 3V3). Doing so will likely damage the ESP and may also damage any connected peripherals, including the USB power source.
USB Port
The USB port is an easy and convenient way of powering your board. It is also the way that you will initially program or flash code to the ESP. Since the ESP board itself draws very little current (<1 A), the board can safely be powered and programmed from a USB port on a computer.
When powering via USB, the VIN pin will output 5V and the 3V3 pin will output 3.3V. These pins can be used to power low current peripherals (see info on current considerations below). Some development boards may provide additional power pins (usually 3.3V) and ground connections to facilitate additional peripheral connections. But there are other ways to power multiple peripherals even if there aren't enough power pins on your board. More on that in a bit.
VIN (5V) Pin
The VIN pin (and ground) can also be used to power the board. Simply connect the positive lead from the power supply to the VIN pin and the negative lead to GND. The VIN pin, like the USB port, is connected to the power regulator, so you aren't necessarily limited to 5V but by the upper end of the power regulator. This means that you can use these pins to also power your board by something like a battery. In fact, some development boards include a special battery connector and even a special circuit for charging rechargeable batteries.
When powering the board via the VIN pin, always remember to disconnect the external power source before connecting the board to USB for flashing or coding. As mentioned above, connecting more than one power source to the board at the same time will likely damage or destroy the board and may damage connected peripherals as well.
3V3 (3.3V) Pin
Unless you have a special need, you normally would not power your board via the 3V3 pin. This pin is connected directly to the ESP chip and bypasses the onboard voltage regulator. This means that you need to assure a stable, consistent power source. Anything over 3.6V could damage the ESP. As a general rule, the 3V3 pin is used to provide power to 3.3V peripherals and not as incoming voltage source for board power.
GPIO Pin Input/Output Voltage
The "normal" (non-power) GPIO pins are generally connected directly to the ESP chip. Since the ESP chip runs at 3.3V, then the GPIO pins are also 3.3V tolerant. When connecting peripherals, there are often two power requirements to consider... power to run the peripheral (e.g. 5V power and ground) and then the power or voltage of the data signal received or sent.
In this example, I'm showing an AM312 PIR motion sensor. This has three pins available. Vin and GND are used to power the AM312 itself. This particular model has an operating voltage of 2.7-12V so it has a wide range. But we need to be concerned about the output voltage of the data signal, as this will connect to a GPIO pin, and these are only 3.3V tolerant. What is the voltage of the output signal? You need to check the specs of the component to know for sure. In the case of this particular AM312, it has an onboard voltage regulator (much like the ESP dev board) so it regulates the output signal to 3.3V regardless of the incoming voltage to power the device so it can be connected directly to a GPIO pin. The AM312 will output 0V (low) when there is no motion and 3.3V (high) when motion is detected.
But what if your component does not have a voltage regulator and the signal voltage is the same as the incoming power supply? As an example, say the above PIR sensor does not have the regulator and the output data signal will be at the same voltage as the incoming power. This means if we power the peripheral by 5V, it will also output a 5V (high) signal. And we can't connect this directly to a GPIO pin without potentially damaging the ESP. This is where logic level shifters come into play.
Logic Level Shifters
A logic level shifter is used to convert a digital signal between two voltages, normally 3.3V and 5V.
This is only one type of shifter (there are many others). This one happens to be a four channel bi-directional shifter. The four channels (shown as xV1 thru xV4) means that four different channels/signals can be shifted from this single component and the bi-directional means that signals can be shifted up or down. And if you need more than four signals, you can get shifters with more channels.
 |
An 8-channel logic level shifter |
A common use for a logic level shifter is when working with addressable LED strips. Most addressable LED strips (whether 5V, 12V or 24V) expect a 5V data signal. But the ESP only outputs a signal at 3.3V. While you can sometimes get away with the 3.3V signal when the data line is kept short, a more reliable method is to shift the 3.3V signal up to 5V before sending on to the LED strip.
Note: The types of shifters shown above are also known as I2C or I2C-compatible shifters (because they work with I2C signals). While I've used these in dozens of LED-based projects, some have claimed that this type of shifter is "too slow" for LEDs. The recommended shifter accomplishes the same function, but internally in a bit of a different manner.
This is an SN74AHCT125N a quad bus buffer gate integrated circuit (IC) and is the recommended shifter for addressable LEDs. If you want to know more about using ESP boards with LED strips, I have numerous other videos and blog articles that cover that subject in more detail.
Just know that you can use a logic level shifter to shift digital data signals between 3.3V and 5V. You cannot use a shifter to shift the voltage for powering a device. In other words, you cannot take the 3.3V output from the 3V3 pin and "shift" it up to 5V for powering a 5V device. For shifting voltage related to powering a device, you need a buck (shift down) or boost (shift up) converter. More about this under the next section.
Powering multiple peripherals
Most development boards make at least a single VIN (5V) pin and one 3V3 (3.3V) pin available. Some boards may provide additional 3.3V and GND connections for powering external components. But what if you have more components that require power than you have power pins? This is where something like a breadboard or prototype board can be beneficial.
In this example, a 5V power source is connected to the (+) and (-) of a power rail. The VIN and GND pins are connected to this rail to provide the 5V power for the board. On the opposite side (assuming this is where the 3V3 pin is located), the 3V3 pin and GND are connected to the (+) and (-) rows of the other power rail. This now gives a 5V and 3.3V power rail on each side of the breadboard for powering external components.
When ready or if desired, you can substitute something like an ElectroCookie Protoboard to create a soldered version of your project.
Since an ElectroCookie board is designed just like a breadboard, the same process can be used to create 5V and 3.3V power rails for powering external components.
Note however, these methods are only applicable for low power (current) devices! Most things like sensors only draw a few milliamps and can safely be connected to a breadboard or directly to the ESP power pins. Other devices, like relays or LED strips can draw too much power for the ESP or breadboard. In fact, a large number of LEDs can easily draw dozens of amps, which may melt or destroy components not rated for the high current.
Current (amp) Considerations
None of the present ESP designs are rated for high current. While the actual current limits may vary slightly based on board and design (and voltage regulator used), a general rule of thumb is that a single GPIO pin can handle up to 40 mA. The current that can be handled by the 5V pin depends upon the regulator, but generally should be kept to no more than around 250mA (remember that the ESP itself draws current, which is also passing through the regulator.
But what about if you create power rails like shown above so that the current for external peripherals isn't passing through the ESP? Well, breadboards and protoboards like the ElectroCookie still have relative small traces and can only safely handle around 1A. So what do you do if you need to power devices that use higher currents?
First off, the power supply itself should be rated to supply at least the expected current draw of all components. For example, if all components of your project could potentially draw 6A when fully in use, then you'd want to use something like a 10A power supply. Ideally, you want the power supply rated for around 20% or more than the estimated amps your project might draw.
Next, you can split the power feed from the supply and run it in parallel to the ESP/controller and any higher powered peripherals. For example, let's say we are building an LED project that will use 100 5V addressable LEDs that can potentially pull up to 6A at full brightness.
 |
Click to enlarge |
The above shows three different ways of powering the system.
In the top example, the ESP32 is powered via USB and then the LED strip is powered off the 5V and GND pins of the ESP32. This scenario has a couple of problems. First off, most USB power supplies are only capable of 2-3A. This isn't enough power to fully light the LEDs at maximum brightness. And even if the brightness is limited to drawing only 3A, this is still too much current for the ESP32 voltage regulator (usually rated for 1A). The LEDs may work for a while, but there is a high probability that running at this high current for an extended time will damage or destroy the ESP32. In addition, the USB power source is also likely to get hot and eventually fail as well.
In the middle example, we've replaced the power supply with a properly rated source (say 5V 10A). The LED power is run via the 5V power rail on the breadboard/ElectroCookie so it isn't passing through the ESP32. But breadboard is only rated for a maximum current of around 1A. So trying to run up to 6A via the breadboard/ElectroCookie runs the risk of overheating or even melting something like a breadboard.
The bottom example shows the recommended wiring when dealing with higher current peripherals. The power from the source itself is split with one set of leads running to the controller/ESP32 and a second set of leads running directly to the high current component.
 |
Click to enlarge |
As a general rule, if your project contains both low and high power (current) devices, you should 'split' the power from the primary supply and run the leads in parallel to the low/high power devices. Data or signal lines (which are generally very low current) can connect directly to the ESP32. Just remember to shift the voltage of any signal lines using a logic level shifter (described above) if needed as the GPIO pins are only 3.3V tolerant.
In addition to the components themselves, you should always assure that wiring, connectors, etc. are rated for the expected current. For example, trying to run 30A through 22 gauge wire may well cause the wire to overheat, melt the insulation and potentially create a short. This could even result in a fire. Always assure all components used in your circuit, including the power supply, are appropriate rated for the expected power! When it comes to wiring, there are numerous online charts and calculators that can help you determine the proper gauge wire to use based on expected current.
Failure to consider the current draw of some components (especially potentially high draws like with addressable LED strips) is one of the most common mistakes I see beginners make. I'm guilty of it myself... frying a number of components before I realized the current draw in my project far exceeded the rating of a particular component. You certainly don't need to be an electronics engineer for many of these projects, but it is important to at least understand Ohm's law (V=IR) and the relationship between voltage, current and resistance.
Voltage Considerations
The preceding section talked primary about current and high current vs. low current devices. But what if your project has components that require different voltages? For example, say you want to build an ESP32 LED controller (5V) that is going to be connected to 12V LEDs. There are actually a number of different ways to handle this situation. I'll cover a couple of the most common, using an LED strip as the higher voltage component. But these processes will work with any device that requires a different voltage from the ESP8266/ESP32 (5V).
Boost/Buck Converters
Like the logic level shifter is used to convert a digital data signal to a different voltage, you can use boost or buck converters to shift voltages for powering devices.
There is a very large variety of converters and unless you have a very unusual case, you will be able to find a converter to meet your needs. As a general rule, these converters accept a range of input voltages and either step those down (buck) or up (boost) to a different fixed output voltage. Some converters can both shift up and down and others have adjustments to change the fixed output voltage. Adding one to your circuit allows you to power components at different voltages.
In this example, a 12V power supply is used. Once again, the power is 'split'. One one 'leg', a buck converter is used to step the power down from 12V to 5V. Alternatively, you could use a 5V power supply and a boost converter to step that up to 12V. But the boost/buck converters also have a max current/amp rating, generally 3A or less. For this reason, you normally want to do the power conversion (step up or step down) on the lower current side.
Using multiple power supplies
You can use more than one power supply if necessary in your project.
For this example, a 5V power supply is used for the 5V components and a 12V power supply is used for the 12V components. When using this method, you must establish a common ground between the power supplies to avoid issues related to potential ground differences. However, you also need to design your circuit carefully to assure positive connections from different power supplies are never connected together! This may damage the power supplies and even destroy connected components. While it is possible to connect multiple power supplies of the same voltage together to either boost current (parallel) or voltage (series), extreme caution must be used and normally specialty power supplies that have a precise output are needed. As a general safety rule, never connect the positive leads from different power supplies together.
Between buck, boost and logic level converters, you can easily create projects that use components of different voltages. Again, as an important safety reminder, assure all wiring, components and connectors used are appropriately rated for the expected voltages and current of the circuit.
For any projects where power could be an issue, I create benchtop/breadboard versions first. Then I run the project at the max power (e.g LEDs at max bright white) and monitor all components and connections for heat. If any portion or component get any more than just slightly warm to the touch, I re-evaluate the circuit and consider different wiring, components or circuit design before creating any permanent version.
Code, Firmware and Flashing
OK... you've designed and maybe even built a circuit. But without some sort of code or "firmware" on the ESP board, nothing is going to happen. Now, before you bail because you are not a coder and don't want to learn how to write code, it doesn't mean you can't complete your project! There are all sorts of open-source, free versions of firmware available that you can use for your project. You just need to check the firmware's documentation to assure you are using compatible hardware. Here are just a few examples:
WLED
If you want to control addressable LEDs, then it is hard to beat the free, open-source WLED firmware. With hundreds of effects and options like presets and playlists, it offers easy installation by just plugging in the ESP to your computer via USB cable and visiting the installation web site. The rest is point-and-click. No coding required!
Tasmota
Tasmota can be used with many types of components, such as sensors, switches, relays, etc. It doesn't require any code (although a few settings may be specified via a command line... but it is well-documented) and like WLED, can be installed via a simple web browser.
ESPHome
While it is normally used alongside Home Assistant with automatic integration, ESPHome can be used to create and flash custom firmware to your ESP. Currently, ESPHome does not have a visual GUI for designing firmware, so you do have to create the configuration using a language called YAML (I suspect a visual editor will eventually be developed). But YAML is relatively easy to understand and use and the documentation contains plenty of examples.
Github
Github contains literally thousands of projects designed for use on the ESP8266 or ESP32. Many of these will contain a compiled binary that you can simply download and then flash to your ESP board via a simple desktop utility like NodeMCU PyFlasher, ESPHome Flasher, ESPTool, etc. Again, you simply plug in the ESP board via USB to your computer and use the desktop or web utility to select and load the compiled binary.
This is an example Github repo for one of my projects that use an ESP32 and WS2812b LED strips to create a multi-function matrix. Under the releases, there is a compiled binary file.
In this case, you'd only need to download the compiled .bin and flash to your ESP32 using one of the desktop utilities. Note that certain projects may have additional hardware requirements, so always check the documentation first!
Of course, some repositories may only supply the source code and not a compiled binary, meaning you need to compile that source code yourself. This isn't a big deal and doesn't require a coding background. In fact, I have a separate video on setting up and using the Arduino IDE for non-coders. This shows how to setup and use the Arduino IDE to compile the source code (and even make a few minor changes, like for different GPIO pins) into a binary file and then flashing to the ESP board.
Developing your own firmware (yes... coding!)
A time may come in your own journey that you can't find 'pre-made' firmware that is appropriate for your project. In this case, you may need to write your own. But it really isn't as difficult as you might expect. Multiple languages are support and there is a ton of online tutorials, examples and a community that is happy to help. Some of the more common language used include:
- Arduino C/C++ (probably the most common)
- MicroPython/CircuitPython
- Lua
- ESP-IDF
Other languages have been developed and used on the ESP, but those listed above will likely be the ones you run into most often.
ESP32 Bootloader Mode
For most ESP8266 development boards, simply plugging them into a USB port and sending the firmware is all that you need to do. However, with some ESP32 boards you must manually put the board into "bootloader" or flashing mode before it will accept firmware over USB.
As a general rule, you put an ESP32 dev board into flashing mode by pressing and holding the "BOOT" button while the board is plugged into USB/powered on. In most cases, this is enough and the BOOT button can be released after it is powered up. In some rare cases, I've had to continue to hold down the BOOT button until the flashing utility attempts to make a connection.
Alternatively, and if your dev board has it, you can use the EN (enable) button to restart the board.
In this case, you can connect the ESP32 to a USB port. You then press and hold the BOOT button down while also pressing and releasing the EN button. This should restart the board and put it into bootloader mode, at which point you can release the BOOT button. Again, sometimes you need to do this at the point that the flashing utility attempt to connect to the board. Occasionally, it takes a couple of attempts or even a bit of trial-and-error to get a particular ESP32 board into bootloader mode.
Over-the-Air (OTA) Updates
Generally, the first time you flash firmware to an ESP board, it must be done via USB. But often that firmware will contain code for over-the-air updates. This means that after the initial firmware flash, any future updates or changes can be flashed to the ESP32 wirelessly over WiFi. This means that you do not need to bring the ESP32 back to a machine to update the firmware. Check the firmware's documentation to see if it supports OTA updates and how to use the feature.
Final Thoughts
Using an ESP8266/ESP32 is definitely a DIY project. If you simply aren't interested in learning basic electronics or the ins-and-outs of flashing firmware, note that you can often find 'prebuilt' devices like LED controllers that are already flashed with WLED firmware. One example is the series of WLED controllers built and sold by YouTuber Intermit. Tech (or Quindor as he is more commonly known). You can also find smart devices like plugs, switches, dimmers and more already flashed with common firmware like Tasmota or ESPHome. Athom and CloudFree are just a couple of commercial companies that sell ESP-based products that are 'pre-flashed' with open source firmware. There are others as well. A quick web search for 'XXXXX' firmware pre-flashed will provide additional choices.
But for DIY projects, it's hard to beat the features vs. cost of an ESP board. Generally available for just a few dollars each, you can create a myriad of projects using an ESP and the processes covered in this article.
Let me know down in the comments if you have any additional thoughts or questions! And as always, thanks for reading!
Parts List
This is a list of the parts shown or used either in this article or in the related YouTube video.
Some of these links may be Amazon affiliate links. Use of these links will not affect your pricing, but as an affiliate this blog may earn a small commission if you make a purchase.
Links and Additional Information
Supporting this blog and related YouTube channel
It takes significant time and effort (and often expense) to create these articles and videos. If you'd like to support future content on this blog and the related
YouTube channel, or just say thanks for something that helped you out, you can consider buying me a one-off cup of coffee or two at:
No comments:
Post a Comment
To help eliminate spam and to keep all conversations civil, submitted comments are moderated. Therefore your post may not show up immediately. Please be patient as most reviews are completed within a few hours.