## 4 Implementation and Evaluation
### Functional Evaluation
#### 4.2.2 Reliability and Energy Consumption  
To verify the reliability, we made a testbed to emulate a passing vehicle with a rotating arm to which a magnet is attached (Figure 11). Since we separate two T-Sensor nodes under the rotating magnet, they detect the magnet consecutively and report the events to T-BS-com node via T-Sink node. We operated the testbed to emulate a passing vehicle every 715-720 ms for 1-24 hours several times and evaluated the functional reliability including detection and communication. T-Sensor nodes were configured to retransmit up to three times at the application layer based on MAC-level ACK, and the other nodes were set up to retransmit up to three times at the MAC-level. To measure the timing information, we used an oscilloscope (GDS-3254 [37]) and a TI's packet sniffer based on CC2420 and CC2520 [38]. Figure 11: Indoor testbed for evaluating reliability. Figure 10: TAR, TACCR0 register alignment for synchronized periodic timer interrupt in 2 T-Sensor nodes. As we described in Section 3, the T-BS-com node was designed to record every event (APPROACH or DEPARTURE) packet in its local SD card to support fault-tolerance, and we analyzed the recorded data. The event detection probability was measured to 100%, and the end-to-end packet delivery ratio for the event packets was measured to be between 99.1-99.9% as shown in Table 4. Throughput for the end-to-end successful packet (29 bytes of MSDU) delivery was calculated from 638-644 bps. We also measured the throughput between T-Sensor node and T-BS-com node for the real-time magnetic field monitoring packets (111 bytes of MSDU) which were gathered every 15.89 ms and reported from the T-Sensor node and it was measured to be 55.87 kbps. It is noticeable that it is not the maximum achievable throughput of the designed network stack. In addition, the application message (especially, EVENT message) delay from the detection to T-Sink node was measured to be 2.28 ms, 5.16 ms, 8.04 ms, and 10.92 ms for 1 st time success, 1 st retry success, 2 nd retry success, and the last retry success based on MAC-level ACK and application-level retransmissions, respectively. Of course, since the upper tier network was based on MAC-level random back-off and retransmission, the delay from the T-sink to T-BS-com was variable between 5.07 ms and 7.40 ms. Therefore the overall latency of the EVENT message without any retransmission was measured to be from \(2.28+5.07=7.35\) ms to \(2.28+7.40=9.68\) ms. The long and variant latency of the upper tier network is due to the factors such as the random-backoff in LW-MAC and the transmission delay in UART connection in T-Sink node as described in Figure 2. However, the delays and jitters in the upper tier network do not affect the performance of the overall application. As we described in Section 3, unlike other WSN applications, this application is not so strictly constrained by the battery-life time since the basic operation time of PES from the deployment is just six hours, and we leave the system always on. We evaluated the battery life time of PES with the same battery life time model in [29]. MCU is operated at 16 MHz with 10 mA, and the RF transceiver and CC2590 RF front end consume up to 22.8 (rx)\(\sim\)39.5 mA(tx), and the magnetic sensor and relevant gain block including an amplifier draw the current up to 4.6 mA, and the worst-case current consumption of a T-Sensor node is 55.5 mA. We adopted 4,000 mAh Li-Ion rechargeable battery, and it's expected to operate about 74 h. Assuming six hours operation per evaluation, PES can be used for 12 evaluation periods without rechargi