Currently I am using a Raspberry Pi 4 to read temperature and humidity data which will form part of a broader project I am working on
Raspberry pi 4 running node red, wifi enabled
DFRobot SEN0438 Temperature and Humidity Sensor
(Utilise Modbus RTU over RS485)
Waveshare CE07325 Industrial USB to RS485 converter
The Raspberry pi will operate as a Modbus TCP/RTU Gateway. This will allow me to read Temperature and humidity Data via Modbus TCP for devices that utilise Modbus RTU
Currently the Temperature and Humidity Sensor will be connected directly to the USB to RS485 Converter. The question I have is do I need to connect a 120Ohm termination resistor across A+ and B- pins when connecting the Sensor
RS485 requires a 120Ω terminating resistor AT THE RECEIVING END of a cable run. If the data is only one direction one is required. If half duplex operation (2 way traffic, one direction at a time) as both ends receive 2 resistors required (one at each end). If full duplex (both directions at the same time), 2 circuits are required and a resistor is required AT THE RECEIVING end of each circuit.
The RS485 device you linked has these resistors internally fitted so the core description says
“Protection: 600W lightning-proof and surge-suppress, 15KV ESD protection (onboard 120R balancing resistor)”
I assume this should read “onboard 120R terminating resistor”
This is easily checked anyway. Measure the resistance between A and B. If fitted this should be 120Ω. If not fitted a resistor should be connected with the wires across A and B. Both ends will be OK.
I am also assuming you only have one of these at each end with no intermediate devices. If you have intermediate devices fitted the terminations should be ONLY AT THE ENDS.
Waveshare have 2 models of these units, one with and one without the terminations. The one you linked from Core apparently has them but as I said above it is easily checked.
I have checked the resistance across terminals A+ and B- of the Waveshare CE07325 Industrial USB to RS485 converter and the reading is 121.2 Ohms so the termination resistor is built in [Thanks for that].
Your assumption is correct. Currently I only have the one temperature and humidity sensor connected to the Raspberry PI via the USB to RS485 converter (I have not daisy chained multiple units). The system operates half duplex as the Sensor only has two wires (A+[Yellow Wire], B- [White Lead], with the other two leads for external power [Red/Black])
This should mean I can directly connect the sensor with no external resistors required.
That’s right, you should be good to go. If you do add to this make sure the added converters do NOT have the terminating resistors and install the one that HAS these fitted on the end of the run.
Hi Stuart (and Rob),
This discussion brings up all my thoughts about the DMX-512 protocol used in Theatre lighting systems.
Especially the practice of termination of the data lines. Many Lighting techs carried a connector with a 120R resistor built in, to plug into the ‘last’ daisy-chain output on the string of fixtures (maximum of 30 devices due to the capabilities of the RS-485 line drivers). And a handy simple tool in the back pocket was a connector with a pair of red and green LEDs linked between the common and the appropriate data line ( with appropriate resistors in it too ) as a simple visual tester. Remembering that RS485 is a differential balanced signal - as the Data+ line goes high, the Data- line goes low, and vice versus. - to aid in noise rejection.
Both LEDs flickering - seems ok,
Only one flickering - the other data line is open somewhere, work backwards along the chain to find the dud.
no activity - hmm, is anything actually connected and switched on? Start at the controller…
here is how to make it… (he is very chatty ), but also gives a good description of the binary divide-and-conquer method of quick fault finding.
A reasonable reference for using RS-485 (in the guise of DMX512) is here
The formal definition of the DMX-512A standard is here ( slow download)
Just a note, my tester does use a red and a green LED - ignoring the internal differences that is mentioned in the video - as I can use the ‘missing’ colour to determine which data line is not working.
And you can get our latest projects and tips straight away by following us on: