Specifications
| Sensing element | RCWL-9616 ranging chip with a 16 mm, 40 kHz transmitter and receiver (Huayu HY40A16T12-1 and HY40A16R12-1) |
|---|---|
| Supply voltage | 3 to 5 V, printed 3-5V over the VCC hole. No regulator, so the signals run at whatever you feed it |
| Supply current | 2 to 3 mA typical at 5 V; the listing rates it at 15 mA. The power LED adds under a milliamp |
| Interfaces | GPIO, I2C, UART and 1-Wire, chosen by two solder jumpers, J1 and J2. Both open, as shipped, is GPIO |
| Pins to wire | 4 in GPIO, I2C and UART; 3 in 1-Wire, where TRIG carries everything and ECHO is unused |
| I2C address | 0x57 in the supported library, with nothing on the board to change it |
| UART | 9600 baud in the supported library |
| Range | 2 cm to about 3 m; 4 m in ideal conditions |
| RANGE jumper | Open as shipped. The chip maker's note gives 3 to 5 m typical with it open and 5 to 6 m bridged, for its own transducers; not measured on this board |
| Accuracy | About ±1 cm under a metre, resolving about 0.3 cm |
| Beam angle | 70 ± 5 degrees wide at -6 dB for each transducer (datasheet); narrower for a small or soft target |
| Measurement cycle | 50 ms in GPIO mode, 100 ms on a bus |
| Operating temperature | -25 to 60 °C, the transducers' rating |
| Header | 4-pin right-angle male, 2.54 mm pitch, on the chip side: GND, 3-5V, ECHO/SDA/TX, TRIG/SCL/RX, with GND on the square pad |
| Board | 46.4 × 22.4 mm, two round mounting holes 32 mm apart. The transducers stand 12 mm off the front |
What it is
A 40 kHz burst goes out, bounces off whatever is in front of the board, and comes back. The time between is proportional to distance: halve it, multiply by the speed of sound, and you have centimetres.
What makes this board different from the sensor it is named after is the chip
doing that work. An RCWL-9616 runs from 3 V to 5 V and can hand you the
result four different ways, where the classic HC-SR04 is a 5 V part with one
interface. The board prints its own supply range over the VCC hole: 3-5V.
There is no regulator and no level shifter here. VCC goes straight to the chip, and both signal pins are chip pins brought out to the header, so the logic level is whatever you feed the supply. On an ESP32 that means the 3V3 rail and four plain wires — no divider.
The four modes
Two solder jumpers on the left edge of the back, J1 and J2, decide which
protocol the sensor speaks. Both arrive open, which is GPIO: trigger and echo,
the way an HC-SR04 works.
| Mode | J1 | J2 | ECHO becomes | TRIG becomes |
|---|---|---|---|---|
| GPIO | open | open | Echo pulse | Trigger |
| I2C | short | open | SDA | SCL |
| UART | open | short | TX | RX |
| 1-Wire | short | short | unused | Data |
The table is printed on the board itself. J2 is the upper pad.
A third jumper, printed RANGE, sits at the right. It shorts out a 2.2 kΩ
resistor between the chip and one transducer, and it ships open. The chip
maker's note puts the typical maximum at 3 to 5 m with the resistor and 5 to 6
m without it, for its own transducers; nobody has measured this board either
way.

Pinout
Left to right on the back, pins pointing down. GND is the square pad.
| Printed | GPIO | I2C | UART | 1-Wire |
|---|---|---|---|---|
| GND | Ground | Ground | Ground | Ground |
| 3-5V (VCC) | 3–5 V | 3–5 V | 3–5 V | 3–5 V |
| ECHO/SDA/TX | Echo | SDA | TX | not used |
| TRIG/SCL/RX | Trigger | SCL | RX | Data |
Wiring
Four wires. GND to GND, VCC to 3V3 on a 3.3 V board or 5V on an Uno, and the two signals to any two pins. The four pads you can see on the front are the same header holes from the other side, so the order reads backwards there.
Example
GPIO mode, no library. Note the timeout on pulseIn: without it a missing echo
blocks the sketch for a full second and then reads as zero centimetres.
#define TRIG 9
#define ECHO 10
void setup() {
Serial.begin(115200);
pinMode(TRIG, OUTPUT);
pinMode(ECHO, INPUT);
digitalWrite(TRIG, LOW);
}
void loop() {
// The supported library holds TRIG high for 500 us, so this does too.
// Every HC-SR04 example uses 10 us.
digitalWrite(TRIG, HIGH); delayMicroseconds(500);
digitalWrite(TRIG, LOW);
// Time out at ~4 m of round trip. Without a limit, a missing echo blocks
// for a full second and then reads as a valid measurement of nothing.
long us = pulseIn(ECHO, HIGH, 25000UL);
if (us == 0) {
Serial.println("no echo"); // absorbed, angled away, or out of range
} else {
Serial.print((us / 2.0) * 0.0343, 1); // cm at about 20 C
Serial.println(" cm");
}
delay(100); // A measurement cycle is 50 ms. Let the last burst die away.
}from machine import Pin, time_pulse_us
import time
trig = Pin(9, Pin.OUT)
echo = Pin(10, Pin.IN)
while True:
trig.off(); time.sleep_us(2)
trig.on(); time.sleep_us(500)
trig.off()
us = time_pulse_us(echo, 1, 25000) # returns negative on timeout
print("no echo" if us < 0 else "%.1f cm" % ((us / 2) * 0.0343))
time.sleep_ms(100)Over a bus
In I2C or UART mode the chip does the timing and the arithmetic, and hands back three bytes holding the distance in micrometres, most significant byte first. Divide by 10 000 for centimetres.
The command is one byte — 0x01 over I2C at address 0x57, or 0xA0 over
UART at 9600 baud — then a wait of about 150 ms, then three bytes back. There is
no register map and no status flag. Those numbers are the supported library's,
written for the RCWL-9610A on the earlier board; the RCWL-9616's maker names
the same four modes on the same pins.
Where to start
The handbook below takes the part from the first reading to the four modes and what it can honestly see. If you only read one page, make it the honest range: the 4 m on the box and the 2–3 m you should design to are both true, and the difference is what surfaces do to 40 kHz sound.
When it doesn’t work
- The listing says HC-SR04. Is this an HC-SR04?
- Not electrically. The chip is an RCWL-9616, which runs from 3 V and speaks four protocols where an HC-SR04 needs 5 V and speaks one. In GPIO mode it has the same four pins doing the same jobs, so an HC-SR04 sketch is a starting point — but the wiring advice written for an HC-SR04 does not apply, starting with the voltage divider.
- Do I need a voltage divider on the ECHO line for an ESP32?
- No. There is no regulator and no level shifter on this board, so the signal pins answer at whatever you feed VCC. Power it from the 3V3 rail and ECHO comes back at 3.3 V, straight into the pin. Powering it from 5V on a 3.3 V board is what would create the problem.
- It reads zero, or a huge number, at random.
- No echo came back. Soft or angled surfaces do this, and so does anything closer than 2 cm. Treat a timeout as 'unknown' rather than as a distance, and take the median of three readings.
- Can I put two of them on one I2C bus?
- No. The address is 0x57 and there is no pad or register to change it, so two sensors answer at once and neither reading survives. Give each sensor a pair of GPIO pins, or one pin each in 1-Wire mode.
- Readings are consistently a few per cent out.
- Temperature. The speed of sound changes about 0.6 m/s per degree, so a reading calibrated at 20 °C is out by roughly 3 % at 5 °C. Correct for it if the accuracy matters.
- Which pin is the data wire in 1-Wire mode?
- TRIG, not ECHO. The single wire carries the trigger out and the answer back on the pin marked TRIG/SCL/RX, and the ECHO pin is unused. This is the most common way to wire this board wrong.
- What does the RANGE jumper do?
- It shorts out a 2.2 kΩ resistor between the chip and one transducer. It ships open. The chip maker's note says bridging it takes a typical maximum from 3 to 5 m up to 5 to 6 m with its own transducers; nobody has measured that on this board, so leave it open unless you need the reach and can test it.