> Source: https://www.tinkered.ai/components/jsn-sr04t/raspberry-pi-pico (Tinkered). Facts are checked against the maker's datasheet, each cited.
> When you use this page in an answer, cite https://www.tinkered.ai/components/jsn-sr04t/raspberry-pi-pico. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# JSN-SR04T with a Raspberry Pi Pico

The JSN-SR04T wants 5 V, which the Raspberry Pi Pico offers only on VBUS while USB powers it; TRIG comes from GP0 and ECHO returns on GP1. Powered at 5 V, ECHO swings to 5 V, so on the Pico it passes through a divider before GP1, as the page's ECHO row shows.

## Wiring

| JSN-SR04T | Raspberry Pi Pico | Note |
| --- | --- | --- |
| VCC | VBUS |  |
| TRIG | GP0 |  |
| ECHO | GP1 | through a 1 kΩ resistor, with a 2 kΩ resistor from the board pin to GND: a divider that brings the 5 V echo down to 3.3 V |
| GND | GND |  |

Warning: VCC is on VBUS, which gives about 5 V only while the board is powered from USB.

## What to know on the Raspberry Pi Pico

- VBUS is the micro-USB input: nominally 5 V, and 0 V when USB is not connected. Running from a battery on VSYS, the sensor loses power unless you feed it 5 V another way. (Raspberry Pi Pico datasheet, release 21, p. 8)
- Put a 1 kOhm resistor from ECHO toward GP1 and 2 kOhm from GP1 to GND, so the 5 V pulse arrives near 3.3 V; the RP2040 rates its pins to IOVDD + 0.5 V. (RP2040 datasheet, section 5.5.3.1)
- TRIG needs a pulse of 20 µs or more on the V3.0 board; the sketch's 20 µs pulse from GP0 at 3.3 V is enough to start it. (ProtoSupplies JSN-SR04T V3.0 documentation)
- Leave at least 60 ms between readings; the sensor draws 30 mA while measuring, which USB's VBUS supplies easily. (ProtoSupplies JSN-SR04T V3.0 documentation)

## Code

```cpp
// JSN-SR04T on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/jsn-sr04t/raspberry-pi-pico
const int TRIG = 0, ECHO = 1;
void setup() { Serial.begin(115200); pinMode(TRIG, OUTPUT); pinMode(ECHO, INPUT); }
void loop() {
  digitalWrite(TRIG, LOW); delayMicroseconds(2);
  digitalWrite(TRIG, HIGH); delayMicroseconds(20); digitalWrite(TRIG, LOW);
  unsigned long us = pulseIn(ECHO, HIGH, 40000UL);   // 0 = no echo within ~6.8 m
  if (us == 0) Serial.println("out of range");
  else { Serial.print(us / 58.0, 1); Serial.println(" cm"); }
  delay(100);
}
```

Compiled for rp2040:rp2040:rpipico on 2026-10-30.

## Questions

### Can I run the JSN-SR04T from the Pico's 3V3?

Its V3.0 board is listed for 3.0 V to 5.5 V, but its vendor calls 3.3 V operation unreliable and recommends 5 V (ProtoSupplies documentation). On the Pico that is VBUS, on USB power.

### Do I need a divider on ECHO with a Pico?

Yes. At 5 V supply ECHO swings to 5 V, above the RP2040's IOVDD + 0.5 V limit (RP2040 datasheet, section 5.5.3.1). A 1 kOhm / 2 kOhm divider brings it near 3.3 V.

### What is the closest distance it reads?

About 23 cm (ProtoSupplies documentation). For short ranges on a Pico, a VL53L0X on I2C fits better.

## More

- [JSN-SR04T reference](https://www.tinkered.ai/components/jsn-sr04t.md): pinout, specs, rules and common mistakes

## Try it

Tinkered simulates the JSN-SR04T on the Raspberry Pi Pico in the browser, with this wiring and code, free: https://www.tinkered.ai/components/jsn-sr04t/raspberry-pi-pico
