Over the past few decades, research on the Internet of Things (IoT) has advanced quickly thanks to recent advancements in wireless communication technologies. IoT is evolving into a large-scale, all-encompassing network that will be extensively used in environmental monitoring, agriculture, and other fields. Wireless Sensor Networks (WSNs) serve as the IoT systems' primary monitoring infrastructure. WSNs could be used to monitor the conditions in an agricultural field, including temperature, humidity, light, carbon dioxide, soil moisture, and acidity. These factors have a crucial role in the development, excellence, and yield of crops. In order to gather crucial data, numerous sensor devices are placed in agricultural land. The ability of sensor nodes to conserve energy is thought to be crucial for extending the lifespan of WSNs. Innovative, effective, and cost-effective solutions should be devised to provide reasonable energy consumption and maximize the lifespan of WSNs for agricultural. In routing operations, clustering is recognized as a well-known strategy. In this paper, a novel energy-efficient approach based on genetic algorithms and fuzzy logic is suggested to increase network lifetime. The proposed technique use an integrated clustering structure to reduce the distances between sensor nodes where data must be transmitted. The results of OPNET's simulations showed that the suggested system performs better than the IEEE 802.15.4 protocol in terms of energy usage and WSN lifetime.