Keywords: datalogger, data recorder, temperature recorder, DS1615, DS1616
The newest member of the datalogger family is the DS1616. The DS1616 takes all of the features of the DS1615 and adds a 3-input MUX'ed Analog to Digital Converter (ADC) to allow the logging of temperature and up to 3 external sensors that generate a voltage output. This feature allows for the logging of temperature, humidity, and pressure as an example to record the conditions during the transport of an item.
These devices serve in two primary applications. First, they provide most of the functions necessary for a stand-alone portable datalogger. Portable dataloggers are often used for monitoring perishable products in transit, HVAC evaluation, environmental research, and numerous other applications. As a second type of application, they can be designed into a system whose primary function is something other than monitoring temperature or other sensors, yet can still benefit from maintaining a data history. Systems can often benefit from environmental monitoring to ensure reliable operation. This information can be useful for calibration, maintenance, and warranty information. A discussion of how to use the DS1615 and DS1616 in these two types of applications will be covered in this applications note. Table 1 provides a quick overview of many of the features of the DS1615 and DS1616.
Table 1. DS1615 Features
|Temperature Range||-40°C +85°C (-40°F to +183.2°F)|
|Real Time Clock||BCD format counts seconds, minutes, hours, date, month, day of the week
and year with leap year compensation
|Datalog Memory||2048 temperature measurements|
|Data Histogram||"Data bins" record up to 65,535 data samples at each 2°C or 4 LSb interval|
|Sampling Frequency||User-programmable intervals from 1 to 255 minutes|
|Alarms/Interrupts||High and low temperature alarms, and time of day alarm interrupt.|
|Serial Interface||Two Serial Interface Options:|
As seen in Figure 1, a control block provides the logic required to take measurements at scheduled intervals and write the resulting data to the appropriate memory locations. The control logic also monitors the data against user programmable upper and lower threshold limits and provides the appropriate response which can include pulsing the /INSPEC\ or /OUTSPEC\ pins or driving the /INT\ pin active. The control block also monitors the /ST\ (Start/Status) pin which is typically connected to a push-button switch.
As can also be seen in the diagram, the serial interface to the chip is composed of six pins. Three pins (SCLK, I/O, and /RST\) are the serial interface for use in applications with an embedded microcontroller, two pins (TX and RX) are a UART serial interface for RS-232 communication, and the final pin (COMSEL) is used to select which type of interface will be used. Finally, an oscillator circuit provides a time base to the real time clock and UART from a 32.768 kHz crystal.
The DS1616 adds a additional block with the 3-input ADC. The 3 ADC inputs are MUX'ed to the same ADC to reduce channel to channel errors that would be caused by multiple ADC's.
Figure 1. DS1615 Block Diagram
As a minimum, the DS1615 requires that a battery, crystal, 5V power supply, and serial transceiver be provided for the device to function properly. The battery illustrated in the schematic is a 3.6V lithium battery, although other types of batteries can be used. To ensure reliable operation, the battery voltage must be at least 2.7V, but no more than 90% of operating VCC. As for the crystal, a 32.768 kHz crystal with a 6 pF specified load should be used. For more information on crystal selection and lay-out, please consult application note 58, Crystal Considerations with Dallas Real Time clocks.
In Figure 2 the UART serial interface of the DS1615 is selected by pulling the COMSEL (Communication Select) pin to ground. The TX and RX pins are connected to a DS275 Line Powered RS-232 Transceiver Chip which converts the signals to RS-232 voltage levels. This chip provides lower current operation than traditional charge pump transceivers.
A low drop-out voltage regulator provides a 5V supply to the VCC pins of the DS1615 and the DS275. The voltage regulator used in Figure 2 is an ST Microelectronics L7805ABZ (www.ST.com). The input to the regulator is supplied by the DTR RS-232 output of a host machine. For this circuit to function, the DTR pin must be in a spacing state (i.e. it must be a positive RS-232 voltage). The diode between the DTR pin and the circuit provides protection in case DTR is inadvertently driven to a marking state (negative RS-232 voltage). The minimum voltage necessary on the DTR pin is dependent on the characteristics of the voltage regulator used. The minimum required DTR voltage is that voltage which allows the regulator to provide at least 4.0V to the VCC pin of the DS1615. With this in mind, a low drop-out voltage regulator should be used if the DTR pin does not provide at least 7V. Furthermore, a low power regulator would be helpful to insure that the RS-232 pin can source the needed current for the circuit. Low power, low drop-out voltage regulators are widely available on the commercial market.
Purely optional components in this reference schematic are a pushbutton switch and two LEDs. The pushbutton switch can be used to instruct the datalogger to begin sampling the temperature and to poll the DS1615 for the status of its data. The pushbutton switch which is connected to the STpin is optional because the DS1615 can be programmed directly by the host system to perform these functions. In most applications it is probably best to design in the pushbutton since there might be a significant lapse of time from the programming of the device at the host system to placing it in the environment requiring monitoring.
The LEDs, which are also optional, provide visual indicators to the end user of the device. Low power LEDs should be used since they can provide sufficient luminescence with 1mA or less. Typically, a green LED is connected to the /INSPEC\ pin and a red LED is connected to the /OUTSPEC\ pin. When a datalogging mission is started, both the /INSPEC\ and the /OUTSPEC\ pins are pulsed four times. When the /ST\ pin is used to poll the status of the data, either the /INSPEC\ or the /OUTSPEC\ pin is pulsed four times. The /INSPEC\ pin is pulsed if all of the collected data is inside of the user programmed high temperature and low temperature threshold limits. The /OUTSPEC\ pin is pulsed if any of the collected data falls outside of these limits.
Note that VCC is required for the DS1615 only when communicating with a host system. In other words, VCC is required only for powering the serial interface portion of the DS1615. In a typical application, the temperature datalogging module illustrated in the schematic would be connected to a serial port of a PC or other host system. The device would then be programmed by the user. After programming, the device would be removed from the serial interface and placed in the area requiring temperature monitoring. When the monitoring job is complete, the datalogging module would be again connected to the serial port to download its data to the host system.
Figure 2. DS1615 as a Portable Datalogger
Figure 3 Illustrates one possible application in which the DS1616 is directly interfaced with an 8051 microcontroller. In this example, three of the microcontroller port pins are used to communicate with the DS1616 over the serial interface.
Figure 3. DS1616 in Embedded System
Also notice that the interrupt output pin (/INT\) of the DS1616 is connected to the interrupt input of the micro-controller. The DS1616 can be programmed to provide an interrupt signal if any of the sensors' data falls outside of user programmed threshold limits. The device can also provide a time of day alarm interrupt so that the system can be programmed to accomplish certain events at specific times. These features allow the DS1616 to alert the system if an action needs to be taken. Finally, notice that the COMSEL (Communication Select) pin is tied to VCC. This instructs the DS1616 to communicate over the three-wire interface.
Although the specifics of how to program these registers will not be detailed here, a brief description of the capabilities will be given. Please refer to the datasheets for a detailed explanation of the following registers to be discussed.
The first step in starting the datalogging process is to initialize the RTC. The RTC keeps track of seconds, minutes, hours, day of the week, month, date, and year (with leap year compensation) in BCD format. All of this information is kept in a series of seven registers. An additional set of alarm registers are also available for applications that require a time of day interrupt signal.
The operating characteristics of the datalogger also need to be programmed by the user through the Control Registers. Table 2 Illustrates some of the operating characteristics that can be programmed through the Control Registers.
Table 2. DS1615/DS1616 Programming Capabilities
|Sample Rate Register||The Sample Rate register programs the data sample rate from once per minute to once per 255 minutes.|
|High Alarm||The High Temperature/ADC Threshold registers determines the upper limit for an "in-spec" measurement. If the measured data exceeds this value an "out-ofspec" violation has occurred.|
|Low Alarm||The Low Temperature/ADC Threshold register determines the low limit for an "in-spec" measurement. If the measured data exceeds this value an "out-ofspec" violation has occurred.|
|Time of Day Alarm||The time of day alarm can be used to generate an interrupt at a particular time.|
|Alarm Status||Two methods of alerting the user to an "out-of-spec" violation are: 1) the generation of an interrupt and/or 2) the driving of visual indicators (LED's) in response to the user request for data status.|
|Start Delay||The two byte start delay register allows the user to program the number of minutes of delay that occurs between the initiation of the datalog mission and the first temperature measurement. The delay equals the value in this register multiplied by one minute.|
Write Byte (22h)
This command is used to write one byte to the RTC registers, the control registers, and the User NVRAM. This command is used to initialize the RTC, program the operating characteristics, and write data to the user NVRAM.
Read Page (33h)
The Read Page command is used to read up to one page of data (32 consecutive bytes) from the internal memory.
Specification Test (44h)
This command is used to instruct the device to provide a visual indication of the status of the collected data (i.e. have any temperature measurements been outside of the user programmed thresholds).
Read Temperature/Data (55h)
The Read Temperature/Data command is used to instruct the DS1615 or DS1616 to take an immediate temperature/data measurement. This command functions only when the device is not currently on a datalog mission and in the DS1616, the channel desired to be read is enabled.
Clear Memory (A5h)
The Clear Memory command is used to clear the contents of the datalog and histogram memory as well as a few other registers. As a safety measure to protect against accidental clearing of data, this command can be executed only if the CLR bit in the Control Register has been set.
The datalog feature functions such that the sampled readings are successively written to the Datalog Memory block. A total of 2048 data samples can be recorded in the datalog memory. In the DS1616, this memory is shared between all of the channels that are enabled.
The second data collection function is the ability to provide a histogram of over a given time period. The histogram data is provided by a series of 63 two-byte data bins that are located in the Histogram Memory block. Each bin consists of a 16 bit binary counter that is incremented each time an acquired data value falls into the range of the bin. After a conversion is completed, the bin associated with the data is incremented. Since each data bin contains two bytes, a total of 65,535 samples can be accumulated in each bin. If more samples are measured, the data bin will remain at the maximum value. In other words, the data bin value will not roll-over in the event of an overrun.
One of the most useful aspects of the data histogram is that it allows the data to be monitored for a much longer period of time than is capable by just the datalog memory. Although the datalog memory allows the user to determine exactly what the data was at a particular time, it provides this information for a somewhat limited number of data samples. The histogram, by contrast, does not give the user the data at a specific time, but it does give the user the total number of times each data range is measured and increases the total number of data points that can be collected. This is intuitively obvious since each data bin can count up to 65,535 samples at that given data range.
Figures 4 and 5 illustrate a hypothetical datalog and histogram, respectively. Note that the datalog chart shows that the maximum of 2048 data samples were logged. The histogram, on the other hand, shows an example where more than 2048 samples were collected.
Figure 4. Temperature Datalog
Figure 5. Temperature Histogram
The use of the histogram should also be considered, however. For example, if a sampling rate of once per minute was selected for the DS1615, the datalog memory would be filled in slightly less than a day and a half. Each histogram bin, in contrast, can store more than forty-five days worth of data samples (65,535 samples / 1 sample per minute = 45.5 days). Clearly, the histogram memory can provide a method of extending the useful duration of the device. Although, the exact time of some of the data samples are lost after the datalog memory is filled, the value of each sample is not lost.
Table 3. Datalog Operating Duration
|Sample Rate||Datalog Duration|
|1 min.||34.13 hours|
|10 min.||14.22 days|
|50 min.||71.11 days|
|100 min.||142.22 days|
|150 min.||213.33 days|
|200 min.||284.44 days|
|255 min.||362.63 days|
A quick method to determine battery life is to simply determine the capacity of the battery and divide by the average current consumed by the device. Determining the average current consumption of the DS1615 is a simple calculation that is dependent upon the sampling rate. The following equation demonstrates how the average current is determined. For the DS1616, the calculation may be more complex depending on the types of external sensors attached and their power source.
If we assume that the worst case battery consumption scenario where the DS1615 is sampling the temperature once per minute, then T = 1 minute and Iavg is calculated as follows.
Once the average current is calculated, the lifetime of the battery is simply a matter of dividing the battery capacity by this value. For example, a Ray-O-Vac BR2032 lithium battery is rated with a nominal capacity of 195mAH. Dividing this capacity by an average current of 1.7µA yields a battery lifetime of 12.7 years if the device is never turned off! Obviously, increasing the time between samples would extend the battery life even further. Table 4 illustrates the projected lifetime for a few common lithium batteries using various sample periods.
Table 4. Battery Life
|Battery Type||Battery Manufacturer||Nominal Battery Voltage||Battery Cap. (mAH)||Sample Period (Minutes)||Battery Life (years)|
On the other hand, 3.6V lithium batteries are less likely to violate the minimum battery requirement since they have a higher nominal voltage and have better temperature characteristics. However, the designer must ensure that the VCC is large enough when using this type of battery to ensure that the battery does not violate the maximum battery voltage specification.
There is no single perfect battery for every application. The designer must determine the characteristics of his end product and choose the battery the best meets his requirements.