The Haversine equation calculates the distance between two GPS points by taking their latitudes and longitudes in decimal degrees, computing the central angle between them using spherical trigonometry, and multiplying by Earth's radius to get the distance; this mathematical approach enables GPS trackers to measure the straight-line distance and heading angle between any two geographic locations on Earth.
Raspberry Pi GPS Tracker: Measure Distance Between Two Points
Added:Hello guys, this is Paul Mcquarter with topteboy.com and we're here today with episode number 15 in our incredible new tutorial series where you're knowing where you're going with your ultimate GPS tracker project.
What I will need you to do is pour yourself a nice tall glass of ice cold coffee.
That would be straight up black coffee poured over ice. No sugar, no sweeteners, none needed. And as you're pouring your coffee, let's jump in and talk about what I am going to teach you today. And what I'm going to do is I'm going to show you my solution to the homework assignment that I gave you in lesson number 14. Now, if you remember in lesson number 14, we learned about the Havine equations. And the Havine equations allow us to take two GPS locations lat one lawn one in decimal degrees and lat two lawn two in decimal degrees and calculate the distance between those two points and then calculate the heading angle between the first point and the second point. Now, we programmed up those functions last week, but we were using them just by manually entering GPS locations. We weren't actually incorporating those functions into our GPS tracker project.
So, what your homework assignment was was to take those functions that we developed last week to bring them into our main program. And then with that little push button, when you just start the program, it just shows you your lat, your lawn, your, you know, your uh number of sats, the stuff that we were showing before. But then the first time you press that button, it grabs your present location. It displays your present location. It prompts you to go to your new location. You go to your new location. You press the button again.
And then it displays on the little OLED screen. It displays the distance between your first button push and your second button push. And it tells you the angle, the heading angle between your first and second point. Okay, so I've got to ask, how many of you were successful?
I will admit this was a little bit more tricky than what I thought it was going to be. I mean, getting into the whole program flow because we've got we're starting to have a lot going on in this program, right? We've got the what's going on with the button in the OLED.
We're constantly going out in that thread and reading our GPS location.
We're parsing the location. And so that that OLED function is a very important function because that kind of controls the flow of the program. what's happening as we continue to look loop through the program and how to get that to do precisely what we wanted turned out to be a little bit a little bit more thought than what I thought initially it would be but never fear I have a solution I hope some of you guys were able to do it if you were not able to do it it's okay because this was a little bit of a you know this is getting to be a fairly advanced program and so if you need a little help by watching me that is Okay. So what do we do in a case like that? This we always start by doing things on paper and if we can think through it on paper then doing the coding becomes pretty easily pretty easy. Now right now we have that button and we press the button and it goes between screen one and screen two. So we had a variable that was a boolean variable either true or false and that was screen one. If screen one was true inside of that OLED display function, we would display a certain number of parameters from the GPS. Then if we pressed it, screen one becomes false.
And then instead of showing screen one, it shows screen two, which is the other information that we were getting later.
I think it might have been speed and heading and elevation and things like that that are on the second screen. So as you toggle the button, screen one just goes true, false, true, false. Now that is pretty nice. Okay, that is a pretty good idea. But the problem is now we're really instead of having two states, instead of having two states, we're going to have five different states. And so just having screen one be true or false isn't going to work anymore. So, we're going to want to go instead of having our control variable that controls the flow of our program, instead of having that be uh screen one, that variable, we're going to create a new variable, which is going to be CIS state. And CIS state is going to be 0 1 2 3 4. So, between 0 and four, there are five states. And those states are going to control the program flow. So, one of the first things we're going to do is we're going to go in and we're going to take out this screen one idea and we're going to replace it with this cyst state idea. So, what are these cyst states?
Let's talk about that. So, what do we start with? We're going to start with uh let's see, let me use good uh syntax here. We're going to use cis state and it's cis state zero. When we're in cyst state zero, what are we going to do? We're just going to show the GPS data.
Okay. So, cy state 2 in effect is just going to be what we're presently doing on screen one. So, cy state 2 uh cy state zero is going to be the same thing as screen one true. All right. So, that part isn't going to change. We're just going to show the GPS data and that's going to kind of show where you are and maybe number of satellites or whatever we had on there. Show where you are.
Okay. Now, what we're going to be doing is we're going to be waiting on the button push. And when we see the first button push, we're going to go to CIS state.
We're going to go to CIS state one.
Okay. How do we get to state cy state one on the button push?
Okay, so on button push we go to cis state one. Now what do we do at cis state one? We record the first GPS point and that's going to be lat one lawn one.
Okay, so we're walking around. Our location on our OLED screen is constantly updating. And when we press that button, we record our present location. Okay. Now, now that we're in cis state one, we've got to get out of it because if we just stay in cis state one, it's going to keep updating that GPS1 point is going to keep updating lat one lawn one. So, we want to jump out of cyst one. So, this is not on a button push. This is just move to cystate 2. Move to cystate 2. So you're just going to say in the cate one after you record the location you're just going to say cis state is equal to two. And that way the next time through the loop it doesn't enter into cis state one. It jumps and you're sitting now in cis state two. Okay. So now what does cystate 2 do you ask?
I hope this is making sense to you. What does cystate 2 do? Okay. What you do is you show the GPS one data which is lat one lawn one. So now until you press the button again, it's just looping through the program and it's staying in cyst state 2. So what does cis state 2 do? It just shows you what your first location is. Now while I'm in cis state 2, what am I doing? I'm walking or driving or flying or swimming or whatever to the second location. And it's just showing me the first location and then it is also prompting me.
So, I'm prompting on the screen, go to location two. Go to location two. Walk to location two. Then press button.
So, what do I see on the screen? It says, "Hey, this was your first location. Now, walk to your second location." And then press the button.
So, as I'm walking, I'm just sitting there and it's looping into cis state 2 every time. But now, what takes us to cis state three? You get there on on a button push on a button push.
So, as I'm sitting and waiting in two, I walk to the new location. I press the button. Now on that button press I come down and I am in cis state three and I get there on a button push. So what do I do on cis state 3? I record I record GPS 2 which is going to be lat two and lawn two. Now I've got my first position, my second position. Okay, now I don't want to keep getting a new second position. So what do I want to do? And I don't want to go off the bottom of the page here. So then what do I do then? You jump to cis state 4, right? We're going to jump to state 4. Not on a button push. All cyst state 3 does is we just grab that second location and then we set cyst state to four. Okay. Now what is going to happen up here in cis state 4.
What is going to happen? You are going to calculate calculate distance and heading.
And how are we going to do that? We're going to call our HS sign equations, our calculate distance and our calculate heading functions that we developed last week. We're going to call those and then we are going to calculate the distance between the two points and the heading direction between 0.1 the heading direction between 0.1 and point 2. So we're going to calculate that. Then we are going to display heading and distance.
And we're just going to leave that on the screen so you can sit and look at it, walk around with it, whatever.
You're you're keeping that distance that you measured and calculated. All right.
Now, what if you want to like start over then on button push on the button push you're going to go back to cis state you're going to go back to cis state zero. Okay. So here, after you're tired of looking at your heading, you're going to jump back up here and then you can do the whole thing again. Okay, does that make sense? I hope it does. So, how many different states do we have? We have five. Okay, we have five states. 0 to four is five states. So, how am I going to keep track of this? Because you see, every time I push the button, it's going to increment it. And then sometimes the program itself is going to change CIS state. And what I'm going to do is I'm going to kind of do the cyst state cyst state.
And remember how we learned about mod five. So you divide cy state by the number five. And then you return the remainder. And so if you're zero, if your cy state is zero, then what is your remainder going to be? It's going to be zero. If your cy state is one, the remainder is going to be one. 2 3 4.
That all makes sense. But then if you go to five you're going to go back to a remainder of zero. So if we do this button push can continue to increment or cy state can continue to increment but what we're keeping what we are keeping or the button push number that can continue to increment but what we're really looking at is that mod five and that just means that we're going to be cycling through these you know and then like that. Okay, so I've talked about mod a lot in the earlier class. If you're just jumping into this class and it's not making sense, you know, go back and review some of those earlier videos. Okay, that was a long introduction, but remember, if we can get it to make sense on paper, it is a whole lot easier to get it to make sense in the code. So, let's come over here and I'm going to have you guys go to the most excellent www.toptechboy.com toptechboy.com.
And then let's go to last week's lesson.
First of all, this is the schematic of what we're doing here to get this thing working in case you guys need to see exactly what our circuit is. And then search here with this happy little search icon. Search on something like portable power for your Raspberry Pi Pico W. That was last week's lesson or actually week before last lesson. And what that has is that has that last code that we have that just basically did screen one true or false and then displayed on either screen one or screen two all of the different neto information that we got from the GPS. So we're going to grab that and we're going to come over here. We're going to start with that as our core code. And then we're going to come back to www.toptechboy.com toptechboy.com and this time I want you to search on Python program to calculate distance and heading between two GPS points using the hover sign formula. And so what I'm going to do is I'm not going to get all of this, but basically I want these two functions. Okay, I want these two functions, the the the function calculate distance and calculate heading. And so I'm going to right mouse click and I'm going to copy those. And then I'm going to come back over here.
And those two functions I want up top. I want them kind of above our first function.
So let's see here. Where is this is our GPS thread. And so before we do that GPS thread, let's go ahead and let's put those two functions in.
That was something strange. So, I'm going to undo that. I just feel like something odd happened there. So, edit undo again. Okay. Now, here I am before that. I'm going to come here and say controllb.
All right. So, that's going to return beta degrees. So, that's calculate heading and that's calculate distance.
Those are our two functions. So, we've got those right after we define our variables. Now, if we come back over here, we do need to know the Earth's radius and we need to import math. And so, I'm going to get the Earth's radius here in meters and we need that constant for these these things to work. And so, here is we're putting in constants, I'll just come right here and I'll put that constant in. And then in our imports we need to import math because right we were doing all those trigonometry all those trigonometry functions. Okay. Now we had this idea of screen one. We don't want to use screen one. We want to do what? We want to use cy state. Okay. We want to use cy state. And so what I'm going to do is I'm going to do a control find and I'm going to find screen one.
And then I'm going to replace it with cis state like that. Okay, I'm going to replace it with cis state.
Uh just like that. And so I'm going to find it. And there it is. So I'm going to replace that with uh cy state. Now I don't want cis state true. I'm going to go in later and put in zero 1 2 3 4 whatever one. But let's just see. Okay.
I'm just going to I'm going to live dangerously. I'm going to replace all.
Okay, so I've replaced all. So I got rid of screen one. And now what we're saying is if cis state, okay, if cis state, now we're going to go put in all of those five cyst state, you know, procedures into this display OLED. So this is really where most of the action happens. Now, wherever I replaced screen one with cy state somewhere up there I initialized it to I initialized it to true and I want to initialize it to zero. So I'm going to come up here. I'm going to find that again. And you guys if you get tired of following along on this type of thing, it's better than me starting and writing the whole it's better than me writing the whole program from scratch every time. So, I'm going to find CIS state and I want to find the one where it's initialized. Okay.
Okay. CIS state. Now, that is initialized in kind of a strange place here. So, I'm just going to take this and I'm going to set it to zero, but I don't like it down there. I'm going to put this up at the top. So, cis state is equal to zero. I'm going to cut that from there. And let's put that up at the top where we are defining our variables.
just to be a little bit cleaner about it. So here we're going to just put it here. Okay. So that's saying when the program starts running, I'm going to be there on screen one. Now let's come over and let's look at our OLED program, our OLED function. Okay. And I kind of ru the day that we added the date with all of it. It's like we doubled the size of the program to get all those special cases for the date to work. I kind of don't like all this junk cut cluttering up the code. But nonetheless, that is where we are. So display OLED. So here instead of saying if uh okay, so we are going to say if we have a fix, then we come and do this. So cy state instead of being a true we're going to start at zero. And then what do we want to do if it is zero? If it is zero then also what we're going to do is instead of saying cis state remember what we said we're going to mod it by five. So we're going to divide by five and report the remainder. Well if cis state is zero if you divide by five it's zero and the remainder is zero. And so that would work. And similarly it'll just cycle through there. But you see otherwise if we keep pressing the button the next time around we're going to have you know a higher a higher cyst state.
So this just allows you to cycle cycle through.
Okay. So what does this do? This just displays our present information. Okay.
Now what is the next one? If cis state mod 5 is equal equal to one. Okay. Now this time and I'm not going to try to keep this data. You can keep the data that you want that you think is more important. But this was what our screen two was that when screen one becomes false you would come here and you would display that second set set of data. I'm just displaying the first set of data.
And if you don't like the first set of data that's being displayed, then you can adjust that. But this thing here is just slowing us down. So, we're going to take all that stuff out. Okay. And now, what did we say we were going to do in CIS state one? We get there on button push and we're going to record lat uh position one and we are going to record lat position two. Okay, we're going to record lat position one and we're going to record lat position two. Now, I'm going to go ahead, I think, and spell it out. So, I'm going to say latitude is equal to GPS data of what? Lat decimal degrees from our dictionary. Okay. And this is going to be latitude one.
Does that sound good?
Okay. Now, what we are going to do is we're going to say longitude 1 is equal to GPS data of what?
Lawn DD decimal degrees. Okay. So now what were we supposed to do in cystate one? Just grab our location. We've grabbed our location. We want to get out of here because as I walk around, I don't want to be in cis state one because it would continue to update lat one and lawn one. So, I want to get out of here. So, what am I going to say? I'm going to say cis state is going to be is going to be equal to is going to be equal to two. Right? I'm in one. Now, how do I get from 0 to one? by pressing the button. Right? And what happens when I press the button? Let's go down and look at that IRQ.
Right? Here it is. So every time ah and you see we find something here that we need to do as well. So every time we press the button we don't do a knot.
What do we do? We say cis state is equal to sis state plus one. So every time we press the button we increment the cyst state. Now we move from cy state to cy state.
Sometimes just by hopping and sometimes on button push but this is going to keep track. This is going to increment when the button is pushed. And then that will take us to the next section of the OLED uh problem. Okay. The ole function.
Okay. So now we go to cis state 2. All right. So let's just copy this just to help out a little bit. Okay.
Ctrl +V. So now if CIS state 5. Now I'm going to jump to two. Okay. And what am I going to want to do in two? All right.
I want to go ahead and put that first little bit that we did up here. I want to in the zero I want to I want to clear the screen. I want to put the label. And then I want to put the date. All of this stuff I want to do. Okay.
So, I'm putting I'm clearing the screen.
I'm putting the label. I I'm Yeah, I'm clearing the screen. I'm putting the title and then I am putting the date and time. Okay. So, we're going to do that in cis state 2.
All right. So now after that what do I want to do? I want to display text and then I'm going to display that first point. So I'm going to say P1. And remember we don't have very many characters. So we've got to abbreviate P1 lat.
And then I'm going to that's a string.
I'm going to concatenate that with the string value of latitude one. Okay. And then I'm going to then go 0 and 26.
Okay. So the first uh the first row is at zero. The second row is at pixel 16.
And then if we go to pixel 26, that should line things up nicely. Okay. Now I want to display display text and then it is going to be P2 and that's going to be one and then that is going to be plus the string value of longitude one. Okay. And then that is going to be column zero or an x value of zero and a y value of 36 pixels down. Okay. Now I want to display text. So I've shown you what your first point is. Now as you walk around it's not updating that point. As you walk around it's not updating that point.
It's just waiting for you to press the button again. So what do you do? you say proceed to P2.
And we're going to have to see if uh if I'm making these too long, right? If I'm making them too long, we'll have to abbreviate further. But that's just going to be on 0 and 46 like that. And then display display.ext.
And then we are going to say and so proceed to point 2 and then press btn.
Okay. And then that is going to be 0 comma 56 like that. All right. So we're going to stay here as we're walking around on our way to point 2.
This is what we're going to see on the string. We're going to see what our 0.1 was. That's 0.1 and this is 0.1. Okay. We're going to see our 0.1 latitude and longitude. It's going to tell us now walk to 0 2 and it's sitting there waiting for the button push. Okay. And so let's go ahead and copy this just to save a little bit of time. Okay. Now, I think I could have typed it just as quick. So, now we're going to go to what? CIS state 3 on that button push.
And what do we want to do in cis state 3? Well, I need to now snag when I press that button, I come to cis state 3. Now, I've got to snag that second GPS point.
So latitude 2 is equal to GPS data of what? Lat DD, right? Okay. And then longitude 2 is equal to GPS data of longitude DD like that. Okay. Now, what else do I need to do? Now, I've got that point. Now, I need to go on and jump to cis state 4. So, I'm going to say cis state is equal to four. So, all I do in cis state 3, I press the button, I end up in cy state 3. I grab my present location and next time through the loop, I'm in cis state 4. Why? I don't want to keep grabbing a second point.
Although if you wanted to track your distance from the first point, you might be able to do that. You see, it might you could have kind of a running distance from where you started if you played with this code a little bit.
Okay. Now, if state mod 5 is equal 4, this is the fifth state, right? What do I want to do?
Well, I want to do all this nonsense up here, right?
Where I'm basically clearing the display, putting the title, and putting the date and time. We'll go ahead and do that again.
Okay. And now after that, what do I want to do? Well, I want a distance. I want to equal and then I'm going to say calculate distance. So I'm going to call that function. And what do I pass it?
Latitude one, longitude one.
Longitude one. Latitude 2 and longitude two.
Like that. All right. So now I've calculated the distance. The heading is going to be almost the same. So I'll copy that and paste it. And here we're going to say the heading is equal to calculate heading like that. Okay.
Does that look good?
I think that looks good. Now what I want to do is I want to display that. So display text and then what I'm going to say distance is plus string of distance and then we're going to go 16 was our last one. You guys can see that distance was or uh 16 was our last one. So here we're going to go 0 and 26 like that.
Okay. And then display text.
And then we're going to display the heading plus the string value of head. And this will be 0 comma 36 like that.
Okay. Now, so as we're walking around now, it's just going to show us the answer. It's going to show us the answer and the answer is going to stay on there because I'm not jumping somewhere else.
The answer will stay there until what?
Until I press the button. And when I press the button, then cy state will be incremented and it will increment to five and then it will loop back to here because 5 / 5 is zero with a remainder of zero. All right. Now one thing one little subtlety that you have to think about. Okay. Now first of all if I define a variable up at the top like cis state if I define cy state up at the top then it becomes a global variable and display ole will know what its value is.
But here's the catcher.
it creates a local variable based on that global variable. So if I am in this function, if I am in this function and I change cy state in the function, it changes its value in the function, but it doesn't change its value outside of the function. So I'm going to have one cis state running in the function and a different cyst state out of the function if I change the value in the function.
And so if I understand this right and I really hope I do I really need to make gloal what cis state and that way if I change it inside the loop it's also ch inside the function it's also changed outside the function. All right. Now, this is a little bit of a second tricky thing, and that is our latitude one, longitude one, latitude 2, and longitude 2. Those four variables are only used inside of this display OLED function. So, you would think those don't need to be global. Now when you call the calculate heading and calculate distance you pass those from here everything should be copacetic right but if I understand micro python right when you go back if I leave this function and I come back to this function it will not remember the previous values of the local variables.
So what would I do? I would come in and when I press the button I would get latitude and longitude.
And then when I come down to the end of this the functions over I go back to down to the main program loop. And then the next time through the loop I call the next time through the loop I call display OLED again. When I come back into When I come back into display OLED, it has forgotten what the latitude and the longitude that I recorded the last time through, it's forgotten them. So, what I have to do is for it to remember those variables between different calls to itself, they need to be global. So I'm going to say latitude one longitude one latitude 2 longit longitude two latitude one longitude one latitude 2 longitude two okay so now I should be able to remember the lat and lawn values between different OLED calls. And if I change SIS state inside of display OLED, it should change it outside. Why is that important? Because I change it inside and outside. And when we come down to this but one IRQ, you see we increment it on a button uh on a button push. Does that make sense? I hope it does. Wow. I wonder how many mistakes I made.
Okay guys, I hope this is not too painful. I hope this is not too painful, but we're going to try to run it and I really hope that we get close here.
Okay, so let's let's come over here.
Let's take a look at this and then let's run this thing and see what happens.
Okay, so we are going to run it.
Okay, interesting.
We seem to have a little sign of life there, right? We seem to have a little sign of life. And so we have the first we have the first uh screen. It's showing me ultimate GPS time and date or date and time. It's showing me laton and the number of satellites. Okay. Now, let's see if I press this button. If I press the button, it looked like things crashed.
And so, let's see why I got a crash there. It crashed the uh it crashed the the program. And so I got to come up here and see what it didn't like more here.
Okay. I was sure. Well, we see that it crashed there. And so let's see if there's anything we can figure out.
I thought I saw an error message flash by.
But I'm not seeing an error in here. So, uh, then what that means is we're not sure, uh, we're not sure why I'm not getting anything on the screen here, but we can get to the bottom of that.
Okay, it says we exited cleanly. Okay, so let's look when we go to Let's go through our display OLED. So, we've got if CIS state 5 is zero, we just display things. That worked. And then on one, we get latitude one, we get longitude one, and then we say cystat.
How about cystate?
That one scared me bigly. That one scared me bigly. Okay. So now let's run it again and let's see what happens.
Okay. So we are running and we are getting data. Okay. And I'm checking to make sure the data updates. And so I'm not going to press the button. Boom.
Look at that. What it says is I've got 0.1 I've got 0.1 lawn. And let's go ahead and let's see if I can just show you this. Okay. So you can see it a little better. And guys, you see I've got this bread volt, but make sure you understand it's off because I've got the USB connected. It's just the USB lights up the bread volt, but the bread volt itself is off. Okay. So now what I am going to do is the moment of truth is I'm going to mash the button. I'm going to press the button again. Okay. And then boom. Look at that. Okay. What does it tell me? I've got a distance of 3 meters and a heading of 23. Okay, what is that distance of three meters? That's just the uncertainty in the readings.
Okay, that is just the uncertainty in the readings. And what's happy? Uh what's a good news is the thing is still running. It didn't kill the thread. So let's say see if we can loop back around to the start. So I'm going to go there.
I've looped back to the start. Now I'm getting latl long. And then let's press it once. Okay. And I've got the 0.1.
It's still updating. It wants 0.2. I press it again. And this time, you see we did much better. We've got a distance of less than a meter. And then, while we're standing still, the heading is going to be random, right? Because the the distance from where I was is noise.
And so, therefore, that heading is going to be noise. And so, all right, guys. I think this thing might actually be working. Now, if we want to run remotely, what am I going to need to do?
I'm going to need to come back over here and then I'm going to need to exit the program. Ctrl C. Okay, exit cleanly. And now I need to save that as file. Save as the Raspberry Pi pic. I need to save it as main.py.
Like that. Okay.
Yes. Overwrite it.
Okay. Now I come back over here. Now, let's try it again. So, I'm going to unplug it. Everything's off. And now, I'm going to turn the bread bolt on. And we're going to hope for looking for a fix.
Okay. Okay. Waiting for a fix. Good.
Okay. There. Boom. We've got our fix.
We're updating. Everything is looking good.
We're walking around. And then I am going to press the button one time.
Boom. I recorded the first data point.
It tells me to go to 0 2 and then press the button. I go to 0 2, press the button, and this time I've got a 2 meter error and a 2 meter distance, which is again, that's the uncertainty in the GPS. Let's do it again and see. Okay, we come back. We're updating. We're at CIS zero. Okay, and then here we grabbed our first point and then we uh grab our second point again. the second time. Uh, my error is under a meter. So, it could be that right when we turn the thing on, maybe we haven't found all the satellites. All right, guys. I think what I'm going to do is I'm apologize that this is a little bit of a long lesson, but you guys can stop and have a have a coffee or whatever if you want.
But what I'm going to do is I'm going to pause this video and then I am going to go walk around with this and you guys can walk with me. Okay? If you don't like watching me walk around, you can just jump over that part of it. But I'm going to go walk around and then we're going to try this thing actually in the field. And then when we come back in here, what we are going to do when we come back in here, what we're going to do is then look on Google Earth and see if those uh if those points match the result that we are getting here. Okay guys, so you will uh in 3 seconds see me out in front of my house and walking around the compound and then I will jump back into the studio to finish the video up. Okay, guys, let's go for a walk. All right, we are ready to go on a walk.
Let's go ahead and boot this thing up.
See if it comes to life out in the field. Okay, there it is. Looking for a fix. Let's get the old hat so we don't get too much sun and let's see if we can go get a couple of data points. So, we'll come out, walk around the compound a little bit.
>> You going with me?
>> Mhm.
>> Okay. What's your name?
>> Gabo.
>> Oh, yeah. Let's go.
>> And then when we go to lunch, we'll pick up my >> Okay. So, this is our avocado tree. I don't know if you can see, but it's just covered with avocados. We're getting lots of avocados every day. We're going to be walking down to the river. Okay.
>> Very cloudy today.
>> Yeah, it's a cloudy day and we'll be walking to the river. I want to go from one tip of the compound to the other.
Out there is the island that you normally see behind me as I am recording.
Okay. And we're going to head down to the tip of the property.
You can uh also see maybe Uh you can't really see it here, but yeah, there it is. You can see that they're building a little bit of a resort on the island. If you look over at the tip, you can see there's two or three little cottages that they're putting out on the island. So, development is coming to our area here little by little. And what your what?
>> I don't know who that is.
Uh, looks like we have a fisherman down there. Okay. And then as we look back to the left, you'll be looking at the headwaters of the Nile River. And what you're looking at down there is where Lake Victoria dumps into what becomes then the Nile.
And I want to come down all the way to the tip.
Kind of a pretty morning this morning.
You know, it's nice and cool. Enjoy getting a little bit of cool weather.
Okay, now we are here at the complete extent of the property and we will come back over here.
>> Uh that is a date tree where you get the sweet dates from. Okay. And you can see that we are running. So I'm going to press the button to grab the first data point.
and it did work. And so now let's head up to another corner of the property and we'll kind of look and see what's going on along the way. It doesn't show in the video, but this is really quite steep.
And it rained last night, so the grass is very slippery, so I'm hoping I don't slip and fall. And this is another date tree where we get the really sweet dates from, you know, the eating dates.
And looking up here is the house on the second floor. Over to the right, that is my studio that you're familiar with uh filming in.
>> There's an airplane. The airplane came the last time we tried the video.
>> Yeah, there's the airplane.
Okay. And then here we have a macadamia nut tree and it is covered with macadamia nuts. We're picking them every day.
This is a sour soap tree. And uh >> there's a sour soap.
>> Yeah, there's a good one here.
>> Uhhuh.
>> And a Yeah, quite a few sour sop on there. A sour sop would be like if you took strawberries and pineapple and mixed them together. That is what a sour sop is like. Then that's malberry trees.
Smallberry trees. More macadamia nuts.
More macadamia nut nuts. Tamarind tree.
Banana trees.
GPS still working.
You can see that big bunch of bananas.
Another big bunch of bananas.
And then Here we're running watermelons. We've been getting quite a few watermelons, but uh the patch is sort of beginning to play out.
Let's see what else we have here.
We have tangerines.
The tangerines are going to start ripening up pretty soon.
We have a mango tree in full bloom. More bananas.
This is a cinnamon tree.
More lemons.
>> Does that mean that it smells like >> Well, you use it as a spice.
Okay.
Now, this is hay for our rabbits and another mango tree. Front of the house.
This hay has just been cut, so it's low.
Here we've got ginger. And those big plants back there are cocoa yams. It's a >> There's a And this is hay. And this hay should be ready in about a week to cut. Then here, one of the things we do is teach the local indigenous farmers who are basically sustenance farmers.
>> Hey, we got here comes someone.
Basically, people live on the verge of starvation level here. So, we're teaching farming God's way where you use a lot of mulch. And you can see this is our corn row here. Who is this?
Who is this?
Hey, come here.
>> Come here. Tell me your name. Tell me your name.
>> Palac 2.0.
>> Palmer 2.0. Yep. We got a Palmer quarter 2.0. So this is our maze where we're teaching sustainable agriculture to the people who can hopefully start making a little more money and having life a little better.
>> That uh that is Casova. And Kasova, you see, it's like a huge woody bush, but it has 20 or 30 or 40 lbs of tuber under those bushes. And so it's a little bit like a potato. It's quite delicious.
It's a very easy way to get a lot of calories. Here we've got another row of hay for the rabbits. Another Farming God's Way maze lineup.
This is our alfalfa for the rabbits. And then more hay and more hay. And you can see most of these are cut down. So it's just it's a challenge for us to keep these hay fields going. Micah is stopping. So okay. Uh and then this is uh more alalfa comfrey.
These are Irish potatoes. more comfrey.
And then the alalfa.
>> And there's mom.
>> Mhm.
Uh diia alalfa. More comfrey.
Then here is some broccoli. And this is Anthony. Hello, Anthony.
>> Hello.
>> Say hello. Wait.
>> Hello.
>> Okay. Anony's working on the cucumbers.
The cucumbers. And then Ginger. Who have we got here? Okay.
>> That's my mom.
>> Uhhuh. And then we've got dill.
That does. And >> let's over here we've got onions. And we've got kale. We got blackberries.
Huge things of blackberry and mulberry.
Mica, are you eating? Are you eating my berries? What are you doing?
And then this is more kale. Macadamia.
More kale. More cucumbers.
Okay, so that's that. Let's continue looking.
Little bit of a guest house over there.
Then this is a nice little twobedroom guest house for when we have visitors.
>> Over here is our kind of support room where we've got the laundry, the tool uh shop.
>> We have cats.
>> We have what?
>> Leather cats. Sh.
>> We don't talk about cats on this channel.
>> There's indigo over there. And then the garage is really just for equipment.
Okay, you can kind of see that cottage and then the guest house here.
>> And there's Simon.
>> Yeah, the treeine drive here.
>> And there.
>> This is our coffee plantation here.
We're getting loads of coffee.
I'm trying to see if uh we're kind of finishing the last picking.
>> There's some what?
>> Lemons.
>> Uhhuh.
>> There you can see the green beans aren't quite ready to pick there.
>> And that one's ready.
>> And there you can see yellow lemons up there that are ready to pick. And then we're continuing on.
Okay.
Hi.
>> Hi.
>> Hello.
>> Hello, Simon. What are you working on?
>> Palm leaves.
>> What do you use the palm leaves for?
>> I use for muling.
>> For mulching the gardens. Yeah. Look at that. Lot of good mulch. Huh?
>> Say hi.
>> Okay. So, we get up to the gate >> and then we are going to look at this and see if we can Micah do let Micah press it. Press the yellow button one time.
>> But you said Dell's going to do it.
>> She did it last time. The yellow button one time. Okay, let's look. Okay, we got a distance of 244.
A distance of 244 at a heading of 51. 244 and 51. Now, let's go back and check that. Uh, we'll come back around this way.
Okay.
Hello, Nancy. Can you wave hello? Okay.
Hello.
Okay.
>> Hi.
>> Here's the rabbits.
You can see this is our paddocks for our chickens. So, every day the chickens get a different paddock to go into. So, they're always eating lots of fresh greens.
Let's come in here.
Okay. And these are the rabbits. Say hello, Kira. Wait. Kira cut all this grass for the day. You can see we got about 150 rabbits.
And then back in the back is our fly operation where we're growing grubs.
Okay. So, we grow probably 20 pounds of grubs every day for feeding the uh feeding the chickens. What? Micah, what?
>> M feeding the rabbit.
>> Okay, good job, Micah. Okay, so the shoe tree, mulberry tree, that huge plant there is the cocoa yams.
>> Compost.
>> Yeah, compost. This is our rabbit poo, which is the heart of our operation, which goes into the which goes into the uh all the gardens. Again, our paddocks for the chickens. And we can eat out of these too. Everything that you see in there is edible. This is our dormatory in the kitchen. Okay. Dormatory with the kitchen. And our water towers.
>> Another avocado tree. Yeah, that's Brenda. Brenda's house there. And then this is a neem tree. And neem oil is a good pesticide.
Avocado. Avocado.
>> We've got a shipping container for tools.
>> Water.
>> This is a This is a mango tree, >> Papa.
>> Yeah, the water tank up there.
And my So, what did we say? It's uh 51 m or it's 244 m at 52°. Can you remember that? 244 at 52. Okay. These are some grapes on the tree.
>> How about can we press how many these are?
>> Those are cocoa ys. There's enormous potatoes down there.
>> Some more corn.
>> No, we don't we don't press it yet. We don't press it yet. And then this is another set of gardens here. And this is a pumpkin patch. It's growing some enormous pumpkins. We've got a generator. And then everything runs on solar, but if for some reason we're running low on sunshine for a few days, we can turn the generator on. And then over here, you can see the happy chickens.
And then this is where the grubs are actually grown in these containers.
And each day we have a container that's ready. And again, it has 20 lbs or so every day.
>> And there's some of the maggots.
>> Yeah, the maggots are the what we call the grubs. Micah, what are you doing in there?
>> I Okay, come on everyone. Come on.
So, coming back around. We don't have a dryer, so we use the we use the clothes line to dry things.
They wash our fruits and vegetables.
They pick every day there.
Got the cottage, got the laundry room, the shop, the office, the garage, and then uh we'll cut through here.
These are some coconut trees. These are dwarf coconut trees. So, we should be getting coconuts next year off of those things.
Plum trees. Plum trees.
Mango tree has just bloomed there. Yes.
Uh-huh.
>> We saw the kitties. Um, >> the what?
>> We saw the kitty.
>> What do we not talk about on this channel?
>> No. Watching silly cat videos. We don't talk about what's >> okay. So here cabbages, spinach, turmeric, ginger, >> pomegranates.
>> That looks good to pick it.
>> Yeah. Here we've got parsley and then carrots. And then that is hibiscus back there. So we make habiscus soda from the hibiscus. So you see it's blooming and those blooms then we take down for uh uh for making the tea. Yes, >> we're going into the zoo land.
>> Okay. And then here we've got some squash that we're getting. The moon beam squash. Those big plat white squashes that are very good if you fry them up.
And this I guess anything's good if you fry them. A new batch of watermelons here. Another uh macadamia tree. More cocoa yams.
More cocoa yams.
Okay, >> you guys be careful. There's cobras here. So, you all >> Yeah. Don't walk through all that bushy stuff. Okay. And then this is something called a dragon fruit that kind of looks like a snake crawling up. And that is really, really delicious.
And >> this is uh you saw the 150 rabbits.
Well, every day we come and we bring the rabbit urine here. And the rabbit urine goes in that blue tank. And then there's a line that goes to the river. And then we pump the river a line a water line.
And then we pump the river water. And then we mix it like 10 parts river water to one part urine. And then when we water through the drip lines, everything I've shown you is on drip lines or through the overhead sprinklers. We are uh we are fertilizing and we are also the rabbit urine is like a natural pesticide. Micah get down from there.
Okay. Come on.
>> More banana trees. This is a casa. So go stand by the casa mic so you can see how you see it's enormous. And like I say, you dig that and you've got a 30 or 40 lb tuber >> that is more delicious than a potato even. And I pretend like the cost of um leaves are hands.
>> Yes, it looks like a hand.
>> So, this is the hay that is looking better. Okay. Yeah, there's Miss Nana.
>> There's Miss Elizabeth. And then here you see that we've got the uh a new row of hay that we planted. So, as we go, it's like keeping the rabbits fed is a pretty big deal. So, you see that about half of our garden space is to is to feed the rabbits and the other half to feed us.
Okay. So, we can see here we have 244 m and a heading of 51. So, 244 m and a heading of 51. We are back to the house. Here we are back to the house. And we see indigo and Dutch.
And I will meet you back in the studio.
And we are back. So, let's give a check and see how we did on the accuracy of our little gadget.
So, we're going to come over and we're going to go to Google Earth. And you can see that I had gotten a we had gotten a result of 244 m at an ang at a heading of 51 degrees. So, let's come to Google Earth and let's zoom in. It's pretty easy for me to find my house because Lake Victoria is very very visible. And then from Lake Victoria, we're going to see the River Nile. And then from there, we are going to come to my GPS location.
And you guys, please I I love every one of you, but please don't don't come to my house, okay? Don't come for a visit.
Where is it?
Ah, I was too far up, I think. Here we go. I'd gone too far up the river. All right. So, where did we go?
We went right here. So, what I'm going to do is I'm going to get the ruler and I need to Okay. So, I'm going to get the ruler and I'm going to come right here and then I'm going to go up to the gate.
Okay. I'm going to go up to the gate.
Right up to the gate.
and right there.
Okay. Now, what did we read? We read from Google Earth 244.6 m and I had 244.2 m and then I have a heading of 53° from Google Earth and we got a heading of 51.2°.
All right. And that could very easily be that, you know, a little bit more careful placement of this point down here. But that is pretty good. Boy, my hair my hair kind of got messed up with that with that hat on. Right. Okay. So, anyway, guys, I hope that you didn't get bored walking around the compound with me, but I thought it might be neat for you guys to see a little bit about where I live and how I'm trying the sustainable lifestyle. And basically most of what we eat, we grow ourselves.
And along the way, we treat uh we teach the people in the neighborhood, our indigenous uh population that are barely above the starvation level, how to start doing these sustainable agricultural pro uh projects where, you know, they have higher value crops with lower uh lower cost inputs. And so that's what we're really working with. and we work with people here and around in different places in Uganda. But I hope you're having as much fun taking this class as I am making it. Uh I think your homework for this week is to just demonstrate that you have your tracker and distance and heading system working. Make a little video showing it work and then upload it to uh to show people the the results that you're getting. And it's at this point I always give a big shout out to uh the people that are standing with me on Patreon. Without the Patreon support, I would not be able to continue to produce fresh, new, quality, in-depth content every single week. You can also help me by giving this video a thumbs up when uh uh and and also leaving a comment down below. Make sure that you've subscribed to the channel. When you do, make sure you ring that bell so that you get notification when future lessons drop. And most importantly, share this video with other people because the world needs more people who know where they're going and fewer people sitting around watching sillyat videos. Paul McCarter with toptechboy.com. I will talk to you guys later.
Up Next

Oxford Mathematician Takes Irish Leaving Cert Maths Exam
@TomRocksMaths
278.7K views•2024-11-17

JEE Maths | Circles: Pole & Polar Explained with Equations
@TargetPublications
14.4K views•2019-02-23

Fourier Series Introduction: The Big Idea Explained
@DrTrefor
387K views•2021-05-03

The Mathematical Impossibility of Accurate World Maps
@Vox
23.3M views•2016-12-02
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Mathematics












![[STM32 Cơ bản] Buổi 7 - Giao tiếp UART](https://i.ytimg.com/vi/8SpZnFaYews/maxresdefault.jpg)
![[UART] Bài 01 - Giới thiệu giao thức UART](https://i.ytimg.com/vi/VtAyIt4Xqjw/maxresdefault.jpg)






























