# Real-Time Anomaly Detection in Cold Chain Transportation Using IoT Technology
## 3 Materials and Methods
### The Perception Layer
#### 3.2.2 Sensors  
A limitation of the Eagle's architecture was that I2C devices produced by third-party manufacturers could not be configured with custom addresses, and thus, the I2C communication bus only supported one sensor. For this, the highly accurate and robust T9602 Temperature/Relative Humidity (T/RH; \(\pm\)2% RH, \(\pm\)0.5 \({}^{\circ}\)C, 0.01 \({}^{\circ}\)C resolution) I2C sensor (Amphenol, Wallingford, CT, USA) was chosen. However, since the objective of this work was to design a system which could monitor temperature in two areas of a delivery van in parallel, a second communication bus would have to be employed. The literature has shown that the DS18B20 temperature 1-Wire probe (Maxim Integrated, San Jose, CA, USA), noted for its low cost and accuracy, has been widely employed for IoT temperature monitoring solutions, especially those pertaining to food loss and waste monitoring [81]. Thus, this sensor was selected as the second probe for the setup to allow monitoring in the chill area of vans in addition to their freezers. The sensor has an operating voltage of 3.3-5 V and \(\pm\)0.5 \({}^{\circ}\)C accuracy. To allow flexibility on the installation location of the logger, the DS18B20 sensor was purchased on a 3 metre length to ensure it could be routed to the freezer area of the van. From official documentation from the sensor supplier, on cable lengths greater than 1 m, the sensor required a 5 V supply due to the voltage drop caused by the increased resistance which occurs on longer cable lengths. Given that \(V_{drop}=I\times R\), the voltage drop will increase as resistance increases. Using the resistance of a length of material formula \(R=\rho\frac{l}{A}\), where \(\rho\) is the conductivity of the cables material, \(l\) is the length of the cable, and \(A\) is the cross-sectional area of the cable, it is demonstrated that as the length of the cable extends, the resistance of it also extends. Hence, the longer the cable, the larger the voltage drop.  
However, the Eagle logger only had a 3.3 V supply so a voltage regulator had to be added to the circuit, which would step up the 3.3 V to 5 V. The 2119 (Pololou, Las Vegas, NV, USA) step up/step down voltage regulator (\(V_{in}\) = 2.7 V-11.8 V, \(V_{out}\) = 5 V) was selected and added to each of the DS18B20 probes. This DC-DC converter is a switched-mode power supply which uses a buck-boost topology to regulate the input voltage to 5 V output with +5/ -3% accuracy. Its typical continuous output current is 500 mA when stepping up, and its quiescent current is less than 0.1 mA.  
An onboard accelerometer is used to detect the movement and change device state from sleep to awake. GPS logging was handled on-board the Eagle device by the EVA-M8 module (uBlox, Switzerland). The Eagle processes the GPS recordings and provides a single binary bit to indicate if the logger has moved in the last five minutes. The intention of this feature was to allow logistics companies to track whether their road transport vehicles were in motion. Further details on the trip detection algorithm will be presented in the next section.