Auto direction control of 485 modules using not-gate (Part3/3)

In part 2, we learned that:

  1. Only a small portion of RSS485 to TTL chips support automatic direction control. The majority of the chips need to be controlled by R̅E̅ and DE pin.
  2. The SP3485 uses much less power than the MAX13487 in a 3.3v setup.
  3. Most of the non-auto direction control modules you can buy, use a not gate as flow control.

Let’s take a closer look at how a not gate managed to control the flow direction in the XY-017 module. And then I modified the schematic a bit for easier understanding.

The “XY-017” module schematic diagram

The TX signal goes through two not-gate and to DI pin. RO data also goes through two not-gate and to RX. The two not-gate could reform the signal and sharpen the edge, especially when we are driving an LED in this module.

The following oscilloscope graph recorded the signal of 74HC04 Pin 10 (which is the also same as pin DI) versus RS485+. The left part is the MCU asking for the holding resistor value and the right part is the reply from the sensor. There is a short voltage vibration during transitioning. The transition has to be located before the reply of the sensor. The sensor takes around 1ms before replying.

For the R̅E̅ and DI, the signal is latched by C4 (20nF ceramic cap). C4 is charged via R7 and discharged via D3 (there is no current flow into Pin 13), so the discharge rate is much faster than the charging rate. When Pin 10 is high, C4 gets charged. When Pin 10 is low, C4 discharges.

Take a closer look at pin 13 and the inverted output pin 12, we see that the 74ch04 inverts the signal when the input is around 1.3V.

The charging and discharge time has to be set up within the range for a correct latching time of R̅E̅ and DE. Or otherwise, the signal will be disturbed. For a too small capacitor, I changed the capacitor from 32nF to 1nF. R̅E̅ and DE changed state when the requesting message is not yet finished.

As a result, the 485+ 485- are pulled to neutral, and the difference between 485+ and 485- becomes zero (bus idling state). Although the sensor can still understand the message and make a reply.

And here is a zoomed-in capture.

If a too large capacitor is chosen, the transition will occur during the sensor reply signal and disturb the message. As a result, the MCU cannot understand the reply. ***In later time, I will switch to a Schmitt trigger inverter to check any improvement***

Auto direction control by transistor

On the other hand, we could use a PNP transistor as a not gate to control the flow.

MCU sending data

When TX is high, R̅E̅ and DE are low, SP3485 enters receiving mode. When TX is 1, the transistor activates, R̅E̅ and DE pull low, SP3485 output enters high-Z mode (high impedance mode), which means, the output is floating. When the output is floating, the bus line B- will be pulled down to ground while A+ pulled up to Vcc. So when TX is 1, A+ line is 1 and B- line is 0.

When TX is 0, the transistor is off, R̅E̅ and DE pull high. When DE is 1 and DI is 0, B- outputs 1, and A+ outputs 0. So when TX is 0, the 485 line is 0.

MCU receiving data

When the MCU is receiving data, the TX line is pulled 1, R̅E̅ and DE are 0, SP3485 enters receiving mode and transceives the 485 data to MCU.

TXD R̅E̅ DEDI(Pull GND)BARo
MCU sending10000(Floating)1(Floating)1
MCU sending 0110100
MCU receiving 10000(Floating) 1(Floating) 1
MCU receiving10001(Floating) 0(Floating) 0

Appendix: power consumption of Sipex SP3485 and Texas Instruments SN74HC04N

The following is using a Sipex SP3485 chip with Texas Instruments SN74HC04N hex inverter. The Sipex SP3485 does not feature a low power shutdown mode. So this module cannot drop to μA level consumption, please consider Sipex SP3481 or MaxLinear SP3485 if you need a low power mode. In this circuit board, all the pull-down and pull-up resistors are changed to 100k to minimize power loss.

Average transmission current: 4.47mA (requesting: 10.8mA, replying:653.7μA)
Average idling current: 182.86μA

However, the drawback of using such a weak pull-up is that the signal will be much noisier. The good news is that RS485 calculate the difference between AB line, as a result, they compensate each other.

Power consumption of different RS485 to TTL modules (Part2/3)

In this article, I will check the power consumption of different common RS485 to TTL modules. Please note that this is the total consumption of the module including LED indicators for some of the modules.

I will be using the same setup as part 1 with the temperature humidity sensor. Baud-rate:9600, 80 bit (include starting and ending bit) request and then a 90 bit reply data.

The six RS485 to TTL modules I will be using.

1. MAX485 module

Typical operating voltage: 5V
Sleep mode: No
Slew-rate limiting: No
Fail-safe circuitry: Output short-circuit protection, thermal shutdown
AutoDirection control: No
Data Rate: 2.5 (Mbps)
ESD-Protection: –
Module LED indicator: Power LED (always ON)
Maxim Integrated Datasheet: here

MAX485 Block Diagram
5V setup with Arduino Mega

Average transmission current: 112.6mA
Average idling current: 4.7mA
Consumption time: 8.5ms (only consume power during requesting)

3.3V setup with ESP32

***The MAX485 module requires 5V power input as mentioned by the manual, please take your own risk when using 3.3v. But the communication looks normal with my own test, I test ran it for 60 mins***

Average transmission current: 35.86mA
Average idling current: 2.32mA
Consumption time: 8.5ms (only consume power during requesting)

2. SP3485E module

Typical operating voltage: 3.3V, 5V logic tolerant (module power input 3V-30V)
Sleep mode: R̅E̅ high and DE low for 600ns
Slew-rate limiting: No
Fail-safe circuitry: Driver output short-circuit protection
AutoDirection control: No (Yes, controlled by 74HC04 provided by the module)
Data Rate: 10 (Mbps)
ESD-Protection: 2kV
Module LED indicator: TXD indicator, RXD indicator
MaxLinear Datasheet: here

SP3485 Block Diagram

Let’s zoom in on the reply region and have a closer look. The current chart matches the RS485 signal.

Average transmission current: 1.67mA (requesting: 2.46mA, replying 1.11mA)
Average idling current: 321uA

3. MAX13487EESA

Typical operating voltage: 5V
Sleep mode: S̅H̅D̅N̅ pin
Slew-rate limiting: Yes
Fail-safe circuitry: TTL side hot swapping protection
AutoDirection control: Yes
Data Rate: 0.5 (Mbps)
ESD-Protection: 15kV
Module LED indicator: Power LED (always ON), TXD indicator, RXD indicator
Maxim Integrated Datasheet: here

MAX13487EESA Block Diagram

***The MAX13487EESA module requires 5V power input as mentioned by the manual, please take your own risk when using 3.3v. But the communication looks normal with my own test, I test ran it for 60 mins***

Average transmission current: 6.26mA (requesting: 6.67mA, replying:5.93mA)
Average idling current: 5.5mA

4. SCM3721ASA signal isolation YD3082EESA module

Typical operating voltage: 3V-5.5V
Sleep mode: R̅E̅ high and DE low
Slew-rate limiting: Yes
Fail-safe circuitry: Receiver pulls high when receiver’s differential inputs are either shorted, open circuit, or connected to a terminal resistor
AutoDirection control: No (Yes, controlled by HC14 provided by the module)
Data Rate: 1 (Mbps)
ESD-Protection: 15kV
Module LED indicator: None
Datasheet: here

YD3082EESA Block Diagram

Average transmission current: 4.5mA (requesting: 5.27mA, replying:3.8mA)
Average idling current: 3.12mA

5. SCM3725ASA signal isolation SCM3406ASA module

Typical operating voltage: 3V-5.5V
Sleep mode: R̅E̅ high and DE low
Slew-rate limiting: No
Fail-safe circuitry: Receiver pulls high when receiver’s differential inputs are either shorted, open circuit, or connected to a terminal resistor
AutoDirection control: No (Yes, controlled by HC14 provided by the module)
Data Rate: 10 (Mbps)
ESD-Protection: 15kV
Module LED indicator: None
Datasheet: here

SCM3406A Block Diagram

Average transmission current: 6.84mA (requesting: 7.66mA, replying:6.09mA)
Average idling current: 5.19mA

***2 transmissions failed out of 1358 trials ***

6. ADUM5401 DC-DC isolated SP485EE module

Typical operating voltage:5V (module power input 3.3V-5V)
Sleep mode: No
Slew-rate limiting: No
Fail-safe circuitry: Driver output short-circuit protection
AutoDirection control: No (Yes, controlled by HC14 provided by the module)
Data Rate: 10 (Mbps)
ESD-Protection: 15kV
Module LED indicator: Power indicator, TXD indicator, RXD indicator
Datasheet: here

SP485E Block Diagram

Average transmission current: 109.71mA (requesting: 120.72mA, replying:102.06mA)
Average idling current: 72.27mA

Summary

Most of the modules work stable and reliable under my test environment and the code mentioned in the previous article, only the SCM3406ASA module has transmission failure, but only a small portion.

The Max485 is a no go in industrial applications, because it has no ESD protection but the same time high power consumption (But the MAX485 is the only few chips that offer industry qualifications such as MIL-STD-883B). Besides, the MAX485 chip is not any cheaper than the other chip such as MAX481. However, this MAX485 module is extremely cheap compared to the other modules. This could be a good starting point to test out your first RS485 circuit.

The ADUM54, SP485EE module is DC-DC power and signal isolated. If you are working in a harsh environment and do not have power contain, this module may be your choice.

The MAX13487EESA chip is the only chip that has auto direction control and hot-swaps protection. If you want to make your own module and do not want to add any hex inverter, this may be your choice.

The SP3485 module consumes relatively low power, if you are working with a power limited environment, this is your first go. And in part 3, we will dive deeper into SP3485 chip and make our own PCB.