Demo ESP32 S3 board with Arduino environment

Introduction

ESP32-S3-GEEK is an Ethernet development board designed based on ESP32-S3R8. It has excellent Wi-Fi and Bluetooth wireless connection functions, has a more reliable and efficient wired Ethernet connection, and supports PoE power supply (PoE version only). The onboard camera interface is compatible with mainstream cameras such as OV2640 and OV5640, which is convenient for image and video capture. The development board also reserves a Pico-compatible interface, supporting some Raspberry Pi Pico expansion boards. Relying on its rich ecosystem and open-source resources, users can quickly and flexibly perform secondary development. It is widely applicable to Internet of Things, image acquisition, smart home, and artificial intelligence projects.

Features

  • Based on the high-performance ESP32-S3R8 chip, equipped with an Xtensa 32-bit LX7 dual-core processor, with a main frequency up to 240MHz
  • Integrated 512KB SRAM and 384KB ROM, with built-in 8MB PSRAM and 16MB Flash
  • Supports 2.4GHz Wi-Fi and Bluetooth 5 (LE), built-in antenna, supports external antenna
  • Onboard W5500 Ethernet chip, extending 10/100Mbps network connectivity via SPI interface
  • Supports external PoE module for Power over Ethernet (IEEE 802.3af compliant)
  • On-board camera interface, compatible with mainstream cameras such as OV2640 and OV5640, suitable for image and video capture
  • Onboard USB Type-C port, supporting power supply, debugging and firmware downloading, making development more convenient
  • Onboard TF card slot, supporting external TF card storage for pictures and files
  • Onboard Pico-compatible interface, providing rich peripheral expansion, with strong compatibility

Onboard Resources

1. ESP32-S3R8
Dual-core processor, up to 240MHz operating frequency

2. W25Q128
16MB Flash for storing programs and data

3. W5500
Network port chip

4. H1102NLT
Network transformer

5. JW5060
Voltage regulator chip

6. USB Type-C port
Available for downloading programs and powering

7. Ethernet interface
RJ45 10/100M adaptive network port

8. PoE port
External PoE module available

9. Camera interface
Compatible with cameras such as OV2640/OV5640

10. IPEX Gen 1 antenna interface
Reserved interface, it can only be enabled by re-soldering the resistor

11. Ceramic antenna
Enabled by default and can be changed to IPEX external antenna by re-soldering

12. TF card slot
13. BOOT button
14. ACT indicator
15. LINK indicator
16. RESET button

Interfaces

Components Preparation

  • ESP32-S3-ETH x1
  • PoE Module (B) x1
  • OV5640 camera x1
  • 16GB TF card x 1
  • USB cable (Type-A male to Type-C male) x1

Download and Install Arduino IDE

This chapter introduces setting up the Arduino environment, including the Arduino IDE, management of ESP32 boards, installation of related libraries, program compilation and downloading, as well as testing demos. It aims to help users master the development board and facilitate secondary development.

Install ESP32 Development Board

  • To use ESP32 boards in Arduino IDE, first install the ESP32 Development Board package.
  • In some areas, it may not be able to Install online due to network reason, and Install offline is generally recommended.
  • For the tutorial on installing ESP32 Development Board package, please refer to Arduino board manager tutorial
  • ESP32-S3-ETH Development board installation instructions
Board name Board installation requirement Version number requirement
ESP32-S3-ETH "Install Offline" / "Install Online" 2.0.12 and above

Install Libraries

Library Name Description Library Installation Requirement
Adafruit_NeoPixel NeoPixel Light Bar Control Library "Install Online" or "Install Offline"
ESP32-BLE-Keyboard ESP32 Bluetooth Keyboard Library "Install Online" or "Install Offline"
ETHClass ESP32 Ethernet Library Install Offline

Run the First Arduino Demo

Run the Arduino IDE and select File -> New Sketch

  • Enter the code:
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  Serial.println("Hello, World!");
  delay(2000);
}
  • Save the project and select File -> Save As.... In the pop-up menu, select the path to save the project, and enter a project name, such as Hello_World, click Save

Compile and Flash Demos

  • Select the corresponding development board, take the ESP32S3 motherboard as an example: Tools -> Board -> esp32 -> ESP32S3 Dev Module

  • Select the corresponding port. In addition, if ESP32 S3 motherboard only has a USB port, USB CDC must be enabled, as shown in the following figure:

  • Compile and upload the demo:

  • Open the serial port monitoring window, and the demo will print "Hello World!" every 2 seconds, and the operation is as follows:

Basic demo: GPIO pin high and low level control

This demo demonstrates how to use multiple GPIO pins of the ESP32-S3-ETH module as output control ports. The demo sequentially sets each GPIO pin to high (open) and low (closed) in order, with an interval of 300 milliseconds for each state change. In this way, the sequential switching operation of the GPIO pins can be observed.

Hardware connection

ESP32-S3-ETH GPIO Pinout definition
  • Connect the board to the computer using a USB cable

 

 

 

 

 

 

 

 

 

Code Analysis

1. GPIO pin configuration: The demo first defines the 25 GPIO pins and initializes them into output mode in the setup() function. All pins are set to low level (off state) at the beginning.

#define NUM_GPIO 25

// Define GPIO pins
const int gpio_pin[NUM_GPIO] = {21, 17, 16, 18, 15, 3, 2, 1, 0, 44, 43, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 47, 48};

2. GPIO control loop:

  • In the loop() function, the demo will turn on each GPIO pin in turn (set to high) for a delay of 300 milliseconds, and then turn off the pin (set to low).
  • This process will be repeated constantly.

3. Print Output: The demo outputs the status information of each GPIO pin through the USB port, indicating whether the pin is in a high voltage level (on) or a low voltage level (off) state.

void loop() {
  // Turn on each GPIO one by one
  for (current_gpio = 0; current_gpio < NUM_GPIO; current_gpio++) {
      digitalWrite(gpio_pin[current_gpio], HIGH); // Set GPIO pin to HIGH (turn on)
      printf("GPIO %d set to HIGH.\n", gpio_pin[current_gpio]); // Print GPIO state
      delay(300); // Delay for 300ms
  }

  // Turn off each GPIO one by one
  for (current_gpio = 0; current_gpio < NUM_GPIO; current_gpio++) {
      digitalWrite(gpio_pin[current_gpio], LOW); // Set GPIO pin to LOW (turn off)
      printf("GPIO %d set to LOW.\n", gpio_pin[current_gpio]); // Print GPIO state
      delay(300); // Delay for 300ms
  }

Result demonstration

After the demo is flashed, the running result of the device is as follows:

  • ESP32-S3-ETH will control 25 GPIO pins in turn. The demo switches the HIGH and LOW states on each GPIO pin and outputs the state changes to the monitoring window via USB.
    The low level of the output is 0V, and the high level is the operating voltage of the current board. Since the operating voltage of ESP32-S3 is 3.3V, the high level is 3.3V.
  • Open the serial port monitoring window of the Arduino IDE, and you can observe the state switching of each GPIO pin, as shown in the following figure:

Basic demo: Connect via WiFi, assign IP address via DHCP

The demo connects via Ethernet using the ESP32-S3-ETH module and assigns an IP address through DHCP.

Network port interface ESP32-S3-ETH GPIO
MISO GPIO12
MOSI GPIO11
SCLK GPIO13
CS GPIO14
RST GPIO9
INT GPIO10
  • Connect the hardware according to the following diagram, as shown in the figure below

  • Function: Initialize system settings
  • Main steps:
    • Initialize serial port communication (for debugging output).
    • Initialize the SPI bus and configure the pins of the Ethernet communication module.
    • Initialize the Ethernet module and use DHCP to obtain an IP address. If it fails, stop the demo and continue if it succeeds.
    • Print the obtained IP address.

After startup, ESP32-S3 will initialize Ethernet and print the IP address assigned by DHCP.

Back to blog