Hi
I am a noob. I have only very basic ability when it comes to writing code. I am limited to searching for examples of something similar and then cutting and pasting and then trying to make it work. I have completed a few projects successfully this way but this time I have bit off more than I can chew.
I am trying to build a GPS controlled "torpedo" capable of travelling a few hundred meters from a beach hauling a fishing line and then drop a bait. Here is a link to something similar
" Fish Seeker Contiki - Catch more fish, all year round! – TV Shop"
I have found a similar project on this forum "title GPS controlled boat waypoint setting" where OP Beretta
was doing exactly the same thing but it doesn't look like he posted the completed project. its a few years ago so I thought I would start a new post.
I have followed all the links and have tried to use the NeoGPS library posted by SlashDevlin and also the advice he has given in many many other posts relating to his Library.
I have forked together code to run the motors to provide steering. I have also found code to read heading from a QMC5883L magnetometer and some code to operate a servo to release a latch and drop the bait. I have also fabricated the torpedo. I have found a bluetooth control panel app for smart phone by Martyn Currey which allows me to configure a few initial settings and transfer to the arduino via bluetooth. I have got the code for this bit working as well I think.
So my circuit comprises, Arduino nano v3. Gps Neo 6m module. QMC5883L magnetometer, L298N motor driver, HC 05 bluetooth module, 9g Servo motor.
I was hoping to be able to
arrive at a beach.
Switch on the Arduino
Acquire GPS fix for the shore.
Acquire a bearing from the QMC button press on bluetooth app
send a distance of say 400m via bluetooth to the board.
Calculate a waypoint for the baitdrop 400m off shore at bearing.
send a motor start signal via bluetooth app
launch the torpedo
navigate to waypoint and stop motors and drop bait.
The part I am struggling with is the code to fix the shore location
fix the baitdrop location and then use the GPS read of current location to start navigating.
I'm sure it is something blindingly obvious but at the moment I can't see the wood for the trees.
The initial part of the code does seem to work.
It will serial print the shore location
It will serial print the baitdrop location
it will calculate distance and bearing to the baitdrop but the last bit of the loop I want the torpedo to read its location "fix" compare that to baitdrop distance and bearing and then start navigating Any help or advice would be appreciated
Its a long post so will attach code in the next post



