0

I have designed a test board to understand ESP32-S3 working pins. I am using USB interface D+, D- for programing so Serial0 is free to use.

This is my test circuit for testing an RS485 converter. For the test, I am using an MD02 temperature and humidity sensor. Also for the converter I am using this module

enter image description here

This code is not working on Serial0 despite Rx and Tx LEDs are blinking on the RS485 converter.

#include <HardwareSerial.h>

void setup() {
  // put your setup code here, to run once:
  Serial0.begin(9600, SERIAL_8N2, 44, 43);
  Serial.begin(115200);
}

void loop() {
  Serial0.write("READ");
  delay(3000);
  Serial.print("Temp ve NEM: ");
  while (Serial0.available() > 0) { 
    Serial.print(char(Serial0.read()));
  }
  Serial.println(".");
}

This is working

#include <HardwareSerial.h>

void setup() {
  // put your setup code here, to run once:
  Serial1.begin(9600, SERIAL_8N2, 18, 17);
  Serial.begin(115200);
}

void loop() {    
  Serial1.write("READ");
  delay(3000);
  Serial.print("Temp ve NEM: ");
  while (Serial1.available() > 0) {
    Serial.print(char(Serial1.read()));
  }
  Serial.println(".");
}

What should I do differently for Serial0 and RS485?, because the 6M NEO GPS module is working properly on Serial0.

3
  • There are RX0 and TX1 on the PCB. Are these actually the right pins? Commented Oct 10, 2023 at 13:46
  • Yes, RX0 and TX1 names comes from arduino nano. But this 44 and 43 pins of esp32 s3. Also same code working with gps modules as i said.
    – mehmet
    Commented Oct 10, 2023 at 18:48
  • You might want to use your oscilloscope to look for differences. "READ" should be easily detectable, and you can look for the reply. Compare baudrate and UART protocol. Commented Oct 11, 2023 at 5:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.