In this paper we present WILLEM, a system for dynamic evacuation routing in buildings, using a wireless sensor network. Dynamic evacuation routing is the process of dynamically determining the fastest routes to the exits. The routes may be changed in case a fire occurs somewhere. We also present an algorithm for detecting congestions in corridors during evacuation, and a means of providing the people in those congestions an alternative route towards the exit. Each phase of the method is descibed extensively: the deployment of the wireless sensor network, the automatic topology learning of the network and the actual evacuation routing methods. We have built a simulation framework in which all types of evacuation routing can be simulated. The results of our experiments were surprising in the sense that dynamic evacuation routing turned out not to be faster than static evacuation routing in every setup; however, we did find out why this is the case. We also performed some experiments on a real wireless sensor network, in order to find out if our automatic configuration method could work in real life. The results are promising. We also present an algorithm for mapping the learned topology of the wireless sensor network upon a virtual map. This way, the network topology can be visualised – which is an important feature for emergency services.