# RS485 Not working, What I'm doing wrong

**URL:** <https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320>\
**Category:** Networking, Protocols, and Devices\
**Created:** [March 26, 2024, 8:57pm UTC](https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320 "2024-03-26T20:57:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ardillolambo](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@ardillolambo](https://forum.arduino.cc/u/ardillolambo)\
**Post date:** [March 26, 2024, 8:57pm UTC](https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320/1 "2024-03-26T20:57:10Z")

</div>

Folks,

Using "shield" MAX485 TTL to RS-485 to communicate a Mega (Master) with a Micro (slave)

Test each sketch using the Serial Monitor and the Slave is sending the data as expected, and the Master is receiving the data as expected. But when I change to the RS485 shield, it appears that data is not being received or transmit or both.

I wired the Shields as per for half duplex communication. Triple check the connections and everything seems to be connected fine, but see no seral activity. I'm not using any resistors for the bus, none of the "tutorials", videos and connection diagrams showed or say anything about  
adding resistors to the bus. What I'm doin wrong??

Below the Codes

Master:

```arduino
const int Tx_Rx = 3; 

void setup() 
{
  pinMode(Tx_Rx, OUTPUT);
  digitalWrite(Tx_Rx,LOW);
  Serial.begin(9600); // Local Serial cooms
  //Serial1.begin(9600); // RS485 Comms

}

void loop() 
{
  Message_From_Slave10();
  //Message_To_Slave();

}

void Message_From_Slave10()
{
  digitalWrite(Tx_Rx,LOW); // LOW = Receiving Data from Serial
  if(Serial.available()) // Check if there is Data in the serial buffer
    {
      if(Serial.read()=='<') // New Message from Slave. 
        {
          int TargetAddress = Serial.parseInt(); // 
          if ( TargetAddress == 10)
          {
            Serial.println (" We have a message from Slave 10");
   
          }
        }
     }
}

```

Slave:

```arduino
const int Tx_Rx = 12;

void setup() 
{
   pinMode (Tx_Rx,OUTPUT);
   //digitalWrite(Tx_Rx,LOW);
   Serial.begin(9600); // Local Serial cooms
}

void loop() 
{
 digitalWrite(Tx_Rx,HIGH); // HIGH = Transmitting Data to Serial
 Serial.print ("<");
 Serial.print (10);
 Serial.print (";");
 Serial.print (0);
 Serial.print (";");
 Serial.print (0);
 Serial.print (";");
 Serial.print (0);
 Serial.print (";");
 Serial.print (1);
 Serial.print (";");
 Serial.print (0);
 Serial.print (";");
 Serial.print (1);
 Serial.print (">");
 Serial.println (" ");
 //digitalWrite(Tx_Rx,LOW); // LOW = Receiving Data from Serial
 delay (5);

}

```

---

<div class="post-metadata">

**Author:** ![markd833](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/markd833/32/1186928_2.png) [@markd833](https://forum.arduino.cc/u/markd833)\
**Post date:** [March 26, 2024, 10:11pm UTC](https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320/2 "2024-03-26T22:11:22Z")

</div>

Can you provide a link to the RS485 shield you are using?

Are you sure your shield is using the hardware serial port for comms?

Can you provide a drawing of the wiring you have used showing the various connections?

---

<div class="post-metadata">

**Author:** ![ardillolambo](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@ardillolambo](https://forum.arduino.cc/u/ardillolambo)\
**Post date:** [March 26, 2024, 11:12pm UTC](https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320/3 "2024-03-26T23:12:49Z")

</div>

@markd833  
here is the connection schematic I used for half duplex mode

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/b/1/b/b1b8ca50032cef889e9a45bd88c9e19745f13c72.jpeg)

Yeah I know... instead connecting DE & RE to pin 2 as shown on the schematic I connected them to pin 12 on the slave and pin 3 on the master...that should not be a problem.  
follow the link below for the shield  
[MAXRS485](https://www.amazon.com/uxcell-MAX485-Instrument-Interface-Arduino/dp/B07R52KJYZ/ref=asc_df_B07R52KJYZ/?tag=hyprod-20&linkCode=df0&hvadid=652455273301&hvpos=&hvnetw=g&hvrand=4244318250999748795&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9010842&hvtargid=pla-2063543581598&psc=1&mcid=3a1b8a47ad7e3b4c9f664fff84d8832c)

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [March 27, 2024, 12:21am UTC](https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320/4 "2024-03-27T00:21:49Z")

</div>

You should not be powering the stepper with the Arduino, use an external power supply

> [@ardillolambo](#):
>
> instead connecting DE & RE to pin 2

Why not show that in your picture. Same as except cause confusion.

---

<div class="post-metadata">

**Author:** ![ardillolambo](https://avatars.discourse-cdn.com/v4/letter/a/df788c/32.png) [@ardillolambo](https://forum.arduino.cc/u/ardillolambo)\
**Post date:** [March 31, 2024, 9:44pm UTC](https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320/5 "2024-03-31T21:44:36Z")

</div>

gilshultz,  
I appreciate your concern but, I did not ask about the servos, I'm not even using them . That's the connection schematic I went by to do the RS485, so I modified to fit my application, I specify that I connected to pin2, that's irrelevant for the issue I'm having. Next time don't waste your time and refrain to answer only what is asked.

---

<div class="post-metadata">

**Author:** ![noobmastha](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/noobmastha/32/738653_2.png) [@noobmastha](https://forum.arduino.cc/u/noobmastha)\
**Post date:** [March 31, 2024, 9:53pm UTC](https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320/6 "2024-03-31T21:53:59Z")

</div>

Master and slave should have common ground and that is not the case on your schematic with two Unos.

---

<div class="post-metadata">

**Author:** ![gilshultz](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gilshultz](https://forum.arduino.cc/u/gilshultz)\
**Post date:** [March 31, 2024, 11:26pm UTC](https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320/7 "2024-03-31T23:26:24Z")

</div>

> [@ardillolambo](#):
>
> I did not ask about the servos, I'm not even using them

They why did you clutter the drawing with them. Maybe the best thing is to redraw it to show exactly what you have instead of playing guessing games.

---

<div class="post-metadata">

**Author:** ![b707](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/b707/32/854321_2.png) [@b707](https://forum.arduino.cc/u/b707)\
**Post date:** [April 1, 2024, 1:03am UTC](https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320/8 "2024-04-01T01:03:45Z")

</div>

> [@ardillolambo](#):
>
> What I'm doin wrong??

You can't use the same Serial for RS485 and for printing message in the Serial Monitor at the same time

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 28, 2024, 1:04am UTC](https://forum.arduino.cc/t/rs485-not-working-what-im-doing-wrong/1240320/9 "2024-09-28T01:04:07Z")

</div>

Closed on September 28, 2024, 1:04am UTC

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