This paper proposes a method of minimizing total energy consumption of IoT environment when communication devices in the network share the information directly. The proposed method reduces total number of transmission for the information sharing by using an effective network coding-based technique which dynamically selects a node and a data packet for each transmission. Simulation results show that the proposed method has better performance than an existing network coding-based method selecting transmission node in fixed order, a network coding-based method selecting transmission node in random order, and a uncoded method selecting transmission node in random order.