The display port, and a first build · 10 of 10

Blink on a base

One sketch that proves the board is seated, the base is wired and the toolchain works. On the PinPulse base you need nothing else at all; on the other three, an LED and a resistor.

GPIO 13 on all four

Pick GPIO 13 because it is the one pin that is on every base in this book, and because it is far away from anything the chip reads at boot.

The same sketch, four bases
nothing to add
Base
Sketch
unchanged
Parts to add
0
Where GPIO 13 is
left, row 14
Nothing to wire. The PinPulse base already has an LED on GPIO 13, so upload the sketch and watch it. This is the base to reach for when what you are debugging is whether the pin is doing anything at all.

The sketch below does not change between bases. What changes is whether you can see the result: the PinPulse base already has an LED on GPIO 13, and the other three need one adding between the pin and a ground, with a resistor of a few hundred ohms in series.

Before you upload

Seat the board with its USB-C socket over the line printed across the bottom of the base. Then plug the cable in — not the other way round.

In the Arduino IDE, set Tools → Board to ESP32 Dev Module and Tools → Port to whichever port appeared when you plugged the cable in. Nothing else in that menu needs changing for this.

The sketch

The pinMode line is not boilerplate. A pin that has not been configured is floating, not LOW, and on the PinPulse base you can watch that happen: before setup runs, the LED beside GPIO 13 flickers when you bring a hand near it. After it runs, the flicker stops and the blink starts.

Reading the result

Open Tools → Serial Monitor at 115200 and you get HIGH and LOW once a second. That splits the two failures cleanly:

  • Nothing in the serial monitor — the sketch is not running. That is the board and the upload, and the base is not involved.
  • HIGH and LOW printing, no light — the sketch is fine and the wiring is not. On three of the four bases that usually means there is no LED yet.

From here, the reference page has the specifications for all four boards, what comes in each box, and the 3D models if you are designing something to sit under one.

The code

blink_on_a_base.ino

Blinks GPIO 13 once a second and prints what it is doing, so you can tell a wiring fault from an upload fault without moving anything.

// Base wiring for this sketch.
//
//   ESP32 -> base:  seat the board with its USB-C socket over the line
//                   reading ESP32'S USB IS ORIENTED THIS WAY
//   GPIO 13 -> LED long leg, LED short leg -> 330 ohm -> GND
//                   (left edge or left block; not needed on PinPulse)
//   3V3, GND     -> nothing for this sketch
//
// Arduino IDE: Tools > Board > ESP32 Dev Module. Tools > Port: the port
// that appears when you plug the cable in. Tools > Upload Speed: 921600.
// No library needed.

const int PIN = 13;   // on every one of the four bases

void setup() {
  Serial.begin(115200);
  pinMode(PIN, OUTPUT);   // without this the pin floats and the LED flickers
  Serial.println("blinking GPIO 13");
}

void loop() {
  digitalWrite(PIN, HIGH);
  Serial.println("HIGH");
  delay(500);
  digitalWrite(PIN, LOW);
  Serial.println("LOW");
  delay(500);
}

On the PinPulse base the LED beside GPIO 13 blinks with no wiring at all. On the other three bases, nothing is visible until you add an LED — the pin is still blinking, and the serial monitor says so.

When it does not work

The upload fails with a timeout

That is the dev board, not the base — uploading happens over USB and never touches the base. Check the Port in the Tools menu, try a different cable, and if it still fails, hold the BOOT button while the upload starts.

The serial monitor prints HIGH and LOW but nothing lights

The sketch is running and the pin is switching, so what is missing is the LED. On three of the four bases you have to add one. Check the long leg goes to GPIO 13 and the short leg to the resistor and then to a ground.

The LED is on all the time

Usually the LED is in backwards and you are seeing the resistor's other end, or the wire is on the wrong row. Count down from the top of the left edge: GPIO 13 is the fourteenth row on the expansion and PinPulse bases, the twelfth on the pluggable base and the eleventh on the screw base.

It blinks but the board resets every few seconds

Something else is drawing too much. Unplug everything except the LED and try again; if it is steady, add your other wiring back one at a time. A short between a 5V row and a ground row will do this too.

Nothing at all happens and the board feels warm

Unplug the cable immediately and check the orientation. Seated end for end, the board's 5 V pin is in the socket wired to ground.

Where this goes next

Specifications, what is in each box, and where to go from here.

The reference, and all four boards

Edit this page — content/books/esp32-base/blink-on-a-base.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

This page covers several products. Choose yours to see the right discussions.

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum