RS485 Modbus Protocol

Hi, im trying to read data from pH, EC sensor using rs485 modbus RTU protocol. I already follow the sensor manual book but the response always return 0 for ec and ph value.

this is my byte request according to the manual

unsigned char byteRequest[8] = {0x01, 0x03, 0x00, 0x00, 0x00, 0x03, 0x05, 0xCB};

any idea? i have tried querying the calibration command but nothing changes.

Welcome! To get the best attention from the helpers here, instead of screen shots, please post your code in code tags, after reading

Thanks

I moved your topic to a more appropriate forum category @terangbulan25 .

The Nano ESP32 category you chose is only used for discussions directly related to the Arduino Nano ESP32 board.

In the future, please take the time to pick the forum category that best suits the subject of your question. There is an "About the _____ category" topic at the top of each category that explains its purpose.

Thanks in advance for your cooperation.

Looking at your screenshot, you are sending out a valid modbus request and you are getting a valid modbus response of:

01 03 06 00 00 00 00 00 EF 60 F9

Is your sensor lying on a bench or is it stuck in the material you are trying to get a reading from?

Presumably if you were to put the probe into a cup of tap water, you would get a pH of around 7?

i've tried submerging the sensor into a cup of warm water. the temperature was slightly increased but ec and ph stayed at 0 :melting_face:.

I would contact the place you bought it from and ask to return it as it seems to be faulty. Getting exactly zero for 2 readings does sound suspicious.


I tried commenting a block of code where i do the pH calibration and now im getting the ec value. but when i comment the ec calibration and only run the pH calibration, still no sign of pH value showing :confused:

am i the one testing this sensor or is the sensor testing me

Difficult to guess..
You should post your code (using code tags).

Your 2 screenshots appear to show the same modbus query going out, but you are getting a different response from your sensor.

I don't think this is an issue with your code, but an issue with your sensor.

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