DIY Full-Duplex to Half-Duplex Conversion for Bus Servo Communication_Tutorials_Product Wiki_Support_Kpower
Hogar > Apoyo >Wiki del producto >Tutoriales
APOYO TÉCNICO

DIY Full-Duplex to Half-Duplex Conversion for Bus Servo Communication

Publicado 2026-11-27

DIY Full-Duplex to Half-Duplex Conversion for Bus servoComunicación

When working on robots or smart gimbals, one common issue is the difference between the communication interfaces used by the controller and the servos.


Microcontrollers such as ESP32 and STM32 usually come with hardware UART interfaces that support full-duplex communication. The TXD pin is used for transmitting data, while RXD is used for receiving data. Both lines work independently.

However, many bus servos use a single-wire half-duplex communication interface. Commands sent by the controller and feedback data returned by the servo share the same DATA_Bus signal line.


Connecting these two interfaces directly is not a good idea. One possible approach is to connect TXD and RXD together and then connect them to the servo data line. But when the controller sends data, the same data will also appear at its own RXD input. If the servo starts sending data at the same time, both sides may drive the bus simultaneously, causing signal conflicts.


The conversion circuit itself is actually quite simple. When designing your own controller board, you don't necessarily need an additional serial converter module. Two single-channel tri-state buffer ICs can handle the transmit and receive switching.


In this tutorial, we'll use a section of an ESP32-S3 bus servo controller schematic to explain how the circuit works and what to pay attention to during implementation.

1. Understanding Full-Duplex and Half-Duplex Communication

With full-duplex UART communication, transmitting and receiving use separate signal lines. The controller sends data through TXD and receives data through RXD. Both operations can take place independently.


Half-duplex communication works differently. Both transmission and reception share the same DATA_Bus line. The controller needs to use the bus when sending commands, then release it so the servo can return its data.


So the main challenge here is not simply changing the signal level. It is controlling the direction of communication.
In this design, two logic buffer ICs are used:
  • U6: SN74LVC1G126DBVR — used in the transmit path, with an active-high output enable.

  • U1: SN74LVC1G125 — used in the receive path, with an active-low output enable.

Both chips are powered by 3.3V and connected to the ESP32-S3 through the TXD, RXD and DIR signals.
Since their output-enable logic is opposite, a single DIR signal can control the transmit and receive paths.

2. How Do the Two Buffer ICs Work?

Let's start with the transmit circuit, U6.


The SN74LVC1G126 has an OE pin at pin 1, an input A at pin 2, and an output Y at pin 4. When OE is high, the signal passes from A to Y. When OE is low, the Y output enters a high-impedance state.


In this circuit, the A input is connected to the ESP32-S3 TXD signal, while the Y output connects to DATA_Bus.

Now let's look at the receive circuit, U1.


The SN74LVC1G125 has a similar pin arrangement, but its OE input is active-low. When OE is low, the signal passes from A to Y. When OE is high, the output enters a high-impedance state.


Its A input connects to DATA_Bus, and its Y output connects to the ESP32-S3 RXD pin.


The two buffer ICs therefore handle transmission and reception separately, without directly connecting TXD and RXD together.
The DIR signal controls their operating states:
When transmitting data, DIR is set HIGH.

U6 enables the transmit path. Data sent from the ESP32-S3 TXD pin passes through U6 and reaches DATA_Bus. At the same time, U1 disables its output, preventing the transmitted data from being fed back into the controller's RXD input.


When receiving data, DIR is set LOW.

U6 disables its output and releases DATA_Bus, while U1 enables the receive path. Data returned by the servo passes through U1 and reaches the ESP32-S3 RXD pin.


In this way, the DIR signal switches between transmission and reception, preventing both buffer outputs from actively driving the bus at the same time.


There is also something worth considering when selecting the buffer ICs. Some devices in the SN74LVC1G family have 5V-tolerant input pins when used under the conditions specified in their datasheets. This can be useful in systems where the servo data line has a 5V pull-up. However, always check the datasheet for the exact part number and its input voltage limits rather than assuming that every device in the family has identical specifications.

3. Schematic Connections and Signal Definitions

The main signal connections are relatively straightforward when this part of the schematic is viewed separately.
Figure 1. ESP32-S3 UART to half-duplex bus conversion circuit.
SeñalPin / ConnectionFunción
TXDESP32-S3 IO4 → U6 pin 2UART data transmission
RXDU1 pin 4 → ESP32-S3 IO5UART data reception
DIRESP32-S3 IO6 → U6 and U1 pin 1Transmit and receive direction control
DATA_BusU6 pin 4, U1 pin 2 and servo connectorsShared servo communication line
VBAT_SWServo connector pin 2Servo power supply
TierraServo connector pin 1Power and signal ground

R9 is a 4.7kΩ resistor connected between 3.3V and DATA_Bus as a pull-up resistor.


Its purpose is to provide a defined HIGH level when no device is actively driving the bus. Without a pull-up, the bus may remain in a high-impedance state and become more susceptible to electrical interference.


Another detail worth considering during PCB design is the DIR signal. I recommend considering a 10kΩ pull-down resistor on this line. When the ESP32-S3 is powering up or being reset, its GPIO pins may not yet be configured for normal operation. An external pull-down can help keep the circuit in receive mode by default and reduce the chance of unwanted transmission during startup.


The RXD line may also need a pull-up resistor, depending on the actual circuit, or its internal pull-up can be enabled in software. During transmission, U1's output is in a high-impedance state, so RXD may otherwise be affected by interference.


There is also a practical detail regarding the servo connectors. H1 to H4 are connected in parallel and share the same VBAT_SW, GND and DATA_Bus lines. This makes wiring more convenient, especially when servos are installed at different joints of a robot.


However, when multiple servos share the same bus, each servo must have a unique ID. This is particularly important when using new servos that may have the same default ID. If two servos respond to the same query at the same time, their responses can conflict on the bus.

4. A Timing Issue to Watch Out for in the Driver Code

After completing the hardware connections, there is another detail to pay attention to in the software.


Sometimes the servo responds normally to position commands, but when reading its position or other feedback data, packets may occasionally be lost. In some cases, even the first byte of the returned data is incorrect.


This is not necessarily a wiring problem. The DIR signal may simply be switching too early.


For example, when using Arduino's Serial1 or the UART interface in ESP-IDF, calling Serial1.write()ouart_write_bytes() usually places the data into the transmission buffer. It does not necessarily mean that the last byte has already been transmitted from the TXD pin.

If DIR is immediately pulled LOW, U6 will disable its output. The last byte may still be waiting in the UART hardware to finish transmission. The servo then receives an incomplete data packet.


The correct approach is to wait until the UART hardware has finished transmitting before switching to receive mode.
Por ejemplo:
// 1. Switch to transmit mode
digitalWrite(DIR_PIN, HIGH);

// 2. Send the data packet
Serial1.write(tx_buf, len);

// 3. Wait until UART transmission is complete
Serial1.flush();

// ESP-IDF can use uart_wait_tx_done()

// 4. Release the bus and switch to receive mode
digitalWrite(DIR_PIN, LOW);

One thing to keep in mind is that the exact behavior of flush() depends on the Arduino core version being used. The important point is to make sure the UART hardware has finished sending the last byte, rather than simply clearing the software buffer.


After switching to receive mode, the program should also use an appropriate timeout based on the servo's response time instead of waiting indefinitely.


At a UART baud rate of 1Mbps, each byte takes very little time to transmit, so the timing of the transmit-to-receive transition becomes even more important. Higher baud rates also place greater demands on both the hardware and software timing.

5. Conclusion

When using a microcontroller to control bus servos, converting a full-duplex UART interface to a single-wire half-duplex bus does not always require a dedicated converter module.


As shown in this design, two tri-state buffer ICs, the SN74LVC1G126 and SN74LVC1G125, can be used to control the transmit and receive paths separately. A DIR signal then handles the direction switching.


If you are designing your own bus servo controller board, this circuit can serve as a practical hardware reference. The circuit itself is not particularly complicated, but several details deserve attention, including the output-enable logic, bus pull-up, default state during power-up and UART transmission timing.


Getting these details right makes it easier to integrate the communication interface into your own robot controller.


Bus servos integrate an onboard MCU with an accessible register table. Depending on the model, you can rewrite PID parameters to match heavy linkages, cap maximum torque or current limits, set acceleration profiles, and configure temperature or stall protection thresholds.


That flexibility is why legged robots and biomimetic hands rely on bus servos—you can soften the compliance on a leg during impact or cut power before a stalled gripper cooks itself. The trade-off is setup time. Leave the proportional gain too aggressive on a long lever arm and the joint will vibrate violently; set the overcurrent threshold too low and the servo shuts down mid-motion under normal load.
Comparison
servomotor
Bus Servo
Interfaz de control
PWM pulse signal (500–2500 µs)
Half-duplex serial bus (UART/TTL or RS-485) with ID addressing
Wiring and pin usage
One dedicated PWM pin and cable per servo
Shared bus lines via daisy-chain or hub; saves controller I/O
Status feedback
None built in; requires external sensors
Reads back position, current, voltage, and temperature
Parameter adjustment
Hardcoded in internal circuit/firmware
Register read/write for PID gains, current limits, and protections
System debugging
Probe signal directly with an oscilloscope
Check baud rates, ID conflicts, packet timeouts, and register values

Where Each One Actually Makes Sense

You do not always need a bus servo. For RC aircraft control surfaces, simple pan-tilt mounts, or small desktop mechanisms with a handful of axes and stable loads, PWM servos are cheaper, faster to wire up, and trivial to debug with an oscilloscope. If your MCU has spare timer pins and you don't need telemetry, keep it simple.


Move to bus servos once you cross roughly eight to ten joints, need tight cable routing across rotating joints, or cannot afford blind stalls. Just remember that sharing a bus means sharing single points of failure—a pinched wire, a mismatched baud rate, or two servos accidentally left on ID 1 will stall communication across that entire branch until you track down the conflict.

Update Time:2026-11-27

Impulsando el futuro

Comuníquese con el especialista en productos de Kpower para recomendarle un motor o caja de cambios adecuado para su producto.

Correo a Kpower
Enviar consulta
Mensaje de WhatsApp
+86 0769 8399 3238