In recent years, wireless sensor networks have experienced significant advancements, driven by a reduction in development costs. This rapid growth in WSNs has led to the emergence of various potential and emerging applications, including real-time applications, which pose challenges due to their substantial requirements. As the number of applications continues to increase, ensuring both reliable and real-time Quality of Service (QoS) communication in resource-constrained WSNs becomes a paramount concern. To address this challenge, we propose the use of network coding (NC), a novel research area applicable in diverse environments to overcome several shortcomings within a network. Additionally, we focus on the duty cycle, recognized as one of the most popular techniques for energy conservation. Specifically, we employ the Duty Cycle Learning Algorithm (DCLA) to determine the optimal duty cycle. To guarantee the expected real-time QoS and reliability, we introduce NCDCLA (Network Coding-based Duty Cycle Learning Algorithm). Through simulations in OPNET, our results demonstrate that our approach achieves commendable reliable performance.Povzetek: Nova metoda NCDCLA za zagotavljanje zanesljivosti QoS v WSN je zasnovana kot kombinacija mrežnega kodiranja in algoritma za učenje delovnega cikla.