A TinyML Reinforcement Learning Approach for Energy-Efficient Light Control in Low-Cost Greenhouse Systems
Mohamed Abdallah Salem, Manuel Cuevas Perez, Ahmed Harb Rabia
TL;DR
This work explores a lightweight, on-device reinforcement learning approach for energy-efficient greenhouse lighting control using a low-cost ESP32 platform. By discretizing sensor inputs into 64 states and applying tabular Q-learning with discrete LED actions, the system learns to stabilize target illumination under environmental perturbations, achieving fast convergence and reduced energy consumption. Key findings include rapid on-device learning (often under 100 ms), robust performance amidst disturbances, and clear energy savings compared with open-loop and closed-loop baselines. The study also discusses scalability limitations of tabular Q-learning and points to future extensions for multi-variable greenhouse control and distributed architectures.
Abstract
This study presents a reinforcement learning (RL)-based control strategy for adaptive lighting regulation in controlled environments using a low-power microcontroller. A model-free Q-learning algorithm was implemented to dynamically adjust the brightness of a Light-Emitting Diode (LED) based on real-time feedback from a light-dependent resistor (LDR) sensor. The system was trained to stabilize at 13 distinct light intensity levels (L1 to L13), with each target corresponding to a specific range within the 64-state space derived from LDR readings. A total of 130 trials were conducted, covering all target levels with 10 episodes each. Performance was evaluated in terms of convergence speed, steps taken, and time required to reach target states. Box plots and histograms were generated to analyze the distribution of training time and learning efficiency across targets. Experimental validation demonstrated that the agent could effectively learn to stabilize at varying light levels with minimal overshooting and smooth convergence, even in the presence of environmental perturbations. This work highlights the feasibility of lightweight, on-device RL for energy-efficient lighting control and sets the groundwork for multi-modal environmental control applications in resource-constrained agricultural systems.
