What do I need to do with this command?

I am using a sensor which uses Serial Communication.

In a command it says: sent those bytes and you will recieve this and this return values. Everything is fine here and it works.

But in another command there are only the return values given?

Is this common in datasheets of various sensors?

A very good question. That information seems to be missing from the data sheet. Probably no one in this forum will know the answer. You may have to contact the manufacturer. Perhaps there is a later version of the data sheet available.

You should make it an automated habit to read a datasheet from the very first to the very last line.

if you do read datasheets - automatically

The datasheet says
Note: The communication has active upload and question-and-answer mode. The default mode is Q & A mode after power-on.
You can use commands to switch between the two modes. After power-off or switch power consumption mode, the Q&A mode is
restored.

So I guess if you activate active upload-mode this means the sensor is sending the values in a certain timeinterval automatically and this is the answer you get - automatically

Be the change you want to see in the world
best regards Stefan

They are example values you might receive, and the formula describes how you would convert these into the required values.


You could use the standard Arduino function word() for this, then divide by 100.0.

what is unclear to me is the perspective that they use.
Is active upload the microcontroller sends a request
or
is active upload the sensor is sending without a request of the microcontroller

It seems to be a chinese manufacturer. So the translation to english might be of minor quality.

You can check this by analysing
does the module send bytes itself?
if yes what bytes does the sensor-module send?

If not write a testprogram that does send the commands and analyse what you receive

For a new sensor this is pretty common to do the steps I describe above

Be the change you want to see in the world
best regards Stefan

1 Like

It would be a nice support to the forum if you post post your complete sketch as a thank you and as supporting the community

You can post code by using this method that adds the code-tags
There is an automatic function for doing this in the Arduino-IDE
just three steps

  1. press Ctrl-T for autoformatting your code
  2. do a rightclick with the mouse and choose "copy for forum"
  3. paste clipboard into write-window of a posting

best regards Stefan

Yes, it is correct, but it's less "Arduino style" and less beginner friendly. You could have written

T = word(rcv[8], rcv[9])/100.0;
1 Like

Wrong! The x4F in position 0 is an "O", the x4B is a "K" so the upshot is the sensor returns "OK" for most commands.

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