A daylight harvesting algorithm has been developed in the scope of this project, which is able to function in a standalone or, in case of multiple modules, in a distributed lighting control system. At the beginning of the subject, the lighting systems and the standards of those systems are introduced. These regulations will serve as guides during the development of the algorithm. At first the algorithm is implemented in a high-level test environment. At that phase we produce the structure and base of the control algorithm and determine the important conditions that we must keep in mind during the implementation. For the next step the algorithm is developed in an embedded environment using the given sensors, while following the regulations. Beside the implemented logic, we ensure the configuration of the control logic, and the modularity of the software component too. We verify the algorithm in a simulated test environment. Finally, we review the optimization options, which have come up during the development.