Ensuring desirable performance for piezoelectric microcantilever sensors constitutes a crucial research subject particularly for the applications such as detection of biochemical entities, virus particles or human biomarkers. However, these sensors' performance may be affected by the environmental conditions such as temperature variation, and/or the uncertainty in the material properties. The objective of this study is to explore Young modulus uncertainty of microcantilever's structural layer, thermomechanical and geometrical temperature dependency effects, on the natural frequency, bias and sensitivity of microcantilever mass sensors. These effects have been investigated for different sensor lengths and resonant modes. Also, a temperature compensation method which omits the need for bulky non-contact thermometers or fabrication of built-in temperature sensor has been proposed. As theoretical model, Euler-Bernoulli beam theory has been employed and solved by Galerkin expansion procedure. Using this model, it is demonstrated that the sensitivity of microcantilever sensor decreases with increasing the added mass. The microcantilever sensor sensitivity operating at the second resonant mode has been improved almost five times comparing to the first mode sensitivity regardless of microcantilever length. The simulation results show that temperature variation causes thermal frequency shift which in turn introduces a significant mass bias far beyond the sensors' minimum detectable mass. This mass bias is constant for a given microcantilever in its first and second resonant mode. Additionally, the effect of temperature variation on the sensitivity of the given mass sensors is negligible. However, it has been shown that the variations in sensors sensitivity due to uncertainty of Young modulus remain constant for different lengths and two resonant modes of the microcantilever sensor.