door sensor/How it works/05. VCC is your logic voltage
How it works · 05 of 10

VCC is your logic voltage

The pin printed 3V3 is VCC, and VCC powers nothing: it is the level a closed sensor puts on SIGNAL. So it must be your board's logic voltage, 5V on an Uno and 3V3 on an ESP32, an ESP32-S3 or a Pico, and the listing's claim that the module works at either level is true only of the block, not of your pin.

What the pin sees

Open, SIGNAL is whatever the pull-down makes it: 0 V. Closed, it is VCC, less a fraction of a millivolt. Nothing on the board changes that voltage: no regulator, no divider, no resistor in series. Whatever you wire to VCC arrives on your pin every time the door shuts.

VCC is your logic voltage
Your board
VCC wired to5.0 V
Closed puts on SIGNAL
5.0 V
Reads
HIGH
LED
about 0.59 mA
ESP32-S3 VCC pin
3V3
Too high. A closed sensor puts 5.0 V straight onto a pin that runs at 3.3 V, and nothing in between limits it. It will read HIGH, and it is more than the pin is rated for. Move VCC to 3V3.

The bar is what a closed sensor puts on SIGNAL. The line is the lowest level the pin is sure to call HIGH: 0.6 × VCC on the Uno's ATmega328P, 3.0 V at 5 V; 0.75 × VDD on an ESP32 or an ESP32-S3, about 2.5 V; about 2.0 V on a Pico's RP2040. Above the pin's own supply, the pin is being overdriven.

Which pin, on which board

  • ESP32, ESP32-S3, Pico: VCC to 3V3. Their pins run at 3.3 V. Putting 5 V here puts 5 V on a 3.3 V pin with nothing to stop it.
  • Arduino Uno: VCC to 5V. A 3V3 pin is read as HIGH too, but with only 0.3 V to spare.

What the label means

The header prints 3V3 because most TinkerBlock hosts run at that level. It is a name, not a rule. The listing says the module works on either logic level, and that is true of the block, which has nothing in it that cares. It is not true of your pin, and VCC is the one wire on this block that can cost you one.

Nothing on the board needs 3.3 V, or any other voltage, to work. A sensor closing needs only a level to pass on.

When it does not work

I wired it to 5V on my ESP32 and it reads fine.

It reads HIGH because 5 V is well above HIGH. It is also 5 V on a pin whose own supply is 3.3 V, every time the door shuts, with nothing to limit it. Move VCC to 3V3 before it costs a pin.

My Uno reads the door with VCC on 3V3. Is that fine?

It works, with little to spare: the Uno promises to read HIGH from 3.0 V and 3V3 gives it 3.3 V, so there is 0.3 V of margin. Move VCC to the Uno's 5V and the margin is the whole supply.

The sensor is a long way from the board. Does VCC need to be 5 V?

No. VCC is chosen by what reads SIGNAL, not by the sensor or the cable. Keep it at your board's logic voltage and keep the pull-down fitted; a long wire is a better antenna, and the pull-down is what stops it picking up noise.

Alongside this page
Where this goes next

Three wires and a sketch that prints each time the door changes.

The first read →

Edit this page — content/books/door-sensor/vcc-is-your-logic-voltage.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 →