door sensor/The board/01. The four pins
The board · 01 of 10

The four pins

Four pins, three of them wired: GND on the square pad, then 3V3, NC and SIGNAL. The pin printed 3V3 is the board's VCC, and it powers nothing: it is the level a closed sensor puts on SIGNAL. NC is connected to nothing. A closed sensor reads HIGH, which is what ACTIVE HIGH on the front says.

Three wires and a spare

The header is four right-angle pins, 2.54 mm apart, printed GND, 3V3, NC and SIGNAL from left to right with the parts facing you. GND is on the square pad, and that pad is the only way to tell four identical holes apart. Count from it.

The four pins, and the terminal
Show
Header holes
4
To wire
3
Terminal screws
2, 5 mm apart
A closed sensor puts VCC on SIGNAL: HIGH, which is what ACTIVE HIGH on the front means. An open sensor connects it to nothing at all, so it floats. The board has no resistor from SIGNAL to GND, so you set the pin to a pull-down in setup().

GND is where the light ends. 3V3 goes to one screw of the terminal and to nothing else on the board. SIGNAL goes to the other screw, and to the light. NC is in no net at all.

What HIGH means

The front prints ACTIVE HIGH up its right edge. The sensor you screw into the terminal is a switch between the 3V3 pin and SIGNAL. When the switch closes, SIGNAL is joined straight to that pin and reads HIGH. When it is open, SIGNAL is joined to nothing.

That second sentence is the part the other TinkerBlock sensors do not share: there is no resistor on this board that gives SIGNAL a level while the switch is open. No pull-down on the board is about that, and every sketch in this book deals with it in setup().

3V3 is a label, not a requirement

The pin is printed 3V3 because that is the level most TinkerBlock hosts run at. On this board it is the VCC net, and a closed sensor passes whatever you put on it to SIGNAL. So it must be your board's own logic voltage: 3V3 on an ESP32, an ESP32-S3 or a Pico, 5V on an Uno. VCC is your logic voltage covers why.

When it does not work

Which end of the header is GND?

The square pad. From the front, parts up and pins pointing down, it is the left-hand pin, and the order is GND, 3V3, NC, SIGNAL. The back prints no pin names; turned over, the square pad is on the right and it is still GND.

The header says 3V3. Must I give it 3.3 V?

No. The label names the level the pin was drawn for, not a requirement. This pin is VCC: it goes to your board's logic voltage, which is 5V on an Uno and 3V3 on an ESP32 or a Pico. Nothing on the board runs from it.

Should I connect NC to something?

No. It is soldered to a pad that no trace reaches, so it makes no difference either way. It is there so every TinkerBlock block has the same four-pin header and one cable fits all of them.

Where this goes next

A screw terminal, a resistor and a light, and what each one is for.

What is on it →

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

Community

Questions about this product

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

Ask a question ↗

Door 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 →