How To Configure A Pin As An Input; How To Obtain Data From A Sensor - Digi XBee Zigbee Mesh Kit User Manual

Radio frequency (rf) module
Table of Contents

Advertisement

Inputs and outputs

How to configure a pin as an input

Configure a pin for digital input
You can configure a pin through XCTU. If your sensor reads digital values (like a doorbell) and is
connected to the DIO1/AD1 pin, configure the D1 parameter as Digital Input [3]:
Configure a pin for analog input
If your sensor reads analog values (like a temperature sensor) and is connected to the DIO1/AD1 pin,
configure the D1 parameter as ADC [2]:

How to obtain data from a sensor

There are two ways to obtain sensor information:
Queried sampling to immediately read all enabled digital and analog input pins.
n
Automatic sampling to transmit the sensor data periodically or whenever a digital pin changes.
n
In both cases, the information is sent to the other module is called IO sample. It contains which inputs
(DIO lines or ADC channels) have sampling enabled and the value of all the enabled digital and analog
inputs.
Queried sampling (IS)
The Force Sample (IS) command forces a read of all enabled digital and analog input pins. You can
send it locally or to a remote device.
Use the XCTU console or any serial port terminal application to send this command.
When the module sends the IS command, the receiving device reads all enabled digital IO and analog
input channels and returns their value. If the module transmits the IS command locally, it sends the IO
data out the serial interface. If the module transmits the IS command to a remote XBee module, it
sends the remote IO data over the air to the requester module.
Automatic sampling
Once you have set up the pin, the remote module must be configured to automatically transmit the
sensor information to the main XBee module. The remote XBee module needs to know:
1. Where to transmit the sensor data: define this information for the module receiving this
information by the destination address (DH + DL) parameters.
2. When to transmit the sensor data:
Periodically: The XBee can send the information read from the sensor at a specified
n
interval.
By change detection: When a pin or several pins change status.
n
Configure parameters IO Sampling Rate (IR) and Digital IO Change Detection (IC) to
automatically transmit the sensor data.
XBee® Zigbee® Mesh Kit
How XBee devices get sensor data
99

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the XBee Zigbee Mesh Kit and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents