Recently, WSN are widely discussed in many applications. In this paper, we propose WSN based lighting control system for home and building to save energy. Two kinds of lighting devices, namely direct lighting devices and external lighting device, are used to provide illumination level maintaining and day light modeling, respectively. First we model the lighting control problem. Second we translate the lighting control problem to linear programming problem. Third we implement the linear programming using Simplex algorithm in Matlab.