Error on max485 rs485 no data is receving on slave

Hello guys i ma trying to built a connection MAX485 TTL To RS485 Converter Module Board between the nanos (master and slave) that send data over 150m with a CAT 6 A and B pins on the rs485 (there are two of then, my pins connect are rx0 to RO and tx1 to DI and the last one the control in D4 to RE.

and then my slave (receiver) dont response to the master(transmiter) data sending
can someone tell me or fix my code
here you go:

Transmitter/Master code:

int enablePin = 4;  
int potval =0 ;
void setup()
{
  Serial.begin(9600);            // initialize serial at baudrate 9600:
  pinMode(enablePin, OUTPUT);
  Serial.print("Transmitter Nano");
  delay(3000);
  digitalWrite(enablePin, HIGH);  //  (always high as Master Writes data to Slave)
}
void loop()
{
    Serial.print("Sent Value= ");
    Serial.println(potval);   //Serial Write POTval to RS-485 Bus
    Serial.print("Sent Value");
    Serial.print(potval);
    delay(1000);
    potval+=1;
}

Slave/receiver code:

int enablePin = 4; 
void setup() 
{
  Serial.begin(9600);                   
  pinMode(enablePin, OUTPUT);
  Serial.print("Circuito ativo");
  Serial.print("slave Nano");
  delay(3000);
  digitalWrite(enablePin, LOW);       
}
void loop() 
{                                                  
  while (Serial.available())                   
     {                

        int pwmval = Serial.parseInt();           
        Serial.print("tenho o valor definido");
        Serial.println(pwmval);
        Serial.print("valor recebido");
        delay(1000);     
    }
 }

Photos:

Hi,
A circuit diagram of each unit would help as well please.

Tom... :grinning: :+1: :coffee: :australia:

Hello there, thanks for replaying. I updated the post with photos, the schematic and the real photo.

Hello there, thanks for replaying. I updated the post with photos, the schematic and the real photo. So you can see more clearing i also puted the pins the the post clear for you can see what are the pins i am using!

Hi,
Please do not update posts like that.
If you have anything to add from a post request, then put it after the request.

We still need a circuit diagram, not a fritzy picture.
Can you please post a link to the modules you are using please?

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

Hi,
Please view and try this link.
Unfortunately it uses a Fritzy, but you can see the labeling.
https://create.arduino.cc/projecthub/maurizfa-13216008-arthur-jogy-13216037-agha-maretha-13216095/modbus-rs-485-using-arduino-c055b5

Tom.... :grinning: :+1: :coffee: :australia:

max485 - rs485 module this one and a nano (master and slave)

Hello there and sorry for late response i was working, i need to both of modules comunicate together, i only gonna use nanos or megas so the code should be generic for both .. and also later i will connect then to a relay 8 channel

my labbling is almost the same i dont know why slave/recevier dont responde

Hi,
Do you have a DMM to check your circuit?

Tom... :grinning: :+1: :coffee: :australia:

hello there, i might have why?

Why? What?

sorry i didnt get that you say, yes i have! i think the problem is on the coding or am i wrong?

Looking at your picture in relation to your fritzing diagram i think you seem to think that the hole on one side of the valley in your breadboard are connected to the holes on the other side. With most breadboards this is not the case. This results in the DE & !RE to be connected to each other through a resistor, but to nothing else.
Also if you do a 2 way communication you should not use a 120R terminator, but on you picture this is on the other side of the valley and therefore more than likely not connected.

Hi,

That could be true, no markings on the protoboard to show.

@as7rx
Can you check the continuity of the protoboard and the way the rows and columns are connected.
First just measure the voltage at Vcc and gnd points on the 485 modules, make sure you can measure a voltage there.

Tom... :grinning: :coffee: :coffee: :australia:

so how do i fix that?

i will do that! and thanks for the help

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.