Wireless Sensor Networks (WSNs) are prone to failures and malicious attacks. Trust evaluation is becoming a new method for fault detection in WSNs. In our previous work, a comprehensive trust model based on multi-factors was introduced for fault detection. This model was validated by simulating. However, it needs to be redeployed when adjustment to network parameters is made. To address the redeployment issue, we propose a Trust-based Formal Model (TFM) that can describe the fault detection process and check faults without simulating and running a WSN. This model derives from Petri nets with the characteristics of time, weight, and threshold. Basic structures of TFM are presented with which compound structures for general purposes can be built. The transition firing and marking updating rules are both defined for further system analysis. An efficient TFM analysis algorithm is developed for structured detection models. When trust factor values, firing time, weights, and thresholds are loaded, precise assessment of the node can be obtained. Finally, we implement TFM with the Generic Modeling Environment (GME). With an example, we illustrate that TFM can efficiently describe the fault detection process and specify faults in advance for WSNs.