I need to communicate with some Dynamixel servos from a Raspberry Pi. There’s a commonly published circuit to achieve this using a 74LS241 buffer to manage the half duplex connection. (This page lists several versions, all essentially the same: https://pypi.org/project/pyax12/).
However, it connects a 5V part directly to the Pi inputs, which as I understand it aren’t 5V tolerant. Is this circuit valid? It seems to be widespread, so why isn’t it breaking things?microcontrollerdigital-logicShareCiteEditFollowFlagasked 1 hour agoAncient James1111 bronze badge New contributor
- 1Per the schematic, 3 of the 4 pins on the 74LS241 are inputs, these should work with 3.3v logic coming from the Rasp-Pi. However, pin 18 is an output, that is questionable. One solution may be to use a 74241 type that is 3.3v compatible, (one type is a 74LVT241). – Nedd 59 mins ago
- (1) It is risky to even input 5V0 logic signal to 3V3 Rpi GPIO, which might latch up, get fried sooner or later (30 minutes to as long as days), or shortens it life (GPIO and the whole Rpi). (2) For output signals, you can use any of the many 3V3 to 5V0 logical level up shifters. (3) One nice thing is to do two things at the same time: (a) shifting up logical level, (b) converting duplex to simplex. I will try to give a working example using TSX0104, driving UART servo LX224 in my answer below. – tlfong01 25 mins ago
How to convert Rpi 3V3 logical input/output signals to 5V0, to drive UART bus servos such as those by Dynamixel and LewanSoul?
One working solution is to use TSX0104 to do level shift up and also convert duplex to simplex signals at the same time.
This circuit was most likely designed by a non-EE. LS TTL parts have weak high-side drivers so it may marginally work, but NOT recommended. A 74AC241 has strong high-side drivers and would probably damage the RPi.
There are many level-shifters available, you should use one of them.
If you have already built this circuit and the signals are not too fast, you could fix it with a diode and resistor.