Bringup
Open the editor
Behavioural mixed-signal modelHC-SR04hcsr04

Ultrasonic distance sensor HC-SR04

5 V ultrasonic sensor: TRIG ≥ 10 µs starts a measurement, ECHO then stays high as long as the sound takes for the round trip (343 m/s; 2 cm … 4 m, without echo 38 ms). The distance is adjustable in the inspector, also during simulation. ECHO has 5 V levels: use a voltage divider on the 3.3 V Pico.

VCCTRIGECHOGNDHC-SR04
Schematic symbol

Key data

Category
Modules
Simulation model
Behavioural mixed-signal model
Manufacturer part number
HC-SR04
Reference prefix
U
Pins
4
Land pattern
PinHeader_1x04_P2.54mm_Vertical

Simulation model

A behavioural model implements the interface of the chip (registers, protocol, timing) at its pins. The pins are connected to the analog circuit like CMOS pins.

Model
hcsr04
Supply pins
VCC / GND

Pins 4

PinNameUse
VCCVCCSupply pinSupply 5 V
TRIGTRIGInput pinTrigger input: 10 µs high pulse starts a measurement
ECHOECHOOutput pinEcho output (5 V!): high time ∝ distance; divider for 3.3 V inputs
GNDGNDGround pinGround

Parameters 1

Distancedistancelive
Default50 cm

PCB

Connector / off-boardPinHeader_1x04_P2.54mm_Vertical

Ultrasonic distance sensor HC-SR04 as a module on a 4-pin header (VCC, TRIG, ECHO, GND) – compare the order with your own module