GPS positioning with Arduino.

Hello, I am definitely a beginner Arduino user, and am enjoying learning about them. I am considering a project and was wanting some advise on overall feasibility as well as some specifics.

To quickly outline my project: I am looking to make a diy "spot lock" for my boat trolling motor. I have found a few other posts about this exact project, but didn't find the exact info I was looking for. Essentially, I want to receive a gps location, and when I drift outside of a certain radius from that position, a stepper motor will position the trolling motor, and a relay will turn the motor on until I am back within the accepted radius. I believe that I can figure out how to control the stepper motor, and the relay, what I am having issues finding info on is the GPS. Can anyone provide info on how I might go about using a gps module to lock onto a position, and then have the Arduino know distance and direction to get back to the selected position?

The trolling motor is at the front of the boat, and is already controlled with a rack and pinion system. I was planning on adding a stepper with a matching pinion. To position the motor, the stepper would move the pinion which would in turn rotate the trolling motor head. The trolling motor could then be switched on via the relay to pull the boat in the correct direction.

Thanks.

P.S. Please feel free to point out any logic errors, or flaws in my plan. As stated before, I am definitely a beginner, and am wanting to learn more than anything.

What is the acceptable drift in the actual position versus what the GPS tells you the position is.

Without the boat moving the GPS reported position can vary by 5-10m.

Obviously i'd prefer to have the smallest deviation possible, but if I could maintain relative position within a 20 meter diameter circle, i'd consider it a success. ( If i'm being honest though if I can assemble and code something that will even move/run the trolling motor i'll be happy :slight_smile: ) My whole boat is just a hodgepodge of projects, and I enjoy tinkering with it as much as I enjoy fishing.

Is the accuracy dependent upon the GPS receiver used? My fish finder has a GPS puck already, that I might be able to make a Y cable and use, but I need to do more research on required inputs and compatibility.

Most common GPS have a very similar accuracy of position. There are better ones but they can be £100s.

There is an example in the TinyGPS++ library of using the position reported by the GPS to calculate the distance and direction to a fixed location, they use the co-ordinates of Trafalgar Square in London..

Hello bclark.

Interesting project. Nothing not do-able, I think.

The GPS side would be pretty easy. You'd press a button, the Arduino would register the current lat & long and then repeatedly calculate the drift. It could give you the distance and direction from the registered position.

You would want a display to show your track. A small OLED would be interesting. It could show the track, but be difficult to see in bright sun. It could also show the direction and distance back to the registered point. An arrangement of LEDs could be designed to indicate the drift.

What do you mean by a "GPS puck"? Is this just an antenna or an actual GPS receiver?

John.

Get yourself a GPS module and an Arduino and then see if you can get it working. You'll find plenty of examples of people doing that here and elsewhere. If you're using an Arduino with a single serial port you will want to use SoftwareSerial or the like so you can get GPS data and use hardware serial to debug.

Once you can read and echo what the GPS sends, the TinyGPS library will interpret that data for you and you'll know your position. Note that the GPS will need to be near a window, or better, outside to get satellite signals.

Do you expect wind and/or current to be perpetually pushing you away from your desired position? If so, you may need to be careful that you don't drain the trolling battery as the arduino tries too hard to get precisely back to the datum point.

You can test your initial code just walking around outside & check the range and bearing to the datum.

You may want a compass too - the GPS can calculate it's course when moving, but if you're drifting sideways, the course it reports won't be the direction your boat's actually pointing. You might be able to calculate your heading when the motor comes on, but a compass would be easier I think.

Good advice, wildbill. For a complex project a person needs to understand and master GPS. Get this under your belt at home, before you take it on the water.

Too often on the forum we hear from people who have built an ambitious GPS project and when it doesn't perform come to the forum and yell "please help me".

Good luck and keep us posted.

John.

maintain relative position within a 20 meter diameter circle

No problem at all. But a beginner to Arduino should expect to spend several months working out the details.

Because of the boat's turn radius, most steering mechanisms actually cruise in a figure 8 pattern while "holding position". To accomplish that, you need an electronic compass (magnetometer) for steering, in addition to the GPS for location.

This short video shows a tiny, autonomous boat perfectly executing a triangle course, 60 meters on a side, using the methods mentioned.

Here is the gps "Antenna" I have. It interfaces with the fish finder/chartplotter I have. I guess simply making a Y cable wouldn't work then since its not actually a receiver. The chartplotter I have already has the ability to set waypoints, and view your course and tracks. I have not idea how to go about interfacing the Arduino with the chartplotter, so I just assumed a dedicated GPS module would be a simpler solution to start with.

My "Boat" is actually a small plastic "Bass raider" style boat. At only 8 foot long, and maybe 300lbs fully loaded it turns very easily. When manually operating the trolling motor, I can set the direction and my boat typically pivots and then tracks in a straight line, so hopefully it would respond well to a simpler vector style of navigation.

I fully expect to spend a long time walking around in the front yard testing and debugging. There are many off the shelf trolling motors that already have this feature, but they are very expensive. I definitely don't expect to fully replicate the results of the off the shelf models, I just thought it'd be a fun project and could be a cool addition to my project boat.

The tiny GPS library info is what I was looking for, I didn't know this existed, and was confused on how to interpret the GPS data and determine a heading. I'll do some more research into the library and GPS functions as well.

To start i'm just going to get an Arduino, driver, steal a nema 17 stepper from my 3D printer, and get a gps module and try to learn as much as I can. Two additional features I think I might want to add are a limit switch to "Home" the trolling motor postion, and possibly the use of a remote to set/unset the gps fix. Would an uno be a good choice for this type of project or should I look into another model?

I appreciate all of the replies and help thus far. I don't want to take advantage of the forum and skip my own research, but getting help from the experienced definitely helps guide my personal research.

UNO is good for workbench prototyping and testing ideas. It needs a breadboard and jumper wires. But it's not good for a completed device to use in the field. Too delicate.

I like Nano. Has all the capabilities you will need. You'll need a perf board to mount it on along with another components. You really have to aim for a robust construction. Flaky connections are great time wasters.

I would use a GPS board that has a screwed antenna connection rather than the tiny press-fit connection. Also, one with a USB connection. You can power the board thru this and also send the GPS output direct to a PC, which is so handy I'd call it essential.

Want remote control? An HC-05 Bluetooth module will help. You could then communicate (both ways) with a phone.

Don't worry about "taking advantage of the forum". It's refreshing to see someone who recognises the need to learn and be willing to be self reliant. It's an interesting project and I reckon we'll all love to see it develop.

John.

Here's a deviation map of my device over a period of 12 minutes. Position was plotted every second. The device was stationary throughout.

John.

That would be a good test for the OP once the GPS is talking to the Arduino. I've seen claims for devices having 2-3m accuracy, but I rather suspect that that is a very particular interpretation of accuracy, ignoring atmospheric effects for example.

It would be interesting to see how the position in the diagram above moved. i.e. does it wander in small increments or jump all over the place?

wildbill,

The movement is in small steps and in a certain direction for a while, then off in a another direction and so on. It's not erratically jumping around. It's like a pigeon moving over a patch of ground pecking for food.

During this particular exercise the satellite signals were erratic -- changing strength or dropping out. It's not normally like that. Maybe on open water signals would be steadier and that might reduce the deviation.

The unit the OP referred to claims a 2.5 m accuracy, but that is with augmentation, i.e., assistance from a ground based system.

John.

HillmanImp:
The movement is in small steps and in a certain direction for a while, then off in a another direction and so on. It's not erratically jumping around. It's like a pigeon moving over a patch of ground pecking for food.

That's good, I had hoped it would be, although I do see that the pigeon flew quite a few meters to pick up a particularly tasty morsel to the NNE :wink:

HillmanImp:
UNO is good for workbench prototyping and testing ideas. It needs a breadboard and jumper wires. But it's not good for a completed device to use in the field. Too delicate.

I like Nano. Has all the capabilities you will need. You'll need a perf board to mount it on along with another components. You really have to aim for a robust construction. Flaky connections are great time wasters.

Thanks, Ill definitely go with the nano. I haven't purchased anything, as I want to be confident that I know what i'm getting before i just start buying stuff. I'm looking into an A4988 driver for my bipolar 1.2A nema 17. Not sure if that will be the final motor I use, as ill have to do some testing to see my torque requirements, but ill try it out since I already have a couple of them. I was also looking at these two gps modules.

https://www.amazon.com/exec/obidos/ASIN/B01H1R8BK0/ezvid02-20

Hobbypower 7M GPS Module with Compass & GPS Mounting Bracket for APM2.6 APM2.8 Pixhawk PX4 Flight

I also had a question that is down the road, but ill ask anyways.

The way I had planned to mechanically couple the stepper with the trolling motor was to utilize the existing rack and pinion system. Currently a foot pedal and cable system moves the rack forward and back which rotates the motor shaft. I had planned to mount the stepper with a pinion gear in contact with the rack, and when the stepper takes over it would move the trolling motor shaft, and also the foot pedal. Not the most elegant, but this is the simplest way I see, and I can just move my foot off and stay clear of the pedal. My concern comes when the stepper is off. When I manually control the motor with the foot pedal, it will also drive the stepper via the rack and pinion. Will manually driving the motor create current that could damage the driver or Arduino?

Yes, back driving the stepper motor will create a voltage/current. Ask the stepper driver manufacturer if that could be a problem.

If the stepper driver is powered down when the motor is back driven, both the driver and any connected electronics could be damaged, so a clutch would be a reasonable addition to consider.

That Adafruit Ultimate unit is pricey. I'd want to know what I'm getting to justify a premium price like that.

I looked at the user manual of your Humminbird unit. It is a complete GPS receiver and antenna. The manual explains how to tap into its GPS output (NMEA sentences).

John.

I'm really interested how you went with this. I'm looking to do something similar.

My electric motor (Minn Kota RT80EM) is attached to the cavitation plate on my outboard which is steered by an external GPS Autopilot (Lowrance Autopilot). Basically the autoplitot system is designed to steer the outboard to travel along a set route or constant heading and the motor engagement and speed is controlled manually. For the electric motor it simply has a simple turn knob/dimmer to control the speed.

With the steering part sorted, to spot lock all I need is the arduino to run the electric motor every time the boat drifts outside the set parameter.

I can do the wiring but I dont even know where to start with the coding...