DS1922/DS1923 Battery Gas Gauge

DS1922/DS1923 Battery Gas Gauge

Author's Contact Information


Tracking remaining available energy is critical for battery-operated equipment. Energy consumption depends on the temperature and usage history of the product. With temperature loggers, this data is largely a byproduct of normal use. This application note shows how to estimate the energy consumed during a mission and how to use the OneWireViewer to maintain a battery "gas gauge" in the memory of the logger.

Motivation—The Need to Know

The reliability of portable equipment depends on the status of the energy source. The best equipment cannot function properly with a low battery. For rechargeable batteries as in cell phones, sophisticated battery monitors are now the norm. Is there a way to determine the remaining charge of a conventional battery? In the case of a temperature logger, how can one know whether there is enough power for the next mission?


Batteries lose energy over time through self-discharge (aging) and through normal use when the equipment is switched on. Both the rate of battery self-discharge and the energy consumption of a silicon chip strongly depend on the temperature. The higher the temperature, the higher the energy consumption. If one knows the charge of a fresh battery, the temperature history, and the discharge rate during normal use, one has all the data needed to estimate the battery's remaining charge. The initial battery charge, measured in mAh, is found in battery data sheets. The challenging tasks are getting the temperature history data and current consumption characteristics of the battery-operated equipment.

If the temperature logger is very small, the battery's temperature is about the same as the temperature recorded during a mission. Both the power consumption of the chip inside the DS1922/DS1923/DS1925 Temperature Logger iButton and the charge needed for a temperature conversion are determined through product characterization at the factory. With this information one can estimate the remaining battery charge—if the following additional requirements are met:

Requirements Explanation
Start Upon Temperature Alarm not used This function performs temperature conversions, but does not log any data. Although the Device Samples Counter increments for each conversion, the temperature is not recorded and the energy consumed by these conversions cannot be quantified.
Roll-over disabled If roll-over is enabled, it overwrites temperature log data with new data, thereby deleting a portion of the temperature history needed to calculate the consumed energy.
RTC-oscillator stopped when the logger is not used At room temperature over three minutes, the DS1922/DS1923/DS1925's real-time clock (RTC) consumes approximately as much energy as one 8-bit temperature conversion. This energy consumption is, admittedly, very small. Nonetheless, if the RTC remains on for one month, it consumes as much energy as almost 15000 conversions.
Logger stored below 25°C (room temperature) when not used The battery self-discharge and the leakage current of the logger increase for temperatures above 45°C.
No forced conversions Although the Device Samples Counter increments, the energy consumed cannot be quantified. The charge consumed by a single forced conversion is very small, compared to leaving the RTC oscillator on or storing the device at an elevated temperature.

Mathematical Background

After set up for a mission, a temperature logger records a mission start time and sets an internal timer that controls the sampling interval. After a sampling interval is over, a temperature conversion takes place and the result is stored in the data log memory. The interval timer is automatically set for the next sampling interval, and the process repeats until the mission is ended. Figure 1 illustrates the events. All sampling intervals have the same duration.

Figure 1. Temperature logging process.

Figure 1. Temperature logging process.

For all the samples of the mission and
For each sampling interval,
Take the recorded temperature value, and

  • Look up the DC load current at that temperature and multiply it with the duration of the sampling interval Figure 2. This accounts for the energy consumed by the RTC and through self-discharge (DC load).
  • Look up the temperature conversion charge at that temperature Figure 3, and add it to the charge consumed from the DC load during the sampling interval.

Add the charge of all sampling intervals.

Figure 2. Estimated DC load during sampling interval.

Figure 2. Estimated DC load during sampling interval.

Figure 3. Conversion charge at sampling point.

Figure 3. Conversion charge at sampling point.

As can be seen in Figure 2 above, the DC load is assumed to be constant during the sampling interval. Mathematically this method is equivalent to Estimating Integrals/Areas Using Right Rectangles (heights determined by the right endpoints of each subinterval). There are other integration methods, such as using the average of two samples (midpoint), trapezoids, or Simpson's rule, which deliver numerically more accurate results¹. The positive and negative errors incurred by the rectangles approach average to zero, if the temperature cycles around a thermostatic set point. Therefore, this simple approach is reasonable for this application.

Using shorter sampling intervals can also lower the integration error. The lower limit of the sampling interval is determined by the length of the mission and the available data log memory. Shorter sampling intervals increase the energy consumed by temperature conversions. To conserve energy, the sample rate should be linked to the fastest rate at which the temperature of a monitored object can change if the cooling or heating fails. If, for example, the temperature cannot change faster than 1°C within an hour, a sampling interval of 30 minutes may be adequate.

Applying the Theory

The mathematical model explained above is implemented in the Gas Gauge Spreadsheet (ZIP, 878kB), which can be downloaded. The spreadsheet has three lookup tables, one for the DS1922L/DS1923, one for the DS1922T, and one for the DS1925. The spreadsheet also has three calculation tabs. Figure 4 shows a screen shot of the DS1922L/DS1923's calculation tab. User input goes in the yellow fields; the turquoise fields display the results. Fields without highlight are legend (Sample Number) or interim results, such as lookup results and charge consumed in each sampling interval. For 11-bit temperature conversions, the conversion charge from the lookup table is multiplied by 8. The charge for a humidity conversion is a temperature-independent adder. The µAs version of the Total Mission Charge field is the sum of as many interval charges as indicated by the value in the Mission Samples field. The DS1922T and DS1925 calculation tabs are similar to that of the DS1922L/DS1923, except that the humidity logging function is not applicable. Furthermore, the conversion charge does not vary with selected bit width on the DS1925, but connection to a 1-Wire bus does cause extra current draw that is considered in its calculation.

Using the Mission Viewer, a subfunction of the OneWireViewer application software[2, 3], proceed as follows.

  • After the logger returns from a mission, end the mission using the Disable Mission button on the viewer's Command tab.
  • Next click on Temperature in the viewer's Device Data tab. This displays a graph of the recorded temperature log.
  • With the cursor on that graphic, click the right mouse button. Select "Copy Data to Clipboard without Labels" and click the left mouse button.
  • Now open the applicable calculation tab of the Gas Gauge Spreadsheet.
  • Select the input field for the first temperature sample and click on Paste. This copies the entire temperature log into the spreadsheet.
  • Now click on Status in the viewer's Device Data tab.
  • Copy the Sample Rate value (converted into minutes) to the Sampling Interval field, and copy the Mission Sample Count value to the Mission Samples field in the spreadsheet.
  • If the Temperature Logging field of the Device Data tab shows 0.0625, the temperature was logged at 11-bit resolution. In this case, enter TRUE in the 11-bit Resolution field of the spreadsheet. A value of 0.5 indicates 8-bit resolution. If humidity was logged, enter TRUE in the Humidity logging field of the spreadsheet.

Now the Total Mission Charge field shows the estimated amount of energy that was consumed during the mission.

Figure 4. Example portion of the Gas Gauge Spreadsheet.

Figure 4. Example portion of the Gas Gauge Spreadsheet.

The value in the Remaining Charge field is valid only if a correct value was entered in the Previous Charge field. For the first mission of a fresh device, the previous charge value is 48mAh nominal, as preset in the spreadsheet. After the charge consumed for a mission is calculated, the result must be stored in the user memory of the logger. The easiest way to do this is through the File Viewer function of the OneWireViewer. After the first mission create a file, e.g., CHRG.0, and on the ASCII tab ype in a note such as "Battery Charge 47.975mAh" followed by a date code. Write the file to the memory. With this procedure the data travels with the logger and is available to calculate the remaining charge after the next, and every subsequent mission. Note: For the DS1922L and DS1923 the calculated total mission charge matches the lifetime graphics in the data sheet within 1% for all temperatures and sample rates. For the DS1922T the difference is less than 2% for sampling intervals of 1 minute and longer, and temperatures of +50°C and higher. The estimates for sampling intervals shorter than 1 minute and temperatures below +50°C are up to 10% more optimistic than the lifetime curves in the DS1922T data sheet. The cause for this difference is the lower self-discharge of the DS1922T battery in conjunction with the mathematical simplifications made in the Gas Gauge Spreadsheet.


With fairly simple mathematics one can track the energy consumed during a mission. The approach shown in this application note proves the feasibility of the concept, which can easily be integrated in an automated data-management system. Knowing the remaining charge and estimating the maximum charge needed for the next mission allows the user to utilize the logger's full lifetime, thereby lowering the overall cost of temperature monitoring.