A wireless sensor network is a large sensor hub with a confined power supply that performs limited calculations. Due to the degree of restricted correspondence and the large size of the sensor hub, packets sent through the sensor network are based primarily on multihop data transmission. Current wireless sensor networks are widely used in a range of applications, such as precision agriculture, healthcare, and smart cities. The network covers a wide domain and addresses multiple aspects in agriculture, such as soil moisture, temperature, and humidity. Therefore, issues of precision agriculture at the output of the network are analyzed using a star and mesh topology with TCP as the transmission protocol. The system is equipped with two sensors: Arduino DFRobot for soil moisture and DHT11 for relative temperature and humidity. The experiments are performed using the NS2 simulator, which provides an improved interface to analyze the results. The results showed that the proposed mechanism has good performance and output.