We farm with sheep and I have for a long time now entertained the idea of fitting each animal with a transmitting device with a gateway in the middle of the area where they graze. We have had serious theft in the past and I would like to set up this system to at least have an earlier indication of when an animal is gone from the group.
I have been playing with LoRa somewhat, using it to send pressure signals from our irrigation equipment to a central receiver. With only 3 or 4 transmitters it's easy to come up with a protocol where they sync up, even if one should reset and join the queue again.
But for this project I need to have around 300 transmitter checking in at least once every 30 minutes, although more frequently would of course be better.
The idea is to have a gateway set up in the middle of the paddock/field that would receive all the signals, and upload them to my server as it comes in.
Power supply and packaging of the project aside for the moment, what sort of protocol would be advisable for something like this? I intend to use a TinyGPS module hooked up with a Nano and a Ra-02 module. The gateway would be relatively close to the animals, probably no more than 500m, so we could get away with a fairly low spreading factor to cut on transmission time. The string would contain the gps coordinate and animal's visual id, normally not more than four alphanumerical characters.
So the question - how do I get the best packet survival rate? Some ideas I've had:
- Have each unit transmit at a random time within a 30 minute period (easy for scalability)
- In case no. 1, is there a way for semtech chips to listen and wait until the channel is clear before it transmits?
- Have each unit transmit at a set time bracket within a 30 minute period (more of a hassle for scalability)
- Have the gateway poll each unit and wait for a response before checking in on the next transmitter? (probably the best way to get highest feedback frequency)
Any ideas welcome.
Option 1 is commonly used, often with Poisson distributed timing. The basis for that is that in any subwindow of the 30 minute overall window, there is a constant low probability for a transmission.
If the module listens for "channel clear" there is no guarantee that it will still be clear when transmitting. But with 300 modules and a 30 minute window, collisions would not be all that frequent.
In your tests, send a message counter with each message, to see how many fail.
Finally, you certainly can implement message verification, with retries (again, with retries randomly distributed).
Caveat: GPS receivers are power hungry and very hard on batteries. You really can't expect much lifetime without extremely careful use of low power operational concepts. For guidelines, you might take a look at the options provided with the popular locator, Spot Trace.
Fun project! Let us know how you get on.
Yes - gps is thirsty. Which is probably the only drawback on option 4) - the unit and gps needs to be active all the time while waiting to be polled.
Would be ideal to throw out the gps completely, add a gps into the gateway and have a way to triangulate each transmitter from the gateway or different gateways.
Has anyone played with LoRa and triangulation?
The SX1280 modules have time of flight distance measurement capabilities.
Up to 2 km with clear line of site is demonstrated in this article: Find Product Documentation
Has anyone played with LoRa and triangulation?
Lots of info on the Internet about it, try a Google search on;
2) In case no. 1, is there a way for semtech chips to listen and wait until the channel is clear before it transmits?
Sort of, does not always work very well.
Details are in the LoRa SX127x datasheet, always worth a read.
Would rustlers use the paddock gate or can they access from multiple locations?
Maybe also put a sensor on/near the gate if that's the only entrance.
The gate sensor could be metal detector buried underground just inside the paddock, a gate open switch that is hidden.
Driving home from work last night I was thinking about this and wondered if you really need to tag all the sheep. Maybe giving them all identical collars (or whatever method you was thinking) but only some of them have transmitters.
Can you also apply sheep social engineering to make sensors smarter? I was thinking if you had accelerometers that trigger when a sheep is running (not walking) then if several sheep are all running at the same time and its dark then maybe this would indicate rustlers.
You could maybe use NFC so if several sheep are detected close together then this could be a sign they are being rounded up.