A spring and a rod · 02 of 10

The four pins

Four pins, three of them wired. GND and VCC power the block, SIGNAL goes HIGH for a moment each time the spring touches its rod, and NC is connected to nothing. The board has a pull-down, not a pull-up, and it prints ACTIVE HIGH to say so.

What is on the board

The spring switch lying flat along the top, three small parts in a row under it, a red LED under those, and a four-pin header along the bottom edge. The header is right-angled, so the pins point out past the edge of the board and it lies flat in a breadboard or on a panel.

The TK28 seen from the front: a black board with a gold-plated border and lonely binary across the top, a clear rectangular switch lying flat below it with a long coiled spring inside and a leg soldered at each end, three small parts in a row under it, a tiny LED under those, two big mounting holes, a fist icon, a boxed ACTIVE HIGH up the right edge, and a right-angle header labelled GND, VCC, NC and SIGNAL from left to right.
The front. GND is on the left, SIGNAL on the right, and the switch is at the top.

The row of three, left to right, is R4, the 1 kΩ resistor for the LED; R3, the 10 kΩ pull-down; and C1, the 100 nF capacitor, which is the brown one. The LED sits under them, above the header. The switch is the tallest part, about 5.6 mm above the board.

The four names

The four pins
Pin
Pins
4
Pins to wire
3
Pitch
2.54 mm
SIGNAL is the output, on the switch's other leg. At rest the 10 kΩ pull-down holds it at 0 V and your pin reads LOW. Each time a knock swings the spring onto the rod, SIGNAL goes to VCC for a moment, your pin reads HIGH and the red LED flashes. HIGH means knock.

GND is on the square pad. The pull-down, the capacitor and the LED's resistor all return here.

VCC goes to one leg of the switch and nowhere else. Whatever you connect to VCC is what your pin receives while the spring touches the rod, which is why VCC sets the voltage has its own article.

NC means not connected, and on this board it means it literally: no trace reaches that pad.

SIGNAL is the output, on the switch's other leg. At rest it sits at 0 V and your board reads LOW. Each time a knock swings the spring onto the rod, it goes to VCC for a moment and your board reads HIGH. HIGH means knock, and the front of the board says so in a box: ACTIVE HIGH.

The back of the board

The back of the TK28: a black board with a gold border, lonely binary across the top, the two pads where the switch's legs come through, a large fist icon, two mounting holes, a boxed TK28 KNOCK SENSOR, four header pads in a row with the square one on the right, and SENSES VIBRATIONS along the bottom.
The back. The part number is here, and the square pad is now on the right.

Turned over, the order reverses. The square pad is on the right, and it is still GND. The back prints TK28, the number on the box, and no pin names.

When it does not work

Which pin is GND?

Hold the board with the clear switch at the top and the header pins pointing down. Read GND, VCC, NC, SIGNAL from left to right. GND is also the square pad, which is the one mark that survives when the labels are hidden in a breadboard.

Do I have to connect NC?

No. It is connected to nothing on the board. It is there so every TinkerBlock block has the same four-pin header and one cable fits all of them. Wiring it does no harm and changes nothing.

The back has no pin names. How do I tell which is which from there?

Turned over, the order reverses: SIGNAL is on the left and GND on the right, and GND is still the square pad. The back prints TK28 KNOCK SENSOR and SENSES VIBRATIONS instead of the names. Count from the square pad and you cannot get it backwards.

Why are there two holes under the switch?

They are where the switch's two legs come through the board and are soldered. One leg is VCC and the other is SIGNAL. Nothing else is wired to them, and there is nothing to connect there yourself.

Where this goes next

What holds SIGNAL at 0 V while nothing happens, and what makes the LED flash.

The pull-down and the light

Edit this page — content/books/knock-sensor/the-four-pins.mdx

Community

Questions about this product

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

Ask a question ↗

Knock Sensor

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