Wireless sensor networks may have unconnected nodes known as orphaned nodes due to their failure in obtaining a network address from a router-capable parent node in the network initialization process. The existence of a large number of orphaned nodes adversely affects the performance of wireless sensor network applications such as real time sensor-based automated irrigation control systems. We investigated the optimal management of orphaned nodes in a sensor network deployed in an automated irrigation system. In practice, it is unavoidable that sensor measurements contain random noise. The presence of orphan nodes adds to the effect of measurement noise further reducing the precision of irrigation management. However, reconnecting/restoring orphaned nodes to the sensor network may require some compromises to be made since the parent nodes are restricted in the maximum number of children they can possess. Optimal restoration can be achieved by finding the optimal parent node for each orphaned node that improves irrigation management. We propose two algorithms to suboptimally restore the orphaned nodes to the network, satisfying network constraints for small and large areas of farming. Numerical examples are presented to demonstrate the performance of the proposed methods.