LESSON 22: Build an Arduino GPS Tracker
HTML-код
- Опубликовано: 10 сен 2024
- This tutorial has step-by-step instructions on creating a GPs tracker based on the Arduino and Adafruit Ultimate GPS breakout board. This lesson will get the circuit connected, and the module streaming and reading good NMEA sentences. In lesson 23 we will parse the data and save to an SD card. See details at www.toptechboy.com
No one can explain it better. Thank you Paul for such a wonderful lecture. You have explained everything clearly leaving no room for doubts. One of the best lessons I have come across. Keep up the good work.
Wow! We’re going back some years and still getting excellent videos. I just ordered one of these guys for my robot car. My goal is to make the car go to waypoints that I program into it.
Another great video! I love that you showed us with a completely blank program the gps module still streams data over the serial port. That's such a great visual.
Nicely done. Thank you for not editing out finding the errors. It is part of programming.
Great series very engaging presentation style. Thanks Paul.
“Tell me and I forget, teach me and I may remember, involve me and I learn.”
― Benjamin Franklin
Temp/pressure worked, but not GPS. GPS worked, but not T/P. It was the ClearGPS() that did it for me. Thank you, man! Subbed!
Couple of quick pointers:
Around 17:43 you mention not knowing why you need to use & in front of your variable. This is known as passing a variable by reference (as opposed to pass by value), which means the method being called will have a memory reference to your variable rather than a copy of it. Try googling c pass by reference for a more in depth explanation and why it can be beneficial.
Around 26:30 you mention that void indicates that you aren't passing any parameters to the function or getting any back. This is wrong, void (or int/string/etc) indicates the return type of the method, and in no way says anything about the method parameters.
Amazing work, amazing voice, amazing lesson!
Thanks
Thanks for the kind words!
Amazing comment too
Thank you Paul, this has been so tremendously helpful - not many arduino tutorials are as engaging and well explained as yours!
Thanks for the kind words.
Youre a fantastic teacher helped me sort a project out in no time flat !! thanks a million!!! can hardly belive how simple arduino makes things
Thumbs up every time - I have learnt so much with his detailed and precise tutorials. Thank you Paul
in 17:48 the reason for using the & sign is to pass the memory address of the software serial object. this is done as it prevents making a duplicate of the software serial object Saving memory which is crucial on boards with very small memory (like arduino uno which has only 2kb of memory). I checked the adafruit's library file and looked for the parameters(the thing which you passed in to create the object) and the constructor(the thing which creates the object) is looking for a pointer.
Wow using this video to help me with work i'm doing for my NASA internship
Mcwhotter i actually can't say how grateful i am to you,you've done so much in my life and you've made my dream comes to reality.i have been willing to learn arduino programming since i was small and all attemp to know it proved abortive..i went online to search for videos but i couldn't see one that suits me..many videos lied,i lost hope and at some point i stopped disturbing myself thinking that the programming world is not meant for me until one day when i kept disturbing youtube and i found one of your arduino videos,i taught you were like others too and i downloaded one,i couldn't say how much happy i was that day when i realized my life has changed.....you're such a wonderful being,i don't know what to use and compensate you cuz i don't have anything....but i really appreciate what you've done in my life......one more thing? Can you please make videos on 7segment display with arduino and bluetooth module with arduino??
❤❤LOVE FROM NIGERIA
6:18 _"You have to _*_KILL-"_* I swear I was just hopping backwards in the video and then this 😂 Haven't seen this video in weeks so I surprised myself 😂 Thanks for the help though!
You Are great mr. Everything that you are doing in every tutorials is verry nice.
Thank you for taking the time to teach these lessons.
oh wow! u brushed up my programming skills back to norm. thanks a lot.
That extra zero and that semi-colon were killing me. It's like watching Dora the Explorer, yelling at my screen.
Thank you Paul for sharing your Arduino knowledge. Great tutorials!
Craig Clark Thanks Craig, glad to hear you are finding them useful.
Ur the best resource for me to deal with Arduino programming ,,, love to see Ur vedios 😍😍
You're awesome man. That buffer clogging was messing up my data. You explained it well.
I hooked everything up correctly(5V to VIN, GND to GND, RX to 0, TX to 1), and have the correct baud rate, but I'm not getting anything in the serial monitor. I know my Uno works. Is it possible I have a bad GPS module or is there some setting thats not right?
Red LED on the GPS breakout blinks every so often.
adr127 I too ran into this problem, did you find a solution or the reason why?
I too have the same problem. Did you find any solution? Please share!
Truly informative! Thank you for your dedication to helping others learn.
Excellent video series Paul. Hope you will continue this good work. Thank you very much.
This is just what I needed! Keep up the good work Paul.
Thank you Senpai. You were the one who told me to make this in the live stream about starting an Python Series.
Would not that character c be overwritten every time its in the loop? its not happening but it should, right?
hello . i want to ask if it is possible to use this gps sensor with arduino to make a gps survey instrument which can do the gps correction automatically and so it can be used for surveying with an acceptable precision.
Hi, were you able to make it work with the Arduino? We are trying to do the same thing, but can't get past the first step of just reading data from the GPS. We connected it and both boards had power. Then we loaded the empty code. When we clicked on the viewer, not data was being transmitted from the GPS (even after trying different baud rates). Can you help? - thanks
Good tutorial!
but your clearGPS has a bug, assuming that the GPS messages always comes in a specific order ( I think they do ).
It means if you see the messages being printed out of order you are printing GPS values from two DIFFERENT reads from the GPS, might not be a big issue but one worth knowing.
I would look into clearing the serial buffer itself in your clearGPS and only accept GPS values if they come in the right order.
But beside that small bug I think the video was great!
Can't you ignore the data unless it reads $GPGGA correctly so it does not come over corrupted? only accept it if its good?
17:46 the reason for " & object_name " must be that the gps for the add in address location .....if when we r not using pin 0,1...we must have to tell the arduino to go to GPS tracker and access the file or data located address...so that's the reason I think we need to write " & " to the the data from a particular address
its like a pointer
@@siddheshgawali7764 It's the memory address of that variable.
hello paul i want to ask something, i build project gps with arduino, i want to show name of location to display lcd 2x16 with longitude and lattidute for set point, but when i try to show long and lat to display is not worl can you help me ?
One my favorite guy!! learned a lot!
17:45 - Pass-by-reference has a couple of benefits: better performance since it doesn't have to copy the variable, and the ability for a function to "return" multiple items instead of just one using the normal return.
I'm using the same setup and code as you but then I can't seem to get the data as fast as you. Seems like the GPS data coming in is being delayed, I get the readings for GPGGA and GPRMC every 2-3 seconds. Do you know what can cause this?
Maybe because I'm inside a 5 story building?
Your link does not have GPS lesson 22. Instead it is Arduino Tutorial 22: "Using Active Buzzer to Add Sound to Your Projects". Can I get a link to this lesson?
Thank you you are my oline teacher i will follow you :)
With a void function you can still pass parameters to it, it'll just not actually return anything, you can also make a function that does return something with no parameters passed to it, especially if you're dealing with global variables.
I dont see the command PMTK_SET_NMEA_OUTPUT_RMCGGA in any of the documentation can you explain where you found this?
Excellent tutorial. The best part was the mistakes giving us newbies some hope. :-)
Hi! I bought one of these and am currently using it with an Arduino Mega 2560 and the only way that I can get something to display on serial port is when I do the direct wiring otherwise is not printing anything on the serial even though he seems to be getting a fix when I do the direct wiring.
Any suggestion?
Hey Paul, I am using neo6 gps, and I am unable to get values on my Serial Monitor, I have tried both adafruit and tinyc++ Library. Could you help me with it?
Great video! You are one of those teachers that can just make complex stuff a lot simpler. By the way, I saw there is also a GPS.speed() function for the Adafruit library, and it shows it in knots. Is that a good way to find speed?
HI i was saw your video in noe 06-0001 the GPS i using the esp 8266 i have problem when i using the GPS the RIF ID is not working IT in the same ESP in WHY it is possible using in one Unit ESP?
Hi Paul, i just wondering, how big is the resolution of that GPS coordinate?
can we make it to small resolution like we can get different coordinate in every 1 meter or maybe smaller??
i'm have big hope that you will explain, thanks
I am having a connections problem with the GPS module and the Arduino, the Arduino always got shutdown when I try to connect the GPS module, specifically when I connect it to the power (5V), I believe it is a problem in the power distribution, plz help me fix the problem 😫🙏🏻
Excellent lesson, thank you. One comment... you use the term Baud when the correct term should be bps (bits per second); they are not the same thing. Baud is an old school term that max'd out at 2400. Anything above 2400 is properly called bps. Again... Baudrate and bitrate are not the same... and these days, bitrate (bps) is probably always the correct term. And yes... I still see professional equipment manufacturers incorrectly using Baud where bps should be used. eg. The Arduino IDE dropdown incorrectly uses the term Baud.
Best regards, and keep up the great work.
Hi. Nice tutorial. Do you need an external antenna?
Thank You.
Marc.
Thanks for posting this video I appreciate the time you take to explain everything also its "kool" of you writing the sketch in real time. Subscribed :)
Hi
Can u tell me is it possible to improve my accuracy by using 2 GPS module NEO - 6 M (comparing information)?
I mean in Arduino or create app in Delphi XE8 or C#, or any other methodes?
Dear Paul, I have a GPS module that is not from adafruit. Will this code work?
I have to use an ultimate adafruit GPS module. Which will be compatible with an SD card and a bluetooth module (all its components must be compatible with an Arduino) you can advise me to take what as type of components
Why 1Hz ? Adafruit advertises the device for 10Hz. Is it not good enough to achieve that and remain stable? What kind of problems did you experience with 10Hz operation?
I have NEO-7M gps, and there is PPS pin. What is this pin for? Where I need to connect on arduino board PPS pin? Thanks.
Seems like the read buffer only stores one sentence at a time. The module should specify the buffer refresh rate. To be sure you are grabbing accurate data all from the same loop frame, you'd want to first set your read loop to delay at the module's buffer refresh rate, and then parse each of the total number of unique sentences the module provides. This is just a single loop for initialization. This way, you can determine and designate a start point that aligns in time with the 1st sentence you want to keep. For example, if there are 4 unique sentences that each refresh at 900hz, you can set the start of your 1st main loop to 900hz * 4, and then offset it if your target sentence is not the first in the loop frame. Then, you can initialize a second loop in the same way for the second desired sentence. This way, you're guaranteed to never miss a desired sentence, and the two you acquire in a given read loop frame will be guaranteed to be from the same loop frame of the module. Without doing this, even if you get a "C" sentence and and "A" sentence, you have no way of knowing if they both came from the same loop frame off the module. One of them can still be old data unless you ensure your reads match the refresh 1-to-1.
Hello, I am using arduino due for this project and when I include softwareserial library it says:
exit status 1
Arduino Due (Programming Port) compiling error.
how can i fix this problem?
Paul, getting hold of an Adafruit GPS unit here in the UK is impossible and there are cheaper units. As I don't need the same one that will operate at +60k feet I am going to assume units should produce equivalent data streams
how can i find gps module which has 4 pins
any help maybe i'm doing in proteus
HI Professor Paul,
How do you setup the GPS at the beginning.. Because I receive data but mostly garbage data and the few good strings. thx
Hello, thanks for sharing, first of all. AS user of a GPS i found a problem with all the examples, the lib for adafruit is not usefull for any other GPS. I'm using for example a A9G and i would like to get from GPS longitud, latitud, etc but using AT commands and standard arduino code. Could you help us. I'm calling with A9G with no problems but GPS i can't get it. Thanks a lot sir. kind regards.
Could be without work conecatado Computer wing , exatas to send the information wirelessly and have as cellular UN receivers this can ?
Hi there,
I've been following current tutorial exactly the way it is, and everything is working the way it is supposed to be, but I am not getting two required NMEA sentence. It looks like programm sentence (GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA); ) is not working at all. Could you, please, explain the way for managing such sentence.
Thank you very much in advance for your tutorials.
Have a good day.
Maybe I'm getting ahead of things, but could you set up an interrupt handler to process incoming characters and place them into a temporary buffer (one for each sentence), then copy that temporary buffer to a completed when complete, so that your loop program would always have access to the latest and greatest sentences?
+Chaplain Dave Sparks Certainly not saying that these lessons show the best way to do things. What I am trying to do is get High School students playing around with technology. My expertise is not in programming or micro controllers, so I am just trying to show them a way to get it work. When they get to college they can learn about doing things the best way.
Sir I am big fan of all of your projects kindly make GPS land leveling with arduino...
When I tried to run this program it always stops. It keeps saying "readGPS" not declared in scope?
i'm having project that Send sms with GPS into mobile phone by Sim 900a NEO 6m and Arduino uno:(.Could u help me?.thanks sir.
I just started a crazy ideas folder too! I bet Pauls is definitely up to par =)
My crazy idea folder is crazier than anyone's crazy idea folder. You really do not want to see whats inside.
@@paulmcwhorter
while (true)
{++Like;}
Good day sir ! is it okay if we use gizduino rather than arduino? and can you tell me the version of your gps module? thankyou.
excusme , i want to ask ,
how to make the communication tool of arduino + gps + sms / email + heart rate sensors?
how it works as follows
When the heartbeat sensor stops then the device sends location coordinates via email / sms.
Hello paul do you maybe know why my GPS is printing any information on my sirial monitor
how to use SIM808 with Arduino DUE?
please help
Hi, Sir ! please, could you try to help me a question? It may be a stupid question. I live in a country where a Arduino board costs 12 dollars. A GPS shield is 3 times more expensive here.
It is possible with a simple GPS module and a properly programmed ATmega328P, track a vehicle by Google Maps? I want something simple and cheap. Is this possible to be done ?
and if possible, how do I find the coordinates and read them on Google Earth ?
Sir, sorry for my bad english and since from now, Thank you very much !
Thank you for this helpfull video! I just have one problem: the SoftwareSerial.h fonction is working on the arduino uno board, but if i connect it to the fatherM0Express card, it isnt working anymore and i don't know why. Can someone help me and tell me what i should do to fix my problem please?
Thank you again :)
if your using a MEGA 2560, then try using hardware serial instead of software serial. Change pins 3,2 to 19,18. Go to File--> Examples--> Adafruit GPS Library--> GPS_HardwareSerial_Parsing. Take a look at the code for setting up the hardware serial. Good luck.
very helpful video, but if i am already using Digital pin 2 and 3 , which other pins would work and what would i have to change in the code? thank you.
I'm totally new to this. What boards and connectors are required to make this work? I am starting totally from scratch.
I really enjoyed this tutorial.
Thanks
Maziar Ghorbani Thanks!
Hello there, thank you for this video. I just have a few questions. Is it possible to integrate this diy gps tracker to Google Maps? If yes, how will you do that? Are you going to use GPRS/GSM or you'll use a radio frequency instead? Thank you.
Awesome just what i need thank you
do you need a sim to?
Another question is..
Is the SoftwareSerial.h is already included in the arduino application? The version of arduino application that I am using is the latest one. Thanks again!
Why didn't u write the the code directly in the void loop why creating a function first ??
hi any chance u share thee code please , I got a uni project which we have to vreate a naughts and cross game, I already created the game using racket but my teacher asking us to do something to the matrix light when a player win or when the game end , for example all the 6 light works together at some point or the board make some kind of noise . please help
mujhda mahmoud Thanks for the comment. What I am trying to do it teach how to program. Watch the video carefully. Learn to code. You learn nothing if you just copy and paste my code . . . anyone can do that.
can i do gps tracking and have a relay on off function at the same arduino system together?
If you're still around, you could maybe help me with a problem: GPS.newNMEAreceived() ALWAYS returns false. I know the ultimate GPS works, because I got the streamed stuff when I was using the blank sketch. I'm getting no good NMEAs.
Having the same problem. What was your fix?
sir the readgps() on the void loop is not working on me
Hello again, I followed all the steps in your video, and put the exact codes on my arduino ide. Then, I tried to upload the program onto the arduino; and yes! it successfully uploaded. But when I try to click the icon for the serial monitor, it doesn't appear anything. The serial monitor doesn't stream the data from my gps module. What can be the problem then? Can you help me, please? THANK YOU IN ADVANCE!!! :)
is it possible to get height data from this GPS module
I did exactly what you did here but I'm not getting any sentence in my console. I'm using Arduino Mega 2560
i do connect the tx rx to 1and 0pin on my mega board but on the Serial monitor nothing is displayed. 9600baud. do you know the reason. The gps does receive fix because the red led lights every 15 second
lol pokemon, I too ran into this problem, did you find a solution or the reason why?
Could anyone tell what is the high altitude balloon that he keeps mentioning in the the video a few times?
I think you can clear the serial buffer with Serial.end() too.
So you don't mix up NMEA sentence from different timestamps
How do you know the GPS.sendCommand parameters? It looks like hex machine code
hi thanks for tutorials
i want to ask you how i can send the locations ( longitude latitude ) with GSM to my phone like "SIM900 GPRS/GSM "
How do I get more than six (6) decimal precision with a GPS Rx’er?
Does the *.ino work with Blox Neo-6m?
please i need help on how to " CREATE GPS APP WHICH WILL ENABLE ME TO TRACK A VEHICLE"
干得漂亮
这个老头讲的挺好的
Hi Paul, I've got one question is there a posibility to send data from this tracker remotely without GSM/GPRS module??
W3bT4l3nt I have used an ehternet shield and then sent data over Bullet Radios, but this requires antenna and line of site.