This research aims to develop an automatic control system for temperature and humidity in a greenhouse using the NodeMCU ESP 8266 microcontroller in the context of Smart Farming. Optimal greenhouse environmental control is crucial for increasing crop productivity. The system collects temperature and humidity data from sensors, with control using Fuzzy logic rules designed in Matlab. Test results show that the NodeMCU functions well at an average voltage of 4.7 V. The soil moisture sensor provides readings corresponding to soil conditions: dry (12%-14%), wet (66%-71%), and after watering (39%-42%). The DHT11 sensor recorded an average temperature of 33°C and air humidity of 55%. This system provides an automatic solution responsive to environmental changes, creating optimal conditions for plant growth, while improving efficiency and productivity in modern agriculture. This research contributes to the development of sustainable smart farming.