What's the good transmission cable for RS485?
Will twisted pair cable be fine ?
Twisted pair is fine. Shielded twisted pair is even better. Keep in mind that 485 is 3-wire, not 2-wire. The GNDs must be connected. (It is the signal reference)
The cable shield could be used for this if its not being used as a shield and there is no separate core for the GND.
A common practice is to use 2-pair shielded where 1 pair is for the A/B (+/-) and the other pair is for power and gnd. The data and power share the common gnd. The shield is then used as a proper shield.
so it will be 4 wires in one then, can I use separate power supply but same ground , shielded twisted pair as you said ? save some money too...because 4 wires will be more expensive...I need 20 metres at least..
I had tested with different power supply and different ground yesterday, it's working, but don't know if I send heaps ammount of data, I sent only 8 bytes..
Depends on the cable and how much current you draw. Cat5 is about 100ohms per kilometre if my memory is correct. So work out the voltage drop across the 0v wire based on your current.
If you have separate power supplies at each end then Yes, the GNDs still must be connected. This still means 3-wire; A,B,GND.
However, this is where things can get a little tricky. If the supplies can't share a common ground due to significant difference between local ground potentials and supplies aren't isolated, you may need to use isolated 485. I'd be surprised if you'd run in to such problems over 20m.
Kartman's point is important to though may not be an issue for you since you are not running power thru the cable. If you were, and supplying a lot of current, a separate power ground and comms ground is one solution.
Have you read the 485 sticky thread in the general electronics section here?
© 2020 Microchip Technology Inc.