r/arduino • u/lazuli04 • Oct 05 '26
Need help for RS485 sensor
I am using an RS485 3-in-1 sensor and pH sensor.
I managed to make them work before. However, after rewiring (I was about to do an integrated system test, it worked on individual testing), it suddenly stopped working and my debugging code shows that they are receiving 0 bytes. I tried doing an individual test again, and it still wont work. It's unlikely that both sensors stopped working at the same time,=. I also have an unused npk RS485 sensor, which is also receiving 0 bytes.
Here's a list of things I have tried already:
Oscilloscope tests
- Burst 0x55 sketch (1 s pause, Single trigger): clean, mirrored signal on A and B
- Same test with sensor disconnected vs connected on the ttl module (I use a max3485): same signal, so the sensor doesn't load the line
- One sensor wire removed at a time (A, then B): signal showed on each
- Probe on module TXD pin: data showed, but ESP32 read 0 bytes
Code tests
- Original pH sketch (the one that worked on individual testing): 0 bytes or partial junk
- Address scan 1 to 10, first version: "replies" at every address (19 to 20 bytes), not real because the check was too loose
- Loopback with a jumper between GPIO16 and GPIO17: received 01 03 00 00 00 01 84 0A correctly, so the ESP32 works
- Module reconnected, sensor off: 0 bytes
- Module reconnected, sensor on: about 20 to 23 bytes of changing junk
- Scan with speeds 1200 to 19200: false "replies" with no valid format
- Strict scan (error check), 4800 and 9600, addresses 1 to 10: no real reply
- Wide strict scan, addresses 1 to 247, speeds 2400, 4800, 9600: no real reply on laptop power and on the bench supply
- Original sketch on the bench supply: 4 to 6 bytes of changing junk
- NPK sketch and 3-in-1 sensor: 0 bytes
Multimeter readings
- Module TXD pin, resting level: 3.26 V (healthy)
- Sensor power wire against ESP32 GND: 4.78 V
- Bench supply set to 5.5 V: no change in the result

