User's Manual

MPR/MIB User’s Manual
Doc. # 7430-0021-07 Rev. B Page 19
2. The 2-pin Molex connector. Molex part number 53261-0290, Digi-Key part number
WM1753-ND
. (See Figure 6-4 below.)
Figure 6-4. Photo of using the Molex connector to attach the AA battery pack. Photo courtesy of
Nick Sitar, UC Berkeley, 2004.
6.3 MICAz Battery Voltage Monitor
The MICAz has an accurate internal voltage reference that can be used to measure battery
voltage (V
batt
). Since the eight-channel ADC on the ATMega128L uses the battery voltage as a
full scale reference, the ADC full scale voltage value changes as the battery voltage changes. In
order to track the battery voltage, the precision voltage reference (band gap reference) is
monitored to determine the ADC full-scale (ADC_FS) voltage span which corresponds to V
batt
.
To compute the battery voltage:
1.
Program the application code to measure ADC channel 30 – the Internal Bandgap
Voltage reference.
2.
Compute battery voltage, V
batt
, from ADC reading (ADC_Count) by:
CountADCFSADCVV
refbatt
__×=
where:
V
batt
= Battery voltage
ADC_FS = 1024
V
ref
= Internal voltage reference = 1.223 volts
ADC_Count = Data from the ADC measurement of Internal Voltage reference
The TinyOS component VoltageM.nc can be wired into an application to provide this
measurement capability. The reserved keyword
TOS_ADC_VOLTAGE_PORT is mapped to ADC
Channel 30 in the MICAz.
6.4 MICA2 Battery Voltage Monitor
The MICA2 units have an accurate voltage reference that can be used to measure battery voltage
(V
batt
). Since the eight-channel, ATMega128L ADC uses the battery voltage as a full scale
reference, the ADC full scale voltage value changes as the battery voltage changes. In order to