What you'll build: check the chip, flash and PSRAM from the Serial Monitor, then control the on-board RGB LED from a web page on your own Wi-Fi network. · About 30 minutes.
Part 1 — Set up the Arduino IDE (once only)
2
Add the ESP32 board packageOpen
File > Preferences and paste this into
Additional boards manager URLs:
https://espressif.github.io/arduino-esp32/package_esp32_index.jsonThen open
Tools > Board > Boards Manager, search
esp32 and install
esp32 by Espressif Systems (version 3.x). Espressif's own steps are in the
installation guide.
3
Choose the board and memory settings
Tools > Board > esp32 > ESP32S3 Dev Module, then set:
• Flash Size: 16MB (128Mb)
• PSRAM: OPI PSRAM (this module has Octal PSRAM)
• Partition Scheme: 16M Flash (3MB APP/9.9MB FATFS)
• USB CDC On Boot: Disabled (when uploading through the USB-to-serial port)
✓ Check: Tools shows ESP32S3 Dev Module, 16MB (128Mb) flash and OPI PSRAM.
Part 2 — Upload your first sketch
4
Connect the USB-to-serial port
With the antenna end of the board at the top, the right-hand USB-C port is the USB-to-serial port and the left-hand one is the native USB port. Plug a USB data cable (not a charge-only cable) into the USB-to-serial port, then select the new port in Tools > Port (COMx on Windows, /dev/cu.usbmodem… on macOS, /dev/ttyACM0 on Linux). If no port appears, try another cable and install the USB driver for your board.
✓ Check: A new port appears in Tools > Port when you plug the board in, and the power LED is on.
5
Upload and check the result
Paste Example 1, click Upload, then open Tools > Serial Monitor at 115200 baud and press RST. The on-board RGB LED uses GPIO48 .
6
If the upload fails
Set Tools > Upload Speed to 115200 and click Upload again. If it still stops at “Connecting…”, hold BOOT, press and release RST, then release BOOT.
▸ Example 1 — Check flash and PSRAM, blink the RGB LED
// Example 1 - check the chip, flash and PSRAM, then cycle the onboard RGB LED
// Board: ESP32S3 Dev Module | Flash Size: 16MB (128Mb) | PSRAM: OPI PSRAM
// Upload through the USB-to-serial USB-C port, Serial Monitor at 115200 baud
// If the upload fails, set Tools > Upload Speed to 115200 and upload again
const uint8_t LED_PIN = 48; // onboard WS2812 RGB LED
void setup() {
Serial.begin(115200);
delay(1000); // give the Serial Monitor a moment to open
Serial.println("OK - epartners.co.nz test"); // start-up message, printed once
Serial.printf("Chip: %s, %d cores, %lu MHz\n",
ESP.getChipModel(), ESP.getChipCores(),
(unsigned long)ESP.getCpuFreqMHz());
Serial.printf("Flash size: %lu MB\n",
(unsigned long)(ESP.getFlashChipSize() / (1024 * 1024)));
if (psramFound()) {
Serial.printf("PSRAM size: %lu KB\n", (unsigned long)(ESP.getPsramSize() / 1024));
} else {
Serial.println("PSRAM not found - set Tools > PSRAM to OPI PSRAM");
}
}
void loop() {
rgbLedWrite(LED_PIN, 40, 0, 0); // red (0-255, kept low so it is not too bright)
delay(500);
rgbLedWrite(LED_PIN, 0, 40, 0); // green
delay(500);
rgbLedWrite(LED_PIN, 0, 0, 40); // blue
delay(500);
rgbLedWrite(LED_PIN, 0, 0, 0); // off
delay(500);
}
✓ Check: The Serial Monitor (115200 baud) prints “OK - epartners.co.nz test” once, then “ESP32-S3”, 2 cores, 240 MHz, a 16 MB flash size and a PSRAM size close to 8 MB, and the RGB LED cycles red, green and blue.
Part 3 — Wi-Fi web page that controls the RGB LED
7
Enter your Wi-Fi details and upload
Copy Example 2, change WIFI_SSID and WIFI_PASS to your 2.4 GHz network, keep the same Tools settings and upload. The WiFi and WebServer libraries are part of the ESP32 board package, so nothing extra needs installing.
8
Open the page
Open the Serial Monitor at 115200 baud. When it prints Open this address in your browser: http://192.168.x.x, open that address on a phone or computer on the same network. Tap Red, Green, Blue or Off to change the LED; the page also shows free PSRAM and uptime.
▸ Example 2 — Wi-Fi RGB LED web page
// Example 2 - Wi-Fi web page that sets the RGB LED colour and shows free PSRAM
// Same Tools settings as Example 1. Your Wi-Fi must be 2.4 GHz.
#include <WiFi.h>
#include <WebServer.h>
const char* WIFI_SSID = "YourNetworkName"; // change to your Wi-Fi name
const char* WIFI_PASS = "YourPassword"; // change to your Wi-Fi password
const uint8_t LED_PIN = 48; // onboard WS2812 RGB LED
WebServer server(80);
void setColour(uint8_t r, uint8_t g, uint8_t b) {
rgbLedWrite(LED_PIN, r, g, b);
}
void handleRoot() {
if (server.hasArg("c")) { // e.g. http://<ip>/?c=red
String c = server.arg("c");
if (c == "red") setColour(40, 0, 0);
else if (c == "green") setColour(0, 40, 0);
else if (c == "blue") setColour(0, 0, 40);
else setColour(0, 0, 0);
}
String html = "<!DOCTYPE html><html><head>"
"<meta name='viewport' content='width=device-width, initial-scale=1'>"
"<title>ESP32-S3 N16R8</title></head>"
"<body style='font-family:sans-serif; padding:16px'>"
"<h1>ESP32-S3 N16R8</h1>"
"<p><a href='/?c=red'>Red</a> | <a href='/?c=green'>Green</a> | "
"<a href='/?c=blue'>Blue</a> | <a href='/?c=off'>Off</a></p>"
"<p>Free PSRAM: " + String(ESP.getFreePsram() / 1024) + " KB</p>"
"<p>Uptime: " + String(millis() / 1000) + " s</p>"
"</body></html>";
server.send(200, "text/html", html);
}
void setup() {
Serial.begin(115200);
delay(1000); // give the Serial Monitor a moment to open
Serial.println("OK - epartners.co.nz test"); // start-up message, printed once
setColour(0, 0, 0);
WiFi.mode(WIFI_STA);
WiFi.begin(WIFI_SSID, WIFI_PASS);
Serial.print("Connecting to Wi-Fi");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.print("Open this address in your browser: http://");
Serial.println(WiFi.localIP());
server.on("/", handleRoot);
server.begin();
}
void loop() {
server.handleClient(); // answer browser requests
}
✓ Check: The Serial Monitor prints “OK - epartners.co.nz test” once, then dots while connecting, then the address. The web page loads and the LED changes colour when you tap a link.
Troubleshooting
| Problem |
Likely cause |
Fix |
| No COM / serial port appears |
Charge-only USB cable, or USB driver missing |
Use a USB data cable. On Windows, install the USB driver for your board if no port appears |
| Upload fails or stops part-way |
Upload speed too high for the cable or USB connection |
Tools > Upload Speed > 115200, then upload again |
| “Failed to connect to ESP32-S3” during upload |
Board did not enter download mode |
Hold BOOT, press and release RST, release BOOT, then upload again |
| “PSRAM not found” or the board resets when using PSRAM |
Wrong PSRAM setting |
Tools > PSRAM: OPI PSRAM (N16R8 uses Octal PSRAM) |
| Sketch reports 4 MB or 8 MB flash |
Flash size left at default |
Tools > Flash Size: 16MB (128Mb); Partition Scheme: 16M Flash (3MB APP/9.9MB FATFS)
|
| Serial Monitor is blank on the native USB port |
USB CDC On Boot is disabled |
Use the USB-to-serial port, or set Tools > USB CDC On Boot: Enabled when using the native port |
| RGB LED stays off |
RGB solder pad not bridged on some board batches, or a different LED pin |
Check that the pad marked RGB near the LED is bridged and that LED_PIN is 48 |
| Wi-Fi never connects |
5 GHz network or wrong password |
The ESP32-S3 supports 2.4 GHz only; check the network name and password (case-sensitive) |
Try next: add a button on a free GPIO (for example GPIO4) to switch the LED colour, or show a sensor reading on the web page.
Spotted a problem in this tutorial? Email support@epartners.co.nz and we'll check it and update the tutorial.