In recent years, the internet of things (IoT) has been used to support the automated farming functions of greenhouses, preventing insects and pests, and stabilizing unsuitable weather and light conditions. Concerning an innovative IoT in agriculture, there are still a number of obstacles to enhancing greenhouses' effectiveness. This study presents the architecture, algorithms, and implementation of an IoT-based automated irrigation control system with temperature and humidity sensors. The system monitors relative humidity parameters using an internet-connected relay that controls irrigation. The relative humidity level is controlled by a 50% threshold. The effectiveness of marigold cultivation can be evaluated by means of marigold stem height, size, number of marigold flowers, and weight of the marigold harvest. The stimulating growth of marigolds is affected in every way by the differences between the proposed IoT system in a greenhouse and the conventional growing method outdoors. This contribution research validates the experimental findings to ensure that the air environment monitoring and irrigation control system consistently increases marigold yield.