Initially, a status bit indicating logging disabled prevents the execution of the logging (green) subroutine, and at wake the device queries if it is time to enter the logging on/off (blue) subroutine. If yes, the device measures Vth and compares it to the “Logging On” Vref value. The relationship between Vref and temperature is shown in Fig 2B. If Vth > Vref for a set number of wake cycles (typically 20 sec), data logging is enabled prior to returning to the sleep state. This has the effect of allowing data logging to be switched on by heating the device above the temperature corresponding to the “Logging On” Vref value (typically 50°C). Once logging is enabled, subsequent wake cycles will run the green data logging subroutine at the appropriate sampling interval set in the program. When logging is enabled, each blue subroutine measures Vth, compares it to the “Logging Off” Vref (typically 5°C), and turns off logging if Vth < Vref. In typical real-world applications, the “Logging Off” functionality is not used and data logging is stopped by removing power (cutting the ring and battery connection).