Random Nerd Tutorials
Shares

Getting Started with ESP32 Dev Module

Shares

This is a getting started guide for the ESP32 Dev Module. If you’re familiar with the ESP8266, the ESP32 is its sucessor. The ESP32 is loaded with lots of new features the two most important: it combines WiFi and Bluetooth wireless capabilities and it’s dual core.

ESP-WROOM-32 Dev Module

In this post, I’ll be using the ESP-WROOM-32 Dev Module (as shown in Figure below).

Features and Specifications

Here’s a quick run down of some features and specifications of the ESP32 chip:

  • Wireless connectivity
    • WiFi: 150.0 Mbps data rate with HT40
    • Bluetooth: BLE (Bluetooth Low Energy) and legacy Bluetooth.
  • Processor: Tensilica Xtensa Dual-Core 32-bit LX6 microprocessor, running at 160 or 240 MHz
  • ROM: 448 KB
  • SRAM: 520 KB
  • Low Power: ensures that you can still use ADC conversions, for example, during deep sleep.
  • Peripheral Input/Output: peripheral interface with DMA that includes capacitive touch, ADCs (Analog-to-Digital Converter), DACs (Digital-to-Analog Converter), I²C (Inter-Integrated Circuit), UART (Universal Asynchronous Receiver/Transmitter), SPI (Serial Peripheral Interface), I²S (Integrated Interchip Sound), RMII (Reduced Media-Independent Interface) and PWM (Pulse-Width Modulation).
  • Security: hardware accelerators for AES and SSL/TLS

Preparing the ESP32 Board in Arduino IDE

The ESP32 is currently being integrated with the Arduino IDE just like it was done for the ESP8266, but not everything is working at the moment.

There’s an add-on for the Arduino IDE allows you to program the ESP32 using the Arduino IDE and its programming language. Follow this tutorial to prepare your Arduino IDE:

Pin assignment

You can use the image below as a reference for the pinout.

Note: the ESP32 pin assignment in the Arduino IDE works as expected. So, if you do something like this:

pinMode(16, OUTPUT);

It refers to GPIO16.

Upload code

In this example, you’re going to connect an LED and a pushbutton to the ESP32. The code is very simple when you hold the pushbutton down it turns the LED on and when you release it turns the LED off.

Copy the following code to your Arduino IDE and upload it to your ESP32 Dev Module.

Plug your ESP32 Dev Module to your computer and follow these next instructions:

1) Select your board in Tools > Board menu (in my case it’s the ESP32 Dev Module)

2) Select the COM port

3) To make your ESP32 go into downloading/uploading mode: hold the BOOT button and press the EN button to reboot your ESP32

4) Press the Upload button in the Arduino IDE and wait a few seconds while the code compiles and uploads to your board. If everything is correct this what you should see:

Parts required and schematics

Here’s the needed parts for this example:

  • 1x ESP32 Dev Module
  • 1x LED
  • 1x Pushbutton
  • 1x Breadboard
  • 1x 10K Ohm Resistor
  • 1x 270 Ohm Resistor
  • Jumper wires

Assemble all the parts as in the schematics below.

Demonstration

Now, when you hold the pushbutton down, your LED lights up.

As soon as you release the pusbutton, your LED turns off.

Wrapping up

That’s it for now, I hope you had fun learning about the ESP32 Dev Module. I know the example shown in this blog post isn’t the purpose of the ESP32.

The ESP32 is meant to be used in wireless applications (WiFi or BLE projects), but at the time of writing this blog post those features aren’t fully working with the Arduino IDE.

Make sure you subscribe to my blog, because I’ll be posting more tutorials about the ESP32 very soon.

Do you have any questions? Leave a comment down below!

Thanks for reading,

Rui

P.S. If you like the ESP32, you might also enjoy reading all my ESP8266 tutorials.

P.P.S. Download Home Automation Using ESP8266 eBook

Recommended Resources

Home Automation using ESP8266 »
Build IoT projects and home automation gadgets with the ESP8266 Wi-Fi module.

Build a Home Automation System »
Learn how to build a automation system using open-source hardware and software from scratch.

Arduino Step-by-Step Projects »
Build 25 cool Arduino projects with our couse even with no prior experience!

Leave a Comment:

Add Your Reply

⏰ Early Black Friday 2017 Special ⏰
Download all our courses up to 35% off