Make Your Own GPS Tracker Using the AVR-IoT Cellular Mini

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hi everyone, my name is Ross Satchell from Microchip and welcome to the lab. Today we're gonna check out our GPS tracker demo using the new AVR-IoT Cellular Mini. So let's get started. First of all, we're going to go to Google and we're going to put into Google "AVR-IoT Cellular Mini On-Boarding" and that's going to take you to the Google search page. And all we're going to do is skip the sponsored ads at the top and the first hit that you get that's not a sponsored ad is the one we are looking for. And so you can go through the the on-boarding here where you were first set up the AVR-IoT board, but in this particular sample we're going to be talking about the GPS tracker. So we're going to jump straight into the documentation link here. Okay, so it takes us to the documentation and one of the great things about this board, it has full Arduino support through the the DxCore, Arduino core that's been written for this. And so we can walk through the introduction and everything else, but I'm gonna jump straight to the GPS tracker here under examples. And let's start with the introduction. And so it goes on to tell you that you can create a simple GPS tracker using the AVR-IoT Cellular Mini board and also an Adafruit GPS FeatherWing. And it just clips straight on top. And so the application will send your position or the position of the GPS tracker to a web server and that will then display the track position on a browser. And so here's an example of what our friends in Norway did, but we're gonna be showing you some of our our people in a moment who are actually going out to get me a coffee. So the resources you need for this are you need the AVR-IoT Cellular Mini board, which is this guy here. And then you need an Adafruit GPS FeatherWing and then a battery, and that's all it is. And then you need a USB-C Cable to program it. And so the, the assembly is really quite simple. We're just going to plug this guy on here and we're going to connect our USB-C Cable Place that there, alright? So that's the assembly done. So moving on to the next part, the Arduino Sketch itself. So the GPS tracker uses Adafruit GPS library and to install that, you just go to the Arduino IDE under the tools manage libraries just like you normally do with all of your other, all of your other Arduino libraries. And you just search for Adafruit GPS library and install that. And then we have the code. So we're gonna jump over to the code in Arduino and I have that opened already. Let's make that full screen, whoops, there we go. And so I'll quickly walk through the code here. So I have my URL that we're going to be sending the data to. And then we have a GPS function here that just returns information like your latitude, your longitude and the current time. And then we have a state of the device. So it starts in a not connected state and then we initialize the GPS and it's just setting up the UART connection between the the Cellular Mini board and the GPS Feather there. And we send it some commands to tell it to update every one second and to not use an external antenna, in this particular case, because we're I do not have an external antenna connected. Then we configure our HTTP. And so we are using port 8080. And then to send data, it just sends the latitude, longitude as a string and then the time and it's quite simple. Then it connects to the network and then at the end of that it returns the state as being connected. Then we have passing the GPS messages and it just basically goes to a timestamp and returns your GPS time in terms of your day, month, year, hour, minute. And then also returns the quality of the GPS fix and also the number of satellites that you have. So now we can jump down to the setup function. And so all it does is configure power down. Because it's going to go to sleep in between GPS readings and then the AVR-IoT Cellular board has some extra sensors on the board and there is a color sensor, and there's also a temperature sensor. And we're not using those. So hence why we are shutting those down. You can see the shutdown functions here. And then we initialize our GPS, we initialize our HTTP. And then in our loop we just pass the GPS messages and then we switch through a switch statement which is of the state of the system. And if it's not connected, then we try to connect to the network. And then once it is connected, then it goes and gets a GPS fix and then sends that command so that we can then work with that GPS data. And then once it's connected with a fix, it then sends the actual location and at the end of it we have a power down command. And at the moment we're turning it to power down for one second because we wanna see regularly where our people are driving along the road. And that's all of the code. It's really quite simple. Okay, so my coworkers have one of these devices with them in the car, but I'm gonna program this one here and it's just a matter of setting your port and I'm on port 30 and then uploading the code to the device, so let's get that started. It's the usual Arduino compiling first and then working to upload the code to the board, and we just upload like we normally would in Arduino. So that goes and compiles everything and then starts linking everything together. There we go, and it's writing to the board now. And now it's reading back the data to make sure that the right was good, all right? And then we saw the LED's flash there and then the first thing it's going to do in a moment is the blue light comes on and it's looking for a cell signal. Well we're in a area with poor cell reception at the moment so that may get a signal, but my coworkers in the vehicle, that will turn solid blue and then the it'll start working on getting a GPS lock and then it will start sending the data through. So we can see my coworkers who have been driving down Chandler Boulevard and they're approaching Cooper Road there. And so let's give them a call and see what's happening. Hey guys, how you going? Good, how about you, Ross? Pretty good, pretty good. So yeah, we were watching you drive down Chandler Boulevard and it looks like you've just pulled into a car park. Just what's that on the corner of Chandler Boulevard and Cooper Road? Yes sir. So, can you tell me what's happening with the GPS tracker at the moment? Yeah, so it's sending periodic updates over a battery connection to show our location. Awesome, it looks like it's sending one right now. I think we've got the cell lock and it just had a green light there for a moment and then it's gone to sleep for a moment, excellent. So we should see, yep, I've just got another pin, I zoom right in, I can see you are in the car park here, awesome. So before you guys head back do you wanna grab a coffee and maybe a muffin? Will do. Sounds good. Awesome, all right, see you guys soon. Alright, bye bye Bye. So as you have noticed we are using a web server to host this website and we used a company called Digital Ocean and we set up a droplet as our web server. And so all you have to do is set something up similar to that, some form of web server and then download from the documentation page the web server zip file and then unzip it and then just follow the, install the requirements and then you just run the Python app and that outputs the IP address that this will be using and you then just copy that, paste it into the Arduino code that you're using in the place of HTTP domain and you only need the IP address. So you don't need http:// and you don't need the port, it's just the numbers separated by periods. And then in your browser you simply go to that IP address and the map will appear and show the positions recorded. And it also shows arrows drawing from previous positions to the most recent positions so that way you can see the path that has been taken. And so we can see now Grace and Josh are out on Cooper Road. If I zoom in there, I can see they come out of the car park back on the Cooper Road. And it's Friday afternoon, so there's probably a bit of traffic there. So if you wanna build this yourself, you can go to Microchip Direct and order a AVR-IoT Cellular Mini and then you can also go to Adafruit and there's a link here in the documentation to that. And we'll also post a link in the description below where you can order yourself a GPS FeatherWing. With the GPS FeatherWing, you can choose to use an external antenna, the Adafruit do seldom. We found it wasn't really necessary for this application. But if you're in an area where you're not getting a terribly great GPS signal, then you may need to use that. We also used an external 18,650 battery with a JST connector to just plug it directly in the port here on the AVR-IoT Cellular board. But you can use any type of lithium rechargeable battery. And then when you need to recharge it, you simply plug the USB-C cable in and to some power source and the onboard battery charger will then handle the battery charging for you. You don't need to do anything extra. So if you make something really cool with this, please post a link to it and let us know 'cause we'd love to see what you're doing with it. So that's all for us today. Thanks for watching and we'll see you in the lab for the next demo.
Info
Channel: Microchip Technology
Views: 53,191
Rating: undefined out of 5
Keywords: Microchip Technology, mcu, microcontroller, PIC, engineer, engineering, mchp, AVR, gps, tracker, DIY
Id: WYT7r62AEYo
Channel Id: undefined
Length: 10min 47sec (647 seconds)
Published: Fri Apr 07 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.