RS485 using six arduino NANO as slave and PC as Master

Thread Starter

jayantbarik

Joined Jan 25, 2021
1
I am trying make a network of RS485 using around six arduino NANO as slave and PC as Master. I have purchased six TTL to RS485 converter and one RS485 to USB module. The TTL modules show 120ohm resistance when I measure before connecting at its A & B points. But the RS485 to USB module shows open resistance( No value). I want to know whether it doesnot have the terminating resistance and pull up and pull down resistance as it is seen in TTL-RS485 modele as R5,R6,R7 ? Should I remove R5-6-7 resistance from all modules excepting the end module?
 

dendad

Joined Feb 20, 2016
3,835
On all the RS485 devices I have designed and made over the years, I've included a 10K pull up and a 10K pull down on each unit. And a link to switch in a 120R termination as required. This may not be the recommended design but it has worked well.
A termination is usually only needed on the ends of long lines. Or maybe if the installation is noisy.
Always include the 0V lead connected to the shield, maybe through a resistor. Forgetting to have the common 0V line between units can really spoil your day if they are running on separate power supplies. We had a network in a wire mill that would swing way further than the common mode voltage, and as it was our first RS485 use, we went with the "Two Wire" myth and did not run a common connection as well. Now all the installations are in shielded 120R twisted pair data cables, with the 0V common connected via the shield.
If you need isolation, have a look at the MornSun RS485 isolated drivers. https://www.mornsun-power.com/html/products/48/rs-485-transceiver-module.html
They are pretty cheap. The one I used have the TRX sense inverted with respect to the MAX485 type of driver chips. that is a bit of a pain as an extra inverter was needed on the boards that have the isolated driver build option if the same software is used, but if you have a version of software for each type, that is another way to go. I like common software myself, with the hardware changed as needed.
 

John P

Joined Oct 14, 2008
1,897
I have a USB to RS485 converter, and I was annoyed to find that it doesn't have a pin to send out 5V from the computer power supply to power external devices the USB to UART converters usually do. That was true even though the output is connected via a 9-pin D-sub with several spare pins! I cracked open the case and added a connection, using a diode in case I actually did power the external system from its own supply. That means that I'm not getting a full 5V externally, but that's OK.

With most Arduinos, you have to think about how to share the serial port between the USB interface and whatever else you want to connect to. The line from the USB converter to the processor is shared with the external RX pin, with the USB link working through a resistor so that anything you connect externally will win, but when you've got it wired up, you can't use USB any more, at least to receive from the computer. That means you can't change the Arduino's program. So you have to control the RX line from the RS485 converter, and disable it when you want to receive from the USB port. But how can that work, if the USB link is disabled? Just something to consider in advance.
 

djsfantasi

Joined Apr 11, 2010
7,689
I have a USB to RS485 converter, and I was annoyed to find that it doesn't have a pin to send out 5V from the computer power supply to power external devices the USB to UART converters usually do. That was true even though the output is connected via a 9-pin D-sub with several spare pins! I cracked open the case and added a connection, using a diode in case I actually did power the external system from its own supply. That means that I'm not getting a full 5V externally, but that's OK.

With most Arduinos, you have to think about how to share the serial port between the USB interface and whatever else you want to connect to. The line from the USB converter to the processor is shared with the external RX pin, with the USB link working through a resistor so that anything you connect externally will win, but when you've got it wired up, you can't use USB any more, at least to receive from the computer. That means you can't change the Arduino's program. So you have to control the RX line from the RS485 converter, and disable it when you want to receive from the USB port. But how can that work, if the USB link is disabled? Just something to consider in advance.
Whats the issue? Your not going to use the UDB when you’re overwriting the sketch... pull the USB to RS485 cable and connect the programming cable. Then, reverse. The USB can only be used for one function at a time anyway.
 

dendad

Joined Feb 20, 2016
3,835
Moving my post asking about changing to a Raspberry Pi Pico sytem may be good, to start a new thread. But one reason I was asking here about the Pico is that it has a couple of free serial ports. The TS seems concerned with the serial port issue. Also, the power supply on the Pico can handle lower input volts. That may help. (As well as being much cheaper and more powerful.)
I thought it a valid addition to this post.
 

MrChips

Joined Oct 2, 2009
23,515
If you are attempting to create an RS-485 network you do not need multiple serial ports. That is the whole point of a network.
 

djsfantasi

Joined Apr 11, 2010
7,689
I have a USB to RS485 converter, and I was annoyed to find that it doesn't have a pin to send out 5V from the computer power supply to power external devices the USB to UART converters usually do. That was true even though the output is connected via a 9-pin D-sub with several spare pins! I cracked open the case and added a connection, using a diode in case I actually did power the external system from its own supply. That means that I'm not getting a full 5V externally, but that's OK.

With most Arduinos, you have to think about how to share the serial port between the USB interface and whatever else you want to connect to. The line from the USB converter to the processor is shared with the external RX pin, with the USB link working through a resistor so that anything you connect externally will win, but when you've got it wired up, you can't use USB any more, at least to receive from the computer.
I don’t get it? Why would you power the RS485 network when updating the sketch? If it’s not active, it can’t interfere with the USB comms.

Or use different pins for TX and RX. Great application of the Arduino SoftwareSerial library...

It’s not impossible. In fact, sharing TX/RX with the USB port is often done. If you search enough, there are solutions out there.

In fact, I have a system that uses TX/RX to communicate with a SSC32 servo control board AND uses the USB port to update the sketch. I have ZERO problems or conflicts and I didn’t do anything special.

This is a non-problem.
 
Top