This paper explains how to design an intelligent lighting controller that senses and measures the ambient light level with an ambient light sensor (ALS). Equipped with a real-time clock (RTC), the controller also knows when to turn lighting on or off at specified times. The system presented in this document can be used to control all luminaires that are mains-supply operated. Controller software is also provided in hex format.