I would like to connect a UART sensor directly to an XBee Wi-Fi module using its Rx-Tx, without using another MCU as an intermediate. The XBee would read the data from the sensor and send them via Wi-Fi to the internet (through a router).

Usual Application : Sensor -> MCU -> XBee -> Wi-Fi

My concept: Sensor-> Xbee -> Wi-Fi

From what I have read it is possible to sample analog sensors directly from XBee's analog inputs and send the data via Wi-Fi. It is also possible to sample the states of some GPIO pins of the XBee directly and send them. However, although the XBee has a UART, I have not found an application which uses this UART directly to communicate with a sensor. This UART is only used to communicate with an intermediate microcontroller which reads sensors, and sends commands to the XBee module via this UART. Another problem is that I should be able to transmit a UART command from the XBee module to the sensor (the sensor needs a command to send back a response). My purpose is to send periodically the read command to the sensor, get the response and transmit the response via Wi-Fi.

From my understanding it is not possible to use the UART of an XBee module like that, I would need an intermediate MCU. But I would like to ask, if I am missing something and this is possible. Has someone managed to do it or read something relevant? Is there a way to take advantage of the XBee's UART and program it to do this task?

Xbee: Digi XBee® Wi-Fi - OEM Module with Fully Integrated Support for Digi Remote Manager

Sensor: Dart Sensors WZ-EN CO module - Operation Manual


1 Answer 1


I've not use the wifi model but i don't think there's much difference in how they work.

You just need to send the commands through wifi to your xbee module and it will get passed to the sensor. The sensor should then react to the commands and return the data you requested, which will then be transmitted through wifi.

The baudrate of your sensor need to match with the xbee's baudrate for this to work, and also the logic level.

  • \$\begingroup\$ So i should ask the server to send the Uart command to the Xbee periodically. Even then, I think that XBees add some characters before and after the UART message that the user wants to send, to create a type of packet. I don't know if that would create problems to the sensor recognizing the command sent. I suppose that is sensor-specific...I should order one and try it out. \$\endgroup\$
    – Chatzid
    Oct 5, 2018 at 8:33
  • \$\begingroup\$ Yes, just send the command from your server. Xbee have the headers and checksum but when i'm using it in AT mode then I receive the data without the header and checksum. I don't have a wifi model so i can't test it but you can try it out and see what data you receive through the UART port. \$\endgroup\$
    – Zy Gan
    Oct 5, 2018 at 8:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.