How to send sensor data from Arduino through NRF24L01 to Raspberry Pi
As you haven't said or shown which NRF24L01 library you are using, one can't say for sure what the problem is, but in some NRF24 implementations, the write() method accepts (or requires) a second parameter, len, giving the number of bytes to be sent.  If the library you're using doesn't require that parameter, it could be defaulting it to some value, or could be treating the buffer as a string, to be terminated with a null byte.

Either of those cases could produce erratic results.

Instead of leaving off the second parameter, specify it.  For example:

radio.write(&amp;moisture, 2);
radio.write(&amp;temp, 2);