School zones are areas near schools that have lower speed limits and where illegally parked vehicles pose a threat to school children by obstructing them from the view of drivers. However, these laws are regularly flouted. Thus, we propose a novel wireless sensor network application called School zone Safety System (S3) to help regulate the speed limit and to prevent illegal parking in school zones. S3 detects illegally parked vehicles, and warns the driver and records the license plate number. To reduce the traveling speed of vehicles in a school zone, S3 measures the speed of vehicles and displays the speed to the driver via an LED display, and also captures the image of the speeding vehicle with a speed camera. We developed a state machine based vehicle detection algorithm for S3. From extensive experiments in our testbeds and data from a real school zone, it is shown that the system can detect all kinds of vehicles, and has an accuracy of over 95% for speed measurement. We modeled the battery life time of a sensor node and validated the model with a downscaled measurement; we estimate the battery life time to be over 2 years. We have deployed S3 in 15 school zones in 2007, and we have demonstrated the robustness of S3 by operating them for over 1 year.