NPK sensor not sending correct HEX

Urgent! Please help

I tried using CoolTerm software to troubleshoot my NPK that is displaying "FFFFFFF" in the serial monitor.

While troubleshooting I sent the HEX MODbus RTU request for nitrogen which is "01 03 00 1E 00 01 E4 0C" and received "01 03 02 00 00 B8 44" which is incorrect, i don't know the reason why it is displaying those numbers instead of receiving "01 03 02 00 20 B9 9C" which is what I should received, stated in last minute engineers website

Processing: 17353730825193663810851684060937.jpg…

You say it's urgent but don't supply the information needed for anyone to help you. At the top of each forum category there's a topic explaining what is needed to ask a question that has a hope of getting a good answer, please read the topic and supply the information.

1 Like

Why do you think the response is incorrect? The response you received from the NPK sensor is a valid modbus reply - correct CRC etc.

The value you receive is almost guaranteed to be different to that on their website, unless you are measuring under the exact same conditions as the author was.

Note that there are issues with the code found on various websites that show how to communicate with those NPK sensors. Unfortunately they all copy eachother and therefore copy the flaws in the code.

You are likely receiving FF's as that is the value returned by the serial library - actually I think it's -1 (signed int) - when there is no data to read. The code you have found doesn't check to see if there is any data received.

Note that the forum members with agricultural knowledge do not believe that this type of sensor can actually measure what it claims to.

1 Like

Probably just different register addresses used on yours.
Try what you get with request:
01 03 00 00 00 28 45 D4

1 Like

Have you not seen the dozens if not hundreds of posts letting everyone know that those consumer grade NPK sensors are FAKE. The results will be random.

2 Likes

Sorry, I just want to know why is it sending me a different Hex instead of what I expected, there are no other problems in wiring, its working, but the Hex I received is wrong

Thank you mark for giving me ideas about the sensor, I will work on it, the device might be fake, i just wanted numbers to come out of the monitor, for school purposes, even if it's not the correct nutrient, any number will do that will make it working. I really think I bought a fake

Thank you kmin, I will work on it, ill try your code

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