Projects / ESP32 expansion board first test

ESP32 expansion board first test

Beginner1.5 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. ESP32ESP32

    Seat the ESP32

    USB end at the marked edge, pins lined up, press gently.

  2. ESP3212.8 mA

    Wire the LED

    Long leg through 330 ohms to the S terminal of GPIO23, short leg to G.

  3. ESP32

    Wire the button

    One leg to S of GPIO22, the other to G.

  4. ESP32ESP32

    Connect USB

    To the ESP32's own socket.

  5. ESP3212.8 mA

    Upload the sketch

    The LED blinks twice a second.

  6. ESP32

    Open the Serial Monitor

    At 115200.

  7. ESP32

    Press the button

    The count goes up by one each press.

In short

How do you build an ESP32 expansion board first test?

A 38-pin ESP32 board sits in a screw-terminal expansion board, and a short sketch blinks an LED and counts button presses, as a first test of the board and its power supply. You need ESP32 expansion board (38-pin), ESP32 DevKit V1, LED 5 mm red, Resistor 330 Ω and Tactile push button 6 mm. It takes 7 steps and about 90 minutes.

Level
Beginner
Time
About 90 min
Parts
5

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
LED long leg330 ohm resistor to terminal S of GPIO23LED output
LED short legTerminal G beside it (GND)Return
Button leg 1Terminal S of GPIO22Input with the internal pull-up
Button leg 2Terminal G beside it (GND)Pressed pulls the pin low

Code

An expansion board is a carrier for a 38-pin ESP32 development board that brings every pin out to screw terminals, usually in rows of signal, power and ground, so wires can be fixed without soldering or a breadboard. This test checks the whole chain: the board is seated the right way round, the USB cable and port work, the sketch uploads, an output pin drives an LED and an input pin reads a button. The LED blinks using a timer instead of a delay, so the program can still watch the button, and the button uses the internal pull-up, so it needs no resistor and reads low when pressed. The resistor protects the LED. Seat the ESP32 with its USB end at the marked edge of the board and do not force it, as pins that do not line up can bend. Power the setup from the ESP32's USB socket. If the expansion board has a barrel jack or voltage setting, leave it alone and do not connect an outside supply until you have read the board's own markings. Avoid pins that matter at start-up, such as GPIO0, 2, 12 and 15, for your own wires, and keep to the two pins used here.

Runs on a virtual ESP32 Dev Module in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

const int LED = 23;
const int BUTTON = 22;

int presses = 0;
bool lastButton = HIGH;
unsigned long lastBlink = 0;
bool ledState = false;

void setup() {
  pinMode(LED, OUTPUT);
  pinMode(BUTTON, INPUT_PULLUP);
  Serial.begin(115200);
  Serial.println("ESP32 expansion board test");
}

void loop() {
  if (millis() - lastBlink >= 500) {               // blink twice a second without blocking
    lastBlink = millis();
    ledState = !ledState;
    digitalWrite(LED, ledState);
  }

  bool b = digitalRead(BUTTON);
  if (b == LOW && lastButton == HIGH) {
    delay(20);                                     // short wait for the contacts to settle
    if (digitalRead(BUTTON) == LOW) {
      presses++;
      Serial.print("Button presses: ");
      Serial.println(presses);
    }
  }
  lastButton = b;
}

What the serial monitor should show

Open the serial monitor at the baud rate in the code. This is what our simulator prints for a virtual ESP32 Dev Module with its sensors at their default values. Your numbers will follow your real readings, but the format should match.

ESP32 expansion board test

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
After uploadLED blinks twice a second
Press the buttonCount goes up by one
Hold the buttonOnly one count per press
Unplug and plug inBlinks again, count back to zero
Look at the boardPower light on, nothing hot

If it does not work

Port does not appear

Try another USB cable and install the CH340 or CP210x driver.

Upload fails

Hold BOOT while it connects.

LED never lights

Check the leg direction and that the wire is in the S terminal of GPIO23.

Count jumps

Check the button wiring and the common ground.

Board is hot

Unplug, check no terminal is shorted and the board is seated correctly.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the ESP32 expansion board first test?

ESP32 expansion board (38-pin), ESP32 DevKit V1, LED 5 mm red, Resistor 330 Ω and Tactile push button 6 mm.

How long does the ESP32 expansion board first test take to build?

About 90 minutes for a beginner maker, in 7 steps.

How do I know the ESP32 expansion board first test works?

After upload: LED blinks twice a second. Press the button: Count goes up by one. Hold the button: Only one count per press.

Port does not appear: what should I check?

Try another USB cable and install the CH340 or CP210x driver.

Upload fails: what should I check?

Hold BOOT while it connects.

LED never lights: what should I check?

Check the leg direction and that the wire is in the S terminal of GPIO23.

Count jumps: what should I check?

Check the button wiring and the common ground.