Voltage Readings in XBee Module

From Digi Developer

Jump to: navigation, search

Contents

Understanding the Voltage Setting within the XBee Modules

Supply Voltage (%V)

This measures the Vcc/power pin to the XBee, which equates the voltage being output from your hardware voltage regulator. This is not directly related to any external battery or supply voltage.

Reading the Supply Voltage Directly

Read the Vcc/power pin level directly with the AT command V%. The actual interpretation of the 16-bit value returned may vary based upon the technology, but for example in the XB24-ZB a reading of 0x0900 (2304) represents 2700mV. The two formulas used in the gateway are:

  • set_value = ((1024 * user_mv_desired) + 600) / 1200
  • read_mv = ((1200 * get_value) + 512) / 1024

(The +600/+512 handles the truncation due to integer division)

Including the Supply Voltage in periodic I/O sampling

To avoid the need to manually poll the V% value, use the AT command V+ to selectively have the Supply Voltage included in the periodic I/O Sampling (the IS packet). Bit 7 (0x80) of the IS Packet's Analog Channel Mask is set to 1 when the Supply Voltage has been appended. It is appended with the following logic:

  • setting V+ to a big number (like 9999) forces the Supply Voltage to always be appended
  • setting V+ to zero prevents the Supply Voltage from ever being appended
  • setting V+ to a reasonable value near V% (Vcc) will append the Supply Voltage only when V% is less than V+, meaning you do not consume two extra bytes worth of transmitter power until the Supply Voltage starts to fall below normal.

Battery Voltage

Nothing prevents a user-designed XBee sensor product from including an actual battery voltage level in a protocol response. It could be tied to one of the XBee module's four analog input signals (AD0-AD3). However, this will increase battery drain during sleeping.

Most Digi Adapter products do not provide access to the battery voltage.

Low Battery Signal (Digi Adapter Specific)

Certain Digi Adapter products include a digital low-battery signal read directly from the low-loss battery-friendly voltage regulator used. These include (but may not be limited to):

  • XBee Sensor Adapter (the L/T/ and L/T/H/ adapters)
  • XBee 232 and 485 Adapters
  • XBee AIO and DIO Adapters

Note: An important limitation: this bit only shows low-battery on internal batteries. Externally suppling 9-30vdc or 3-6vdc causes this bit to be low (in alarm) or undefined.

In these products, and ERROR FLAG output is tied to the DIO11 (P1) input (or XBee external module pin 7). Configure this XBee pin to be Digital Input to enable, and it is returned within the I/O Sampling digital channel mask as bit 11 or 0x0800. It is 1 (high) when the voltage regulator is able to maintain the specified output voltage. When the output voltage drops below spec by approximately 5% (due to low input voltage or excessive current draw) then this bit is 0 (low).

The psudeo-code handling this bit could be viewed as:

if digital_channel_mask AND 0x0800
  then print 'power supply is within spec'
  else print 'power supply is too low, is under-voltage condition'
Personal tools
Wiki Editing