RS 485 control Panel

Hello Arduino Community,

I am building my first bigger Arduino project at the Moment. Unfortunately I am not that much experienced with microcontrollers and so on.

My current project is to build a control panel with the Arduino that can control a certain number of devices. The interface for communication in this case is RS-485. I am using the SN75176BP from Texas instruments for this operation and already got everything working on a breadboard. I can send and receive commands over the rs485 bus, by changing the Enable pins of the IC to high or low depeding on if i want to transmit or receive with the arduino control panel.
The device only answers when it is asked to.

Please see the circuit i build for that here:
https://dl.dropbox.com/u/5970471/transceive_rs485.jpg

Unfortunately i am not quite sure, if the circuit i build, is reliable. Thats because i have seen a lot of circuits with many resistors and transistors on the internet that doesnt really look quite as simple as mine. To be honest i do not really know what the 120 Ohm resistor between A and B does....

My goal ist to achieve a stable communication between the control panel and the controlled device at a baudrate up to 115200 and up to 800m distance.

I would appreciate very much, if you could give me your oppinion on this and describe in detail what i could improve here.

Thanks in advance and best regards,

leper

The resistor between A and B is called a termination resistor and is used to better match the electrical signals to the characteristic impedance of the twisted pair wire. There is actually a requirement for two such termination resistors placed at both physical ends of the total cable length. The higher the baud rate being used and the longer the length of the cable the more important proper line termination becomes. Here is an article that seems to deal well with the subject and has many pictures showing the effects of good and poor cable terminations.

Good luck;

Lefty

Don't forget to add input/output decoupling capacitors to remove noise or glitches in the power supply and use shielded twisted pair cable to add also immunity to noise.