# IoT-Based System for Improving Vehicular Safety by Continuous Traffic Violation Monitoring
## 2 Related Work
### The Edge and Sensor Layer  
This layer consists of the GPS sensor, infrared sensor, and limit switch sensor. The GPS sensor, which is considered the primary component of this layer, uses the communication module to communicate with the satellite system. Vehicle speed is estimated using the vehicle's coordinates, provided by GPS. The GPS coordinates are also used to determine the location of traffic violations. The location is necessary for traffic authorities to identify places with more violations and determine future control methods.  
Another option for obtaining vehicle speed is through the CAN bus, which is available in modern cars. However, the proposed system does not include this option because of the likelihood that the CAN bus would not be present in most cars in developing countries. The CAN bus requires a different interface for each car brand, which increases the cost. Moreover, the proposed system has another two important functions, passenger counting and seatbelt checking, and these functions depend on data that are beyond the scope of the CAN bus.  
The other sensor is the infrared sensor, which is composed of an emitter and a receiver and is activated when a passenger interferes with the signal by entering or leaving the  
\begin{table}
\begin{tabular}{c c c} \hline \hline  & **Sensor-Based Approach** & **Computer-Vision-Based Approach** \\ \hline Speed estimation & Proposed system & \\  & [5; 6; 7; 8; 9; 15; 30; 33; 34] & [36; 37; 38; 39] \\ \hline Passenger counting & Proposed system [8] & [12; 42] \\ \hline Seatbelt detection & Proposed system [43; 44; 45] & [13; 14; 46; 48; 49; 50] \\ \hline \hline \end{tabular}
\end{table}
Table 1: Classification of related studies based on the objectives and technologies.  
Figure 1: The proposed monitoring system architecture, which consists of a microcontroller connected to sensors as the edge layer, a processor as a fog layer, and a cloud layer connected to a traffic monitoring station.  
vehicle. Double infrared sensors are used in parallel for each door to determine the direction of movement when entering or leaving the vehicle. Thus, the controller records the movement in the local database with a timestamp for each movement.  
Another type of sensor is the limit switches that are distributed on the seatbelt buckles. All vehicles nowadays have these sensors to check whether seatbelt are fastened or not. However, due to the difficulties of connecting with the vehicle's internal computer system, we installed extra limit switches to verify the functionality of the proposed system. The limit switch essentially generates a high output (binary one) when the seatbelt is fastened. The change in seatbelt status is stored in the local database with a timestamp and the vehicle speed at the time of the change. Moreover, the sensor ID is stored to enable the monitoring of which seatbelt is unfastened and to determine the passenger location. The limit switch sensors are accompanied by pressure sensors to detect whether seats are occupied or not.  
The sensors are connected to the edge layer, consisting of a microcontroller that is responsible for receiving the data from the sensors, aggregates these data, and sends them to the fog layer.