I have six sensors and I need to relay their status back to a base station and then to an online database for interpretation. The only problem is that they could all be triggered at once meaning that six sensors could be trying to send information to the base station.
On one hand WiFi seems the best because if all of the sensors had access to the internet, they could send the data to the database individually.
However I have heard rumor that Xbees can be programmed such that if it doesn't receive the ACK that data was correctly transmitted it can try again.
My main concerns are how to avoid plugging up the base station and/or dropping a transmission due to multiple sensor hits.
Any thoughts on which communication method is more reliable?
Have you tested the timing? What timeframe did you find you have to work with between sensor responses? And how much data are you transmitting from each one (to work out how much time each needs)? It's not usual that events happen in the real world in a way that's precisely simultaneous. Have you set these up with a wired test rig? You may find you have tens of milliseconds between responses which, depending on how much data you have to transmit, might be enough to avoid collisions.
If the sensors do trigger too near each other to avoid the transmissions colliding, how time-critical is it to have the sensor data to the database? How long have you got between sensing and the database update before your readings are no longer useful to you? It may be reporting to a base station isn't the best topology since the Arduino will only address one at a time regardless how you get over the communication challenge. Or, if you just need to make sure no data is missed, a local buffer at each sensor could hold past readings until a successful upload to the base.
Supergumboots:
I have six sensors and I need to relay their status back to a base station and then to an online database for interpretation. The only problem is that they could all be triggered at once meaning that six sensors could be trying to send information to the base station.
On one hand WiFi seems the best because if all of the sensors had access to the internet, they could send the data to the database individually.
Xbee does have a packet ACK feature which can detect and retransmit collided packets. I assume Wifi does as well, but if you're using Wifi you're probably using TCP and TCP definitely does have retransmit.
Thing about Xbees and Wifi is they are transceivers -- each node can both transmit and receive. And they're expensive. If you're going to go the expense and trouble of transceivers anyway, you might as well use cheaper transceivers and then have your master node poll the slaves. That way, slaves only transmit when they're told to, so there are never collisions.
You can also avoid collisions with transmit-only sensors and a receive-only master. What you do is for a given number of sensors x, you have them transmit each packet x+1 times and give a unique retransmit time interval to each slave. Then whatever the longest retransmit time is, force all nodes to wait at least that long before transmitting a new packet.
This can get unwieldy for large numbers of sensors (to the detriment of battery life and update frequency), but even just doing 2 retransmits at unique intervals means the odds of 3 collisions happening in a row are vanishingly small. I'm no statistician but I imagine your odds of winning the lottery or being struck by lightning are greater.