Obtaining location information by localization schemes for sensor nodes makes applications of wireless sensor networks (WSNs) more meaningful. Most of localization schemes only use the information gathered during the execution of the localization scheme. In this paper, we proposed a location model based on Bayesian Network [18] with proximity measurement, the deployment information, and the deployment knowledge to describe the relations of the locations of sensor nodes deployed in a grid topology with the probabilistic graphical model. Based on the location model, we present a cooperative localization algorithm, the CLPKBN scheme, to do the localization for a WSN. To evaluate the proposed scheme, we implement the CLPKBN scheme and the Probability Grid scheme on a simulator. The experimental results show that the CLPKBN scheme outperforms the Probability Grid scheme in most of test cases.