RTLS GPS with HC12 for farm assets

Thread Starter

Joseph_D

Joined Oct 13, 2018
3
Hello everyone :)

Regarding the project from @Mark Hughes, uploaded here, using an HC12 to transmit GPS locations.

I have a ranch with multiple assets such as cows, loaders, nurse tanks, pumps, etc. that I would like to monitor and know if thieves are trying to steal them when no staff is around.

The idea is to use geofencing, so when an asset is going beyond the geofence, I will receive an alert about it.

In the comments section @Mark Hughes had a short conversation with someone that asked "can the one (EDIT: he referred to receiver) handle about 7 trasmitters?" and @Mark Hughes answered, "Depending on what you’re doing you might be able to accomplish this by sequentially transmitting according to a time-table—one transmitter every second.".

So, the above solution is useful when you have a small number of assets to track, what about monitoring over 100 assets (90 livestock plus machinery and equipment) at the same time?

Because I would like to tag the livestock the simple yet elegant solution of utilizing a GPS receiver, an HC-12 transceiver, and a battery as shown in the article is excellent for my needs and won't be a burden for the livestock.

Btw, I can deploy multiple amounts of receivers along the property so I could know what is the direction of the stolen assets and direct the local police force towards them.

I appreciate your time and hope you may be able to help me.

I hope you will have the absolute best day ever!
JD.
 

Mark Hughes

Joined Jun 14, 2016
409
Hi @Joseph_D ,
Sounds like you've got yourself a project on your hands! Good for you. I'm going to ping a few more people into this conversation. @ericgibbs @Raymond Genovese , @RK37 to offer different perspectives if possible. Also -- I'm going to encourage you to see what other people in the industry are doing first. It's often cheaper in the long run to buy a working solution than R&D one.

To answer your question -- yes an unlimited number of transmitters can communicate with one or more receivers. However, you need a way to avoid collisions as the number of transmitters increases. You'd want to put in a small microcontroller (<$1) between the GPS module and the HC12 to implement this.

It'd look something like this for the small quantities you're asking about.
  • Each microcontroller/transmitter would be assigned a unique serial number (e.g. 1, 2, 3, .... 300) during programming
  • The microcontroller would decode the NMEA sentence from the GPS and look at its lat/long and time.
    • If outside the lat/lon geofence boundaries -- start broadcasting GPS continuously at ~1 second intervals at high power. And you better hop in the truck quick -- 'cause these things only have about 1 km of range.
    • If inside geofence, use the current clock seconds and 1 decimal afterwards (ssd), divide it by 300, and if the remainder equals the serial number, broadcast the serial/lat/lon/battery of the asset. (ssd mod 300 == ser?) That should update your assets twice a minute. You could switch to a higher number of you need less frequent updating. (ssd mod 1200 == ser would update every 2 minutes, etc....)
  • The receivers could all be on the same channel. Shouldn't be a problem to put one on a big tall stick out in the middle of the field with an antenna on the end of it. But if you need multiple, you might set up relay stations -- where two HC12s are chained together on different frequencies. The assets transmit to a relay station, and the relay station sends the messages to home base.
Does that make sense? GPS itself is the synchronization for all the receivers, and they take turns sequentially broadcasting their position and battery health based on their serial number. You could increase or decrease the frequency by changing the modulo, and increase the time between successive transmission by choosing different time digits (e.g. minute, second, second, instead of second, second, decimal).

There might be a few kinks to work out -- but it should work. All that said -- with the cost of equipment and cattle -- I'd see what other asset tracking technologies are already on the market first.

Take care,
Mark
 

Thread Starter

Joseph_D

Joined Oct 13, 2018
3
Hi @Mark Hughes :D

Thank you so much for your thorough answer, I appreciate it very much!!!

I indeed searched for assets tracking in advance, and the few companies/startups that do offer RTLS for livestock have a high price tag that makes them unaffordable for me.

I'm all in to invest some time and money in R&D, and also very passionate about the process of creating such project, it will be great to gain experience in a field that will benefit my family and me.

Everything you wrote made sense, I wonder in case there are larger quantities to deal with, does your approach changes significantly?

Another question that is a bit ahead of its time but still is very interesting to know; I would like to have also an autonomous UAV or 1/4 RC crawler (using Dronecode for each) that I will equip with Pixhawk 4, a camera and HC12.

The point is when an asset is outside of the geofence the UAV/vehicle will intercept the thieves, and in case of an error, I will know since no one will be there.

Is it possible to use the HC12 to broadcast the camera feed with the same infrastructure of the livestock receivers or should I add up more HC12 receivers using different channels to transmit?

Anyway, I would like to thank you again, @Mark Hughes, for your time and attention in my project!

Many blessings,
JD.
 

Mark Hughes

Joined Jun 14, 2016
409
@Joseph_D ,
I would absolutely not recommend using the HC12 to transmit video. At best, it might be able to transmit a VGA photograph every minute or so. It's just isn't designed for the kind of bandwidth that video requires. It achieves it's great distances at somewhat low power by transmitting relatively slowly. Your best bet is to spin that off into its own separate project and just buy a GHz video unit made for a drone. There is always going to be a tradeoff between speed, power, and distance.
As for how big it can be.....with my simple scheme, there isn't really a limit to what you can do --- the lower timing limit is how closely the HC12s transmit before interfering with the previous one....give yourself some margin for error. Eventually you'll find that the time to cycle through all the transmitters becomes too great. It's of no use knowing that a cow is missing, if they're 10 miles down the road before you realize it -- by that time they'll be out of reach. There are more complicated schemes out there (e.g. Mesh Networking) -- but that's too much dang coding complexity for the benefit until you get to really big scales.
As for the rock-crawler idea -- you can actually remote control an electric wheelchair in about an hour using a Sabertooth Motor Controller (https://www.allaboutcircuits.com/projects/building-an-rc-robot-using-a-wheelchair-base-part-2/ and https://www.allaboutcircuits.com/projects/building-an-rc-robot-using-a-wheelchair-base/) If you go that route -- get the 2x32 (or the 2x60) -- don't mess around with the 2x25 -- it works well enough, but the 2x32 has more bells and whistles. And since you're on a farm, you can likely weld the wheelchair frame to add useful implements -- like a chicken-feed spreader.
Before you go hog-wild, start with say a dozen of the HC-12s. You've still got to program your ICs, make some circuitboards, and test battery-life. Not to mention decide how you are going to process all the data. It's not going to be too fun changing the AA's on Bessie every other day.
Best,
Mark
 

ericgibbs

Joined Jan 29, 2010
10,008
hi Joseph,
For the cows that have a GPS and HC12 unit, it would be possible at the receiving end a PC which has been programmed with the coordinates the limits that the cows can move before a alarm is raised.
By knowing the cows actual position from the GPS coordinates, you would have a good idea where to start looking on the farm boundary/area.
So the geofence is virtual as it exists as coordinate points in a program.

As one cow transmits its position it will also have a tag ID for the next cow to transmit and so on.
If the receiver gets no reception for a specified period it will send out the ID to restart the chain transmissions.

E
 

ericgibbs

Joined Jan 29, 2010
10,008
hi,
@Joseph_D, @Mark Hughes
Draft:
One option would be to have all the cows fitted with a GPS and HC12 transceiver unit.
All cows HC12's would be running as listeners on the same HC12 channel.

The central control unit would be a computer.
It would transmit the ID code tag for a particular cow, the cow would then transmit back its GPS position.
The PC would transmit the next cows ID tag 5 seconds later and so on until all the cows have been addressed, the sequence would then repeated.

The PC program would compare the cows GPS received position to the preprogrammed limits of its allowed movement area.

If the cows received position was at or outside the programmed limits a low level alarm would be raised.
That cows ID tag would be retransmitted again, say 3 times at one second intervals. This would be to confirm its position.

When the alarm is raised the cows position would be displayed on the PC, together with a text description of its location and the time would be logged.

All the cows would interrogated in sequence, at say at 5 second intervals by transmitting the that cows ID tag.

A similar method could be used for the farms equipment, say on a different HC12 channel.

E
 

Thread Starter

Joseph_D

Joined Oct 13, 2018
3
Hello
@Mark Hughes, @ericgibbs

Thank you guys so much for your help, the information you gave me would help, and I will post an update here about my progress.

About the battery life, I understand that I should experiment and see for my self, but what is your estimation of battery life for such tags?

Kind regards,
JD
 

Mark Hughes

Joined Jun 14, 2016
409
@Joseph_D,
Just so you know -- Eric Gibbs is the guy who told me about the HC12. My article wouldn't exist without him.
As for battery life estimate -- I really couldn't say. It'll depend on which parts you pick, and to a lesser degree, about the code you write -- and whether you tell the mcu to go to sleep in between transmits....and if you can hot start the module.
Eric and I envision different systems -- his is a call and response. Mine is a always on, but sleeping most of the time. Both are valid design strategies. The reason I envisioned putting the geofence on the microcontroller is because I was imagining a nice simple rectangular plot of land aligned along latitude/longitude lines. That might not be the case. For a complicated geofence -- drawing it on a computer is absolutely the way to go, instead of falling into if/then purgatory.
To really stretch the battery life -- it'd be nice if you pick a GPS unit that you can hot-start via the microcontroller. And a microcontroller that can "sleep" between transmissions. That way -- between scheduled transmissions, everything that can consume energy is asleep, you only wake up to get a fix, transmit it, and then go back to sleep....why get constant GPS data if you're only going to transmit it every two minutes? By going from a 100% duty cycle (always on) to a 10% duty cycle, you've now extended the life of your battery by an order of magnitude (from say, 1 day to 10 days).
Now if you really wanted to complicate things, you'd toss in an ultra-low power accelerometer. It's job is to wake things up when movement is detected. Why bother determining the location of a tractor while it's parked in the field? Just blast out the last coordinates if no movement is detected and keep the gps shut off. Then as soon as movement is detected, get a new GPS fix.
Good luck!
 
Top