Here is a Youtube video of me demonstrating the GPS Guided Robot. You can see that I am holding a cellphone and controlling the robot. I am at a tennis court and I am setting a Waypoint for the robot to return to. Once I position the robot where I want it to return to I, clear the GPS waypoints, Set the new waypoint, press Done when I have entered all the waypoint (in this case just one), then I press Go to Waypoint and the robot returns to the desired location, (give or take a few meters). Once I press the Go to Waypoint Button, the robot determines a course to return to the location I set. The robot constantly checks to see if it is within 0 meters of the GPS position, if it is then the App display will read “Destination Reached”. As you can see sometimes it returns to the correct location and other times it is several feet off.
How to Build a GPS Guided Robot – The Demo
P.S. The British voice is something I had to install on my cell phone and select in MIT App Inventor when programming the App.
Step 1: How to Build a GPS Guided Robot
We will start building the GPS Guided Robot in just a moment but first let me give you a little background on how this project came about. If your not interested in how the robot came into existence and why, feel free to skip to the next step.
It is probably obvious to anyone who looks at my YouTube channel that I love to metal detect, It’s also obvious that I enjoy all things Arduino and building Robots. Up until a few years ago, 2014; I had never even heard of an Arduino until I stumbled upon a YouTube Video by Bob Rudolph aka (SentryGun53). I was very impressed to say the least! Using a laptop computer, a Logitech camera, and an Arduino connected to a few servos, the Project Gun would track the person or object and shoot them with a Paintball gun. Awesome! I had to build one myself! But how was I going to do it?
I knew a little about programming, I have a degree in Computer Information Systems, but I knew nothing about microprocessors or anything about robotics. It seemed like an impossible task. Eventually after about three months of immersing myself in Arduino YouTube video tutorials, Arduino Books, magazines; I finally started to build my own project sentry gun and it worked! Much to my amazement!
Bob Rudolph’s YouTube Channel
My version of the Project Sentry Gun
It wasn’t long after this that I caught the Arduino bug, I built more projects. Some were exact copies of other people’s work, some were modifications, and other were completely my own. During this time I was still metal detecting, but while metal detecting I kept thinking how cool it would be to build a metal detecting robot! I noticed that metal detecting was very robotic. Walk in a straight line, turn, move over a few feet, walk in straight line, Repeat, over and over again. But it still seemed like an impossible project, so I started looking for Videos on YouTube hoping that someone else had already built such a device. Well there were a few but most were just way to complicated or too expensive. I needed something simple, easy!
Months went by and one day I was out metal detecting when a gentleman approached me and started asking me questions, not uncommon in this hobby! But he surprised me when he said, “I can’t help but notice that what you are doing seems very repetitive, it seems like someone could build a robot to do what you are doing.” After hearing this I was determined that I would build my own metal detecting robot.
I started noticing that some people were building robotic lawnmowers, which seemed pretty simple. They were using RC remotes to control their lawnmowers, but there was one huge problem with this design. When the person would start out mowing the grass everything was great, but when they would reach the end of the lawn and turn around the person invariable got off course and would constantly have to correct their steering. Eventually, after getting off course so much they would give up trying to keep nice straight lines and just zoom all over the yard, which didn’t look very good. I also noticed that many of the commercial robotic lawn mowers operated on the same principle, zoom all over the yard in hopes that eventually all the grass would get mowed. This seemed very inefficient. I thought there had to be a better way.
When deciding to build the robot I also considered the idea that my project could have more than one application. Not only could it be used as a metal detecting robot, it could also be modified to be used as a robotic lawnmower. After all, they both would operate basically the same way.
I decided to divide the project up into smaller sections. I would need to build a platform on which to build my robot. If it was going to be used outside it would need to be very rugged. I noticed that many people who were building robot lawn mowers were using wheelchair motors. This would work on my eventual end goal but I needed something smaller for testing purposes. In case the robot got away from me I didn’t want it busting a hole in a wall or breaking furniture, so I decided I would have two separate robots. One would be a small inexpensive robot that I could quickly modify, and the other would be larger and closer to the end product, capable of outdoor navigation and able to carry a metal detector.
My goals were simple at first; build a small robot using a preexisting kit from eBay. These kits were cheap, usually less than twenty five dollars, add on an Arduino, a motor shield, a battery pack and the cost was less than fifty dollars. Next, I looked at how I was going to control the robot. I had already determined that the RC idea was out of the question so I decided to start looking for other options. Eventually, after looking at just about every option possible I decided to utilize a cell phone using Bluetooth. My main goal was to keep costs low, and I figured everyone had a cell phone. Many people even have an old spare just lying around.
Over the next few months it seemed I had to overcome more and more hurdles in order to reach my objective. First, I had to build the simple robot, attach the motor controller and Arduino; then I made the robot make simple movements without Bluetooth. Next, I had to add Bluetooth to the robot by installing a Bluetooth module and design my own App using MIT App Inventor to control the robot; moving forward, backward, left and right. In time, I would give my robot a sense of direction by adding on a magnetometer (compass) and eventually I would do the impossible task of adding GPS control.
What you are seeing in the YouTube videos are months, and months of hard work. I continue to tinker around with the design, adding features here and there. I’ve finally reached a point that I can longer spend as much time as I would like to develop this idea. So, I am turning it over to you and everyone else on the internet to see what everyone can do with it. It’s my desire to see lots of copy cats and tinkering with this project. I’m sure I will leave something out so please be sure to post a message on YouTube or Instructables so that I can document the build content better. The code is documented pretty well, I think! The code is commented so that pin hookups to the Arduino and corresponding modules should be easy. Good Luck and Thank you to the Arduino/ Robotics community!
Step 2: Build the Bluetooth Robot First
A few months ago I posted a video showing how to build a Bluetooth Robot. I would highly suggest building this robot first. “Why?”, you might ask. Excellent question! If you can build this simple Bluetooth Robot, then you can just add on to it to build the GPS Guided Robot. Once you build the Bluetooth Robot you will already have most of the things you need to build the GPS Guided Robot. You will just need to purchase a GPS module a(Ublox Neo 6M) and a magnetometer(compass) HMC5883L. Note: The Build a Bluetooth robot is a three part series, this is the first video in the series. Check out my other step by step Instructable on this project. Build a Bluetooth Robot
How to Build a Bluetooth Robot – Part 1
So check out my other Instructable on building a Bluetooth Robot and the three corresponding YouTube videos. The wiring will be the same as well, the GPS version will just require more of it. While I’m on the subject of wiring I would like to add that in most of my projects Red is VCC(+), Green is Ground(-), Yellow and Blue are communication lines. I would also add, that iit is very important to connect wires to the same locations (pins) on the Arduino as I do, and it might not be a bad idea to even use the same color wires as I have, to prevent confusion. Getting wires crossed is a common source of problems and errors.
How to Build a GPS Guided Robot – Part 1
The video above will show you everything you will need to build the GPS Guided Robot.
1. Robot Platform – Car from eBay or Runt Rover from www.servocity.com
2. Arduino Mega
3. L293d Adafruit or compatible motor controller
4. Cellphone or Tablet
5. HC-06 Bluetooth module 5 volt compatible
6. HMC5883L magnetometer/ compass
7. Ublox Neo 6m – others may work but I have not tried them
8. Wire in many colors
9. A battery pack, I use a 7.4 volt Lithium Ion Battery that feeds power to the L293d motor controller which in turn provides power to the Arduino and all other parts.
10. A ping sensor is optional, this is for collision avoidance which I have not pursued much
Step 3: Adding a Sense of Direction – a Magnetic Personality Can Be a Bad Thing
Adding a magnetometer (compass) to the robot is not optional. If your robot does not know which direction it’s pointed, then it will be very difficult for it to know which way to start it’s journey. “But doesn’t a GPS know which direction it’s headed in?” Yes, but only after it has traveled a certain direction for an extended period of time. We don’t have that kind of battery power to waste, we need a constant update on our direction so that we can create the quickest route to our destination.
The magnetometer that I have chosen to use is the HMC5883L or should I say a cheap chinese knock-off of Adafruit’s version.Update! The particular part number is the GY-271 or the GY-273. As of November 2019 this compass is becoming hard to find unless purchased from China. If you want quality, I would suggest the Adafruit version. The magnetometer is very simple to wire up, It only has four wires VCC, Ground, and two Data lines that use I2C.
I cannot stress enough how important it is to get this part of the project Exactly Right. There are so many things that could go wrong in this part of the build. The first step in adding the compass to our robot is to solder header pins to the compass. We must make sure that our pins are not made of ferrous material, in other words no iron or anything magnetic should be anywhere near our magnetometer; otherwise, our compass readings will be inaccurate. When we tell our robot to turn right, it needs to turn exactly 90 degrees to the right, or at least very close to it.
I made a Youtube Video demonstrating this problem a while back. My magnetometers came with it’s own pin connectors that I would need to solder to the HMC5883L. After noticing that my compass readings were consistently wrong I started looking for the source of the problem. Well after a lot of aggravation I finally discovered that the pins were ferrous and throwing off my compass. Here is the Youtube video demonstrating this.
Source: How to Build a GPS Guided Robot