collision sensor/A bumper/02. The four pins
A bumper · 02 of 10

The four pins

Four pins, three of them wired. GND and VCC power the block, SIGNAL tells your board whether the lever is in, and NC is connected to nothing. A hit reads HIGH: the board has a pull-down, not a pull-up.

What is on the board

A lever microswitch lying flat along the top edge, two small resistors, a red LED, 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 on a robot's deck or in a breadboard.

The TK17 seen from the front: a black board with a gold-plated border, a black and white lever microswitch lying flat across the top edge with a thin metal lever reaching up and to the left past it, the switch's three legs soldered in a row below it, two small resistors and a tiny LED in the middle, two big mounting holes, lonely binary up the left edge, COLLISION SENSOR and a boxed DIGITAL 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 lever is at the top.

The switch is a Usakro UK-E0516, 12.7 mm long, with a lever that reaches past the board's top edge. It is the tallest part, 7.3 mm from the bottom of the board. Under it, the two resistors are the 10 kΩ pull-down, on the left, and the 1 kΩ for the LED, on the right. The LED sits between them and the header.

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 NO contact. At rest the 10 kΩ pull-down holds it at 0 V and your pin reads LOW. When the lever is pushed in, the switch joins it to VCC, your pin reads HIGH and the red LED lights. HIGH means hit.

GND is on the square pad. The pull-down and the LED both return here.

VCC goes to one contact of the switch and nowhere else. Whatever you connect to VCC is what your pin receives when the lever is pushed in, 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. The switch also has a contact called NC, which is a different thing. COM, NO and NC untangles the two.

SIGNAL is the output. At rest it sits at 0 V and your board reads LOW. Pushed in, the switch joins it to VCC and your board reads HIGH. HIGH means the bumper is touching something.

The same wiring as the push button

The circuit is the TK04 push button's: a switch from VCC to SIGNAL, a 10 kΩ pull-down, a red LED behind 1 kΩ. Only the switch differs. So the pins, the sketches and the pin numbers in this book are the push button's, and a sketch written for one works on the other.

The back of the board

The back of the TK17: a black board with a gold border, lonely binary across the top, three small pads in a row where the switch's legs come through, a figure being struck by a car, two mounting holes, a boxed TK17 COLLISION SENSOR, four header pads in a row with the square one on the right, and DETECTS IMPACTS along the bottom. The switch and its lever show past the top edge.
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 TK17, the number on the box.

When it does not work

Which pin is GND?

Hold the board with the 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 TK17 COLLISION SENSOR and DETECTS IMPACTS instead of the names. Count from the square pad and you cannot get it backwards.

Is there a sensitivity adjustment?

No. There is no potentiometer on the board, and nothing to adjust: the switch clicks when its lever has moved about a millimetre and a half, and that is set by the switch. What you can change is what presses on the lever, and how long your sketch waits before it believes a hit.

Where this goes next

The switch's own three contacts, and why only two of them are used.

COM, NO and NC

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

Community

Questions about this product

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

Ask a question ↗

Collision 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