Grove-RS485 not transmitting or receiving

Hello, i've got a problem, I'm doing a project were i need to connect multiple captors to an arduino uno using 2 Grove RS485 for each captor and transmit the information to a LED screen.

But my problem is that my RS485 isn't transmiting nor receiving.

Can you help me please ?

You have an Arduino UNO and some Grove RS485 modules. Is that correct?

Do you have a link to the Grove RS485 modules you are using?

Can you provide a diagram of how you have connected the various modules together?

Post the code you are using as well and we can assist you further.

What does that mean? That your "captors" output TTL serial and you need to transmit that for a long distance?
But why 2?

Explain how you have tested the device and how you know it neither transmits nor receives?

here is the rs485 that I use : Grove - RS485 | Seeed Studio Wiki
here is the code :

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SoftwareSerial.h>
#include "Grove_Temperature_And_Humidity_Sensor.h" 

// Définition du capteur DHT22
DHT dht(3, DHT22); 

// Définition de l'écran LCD (adresse I2C 0x27, modifier à 0x3F si nécessaire)
LiquidCrystal_I2C lcd(0x27, 16, 2);

// RS485 : Utilisation de SoftwareSerial sur les broches 2 (RX) et 3 (TX)
SoftwareSerial RS485Serial(2, 3); 
const int rs485Control = 8; // Contrôle DE/RE du MAX485

void setup() { 
    Serial.begin(115200); // Pour le moniteur série
    Wire.begin(); 
    dht.begin(); 
    RS485Serial.begin(9600); // Vitesse de communication RS485
    pinMode(rs485Control, OUTPUT);
    digitalWrite(rs485Control, LOW); // Commence en mode réception

    lcd.init(); 
    lcd.backlight(); 
    lcd.setCursor(0, 0);
    lcd.print("Init RS485...");
    delay(2000);
    lcd.clear();
}

void loop() { 
    float temp_hum_val[2] = {0}; 

    if (!dht.readTempAndHumidity(temp_hum_val)) { // Lecture réussie
        float temperature = temp_hum_val[1];
        float humidite = temp_hum_val[0];

        Serial.print("Humidite: "); Serial.print(humidite); Serial.print("%\t"); 
        Serial.print("Temp: "); Serial.print(temperature); Serial.println(" C");

        // Envoi des données via RS485
        digitalWrite(rs485Control, HIGH); // Passe en mode ÉMISSION
        RS485Serial.print(humidite);
        RS485Serial.print(",");
        RS485Serial.print(temperature);
        RS485Serial.println();
        digitalWrite(rs485Control, LOW); // Repasser en mode RÉCEPTION

        // Affichage sur l'écran LCD
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Temp: ");
        lcd.print(temperature);
        lcd.print(" C");

        lcd.setCursor(0, 1);
        lcd.print("Hum: ");
        lcd.print(humidite);
        lcd.print(" %");
    } else { // En cas d'erreur de lecture
        Serial.println("Erreur capteur!"); 
        lcd.clear();
        lcd.setCursor(0, 0);
        lcd.print("Erreur capteur!");
    }

    delay(1500); 
}

and here is my wiring

You didn't answer my question about the communication interface of your "captor" and why you supposed to need 2 RS485-TTL converters per captor.

Here the schematic that I need to do :

But it doesn't answer my question.
Maybe you should post a link to the datasheet of your "captors"..

The part circled in red makes no sense :

You are trying to connect an analog input into a digital interface. You need to go back to basics here. I can't read the schematic, it is illegible. All I can make out is "RS485 bus".

To do what you want, you need to insert a nano or similar to read the analog input, and respond to modbus commands over the RS485.

A few things spring to mind.

If you have defined your software serial port as:

Then shouldn't the connector to your RS485 module be on the D2 connector?

What do you intend to send over your RS485 bus with this piece of code:

Forgive me if I'm assuming incorrectly, but I think maybe you might not have understood how an RS485 bus works in general.

An RS485 bus allows several devices to be attached to the same cable. In order to get a piece of information to or from a device on the RS485 bus, there needs to be a way of uniquely identifying that device so that only that device responds to the data. This is usually done by assigning a unique identifier (i.e. address) to each device. You can then communicate with a specific device by transmitting its unique address as part of the data packet - usually the first byte is used.

If you buy off the shelf devices that are - for example - modbus compatible, then that defines the format of the messages that get placed onto the RS485 bus in order to communicate with the devices.

If all the devices are your own home brew devices, then you can invent whatever message protocol you like for them.

As @bobcousins pointed out, you need a programmable device - another UNO or a Nano etc) to convert the analogue signal from the LDR (?) into a digital signal so that it can be sent over your RS485 bus to the UNO.

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