LabWired The easy way to build hardware
ESP32-S3-DevKitC-1 development board with an ESP32-S3-WROOM-1 module, two 22-pin headers, BOOT and RST buttons, and USB-C plus USB-to-UART ports.
ESP32-S3-DevKitC-1, the board this lesson uses.

Learn / Track 02

Getting started with the ESP32

This lesson uses the ESP32-S3-DevKitC-1 N16R8 in LabWired. Pick that board in the Playground.

The first two programs have a lab. The lab is a model of the S3. The model runs the Arduino sketch in the editor. Change a pin or a delay. Press Run. A virtual board then runs your code. The third program is Wi-Fi. Wi-Fi needs a real board. The twin does not model the S3 radio yet. This lesson states that limit. This lesson does not show a lab that cannot join.

What you need: a browser. You drop the board, the LED, the resistor, and the button on a canvas. If you own the real board, use Tools > Deploy. The same sketches flash to that board.

Contents


The board

Pick the N16R8 DevKitC-1 on the canvas. Drop an LED and a 330 ohm resistor on the canvas. Later, drop a button and a Wi-Fi AP on the canvas.

The LabWired Playground has an ESP32-S3-DevKitC-1-N16R8 on the canvas. The left header starts at GP4 and GP5. The parts list on the left shows the board as the only part.
GP4 and GP5 are the first two pins on the left header.

Press ⌘K to add a part.

The Playground command palette is open. The query is LED. The list under Outputs shows LED, RGB LED, APA102 Strip, NeoPixel Strip, and Servo Motor.
The badge on each row is the bus: GPIO, I2C, or SPI.

Keep this pin layout open while you wire. GPIO4 is the first GPIO on the left header, under the two 3V3 pins and RST. GPIO5 is the next pin down.

Official Espressif pin layout for the ESP32-S3-DevKitC-1 v1.1. Each pin has a GPIO number and alternate functions.
ESP32-S3-DevKitC-1 v1.1. Octal PSRAM uses GPIO35 to GPIO37. Diagram (c) Espressif Systems, from esp-dev-kits, Apache-2.0.

Blink GPIO4

Connections

Board pinGoes toNotes
GPIO4330 ohm resistor, one endLeft header, first GPIO under RST
resistor (other end)LED anodeLong leg. Resistor in series
GNDLED cathodeShort leg, flat edge of the plastic
Connection diagram. GPIO4 connects to a 330 ohm resistor. The resistor connects to the LED anode. The LED cathode connects to GND.
GPIO4 drives the resistor. The LED cathode returns to GND.
The same circuit is on the LabWired canvas. A wire goes from GP4 to a 330 ohm resistor. The resistor goes to the LED anode. The LED cathode goes to GND. The Arduino sketch is open in the editor.
The canvas shows the same three connections. Drag from pin to pin to draw a wire.

Code

Run this LED blink code in the browser. The code uses Arduino. LED_PIN is 4. setup() runs once after reset. loop() defines the code that repeats.

#include <Arduino.h>

const int LED_PIN = 4;
uint32_t count = 0;

void setup() {
  Serial.begin(115200);
  pinMode(LED_PIN, OUTPUT);
  Serial.println("ESP32-S3 up. First blink.");
}

void loop() {
  digitalWrite(LED_PIN, HIGH);
  Serial.print("blink ");
  Serial.println(++count);
  delay(500);
  digitalWrite(LED_PIN, LOW);
  delay(500);
}

How it works

Run it. Use this wiring and this sketch. Press Run. The LED blinks on GPIO4. Serial prints blink and a count. Change delay(500). Run the sketch again. The blink time is then different.

Open the full lab →

If nothing blinks

Tools > Deploy puts the same sketch on a real board.

Read GPIO5

Keep the LED on GPIO4. Add the button.

Connections

Board pinGoes toNotes
GPIO4330 ohm, then LED anode, then GNDSame as the blink
GPIO5one pair of button legsLeft header, under GPIO4
3V3the other pair of button legsA press puts 3.3 V on the pin
GPIO510 k ohm, other end to GNDPull-down. It holds the pin at 0 V when no person presses the button
Connection diagram. The LED stays on GPIO4 through 330 ohm to GND. The button connects GPIO5 to 3V3. A 10 k ohm pull-down connects GPIO5 to GND.
Four-leg buttons are two pairs. Sit the body across the breadboard centre gap.

Code

BUTTON_PIN is 5. The 10 k resistor holds GPIO5 at 0 V. A press connects GPIO5 to 3.3 V. A press then reads HIGH.

#include <Arduino.h>

const int LED_PIN = 4;
const int BUTTON_PIN = 5;

void setup() {
  Serial.begin(115200);
  pinMode(LED_PIN, OUTPUT);
  pinMode(BUTTON_PIN, INPUT);
  Serial.println("ESP32-S3 up. Button on GPIO5.");
}

void loop() {
  bool pressed = digitalRead(BUTTON_PIN) == HIGH;
  digitalWrite(LED_PIN, pressed ? HIGH : LOW);
  Serial.println(pressed ? "pressed" : "open");
  delay(50);
}

How it works

Run it. Click the button on the canvas. Then tick Pressed in the panel that opens. The LED shows the GPIO5 level. Serial prints pressed or open.

If the pin always reads pressed. GPIO5 stays at 3.3 V. No part pulls the pin down. The 10 k resistor can be absent. Or the four-leg button can be in the wrong rotation. Its legs are two pairs. Each pair is already joined inside the button. The wrong rotation shorts 3V3 to the pin. The short is permanent. Sit the body across the centre gap.

Open the full lab →

Wi-Fi and HTTP

Keep the LED on GPIO4. The board joins an access point. The board requests a page from that access point over HTTP. The LED lights when the answer arrives. All of this section runs on real hardware. The in-page twin does not simulate the S3 radio yet. Read this section with a real board connected.

Connections

Board pinGoes toNotes
GPIO4330 ohm, then LED anode, then GNDSame as the blink
(antenna)your access pointNo jumper. The join is WiFi.begin(ssid, password) in the sketch.
Connection diagram. The LED stays on GPIO4 through 330 ohm to GND. The canvas has a Wi-Fi AP. The SSID is labwired-ap. The request is HTTP GET 192.168.4.1/status. No jumper goes to the AP.
The radio needs no jumper. The station joins the access point by name. The station reads /status over HTTP.

Code

The SSID in WiFi.begin("labwired-ap") must match the access point SSID. WiFiClient connects to the access point. On your board, change the SSID to your 2.4 GHz network. Add a password for that network.

#include <Arduino.h>
#include <WiFi.h>

const int LED_PIN = 4;

void setup() {
  Serial.begin(115200);
  delay(2000);
  pinMode(LED_PIN, OUTPUT);
  Serial.println("joining labwired-ap");
  WiFi.begin("labwired-ap");
  while (WiFi.status() != WL_CONNECTED) {
    delay(400);
    Serial.print(".");
  }
  Serial.println();
  Serial.println("joined");

  WiFiClient c;
  if (!c.connect(IPAddress(192, 168, 4, 1), 80)) {
    Serial.println("GET failed");
    return;
  }
  c.print("GET /status HTTP/1.1\r\nHost: 192.168.4.1\r\nConnection: close\r\n\r\n");
  unsigned long dl = millis() + 5000;
  while (millis() < dl && (c.connected() || c.available())) {
    while (c.available()) {
      Serial.write(c.read());
    }
    delay(10);
  }
  c.stop();
  digitalWrite(LED_PIN, HIGH);
}

void loop() {
  delay(1000);
}

How it works

Run this step on the board. Do not run this step in the page. This is the one step in this lesson that has no lab. LabWired does not model the S3 radio yet. The twin cannot join anything. Put this sketch on a real board with Tools > Deploy. Change the SSID to your own 2.4 GHz network. Add the password as a second argument to WiFi.begin. Point the connect call at a host on that network. Serial then prints joined. Serial then prints the response. The LED goes high after the GET.

If the sketch prints dots and does not stop. The name or the password is wrong. Or the network is 5 GHz only. The ESP32 joins 2.4 GHz.

Open the Playground to wire the next circuit.

A different ESP32

Pin numbers are not the same on every board in the family. A SuperMini and an S3-Zero have different headers.

ChipCoreRadioUSB
ESP32Two Xtensa LX6Wi-Fi 4, Bluetooth Classic and LEConverter chip only
ESP32-S3Two Xtensa LX7Wi-Fi 4, Bluetooth LEIn the chip. This DevKitC-1 also has a converter port
ESP32-C3One RISC-VWi-Fi 4, Bluetooth LEIn the chip
ESP32-C6One RISC-VWi-Fi 6, Bluetooth LE, 802.15.4In the chip
ESP32-H2One RISC-VBluetooth LE, 802.15.4. No Wi-FiIn the chip

The H2 has no Wi-Fi. The H2 cannot run this join-and-GET sketch.

Most older tutorials use the classic DevKitC V4:

Official Espressif pin layout for the ESP32-DevKitC V4. Each pin has a GPIO number and alternate functions.
ESP32-DevKitC V4. GPIO6 to GPIO11 are flash pins. GPIO34 to GPIO39 are input only. Diagram (c) Espressif Systems, Apache-2.0.

If a failure took you a day to find, post it on r/labwired. Or send a message to contact@labwired.com.

Andrii Shylenko
Andrii Shylenko

Founder, LabWired.