
ESP32-S3 board
The brain that runs your uploaded sketch.
TinySkiff ESP32-S3 Lab · Day 10 of 30
Today the board makes sound. You wire an active buzzer through a small transistor, add a push button, and upload a sketch that beeps the moment you press — a doorbell you built yourself. The transistor is the new trick: it lets a gentle pin switch a load the pin could never drive alone.
TSK-DAY10-BUZZER
Hand this to an agent so it can pull the lesson packet and coach you step by step.
01 First, know the pieces
Nine things, most of them tiny. Tap Define on any part you haven't met — the answer opens as a field note you can read and dismiss without losing your place.

The brain that runs your uploaded sketch.

Spreads the pins into rows you can reach and label.

Makes one fixed tone whenever it gets power.

A tiny switch the pin controls to drive the buzzer.

A four-pin switch that closes the circuit when pressed.

Sits between the pin and the transistor's base to keep the current gentle.

Hold the button's pin at a steady level until you press.

Temporary, solder-free connections.

Uploads the sketch to the board.
02 Make the physical circuit
The official Freenove diagram is your chart — schematic on top, the same circuit built on a breadboard below. Click it to enlarge. Each connection tells you where the wire goes and why.
Mind the transistor's legs. The transistor's three legs have their own jobs — emitter, base, and collector — so get them the right way round against the chart. Unplug USB before you move any wire.
03 One action at a time
This is the main path — you can finish the day without opening a single field note. Tap each step as you go to keep your place.
Seat the ESP32-S3 on the GPIO extension board and keep USB unplugged while you wire.
Place the transistor on the breadboard and note its three legs — emitter, base, and collector.
Wire the buzzer's + pin to the 5V rail and its other pin down to the transistor.
Connect the transistor's base to GPIO 14 through the 1 kΩ resistor.
Wire the push button so one side reaches GPIO 21, then add its 10 kΩ pull-up to 3.3V.
Compare every wire to the chart before you plug in USB.
Open Sketch_06.1_Doorbell.ino in Arduino IDE and upload it.
Press the button and listen.
04 Read just enough code
The whole sketch is short. Two lines set the pins up; the loop just asks the button and answers with the buzzer. Switch to MicroPython if you'd rather see the same idea in Python — the wiring never changes.
#define PIN_BUZZER 14
#define PIN_BUTTON 21
void setup() {
pinMode(PIN_BUZZER, OUTPUT);
pinMode(PIN_BUTTON, INPUT);
}
void loop() {
if (digitalRead(PIN_BUTTON) == LOW) {
digitalWrite(PIN_BUZZER, HIGH); // pressed -> beep
} else {
digitalWrite(PIN_BUZZER, LOW); // released -> silent
}
}
digitalRead(PIN_BUTTON) == LOWTrue only while the button is held — a press pulls GPIO 21 LOW. digitalWrite(PIN_BUZZER, HIGH)Sends the pin HIGH, which switches the buzzer on through the transistor. ledcWriteTone(channel, freq)The passive-buzzer variant (Sketch_06.2_Alertor) uses ledcWriteTone to choose the pitch and sweep a siren. Optional side path · same circuit
button = Pin(21, Pin.IN, Pin.PULL_UP)
activeBuzzer = Pin(14, Pin.OUT)
if not button.value():
activeBuzzer.value(1)
else:
activeBuzzer.value(0)
Pin(21, Pin.IN, Pin.PULL_UP)Reads GPIO 21 as an input with a built-in pull-up — the same job the 10 kΩ resistor does in hardware.activeBuzzer = Pin(14, Pin.OUT)Drives GPIO 14, which switches the buzzer through the transistor.Same pins, same wiring. The passive-buzzer version uses PWM(Pin(14), 2000) and .freq(...) to pick the pitch. Run it in Thonny if MicroPython is set up; otherwise skip it — it should never block the Arduino-first path.
05 Understand, don't memorise
There's no trick here — the pin does the deciding, and a small transistor does the heavy lifting the pin can't.
digitalRead checks GPIO 21 many times a second.
The pin can only supply a trickle of current on its own.
The transistor uses that trickle to switch the 5V buzzer.
Let go and the transistor opens so the buzzer goes silent.
press → transistor switches 5V → buzzer sounds
An active buzzer has its own oscillator and plays one fixed tone. A passive buzzer is silent until you feed it a changing signal, so you choose the pitch.
The pin can't supply the buzzer's current. The transistor lets the small pin signal switch the larger 5V current on and off.
06 Know it worked
Nothing prints to the screen today — the proof is the sound under your finger.
An active buzzer plays one fixed tone — choosing the pitch is the passive-buzzer variant's job.
07 Make the idea yours
Same working circuit, one new idea: giving a sound a meaning. It fits inside today's 30 minutes.
Design a two-beep pattern — short-short, or short-long — and write down what it means. Press it out by hand and see if a listener can read it.
Swap in the passive buzzer and upload Sketch_06.2_Alertor.ino to hear a siren instead of a single note. Notice how choosing the pitch changes everything.
Logbook
08 Learn it with a hand on the tiller
Every lesson ships with a code and a machine-readable packet, so an agent can guide you with full context.
TSK-DAY10-BUZZER
How the agent should behave: guide one physical connection at a time, wait for you to confirm, explain terms on request, and always check the transistor orientation, wiring, board, port, and USB before changing code.