# IoT Based Smart City Bus Stops
## 5 System Prototype Implementation and Testing  
In light of the aforementioned hardware and software architectures, the objective of the design proposed was to optimize energy consumption through estimating the bus stop occupancy, remotely monitoring, and automatically controlling the air conditioning and lights. The system also reports utility breakdowns and measures the air pollution around the area. As such, the outcome should be a standalone remote monitoring and control unit that can be installed in existing bus stops to enhance their operation in terms of efficient energy consumption and user satisfaction. To validate the proposed system's hardware and software architectures, a prototype was built and tested. The prototype is shown in Figure 4.  
Figure 3: System deployment diagram. The sensors used were DHT22 for temperature and humidity, TSL2561 for light, MQ7 for carbon monoxide, MQ6 for LPG, and MQ135 for smoke detection. Table 2 shows the specifications of the used sensors. Verification of our system included tests that enabled us to check if the code and procedures executed by the hardware and software were correct. Test cases were developed based on certain use cases and tested to verify if they matched the expected output. According to the proposed system's requirements, the marker attribute on the app's map must turn green if all the following conditions are met: the bus stop is not empty, the temperature is less than or equal to 23 \({}^{\circ}\)C, the LPG is less than or equal to 65 ppm, the CO is less than or equal to 39 ppm, and the lights are working. The marker attribute on the application's map must turn red if any of the following conditions are met. The bus stop is not empty, the temperature is greater than 23 \({}^{\circ}\)C, the LPG is greater than 65 ppm, the CO greater than 39 ppm, or the lights are not working. The thresholds used for CO and LPG were reduced for testing purposes as it was not possible to obtain hazardous CO and LPG levels. The test conditions above were used to check the correctness of the hardware for controlling the lights and the air-conditioning and report them as broken if needed. This was achieved by adjusting the temperature, occupancy, LPG, and light levels. The actual outcomes were the same as the expected output for all of the above test cases. For example, in test case 3, the AC was turned ON as expected because the bus stop occupancy was 1 and the temperature was 24 \({}^{\circ}\)C (map indicator was green, as shown in Figure 5a). On the other hand, in test case 6, the AC did not work although the temperature was 27 \({}^{\circ}\)C with an occupancy of 5 (map indicator was red, as shown in Figure 5b). This indicates that the AC was malfunctioning, which confirms that the system was able to detect such abnormality. More test cases results are tabulated in Table 3. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & **Humidity** & **Temp** & **CO** & **Smoke** & **LPG** \\ \hline Sensor Name & DHT22 & DHT22 & MQ7 & MQ135 & MQ6 \\ Operating Range & 0–100\% RH & \(-\)40–80 \({}^{\circ}\)C & 20–2000 ppm & 10–300 ppm & 200–10000 ppm \\ Sensor Resolution & 0.1\% RH & 0.1 \({}^{\circ}\)C & \(<\) 0.5 ppm & \(<\) 0.6 ppm & \(<\) 0.6 ppm \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Sensor specifications. Figure 4: (a) IoT based bus stop 3D model; (b) System hardware prototype. Figure 5: _Cont._