Hello,
I am working on a project connecting Arduino UNO r3 and an RS485 modbus master with MAX485. The connections are shown below.
MAX 485---------- UNO
DI---- ------------------RX(0)
R0-----------------------TX(1)
DE,RE---------------------Pin4
VCC--------------------------5V
GND-------------------------GND
A,B ----------- Master A,B
The problem is that i do not receive any data in RO pin of chip I checked tha the master send data with osciloscope but no data are presend in RO pin. Any ideas what is going on?
Thanks In Advace,
if i am correct the Tx from the arduino should send the data to the DI (input), and the Rx on the arduino should connect to the RO (output) of the MAX485 converter. try swithcing them around.
As already mentioned, TX should go to DI and RX to DO.
Note that it is a bad idea to use the hardware serial port for this as it is already being used to load you sketch and provide the output for the Serial.print functions.
You should look into using a software serial port - SoftwareSerial or AltSoftSerial.
Also search these forums for "NPK sensor" as it uses RS485 and Modbus. You will find some sketches as well which may help you to get started.
If you get stuck, post your sketch along with how you are wiring the UNO, MAX485 and sensor together and a link to the sensor datasheet.