Distance
Interfacing US 100 Distance with Raspberry Pi
What is the US 100?
US 100 practical reference
A drop-in HC-SR04 upgrade that adds temperature compensation and an optional UART mode for more consistent readings. The US-100 uses the same physical dual-transducer layout as the classic HC-SR04, so it fits existing mounts and wiring, but internally it corrects for the fact that the speed of sound changes with air temperature — giving noticeably steadier distance readings across hot and cold environments — and it can optionally be switched into a simple 3-wire UART mode that skips the fussy pulse-timing of the standard trigger/echo interface entirely.
Key specifications
- Sensor type: Dual-transducer ultrasonic ranging module with onboard temperature compensation
- Operating voltage: 2.4V–5.5V DC
- Operating current: ~2.2 mA
- Measuring range: 2cm to 450cm
- Accuracy: ±1% typical, improved over standard HC-SR04 thanks to temperature compensation
- Interface modes: Trigger/Echo pulse mode (pin-compatible with HC-SR04) or UART serial mode, selectable by a jumper
- UART settings: 9600 baud, 8N1, when jumper-configured for serial mode
- Temperature sensor: Onboard temperature sensor used internally to correct the speed-of-sound calculation
Pinout and connection notes
A small onboard jumper (often a solder pad or physical switch) selects between classic trigger/echo pulse mode — wired and coded exactly like an HC-SR04 — and UART serial mode, which instead streams distance readings as simple serial bytes at 9600 baud, avoiding the need for precise pulse-width timing in your microcontroller code.
- VCC: Power, 2.4–5.5V DC
- Trig / TX: Trigger input in pulse mode, or UART TX in serial mode (set by onboard jumper)
- Echo / RX: Echo output in pulse mode, or UART RX in serial mode
- GND: Ground
Integration checklist
- Confirm the exact part number and breakout-board revision.
- Verify supply voltage, current demand, logic levels, and signal direction against the datasheet.
- Check controller pin assignments and bus address or interface mode against the example code.
- Power up with external loads disconnected, then test signals before full integration.
- If readings or communication fail, check power and ground first, then pin mapping, interface settings, and library initialization.
Troubleshooting and reproducibility
Record the board used, wiring, library/version, supply arrangement, and measured behavior. Use the selected board-specific wiring example as the source of truth. Never assume visually similar modules share identical voltage tolerance or pin order.
Setting Up US 100 with Raspberry Pi
Library
pyserial
pip3 install pyserial — then enable the hardware serial port (not the serial console) via raspi-config
Wiring
| Component pin | Raspberry Pi pin | Note |
|---|---|---|
| VCC | 5V (physical pin 2) | |
| TX | GPIO15 / RXD (physical pin 10, through a divider) | Sensor TX is 5V — Pi RX is 3.3V-max and not 5V-tolerant, so the divider is required here |
| RX | GPIO14 / TXD (physical pin 8) | Pi TX is already 3.3V, fine into the sensor's RX directly |
| GND | GND |
Swipe sideways to see every column →
- Enable the hardware UART and disable the serial console in raspi-config first, or /dev/serial0 won't be usable for this.
- The divider on the sensor's TX→Pi RX line matters — this is 5V logic into a non-5V-tolerant Pi GPIO, one of the more common ways to damage a Pi's UART pin.
- Same 0x55-request / 2-byte-reply protocol as the other boards.
Related Components
GP2Y0A21
Analog IR distance sensor for obstacle detection at 10-80cm range — reliable and well-documented.
HC-SR04
The most reliable ultrasonic distance sensor — measure 2cm to 4m with just two GPIO pins.
JSN SR04T
Waterproof ultrasonic sensor for tank level measurement and outdoor robotics.
VL53L0X
A tiny laser time-of-flight ranger that measures distance in millimetres over I²C, accurate to a few percent and far narrower than ultrasonic.
Related Guides & Projects
Raspberry Pi Pico W and Pico 2 W: Install MicroPython with Thonny or UF2
Hold BOOTSEL, drag the correct UF2 file, open the REPL and blink the onboard LED. Includes the Pico vs Pico W vs Pico 2 W firmware differences and what to do when the drive does not appear.
Raspberry Pi Pico W Web Server in MicroPython: Control an LED and Read a Sensor
Connect the Pico W to WiFi, serve a responsive control page, switch an LED and display the onboard temperature or an external sensor, with timeouts and reconnect handling.
Raspberry Pi Pico Oscilloscope with MicroPython
Convert a Raspberry Pi Pico into a basic 500 kSPS oscilloscope using its 12-bit ADC and MicroPython. Displays waveforms on an SSD1306 OLED or streams samples over USB serial to a Python plotter on your PC.
Self-Hosted Nextcloud NAS on Raspberry Pi 4
Build a private, durable Nextcloud NAS on a Raspberry Pi 4 -- SSD boot instead of a failure-prone SD card, Docker Compose with Redis caching, Tailscale for remote access with zero ports forwarded, and an automated backup strategy that actually runs.