Moreover, if we consider heterogeneous scenarios where multiple SN classes exist, possibly with different access priorities and different transmission schemes, such as SPT and APT, an accurate model to determine energy consumption should incorporate all these features, as they also have a great impact on network operation, performance, and energy consumption. Other studies that focus on computing energy consumption in WSNs have deployed approaches similar to the ones proposed in our study. For example, in [17], a stochastic analysis of the energy consumption based on DTMCs is proposed. However, they consider neither heterogeneous scenarios nor an APT scheme. In [18], an energy analysis of a WSN based on DTMCs is presented. It also considers an APT scheme, but the study focuses on routing aspects, and no specific MAC layer protocol is considered. Other studies aimed at computing energy consumption in WSNs that use an SDC-based MAC have also considered an APT scheme and even some degree of heterogeneity among SNs [19; 20]. However, these studies have been accomplished mainly by simulation or direct measurements on laboratory prototypes. In [21], the authors proposed a DTMC-based model of a WSN, where SNs deploy an SDC-based MAC and an APT scheme. The study evaluates different performance parameters, including energy consumption. However, this study does not consider heterogeneous scenarios or priority assignments. Furthermore, although the energy analysis considers the different SN operation cycles and operation modes, the energy consumption methodology proposed in our current study, which is based on fully exploiting the stationary probability distribution, leads to a more systematic and accurate approach than the one proposed there. In [22], we derived closed-form expressions to determine the energy consumed by SNs in a WSN scenario where SNs deploy the PSA-MAC protocol. The study considered the full operation cycle, including the _sync, data,_ and _sleep_ periods. However, the proposed model there supported neither heterogeneous scenarios that consider different SN classes and priorities nor an APT scheme. The PSA-MAC protocol operating in heterogeneous scenarios was also studied and evaluated in [23]. The approach used there to determine energy consumption is similar to the one used in this current work. However, we now extend the study to scenarios where SNs deploy an APT scheme, while previously, only an SPT scheme was considered. In [24], we extended the approach proposed in [23] to compute energy consumption to support APT schemes. However, in this previous study, only the energy consumed during the _data_ period was considered. In the current study, we extend previous studies by including new components of the energy consumption that where not considered in [24]. The key differential contribution of this study, with respect to prior contributions, lies in the development of novel expressions that enable the computation of energy consumption along the entire operational cycle of SNs, taking into account the complexity and challenges that arise in heterogeneous scenarios. One of the main challenges of the current study has been the design of a methodology that allows the definition of the expressions to determine energy consumption in a systematic and conceptually simple way. The remainder of the article is organized as follows. In Section 2, an introductory description of the heterogeneous scenarios of interest and the APT scheme is provided. We introduce the system model in Section 3. A detailed description of the newly proposed expressions to determine the energy consumption is presented in Section 4. In Section 5, the evaluation scenarios are defined, and the results of our model to determine the energy consumption are depicted. Finally, the conclusions are presented in Section 6.