XBee best input for ultrasonic distance sensor

Hi everybody,

  • I have an ultrasonic distance sensor: LV-MaxSonar EZ3
    It has 3 outputs: serial, analog voltage and pulse width.

*Serial: ASCII format.
*Analog: 2.54 mV / cm (using a 3.3 V input). Range: 38mV-1.6V.
*PW: 58 us / cm.

  • On the other hand, I also have one XBee Series 2 to send the information. So, my remote node will be the ultrasonic sensor and the XBee. The maximum voltage that can be applied to analog IO pin is 1.2V.

I would like to know the best option to connect one of these outputs to my XBee.

Thank you very much.

The best option is to use the UART since it offer that.

Thanks mvut for your reply.
I was thinking that would be the best option.

So,I need to connect the serial output to DIN XBee input (PIN 3). Am I right?

Another question appears when I want to connect a motion sensor (1= if detects movement, 0 if not). Now, the motion sensor has only a digital output so I connect it to pin AD0 (AD03). If I want to send the two sensor information (motion+ distance) using the same frame type (ZigBee I/O Data Sample Rx Indicator), do I need to use the analog output from the distance sensor (for example: connect it to pin AD1, AD12)?


That is correct. You connect the data out to the data in of the xbee.

No that is not an analog connection but a Digital IO. You would need to set the DIO0 as a Digital Input. Then on the receiving module, you need to use API mode an read the data from the UART of the change.