XBee Direct I/O with ADC

Bookmark and Share

XBee radios can now record and output multiple channels of digital and analog data without using microcontrollers. The latest firmware (version 10A1) supports up to seven channels of analog input, nine channels of digital I/O and two channels of analog (pulse-width modulation) output. These will be great for creating small sensor modules or miniature output modules with low power and very low complexity.

Andrew Schneider and I cobbled a couple experimental modules together last weekend, and I recreated them for a demonstration to my Project Development Studio class. Here’s the presentation on XBee Direct that I gave to the class. Firmware updates can be performed with MaxStream’s X-CTU software, and you’ll certainly need to do this if your XBee’s were purchased before 2007.

Direct I/O should be considered for wearables, remote controls, toys, covert sensors, computational jewelry or anything airborne. Photos of the input and output circuits are below, along with the AT commands for this setup, with one analog (potentiometer) and one digital (switch) input, and the corresponding outputs (motor & LED):

INPUT MODULE:
ATID3456 –> PAN ID
ATMY1 –> my address 1
ATDL2 –> destination address 2
ATD02 –> input 0 in analog mode
ATD13 –> input 1 in digital in mode
ATIR14 –> sample rate 20 milliseconds (hex 14)
ATIT5 –> samples before transmit 5
ATWR –> write settings to firmware

OUTPUT MODULE:
ATID3456 –> PAN ID
ATMY2 –> my address 2
ATDL1 –> destination address 1
ATP02 –> PWM 0 in PWM mode
ATD15 –> output 1 in digital out high mode
ATIU1 –> I/O output enabled
ATIA1 –> I/O input from address 1
ATWR –> write settings to firmware


Input Module with Potentiometer and Switch


Output Module with Vibrator Motor and LED

172 Responses to “XBee Direct I/O with ADC”


  • When I consult the analog input AN1 of my Xbee. The value you get is 02 AD
    . How I can interpret this hexa value?. As I can stop volts?.

    thanks

  • Hello Falaudi,

    i read your articles, they are impressive, i also have a problem can you answer it?

    its stated in digi international and maxstream modules that these can directly transmit and recieve RS485 data. How can it be done? I just want to remove cables going from plc’s to the machineries and vice versa. Along with RS485 data there are a few digital input and output cables which also need to be eliminated. Is it possible? and is it possible in one zigbee module at one end? how? and what pins shall i give data+ and data- of zigbee devices? please publish some schematic for this and what will be the software and harware requirements for this?

    you can mail me if you wish to.

    regards

  • hey Falaudi,

    Dont you think there is some bug in the above experiment?
    Or maybe i didnt get it properly, please guide me.
    In the above experiment, i am trying to send analoge signal to AD0(pin20) from sender xbee and recieving at pin 20 at base xbee, but i am not able to get any pwm output. I have properly configure both the radio modules, have tried with digi series1 version 10A5, 10E6, and 10EC all but cant get the output at base pin. Whereas, i can read the hex data at terminal, but this tutorial says we can get pwm output and even digi says on their site we can get pwm out and convert to analogue by placing a capacitor accross.
    I have done all the harware properly, vref to vcc etc. believe me there is nothing wrong with the connections etc. seems like this cannot be done..
    Please answer asap where am i wrong?

  • Hello Mr Faludi,
    I have been doing some research on my project area (wireless servo control with Xbee) and routinely land on your reference material.

    I have been working on trying to control a micro servo wirelessly. I have figured out how to do this with XBee radios (series 2) and Ardunio UNO hardware. That solution worked fine for initial demo. However, I am trying to reduce the physical footprint and power consumption at the receiver end (location of the servo). I tried using an ATtiny85 in place of the Arduino UNO, but found the 8-bit processing caused too much jitter. I have recently tried using the XBee (series 1) Direct I/O and PMW output capability due the small footprint and low battery usage. However, my servo is not responding correctly to input. I am testing using DIGI input/output examples with simple ADC conversion of potentiometer attached to transmitting XBee D0 (ATD0=2; ATIT=5; ATIR=14; ATIA=FFFF; ATID, ATMY, & ATDL set appropriately) and micro servo attached to receiving XBee RSSI/PWM0 (ATP0=2). The setup works for controlling the brightness of a LED with the potentiometer, and the servo does indicate it is getting some signal, but not moving much.

    I am thinking the XBee radio PWM output voltage is too low to drive a micro servo. Any recommendations for me would be greatly appreciated.

    Thank you
    Krist

    • You will want a external microcontroller (or the Programmable XBee) to interface with a servo. The XBee’s PWM output modulates the pulse frequency, while a servo is typically controlled by modulating a pulse’s duty cycle. More here.

      • Thank you for the quick response. I understand your reply.

        My interpretation, the XBee is converting an analog input to a varying pulse frequency; where as, I need the frequency to be steady (e.g. 50hz) with a modulated pulse width (duty cycle) based on the analog input.

        I have thought about configuring a micro controller (e.g. arduino) to generate the servo PWM signal and then send the generated pulses over XBees (e.g. direct wireless communication) without signal manipulation.

        I have been looking for an example of this, but haven’t come across one. All the ones I have come across use micro controllers at the servo end or as you point out are doing frequency modulation vice duty cycle. Are you aware of some resources that you can point me to?

        Thank you
        Krist

  • Hi experts,
    I need to control an LED on Pin 18 (D2) in the remote Xbee (End device) from a coordinator Xbee communicating to it.

    I was able to make LED ON(glow) on the coordinator device using the AT command(ATD2 5), but i didn’t get any reference on ON/OFF an LED connected to remote Xbee by using commands sent from coordinator Xbee

    Any help on this would be appreciated.

    Thanks in advance.

Leave a Reply