ESP32-S3 bases/The pluggable terminal base/10. A first build on the pluggable terminal base
The pluggable terminal base · 10 of 22

A first build on the pluggable terminal base

One LED on GPIO 16, then one button on GPIO 17, wired into the left edge's push-in ways with four pieces of wire. No soldering and no screwdriver, and neither pin is on the display plug, so a screen can stay on.

What you need

An ESP32-S3 on the base, a red LED, a 330 ohm resistor, a push button, a small breadboard, and four lengths of solid hookup wire. The terminal is a Kangnex WJ250B-3.5, and a parts distributor lists 16 to 22 AWG for it, so use wire in that range. A thinner jumper wire may slide out.

Seat the board first, with its USB sockets over the boxes printed USB and the cable out. Plug the cable in last.

Wire the LED

Which wire goes in which way
step 1: blink
Step
GPIO 16 is
GPIO 16
LOW
LED current
0 mA
Resistor
330 ohm
The pin pushes about 4 mA through the resistor and the LED, to ground. With no resistor the LED would take whatever the pin could give. The LED’s long leg goes toward the resistor, its short leg toward the GND way.

Use the left edge, with the display plug at the top. The silkscreen reads, top to bottom, 3V3, 3V3, GND, GND for the power block and 7, 15, 16, 17 for the first four ways of the signal block.

  1. Strip a short bare end on each wire. Too long leaves copper in the open, 3.5 mm from the next way; too short leaves insulation under the spring.
  2. Push one into the third way of the signal block, GPIO 16, until it stops. Tug it.
  3. Push another into the fourth way of the power block, GND.
  4. Run the first to a breadboard row, then the 330 ohm resistor from that row to the LED's long leg. Run the second from the LED's short leg to the GND wire.

GPIO 16 pushes about 4 mA through the resistor and the LED, with the resistor setting the current. Neither pin is on the display plug, nor read at reset, nor USB.

To blink only, the loop is one line shorter:

void loop() {
  digitalWrite(LED, (millis() / 500) % 2);
}

Add the button

The same figure, second step. Two more wires: the fourth way of the signal block, GPIO 17, and the third way of the power block, GND. Put the button across them on the breadboard, wires on opposite corners of the button.

The pin idles HIGH, held up by a resistor inside the chip, which is what INPUT_PULLUP turns on. Pressing the button joins the pin to ground, so it reads LOW. The sketch ORs that with the blink, so the LED stays on while you hold the button.

The sketch

Open the Serial Monitor at 115200. It prints one line at start-up and then nothing; the LED and the button are the output.

To take a wire out, press the button above its way and pull it. The board itself needs nothing: no jumper to move and no screw to undo.

The code

first_build.ino

Blinks an LED on GPIO 16 once a second and holds it on while a button on GPIO 17 is pressed. It prints a line at start-up, so you can tell an upload fault from a wiring fault without moving a wire.

// ESP32-S3 Pluggable Terminal Base: blink an LED, hold it on with a
// button.
//
// Wiring, left edge of the base, display plug at the top:
//   GPIO 16 way (left signal block, 3rd) -> 330 ohm -> LED long leg
//   LED short leg -> GND way (left power block, 4th)
//   Button, one side -> GPIO 17 way (left signal block, 4th)
//   Button, other side -> GND way (left power block, 3rd)
// The ESP32-S3 sits with its USB sockets over the boxes printed USB.
//
// Arduino IDE, Tools menu:
//   Board             ESP32S3 Dev Module
//   USB CDC On Boot   Enabled
//   Flash Size        16MB (128Mb)
//   PSRAM             OPI PSRAM
// No library needed.

const int LED = 16;
const int BUTTON = 17;

void setup() {
  Serial.begin(115200);
  pinMode(LED, OUTPUT);
  pinMode(BUTTON, INPUT_PULLUP);   // the pin idles HIGH
  delay(1500);                     // let native USB enrol
  Serial.println("LED on 16, button on 17");
}

void loop() {
  bool pressed = digitalRead(BUTTON) == LOW;
  bool blink = (millis() / 500) % 2;   // flips every half second
  digitalWrite(LED, pressed || blink);
}

The button is read with INPUT_PULLUP, so pressed reads LOW and the test is == LOW. The LED is switched from the clock, not with delay(), which is why the button answers at once instead of after the half-second wait.

When it does not work

The LED never lights

Turn the LED round: it only conducts one way, and the long leg goes toward the resistor and the GPIO 16 way. Then check that the resistor is in the same breadboard row as the wire from the way, and that the LED's other leg shares a row with the wire to the GND way. If both are right, tug each wire: a wire that moves never seated.

The button seems to be always pressed, or never

A four-legged push button has two pairs of legs joined inside, so a wire on two legs of the same side is a permanently closed switch. Put the two wires on legs on opposite sides, diagonally. Also remember it reads backwards: pressed is LOW, released is HIGH.

A wire pulls out, or will not go in

Strip a short bare end and push it in straight until it stops, then tug it. To take it out, press the button above the way and pull; do not yank it. The part is a Kangnex WJ250B-3.5, which a parts distributor lists for 16 to 22 AWG wire, so a jumper wire thinner than that may not be held. Use solid hookup wire.

The upload fails before the sketch runs

That is the ESP32-S3 and the cable, not the base. Check the Port in the Tools menu, try the other USB socket, and if it still fails hold BOOT, tap RST, release BOOT and upload again. And check the board went in the right way round, before the cable.

Where this goes next

The same mistake on the screw terminal base, drawn on its own sockets.

Seat the board first →

Edit this page — content/books/esp32s3-base/pluggable-first-build.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 →