Xbee S2 mesh network (API) with sensors on Arduino-s


I’m working on a project with Xbee-s (S2) and Arduino UNO-s. My plan is to create a mesh sensor network from 5 radios (it would be a home measuring system): 1 coordinator (API) mode with Arduino connected to PC (only reciving and processing data), 1 (or 2) router in AT mode, and 2 (or 3) end devices with Arduinos connected them, 1 sensor connected to each Arduinos.(I have an LM-35, BMP-180 and DHT-11).
I want to process the data from the sensors with the Arduino-s and wrap these data into Xbee packets which the Xbee-s connected to the Arduinos will send to the coordinator ( through router node in AT- mode, if needed), where the Arduino connected to that coordinator receive these packets from the coordinator, sort out these packets and read out from each of packets the sensor readings values. Then converts these values for strings and print them on the serial monitor on PC (without getting them mixed). For example like this:

"Measured value from E1:
Temperature: °C
Humidity: % "

"Measured value from E2:
Temperature: °C "

"Measured value from E3:
Air pressure: Pa "

My summary question : is this concept doable in this way? I’m only willing to print on the serial monitor on PC the values.

Thanks for your help!!

Yes, it is doable. But if you are going to use AT mode then you need to provide Temp and humidity data to End Device on its UART line.

Otherwise, if your sensors are voltage based, then you can directly connect them to End device module’s IO pins and receive sample data on Coordinator in API mode.

Also note that in AT mode, Coordinator cannot determine originator of TX message. Its only possible in API mode.

1 Like

Thanks for your answer asgm!

I’m only willing use AT-mode on my router(s), if I’m need these to reach the coordinator from my end devices when they are too far away. I want it/them in AT-mode because, im thinking (wrongly?) in AT- mode, if it/they get an API packet from my API- end devices, it/they pass through to the coordinator (API), as it/they got it from the end device(s). Or should the router(s) in API mode too?

My sensors: sadly only my LM-35 is voltage based analog sensor, so with that sensor I could do the direct I/O sampling (because I want printing to the serial monitor at reciving, coordinator side the measurements in human friendly format (text). (BMP-180 and DHT-11 cannot work directly with xbee :confused: ) That’s why im using Arduino with them. But anyway, that’s not a problem to me :slight_smile:

If you communicating via UART (and not IO lines) then either mode is fine. But just FYI, Routers will act in similar manner for hopping data in both AT and API modes.

hello,pls how did you eventually solve this problem