TK27ANALOGbeginner

Analog Microphone

An electret capsule and a one-transistor amplifier on a TinkerBlock board. SIGNAL rests at a level set by the transistor's gain and swings above and below it with sound, in a band of roughly 75 Hz to 1 kHz. Read the peak-to-peak over 50 ms: it hears claps, knocks and loud voices, and it is not a recording microphone.

Comes in this kit — not sold separately

Specifications

TypeAnalog microphone: an electret capsule and a one-transistor amplifier. SIGNAL swings above and below a resting level; there is no op-amp, comparator or LED
CapsuleSTW-9767-Z electret capsule, 9.7 mm across, in a foam ring
AmplifierOne S8050 NPN transistor, common emitter: 510 kΩ base bias, 1 kΩ collector load, emitter to GND. Gain for small sounds about 40 to 130 times from 5 V, worked out
Resting levelSet by the S8050's gain, graded 120 to 400: about 1.6 to 4.0 V from 5 V and 1.2 to 2.7 V from 3.3 V, worked out, not measured. Not half the supply
ResponseThree 100 nF filters: a band of about 75 Hz to 970 Hz from 5 V (67 to 750 Hz from 3.3 V), strongest near 280 Hz. Worked out from the part values
OutputAnalog only: the filtered, amplified sound. Read the peak-to-peak over 50 ms. A clap at arm's length swings it by over a volt; talking a metre away by millivolts. Rough sizes
Supply3.3 V or 5 V on VCC. A loud sound can take SIGNAL up to VCC, so use 3V3 beside an ESP32, ESP32-S3 or Pico and 5V beside an Uno
CurrentAbout 1 to 4 mA from 5 V in silence, worked out from the part values; never more than about 5.5 mA
Pins to wire3 of the 4: GND, VCC and SIGNAL. NC is connected to nothing on the board
Header4-pin right-angle male, 2.54 mm pitch: GND, VCC, NC, SIGNAL, with GND on the square pad
Board22.4 × 30.4 mm, two 4.8 mm mounting holes 16 mm apart. No LED on the board
In the box1 × TK27 block. It also ships inside the TinkerBlock kits

What it is

A microphone capsule, a transistor, and seven resistors and capacitors. The capsule is an electret microphone: a charged membrane with a tiny transistor of its own inside the can. The board's S8050 transistor amplifies what it hears, about 40 to 130 times from 5V depending on the part, and its output is SIGNAL.

The TK27 at an angle: a black board with a wide gold border, a large black microphone capsule standing in a thick foam ring near the top, small resistors and capacitors in columns either side of it, a gold microphone icon below, two big mounting holes, lonely binary along the left edge, a boxed ANALOG along the right, and a right-angle header whose four pins point out past the bottom edge.
The TK27. The capsule is the black disc in the foam ring; the amplifier is the small parts round it.

Three things about it decide how a sketch should treat it. SIGNAL rests at a level set by the transistor's gain, anywhere from about 1.6 to 4.0 V from 5V, and sound makes it swing above and below that level, so a single reading means little: read the highest minus the lowest over 50 ms. Three 100 nF capacitors limit it to a band of roughly 75 Hz to 1 kHz, so it hears claps, knocks and loud voices, not quiet speech and not music. And a loud sound can take SIGNAL right up to VCC.

The page this replaces described an op-amp, an output centred at half the supply, and a level that rises with loudness. The board has no op-amp, its resting level is not half the supply, and a single reading does not rise with loudness.

Resting level and swing

Your boardVCC toResting levelTalking, 1 mClap, arm's length
Arduino Uno5Vabout 325 to 815 of 1023a few countsa few hundred counts
ESP32, ESP32-S33V3about 1.2 to 2.7 Vinside the ADC's own noiseover a volt
Raspberry Pi Pico3V3about 380 to 830 of 1023a few countsa few hundred counts

The resting levels are worked out for the S8050's datasheet range, not measured. The swings are rough sizes from a comparable capsule's sensitivity, because this capsule's own is not published. Your numbers will differ; the gap between talking and a clap will not.

Which pin is which

Parts up, header at the bottom, reading left to right:

GNDto your board's GNDthe square pad: count from here
VCCto 3V3 or 5Vyour board's logic voltage
NCnothingnot connected on the board
SIGNALto an analog inputswings around its resting level

The back prints TK27 ANALOG MIC SENSOR instead of pin names. Turned over, the square pad is on the right, and it is still GND. There is no LED: test it by clapping and watching the swing.

Wiring, in three lines

  1. GND to your board's GND.
  2. VCC to 5V on an Uno, 3V3 on an ESP32, ESP32-S3 or Pico.
  3. SIGNAL to an analog pin: A0 on an Uno, GPIO 34 on an ESP32, GPIO 4 on an ESP32-S3, GP26 on a Pico. On an ESP32, use an ADC1 pin so Wi-Fi does not stop the reading.

Leave NC unconnected.

Example

// The analog pin SIGNAL is wired to.
// Uno: A0. ESP32: 34. ESP32-S3: 4. Pico: 26.
const int MIC_PIN = A0;

void setup() {
  Serial.begin(115200);
}

void loop() {
  // Highest minus lowest over 50 ms: the swing, which grows with
  // loudness. The resting level cancels out of it.
  int lo = 32767;
  int hi = -1;
  unsigned long start = millis();
  while (millis() - start < 50) {
    int r = analogRead(MIC_PIN);
    if (r < lo) lo = r;
    if (r > hi) hi = r;
  }
  Serial.println(hi - lo);
}

Where to start

The handbook below is ten short articles, each with a working figure. The first reading is the whole build in three wires and a few lines, and resting level and swing turns it into one number that means something.

For something that reacts to a clap, a clap switch is the project. If the resting level puzzles you, the resting level works it out; if talking does nothing, three filters says why.

When it doesn’t work

It reads about the same number all the time and barely moves. Is it broken?
Probably not. In silence SIGNAL sits at a resting level, and a single reading of a quiet room is that level. Clap a hand's length from the capsule while printing the peak-to-peak over 50 ms: if it jumps by hundreds of millivolts, the block works. Ordinary talking a metre away moves it by only a few millivolts.
Why is the resting level not half the supply?
Because nothing sets it to half. It is VCC minus the transistor's current through 1 kΩ, and that current is the transistor's gain times a base current fixed by 510 kΩ. The S8050's gain is graded from 120 to 400, so from 5 V one board rests near 1.6 V and another near 4 V. Measure it at start-up; the swing does not depend on it.
Does a louder sound give a higher reading?
Not a single reading. Sound makes SIGNAL swing both ways around the resting level, so one reading can land anywhere on the wave. The number that grows with loudness is the highest reading minus the lowest over a window, about 50 ms. It stops growing once a very loud sound clips at VCC and near 0 V.
Should VCC go to 3V3 or 5V?
To your board's logic voltage: 3V3 on an ESP32, ESP32-S3 or Pico, 5V on an Uno. A loud sound turns the transistor off for an instant and SIGNAL goes up to VCC, so 5V on VCC can put 5 V on a 3.3 V pin.
Can I record speech or music with it?
Not usefully. Its filters pass roughly 75 Hz to 1 kHz, ordinary speech is a swing of a few millivolts, and recording needs thousands of evenly timed samples a second. For recording, use a digital I2S microphone on a board with I2S.
Where is the sensitivity knob?
There is none, and no on-off output. SIGNAL is analog only, and your sketch sets the threshold: measure the quiet swing at start-up and fire a fixed margin above it, as the clap switch in the handbook does.

The analog microphone handbook

10 articles · about 50 minutes

This page is the reference: what the part is, what it is made of, and the questions people arrive already asking. The handbook is the walk — the same part in the order somebody actually meets it.

What is on the board

2 articles

Four pins of which three are wired, an electret capsule in a foam ring, and one small transistor that amplifies it. No op-amp and no LED, whatever the old page said.

The circuit

3 articles

How the capsule is powered and its sound passed on, why SIGNAL rests where it does on your board and not at half the supply, and the three capacitors that decide what it hears.

Reading it

3 articles

One reading catches the wave anywhere. Measure the resting level once, then the swing over a window, and on an ESP32 measure the quiet swing before trusting any threshold.

Using it

2 articles

A clap switch that ignores its own echo, and the short list of reasons a reading looks wrong.

Edit this page — content/modules/analog-microphone.mdx

Community

Questions about this product

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

Ask a question ↗

Analog Microphone

Loading 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