Site icon Renzo Mischianti

ESP32 S2: pinout, specs and Arduino IDE configuration – 1

Spread the love

ESP32 S2 pinout, specs and Arduino IDE configuration main

Esp32 s2 details

In this article, I will present the esp32 s2 family of devices, these devices are under development and some parts may be modified in the future.

In the past 2019 new ESP32 board was born, the s2 family. At first, only the ESP-IDF platform was supported, but now the version for the Arduino ecosystem is also quite mature, although the official version for the Arduino IDE has not yet been released.

On the ESP32-S2, there is no Bluetooth or Ethernet MAC, but it includes new interesting features in order to be more attractive to the IoT device market.
It has a lower cost than the ESP32 and has USB-OTG, LCD, and camera support.
The ESP32-S2 can also dynamically turn off the Wi-Fi transceiver when not in use to save power.

It also now features a powerful single core, so many programming problems such as CPU resource management are solved.

Here the development modules ESP32 S2 Saola 1 - Ai-thinke ESP-12K - ESP32 S2 Mini

Specs

ESP32 S2 SoC core block diagram

Remember that there are many variations of this device, some have specialized functions, but here we put a basic description of the specifications.

esp32 s2 saola 1 v1.2 annotated photo

Pinouts

This device is very powerful, and you can see there are capacitive touch pins, more than one UART, and various analog pins.

ESP32 S2 Saola 1MI

Equipped with ESP32-S2-WROVER-I, there is 2 version of this board, the 1M and 1MI. The only difference is that the 1MI has an IPEX antenna.

This board has three add-ons to the basic configuration: 4MB SPI flash, 2MB PSRAM and an addressable RGB LED (WS2812).

ESP32 S2 Saola 1MI pinout mischianti low

ESP32 S2 Saola 1MI detail and high resolution pinout image

Ai-thinker ESP-12K

Ai-thinker uses an SoC from Ensink Technology that has the same specs as ESP32-S2-WROVER, this board has a simple status led.
There are 2 versions of this board:

Ai-thinker ESP 12K ESP32 S2 pinout

Ai-thinker ESP 12K ESP32 S2 pinout high resolution image

Arduino IDE configuration (Using the updated JSON dev)

Add boards to the Arduino IDE

First, you need to add the esp32 URL descriptor to your IDE

https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json

Go to File -> Preferences and add the URL to “Additional Boards Manager URLs

Arduino IDE esp32 additional board manager

Then you have to add the new board to the Board Manager

Select board manager

The card to select is esp32

Arduino IDE esp32 boards manager dev for s2 c3 s3

It is important that you choose a version of the esp32 core> = 2.

Arduino IDE esp32 select board s2 on menu

Arduino IDE configuration (manual installation of esp32s2 branch) (Deprecated)

The branch was changed in esp32c3 or Master no more esp32s2.

As you can understand from the title, there is not yet a simplified procedure, so we will have to take several steps to be able to use our esp32 s2 on the Arduino IDE.

Install standard ESP32 cards from the IDE card manager

First, you must add the esp32 URL descriptor to your IDE

http://arduino.esp8266.com/stable/package_esp8266com_index.json
https://dl.espressif.com/dl/package_esp32_index.json 

Go to File –> Preferences and add the URL on “Additional Boards Manager URLs”

Arduino IDE esp32 additional board manager

Then you must add a new board in Boards Manager

Select board manager

The board to select is esp32

Arduino IDE esp32 boards manager

Download the manager from the ESP32s2 branch

The branch was changed in esp32c3 and master no more esp32s2.

But now we have installed the stable branch of the master on the IDE and there is no esp32 s2 implementation.

ESP32 S2 download Arduino IDE boards implementation

So you must download this branch

ESP32s2 GitHub branch or Master

then you have to open the path where the Arduino IDE stores its preferences:

ESP32 S2 download Arduino IDE preferences folder

Now find the esp32 implementation. In my case it’s the folder

<Arduino IDE preferences path>\packages\esp32\hardware\esp32\1.0.4

the result becomes

C:\Users\renzo\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4

First create a copy of the folder packages\esp32 if you want revert the operation in the future.

Than open the zip of the branch and copy the same file and folder to the esp32 path

ESP32 S2 copy branch ESP32S2 to esp32 implementation

Now you can find the ESP32s2 Dev Kit implementation on your Arduino IDE:

ESP32 S2 board manager ESP32s2 Dev Module

But you can’t compile and upload nothing because you need 2 other updated tool.

Download xtensa-esp32s2-elf

But nothing can work this because this board not use xtensa-esp32-elf but xtensa-esp32s2-elf, you must download It from here:

IDF downloadable tools

The version for my operating system, Windows 10, is win64.

Download ESPTools

And you need the lastest version of esptool, and you can check the last version from here.

GitHub ESPTools

The first version that support ESP32 s2 is 3.0.0, and we are going to download that version from this link.

ESPTools 3.0.0

Put all togeder

Now you must copy in the

<Arduino IDE preferences folder>\packages\esp32\hardware\esp32\1.0.4\tools 

this two tools.

ESP32 S2 install xtensa-esp32s2-elf and esptool 3.0.0

Now your IDE work correctly, I’m moved.

Your first ESP32 s2 sketch

ESP32 S2 Saola 1MI

Now we are going to manage the addressable RGB led (Addressable RGB LED (WS2812), driven by GPIO18) installed on the board.

You need to install Adafruit_NeoPixel.h library from libraries manager.

Here is the simple sketch:

/*
 *  Here a simple sketch to test the upload of ESP32 S2 Saola 1MI.
 *  The addressable RGB LED (WS2812), driven by GPIO18 need
 *  Adafruit NeoPixel library
 *  by Mischianti Renzo <https://mischianti.org>
 *
 *  https://mischianti.org/
 *
 */

#include <Adafruit_NeoPixel.h>
#define PIN 18
#define NUMPIXELS 1
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

enum {NONE, RED, GREEN, BLUE};
int ledColor = NONE;

void setup()
{
  pixels.begin();
}

void loop()
{
  switch (ledColor) {
    case NONE:
      pixels.setPixelColor(0, pixels.Color(0, 0, 0));
      pixels.show();
      break;
    case RED:
      pixels.setPixelColor(0, pixels.Color(20, 0, 0));
      pixels.show();
      break;
    case GREEN:
      pixels.setPixelColor(0, pixels.Color(0, 20, 0));
      pixels.show();
      break;
    case BLUE:
      pixels.setPixelColor(0, pixels.Color(0, 0, 20));
      pixels.show();
      break;
    default:
      break;
  }

  ledColor++;
  if (ledColor == 4) {
    ledColor = NONE;
  }

  delay(1000);
}

ESP32-S2-Saola-1MI Led RGB animation test

Ai-thinker ESP-12K

Now a blink sketch for this microcontroller:

/*
 *  Here a simple sketch to test the upload of Ai-thinker ESP-12K.
 *  by Mischianti Renzo <https://mischianti.org>
 *
 *  https://mischianti.org/
 *
 */

#define LED_BUILTIN 2

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

Both custom and standard installations running on your Arduino IDE

Many people ask me how to switch between the new and old installation easily. Here is a small guide.

Rename the new esp32s2 installation inside <Arduino IDE preferences folder>/preferences from esp32 in esp32s2 and the “old” standard directory in esp32.

Now you have the previous installation in esp32 (like normal) and esp32s2 the GitHub installation.

Add to “Additional Boards Manager URLs” a fake URL like

https://dl.espressif.com/dl/package_esp32s2_index.json

Now duplicate from <Arduino IDE preferences folder> the file package_esp32_index.json and rename It in package_esp32s2_index.json.

In the new file change name in esp32s2 like so:

{
  "packages": [
    {
      "name": "esp32s2",
      "maintainer": "Espressif Systems",

Now go to

<Arduino IDE preferences folder>\packages\esp32s2\hardware\esp32\1.0.4

open file platform.txt and change the first line from name=ESP32 Arduino in name=ESP32s2 Arduino. Restart the IDE.

ESP32 S2 show double installation in your Arduino IDE

Thanks

  1. ESP32 s2: pinout, specs and Arduino IDE configuration
  2. […]

Spread the love
Exit mobile version