I am using this ultrasound sensor with a Pi. As far as I can tell, it only has a TX connection, and no RX, is this correct? I suspect it is the case, but still want a second opinion.

Also, the sensor TX pin 5 be connected to the Pi RX pin 10 correct? And any regular GPIO can be used on the sensor pin 4 to select real-time or filtered data?


2 Answers 2


The ultrasonic sensor module uses that serial TX to send distance data out. The sensor apparently does not need to receive any serial data from outside world. So you need only TX of sensor --> RX of Pi connection. TX of Pi is not needed.

Since the sensor works with 3.3V range. You can use any 3.3V GPIO pin of Pi to give the pulse for acquiring real time data.


As far as I can tell, it only has a TX connection, and no RX, is this correct?


A distance measurement is "triggered" via pin 4, "Ranging Start/Stop".

Also, the sensor TX pin 5 be connected to the Pi RX pin 10 correct?

The Pi's GPIO pins use 3.3V "TTL" logic, where the lowest voltage is 0 Volts and the highest voltage is 3.3 Volts. The ultrasonic sensor's data sheet says its TX pin uses RS232 signaling by default, which is not voltage-compatible with 3.3V TTL logic.

HINT: SparkFun Electronics' website has a webpage that explains "RS232 vs. TTL Serial Communications".

:: CAUTION :: If you directly connect an RS232 signal to a GPIO pin that is designed for TTL logic, you risk damaging the GPIO pin and possibly the entire board.

The ultrasonic sensor's data sheet indicates that you can modify the sensor so that its TX output uses TTL signaling instead of the default RS232 signaling. After this modification is made, the maximum voltage for the TTL logic HIGH output is defined by the V+ voltage you connect to pin 6. The Pi uses 3.3V logic, so you want to connect a voltage regulated 3.3 Volt power source to the ultrasonic sensor's V+ pin (pin 6), and of course you need to connect the 3.3 Volt power source's GROUND connection to the GND connection (pin 7) on the ultrasonic sensor.

If you don't want to modify the ultrasonic sensor so that it uses TTL signaling instead of RS232 signaling, then you'll need to use an RS232-to-TTL adapter to convert the RS232 voltages (which are unsafe for the Pi's GPIO pins) into 3.3V TTL voltages (which are safe for the Pi's GPIO pins).

The Raspberry Pi's header has 3.3 Volt power and ground pins that provide a regulated voltage of 3.3 VDC. Depending on which Raspberry Pi documents you use, it seems this regulated 3.3V source can safely provide a maximum current of 50 mA (i.e., the load can draw anywhere from 0 - 50 mA). The sensor's data sheet claims the sensor's nominal current draw is "2.5mA at 3.3V". Your Pi's 3.3V power pin can provide current up to 50mA, so you could use the Pi's 3.3V power and GROUND pins to supply power to the sensor's V+ and GND pins.

Of course, if you're planning to use the Pi's 3.3V or 5V power pins to supply power to external devices like this sensor, you want to calculate the combined, total current drawn by all of the external devices to ensure that total current does not exceed the maximum current that can be supplied by the Pi's power pins. For example, if the 3.3V power pin can supply a maximum of 50mA, then the combined total current draw from all of the devices connected to that 3.3V power pin must not exceed 50mA.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.