If you’ve ever ventured into the vast world of microcontrollers, you may have come across Arduino boards. Featuring a battalion of first and third-party boards, the Arduino series has a lot of following in the DIY tinkering landscape. Then there’s the Raspberry Pi Pico, a new microcontroller developed by the creators of the most popular SBC lineup.
However, there’s an equally impressive microcontroller family that most beginners – and even intermediate tech aficionados – aren’t familiar with. By that, I’m referring to Espressif Systems’ offerings, specifically the ESP32 board. So, in this article, I’ll go over everything you need to know before you pick this amazing development board for your next project.
What is ESP32?
And why should you care about it?
At the fundamental level, most ESP32 models are the same as Arduino and RPi Pico boards: they're microcontrollers that are useful for any DIY project involving heavy circuitry, robotics, or automation. Just like its rivals, the ESP32 doesn’t support a full-fledged desktop operating system, and the embedded OS of the ESP32 requires you to program the device using a code editor/IDE if you want it to perform a specific function.
Arduino vs Raspberry Pi: Which board should you buy for your next DIY project?
Don't be fooled by their appearance — there's a world of difference between the tiny Arduino and Raspberry Pi boards!
However, the ESP32 is far more powerful (at least, as far as microcontrollers are concerned) than its competitors, on top of possessing a more expansive IO pin configuration. Plus, many models of the ESP32 are equipped with built-in Bluetooth and Wi-Fi modules, a feature that’s only available on the more expensive Arduino and Pico versions. Speaking of price, ESP32 is far more affordable than the other development boards, and even the cheapest version of the ESP32 will surpass its rivals in processing capabilities.
There are some non-microcontroller ESP32 models out there, like the Olimex SBC that uses the FabGL library. However, since covering them is outside the scope of this article, we're only going to consider the ESP32 microcontrollers for the rest of the tutorial.
How to pair an ESP32 to a PC via a serial connection?
Since ESP32 isn’t a standalone device, you’ll need to connect it to a PC before you can build anything meaningful with it. Since the official Arduino IDE is quite robust and can be calibrated to work with the ESP32, we’ll use it for the entire tutorial.
- Open this link on your favorite web browser and download the zip folder of the Arduino IDE.
- Once it has finished downloading, unzip the folder and run Arduino.exe with administrator privileges.
- If the Windows Defender Firewall displays a warning about restricting access to your private network, ignore it by pressing the Allow access button.
- Choose Install when Windows Security asks for your confirmation to install the Arduino USB driver.
- With the Arduino IDE up and running, it’s time to access the ESP32 from your system.
- Using a micro-USB-to-USB Type-A (or Type-C) cable, physically connect the ESP32 to your PC.
- Inside the Arduino IDE, click on File and select Preferences.
-
Paste the following address into the Additional boards manager URLs option and hit OK.
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Select the Tools header and hover your cursor over Board and subsequently esp32 before picking your specific microcontroller from the options.
- Once again, click on Tools, and this time, choose the Serial Port number that automatically appears under the Port tab.
Although optional, I recommend loading an Example script from the Arduino IDE on your ESP32 to verify whether it’s actually connected to your PC.
- From the File header, hover the cursor over Examples and select AnalogReadSerial under the 01.Basics section.
- Click on the Upload button to send and execute the script on the ESP32.
- Hold the Boot button on your ESP32 while the Arduino IDE executes the script on the microcontroller.
- If the IDE displays the ESP32’s MAC address and starts uploading the stub of the program, the connection is successful.
How to pair an ESP32 to a device wirelessly?
Using Wi-Fi
Since the ESP32 supports Wi-Fi and Bluetooth connectivity, this article would be incomplete if we didn’t go over the procedure to pair the board wirelessly with your PC.
- Click on File and in the Examples menu, select SimpleWiFiServer under the WiFi section.
- Assign the correct values to the *ssid and *password char-type variables.
- Hit Upload, and just like the last time, press and hold the Boot button on your ESP32 while the Arduino IDE finishes writing the code on the microcontroller.
- Once the Hard resetting via RTS pin… message appears in the output, press Ctrl+Shift+M to bring up the Serial Monitor.
- Ensure that the Baud rate is the same as the number within the Serial.begin() function.
- Press the RST button on your ESP32 for a few seconds.
- If you entered the network details correctly, the Serial Monitor will display the Wi-Fi connected message alongside the IP address of your ESP32.
Using Bluetooth
Of course, Wi-Fi isn’t the only wireless connectivity option for ESP32; you can just as easily connect the microcontroller to your preferred device, including smartphones and tablets, via Bluetooth.
- Hit the File option and select SerialToSerialBT from the BluetoothSerial section of the Examples menu.
- Click on Upload on the SerialToSerialBT window and keep holding the Boot button until the code has been transferred to the ESP32.
- Tap Ctrl+Shift+M once again to make the Serial Monitor appear next to the Output tab.
- Like the last time, ensure that the Baud rate in the Serial Monitor is the same as what's specified in the SerialToSerialBT script.
- Press and hold the RST button on the ESP32 board for a few seconds.
- The Now you can pair it with Bluetooth! message pops up in the Serial Monitor.
- With that, you can open the Bluetooth settings on your smartphone and pair it with the device that shows up as ESP32-BT-Slave.
Putting your DIY skills to the test with the powerful yet affordable ESP32
The ESP32 is easily one of the most versatile development boards in the consumer space and is quite cheap despite packing solid specifications. That said, it has nowhere near as many learning resources as the prestigious Arduino family. On their own, microcontrollers require a considerable amount of coding and circuitry know-how.
Combine the lack of beginner-oriented ESP32 tutorials with the high learning curve associated with microcontrollers, and it’s better for newcomers to hold off on investing in an ESP32 initially. Instead, you should build simple Raspberry Pi Pico and Arduino-oriented ideas to familiarize yourself with the ins and outs of a microcontroller, and gradually work your way to the more complex ideas involving ESP32 boards (or even all three of them)!
- Brand
- AITRIP
- Connectivity Features
- UART, USB
The ESP32 is a fantastic development board that combines solid specs with an affordable price. Despite being cheaper than Arduino and Raspberry Pi Pico, it outperforms most of its rivals. Plus, the ESP32 even has Wi-Fi and Bluetooth functionality built into every board, making it great for projects where you can't physically keep the microcontroller connected to your PC at all times.
