Your diagram doesn't provide sufficient detail - you should do a Google search on "RS485 repeater" which is what you really need where your diagram shows an optoisolator.