 Good afternoon and welcome! Today I'm going to review a project that I have a lot of passion for. It's collecting data with an Arduino and shooting it over to my SQL. So let's get on with it because I think you're going to enjoy the presentation and we've got a lot of kind of fun things we're going to do. A little bit about myself. My name is Wayne Lutweiler. I work at Optum. I've been in the IT world for 35 years. The last 25 of it spent with Optum. My career has spanned everything from service manager at a computer repair store to a Nobel network administrator to DBA and to the engineering position I'm in today and there's been a lot more in between there as well but if I were to delve into those it took up the entire presentation so we won't go that deep into those. I do live in right outside of Columbus Ohio with my wife and daughter, six cats and two dogs. Yes it is a bit of a zoo but it's a comfortable zoo so I mean it can't go wrong with that. So today we're going to look at the goal of this project. We're going to look at the hardware used, the software used, what cloud technology I decided to go with, the information needed to create your database and then we'll do some seed in action, some actual real-time queries of the data, seeing the data being sent, seeing it being pulled back. We'll do all those little things as well. I'm not going to bleed every slide when we get to the seed in action. The slides will be in the deck but I want to show you guys in action what's going on not in just slides. I think that is just a little boring and I don't want to be boring. So the goal of this project is to collect weather-related data with an Arduino and send it directly to a MySQL server. But before I go deeper than that I want to tell you a story about what got me involved with weather, why I have a passion for weather and a passion for data collection. In 1974 I was eight years old. I lived in Louisville, Kentucky with my mom, dad and little brother. In April of that year, massive tornadoes came through Louisville, Kentucky. They were just tremendous and there were numerous ones. I think there were eight to ten individual tornadoes and they just wreaked havoc all over the city. So, you know, it's a spring day in Louisville and the sky's blue. It's pretty. I remember it because this is such an overwhelming experience. And then of course all of a sudden the television starts going off with the weather alerts. The transistor radio starts going off with the weather alerts. My dad grabbed the transistor radio and started listening to it. Of course my mom and my brother and I jumped into the living room and started watching the television to see what was going on. And they're calling out that these tornadoes are going through Louisville and they start calling out the addresses, you know, the areas of town where they're hitting the most. And the commentator comes across and says there's one in the path of this neighborhood on a walnut ridge. Well, that's where we lived. So my dad immediately told us all to get to the basement. So we all went to the basement. And for reasons not known to me today, my dad stayed upstairs on the porch watching the storm. And as it got closer, it got louder. And he came down and he said, you know, I see the funnel cloud. It hasn't come down and hit the ground yet, but I see it. He ran back up there to keep watching. I don't know why, but I do know why. I'll explain that in the end. So, you know, we're sitting there and down in the basement when we're scared and dad comes running downstairs. And he grabs all of us. He says, get to the corner. And we went to the furthest corner in the basement. And we just hunkered down. And all of a sudden the sound almost like a jet plane started coming to our house. And the house started to vibrate a bit. So, you know, fear factor is just going through the roof. And then we hear this horrendous noise, this crash and boom. But the house didn't move anymore. And then we heard more horrible noises. Trees being uprooted from the ground. And then all the noise has stopped. Almost as magically as they started, they stopped. We stayed downstairs for about 10 more minutes. Dad went up, kind of peeked, saw that the blue skies had come back. And he, you know, he told us we could come up. You know, when we came up and we went outside, we found that the crashing boom we heard was our chimney getting ripped off of our house. And then the trees being uprooted were all the trees in our backyard and in neighbor's backyards that were just uprooted. Some of these trees were 100 plus years old. And they were just completely uprooted. So, you know, we're looking around at the devastation. My brother and I were not real cool with it. But you know, I'm eight, he's five, so I wouldn't expect us to be cool with it. Then, you know, my dad still has a transistor radio. He's still listening to it. And then they call out that there are, there's multiple tornadoes headed in the direction of Stilts Avenue. And that's where my grandmother's house was. And my grandmother was at work this day. Or we thought she was at work this day. So, my dad's like, oh, we need to go over there and check on Grandma. But we couldn't drive. I mean, power lines were down anymore. Street lights were down. Signs were down. Everything was just down. There was no way to drive on the road. So, we had to walk. It was only five miles from our house to Grandma's house. So, my dad and I started walking and my brother and mom stayed home. And as we walked, you know, we walked through all of the different destruction, you know, to get to Grandma's house. And you know, I was, that was eight. And I was getting like scared. And I guess I started clutching my dad's hand harder and harder, the more scared I got. And he stopped. And he got down on his knees and said, Wayne, I know this looks scary. And it is until you take the time to learn about it. And then it won't be scary anymore. And, you know, I just shook my head and said, uh-huh. And we continued on. And as we, we got to the top of Stilt's Avenue. And there was a pub there. And as we rounded the corner of the pub, we could see down the avenue. And most of the houses were intact. There were some houses that were, that were, you know, damaged, some that were completely gone. But most of the neighborhood was intact. Well, as soon as we got far enough down the sidewalk next to the pub, we found my grandmother's house. And it looked like a child had taken a house built out of Legos, picked up real high and threw it on the ground. There was just debris everywhere. Furniture, lumber, shingles, bricks, you name it, it was around. So we started calling out for my grandmother and no answers. We still, you know, we kept calling, we kept digging through the rubble, looking, I dug, I dug as best I could. I was eight. But, you know, we kept looking. And then I noticed there's movement over where the bathroom should have been. And my dad and I rush over there and, you know, we start to clear away the debris. And as we clear away the debris, the movement becomes more, there becomes more, more movement. And then we get the debris cleared down to where we're at a mattress. And all of a sudden, my uncle stands up. My uncle was 18 years old at the time, but he stood up from underneath that mattress. He was in the bathtub. He was in the house when the tornado came. He said, it sounded like 14 freight trains coming straight at you. He could feel the air pressure starting to change. He could feel the shaking and the vibrations. And, you know, all he knew what to do at that point was is to go to the safest place in the house, which was the bathroom, because there was no window. And there was the bathtub. So he grabbed the mattress off his bed, ran into the bathtub, jumped into it, covered himself with the mattress. And then it happened. He said it just, it was like this massive explosion. The house just was lifted up off the ground, thrown back down all around him. And it just, just made the most horrendous noise. And the debris was everywhere. And, but he wasn't hurt. And I asked my dad, I'm like, dad, why is the bathroom still here? Why is my uncle okay? And my dad was like, well, the bathroom, all the plumbing goes through a concrete slab end of the ground so they can go back to the, you know, to the water incoming in the sewer or whatnot. He goes, and that's all anchored in the ground. The tornado can pick up what it can grab, but if it's anchored to the ground like this was, and it was right on ground level, the tornado wouldn't be able to pick it up. And it didn't. And it was all intact. Well, the plumbing was, most of the rest of the stuff was gone, but the plumbing was intact and the bathroom was intact. So we still didn't know where my grandmother was. I asked my uncle where my grandmother was and he goes, well, she got, she had to go to work today. Well, we knew where she worked and it was on another part of town. And according to the radio, there were no tornadoes hitting that part of town. So grandma was safe and we, you know, we headed back home with my uncle. And I want to say that the statement my father made to me about not, about being afraid is okay, but learning about it so you wouldn't be afraid in the future, stuck with me. And as soon as things got back to normal, I'd go to the library and I'd read all the books I could about tornadoes and thunderstorms and extreme weather. And as I continued to grow older, I continued to read that stuff and keep up with it. And it just became a hobby passion of mine. And that's got us where we are today. But the one thing that I've learned is I understand why my dad kept going up the stairs and watching the storm. It was fascinating. And I've actually become one of those people. When the sirens go off, I don't run to the basement as, as idiotic as it sounds, I run out and look to see what I can see. Now, of course, if it gets really, really bad, you know, I'm going to run for the basement. But until that moment I have to run for the basement. I don't, I watch that storm. And it's just, it's amazing to watch mother nature at work. I don't like the destruction. No one should like the destruction, but watching mother nature do or gig, it was a lot of fun. And I've enjoyed it my entire life. And I probably will until I'm, until I'm off this world. So the initial weather station I built was a weather station built from a raspberry pi 3b plus. And I was collecting UV data, temperature, humidity, dew point, heat index, and barometric pressure. Sorry about that. And it works great. I built it six years ago. It's still working. It's still collecting data. You know, I've had the dreaded SD card corrupt on me like maybe three times in six years, but being a good former DBA, I do backups. So the SD card getting corrupted wasn't a big deal, but you know, it was a hassle. So I decided I wanted to build a new weather station that didn't require an OS. So I didn't have to worry about keeping the OS patched. And then I didn't have to worry about keep downloading the new drivers for the Python libraries that I was using. I didn't want to have to keep doing that. So I decided that it was time to simplify and move to an Arduino. I maybe three or four years after the initial weather station, I started to get involved with the Ardenas. And I actually fell in love with them quite quickly. I love the single board controller. I love the fact that it's specific to what it does and it does it well. And you don't have to worry about updating OSes. You don't have to worry about updating drivers. You can just set it up and let it run. I actually have a automated light out in my garage that's been out there for three years now. And any time you walk out to the garage, it clicks and the light comes on. And when you leave about five seconds after you leave, it sees no more motion. The light goes off. And I thought that was really, really cool. So I wanted the same with my new weather station. And I knew I wanted to keep that data. I wanted to collect it. So as a DBA, I was in my SQL DBA for most of my career. And I love my SQL. It's been my hobby database of choice since version three. But when I started looking at the project, I started finding that pretty much the only way to do this was to use an Arduino and then send the data from the Arduino through PHP, my admin, and then back to my SQL. Well, that just added two more layers of complexity. The Arduino now sticks to PHP, my admin, and then my SQL. I didn't like that. So I started continuing my research. I continued digging because I wanted to get rid of these dependencies on PHP, my EM. So I start digging. I start learning. And I was able to end up with this solution going directly from the Arduino to the my SQL. And the key to that was the Arduino libraries that I found that would allow direct connections to my SQL. Those libraries were like the next key to the puzzle as I was building this out. So the data we're going to collect in this particular demonstration is temperature, humidity, dew point, and heat index. All four of those can be collected from one single temperature humidity sensor. Dew point, we will calculate by hand. And heat index is actually calculated in the drivers for this sensor. And you can just pull it out of there. So it's really cool. You get one sensor, four outputs that you can collect data on. If you wanted to expand this project in the future, you could go with wind speed, rainfall amount, barometric pressure, UV levels. And then there are sensors that will check like groundwater, how much groundwater is how the temperature in the ground is. I mean, the sensors are limited only to what's out there and what your imagination can do. So there's a great number of sensors out there to play with. So for this particular part of the project, we're going to use an Arduino Wi-Fi revision too. We're going to use a DHT11 sensor. And we're going to use three jumper wires. The approximate cost for all this was about $65. When I started this project, it was right before the pandemic started. And the goal of the project was to take this and give it to local STEM centers. So I started it right before the pandemic. And what was interesting is that the approximate cost before the pandemic was $45. Well, since the pandemic has slowly been winding down, the cost of the Arduino Wi-Fi has gone up by 20 bucks. So you could still be able to find it cheaper depending on where you look. I typically get my stuff off Amazon because I don't have any local electronic stores around me. So I get most of my stuff off of Amazon. So and that's where all this came from. So again, we just have these two, the Arduino and the Wi-Fi sensor that we're going to work with. Shoot. Temperature sensor, not Wi-Fi sensor. Wi-Fi is on the board. So here's the build out. Here's the pinout that we're going to talk about. So before I talk about the pinout, I just want to caution everyone. If you try this, don't plug anything into your PC until you have the connections done and this connection set up correctly. If you plug it in and try to set everything up, there is a potential to damage the Arduino, the sensor, or your PC. So don't take that chance. Just get the work done and then connect it to your PC. So as we've seen in the picture here is that we're using the digital to rail to the signal on the sensor. We're using the five volt rail to go to the sensor and we're using the ground to go to the sensor. So that's the only three connections that we need. Any more connections than that for this project. A reminder, when you hook the ground and the positive up, make sure you hook them correctly. If you reverse them, I guarantee you you will burn out your sensor. And that's why on this page I said, hey, get a sensor, it's a three or a five pack. So if you do happen to burn it out, you got something to play with and you're not just dead in your track. Back to here. Once you get this done, you've checked and double checked and you've plugged it in, you're good to move on to the next step, which is gathering the necessary software to start putting your program together to upload into your Arduino. So the software I used, I stuck with the Arduino's basic IDE. I like that tool. Arduino has a web-based IDE you can use as well. I used Adafruit's DHT libraries. I like Adafruit stuff. If I use their libraries, their libraries are always very well written, very compatible. And I've never had a library that I use with the sensor from Adafruit ever giving me a grief. And then the MySQL connection library and then my code, which is out on GitHub, and you can go out there and grab it and, you know, skip all the hard stuff and just copy and paste it right into your IDE and then upload to your Arduino. But the one thing that I want to point out here is Chuck Bell. So Chuck Bell, he developed the MySQL connector for Arduino and it is a wondrous tool. It tickles me so much that I found this. It's just incredible. It does exactly what you wanted to do and there's not a lot of fluff to it. You know, you make a connection, you either leave data or you pull data and that's it. And he has tremendous examples that we can look at. So like if you just wanted to play and start at the ground up, you know, I would say that you would start with this connect sketch. And if we open this connect sketch up, as you can see, it's really quite simple. You know, we're defining an Ethernet driver. That would be as if you're using a wired Arduino, one that had a network shield on it or an Ethernet shield on it. If you're using the Wi-Fi one, you would replace this with the appropriate driver for Wi-Fi and we'll look at that in a couple of pages. You know, but basically you set this connect up. It'll connect to your database that you know that it's there and then disconnect. So you can just within a few minutes you can do basic functionality testing to make sure that the drivers in your Arduino are talking to your database. And that is just the way it should be and it does work very, very well. So, you know, I encourage you that if you want to play with this project from the ground up, you go out to Chuck's place, you grab his GitHub information and you start playing with them. They're really helpful. And I did base some of what I've done on some of these scripts. I mean, I'm not going to reinvent the wheel if someone else has already provided it. I'm just going to modify that wheel to do what I wanted to do. So, and then just real quick, we will jump over here to my site where I keep my repository. It's a little, right now it's not updated as much as I want it to be, but by the time we have this presentation in September on the 27th, this will be completely updated. The current software is out here. It's right here. So you can always jump in here and grab the information. So, you know, this is the code. And when we'll look at this code in a few moments, more in depth. But for now, we're just going to leave it right here, but we'll come back to it. Let's go back to our presentation. So, oh, it is time to look at the code. So, let's go back to that on the screen. Let's look at the code. So, here we are. So, here's the code that we're working with. And, you know, this first section is, well, this is where we're including our necessary drivers. I want to point out a couple of things. This driver is for the Wi-Fi. This is what's going to give us our Wi-Fi connectivity. This file, not a driver, contains sensitive information you don't want to put in your code here. Things like your SSID, your SSID password, your gateway, the IP address of your device, the DNS server provided by your internet provider, and then whatever server address you get for the database that you either set up in the cloud, or if you want to set it up locally, you can also set it up locally. So, it goes into this file called agrinossecrets.h. I will show you how to create that file in a few slides. It just, good practice. It hides everything, you know, of importance. So, we're, you know, we're defining our DHT sensor and then we hit our void set up here. You know, I'm initiating serial communications so I can do some debugging as a program. I'm initializing the driver for the DHT. I am making sure that the Wi-Fi is there and working. And then, if we get through these, then we're going to go ahead and attempt to connect to the wireless network. If you have, like, your password wrong or your SSID wrong, you won't connect to the wireless network, but the nice thing about it is, is it'll tell you in the serial monitor what's going on. Once you get connected to the network, then the tool is going to give you output to the serial output, telling you you're connected. It's going to print what your gateway is. It's going to print what your IP address is. And it's going to print if DNS is configured. DNS being configured is not necessarily needed for this project since we're using IP addresses. You can leave it in. It won't hurt anything, but it's not necessarily needed. And then we jump down here into the void loop. And this is where we start doing our work. So we're reading from the sensor, the temperature and Fahrenheit. We're calculating the dew point using values from the temperature Fahrenheit and the humidity. And then, like I said, the heat index is already computed for us in the libraries. We just have to call it. And here are temperature Fahrenheit and humidity so that it'll calculate it based off of those. Once that's done, an initial connection is made to the database. The connection fails. It'll tell us if it doesn't, it'll keep going. So now we need to define our query. So basically, I've defined that I want to only grab these four columns. And then so I'm setting up how much memory I want to use for each of these. So I have a character query of 128. And then each of these individual variables, I just set them up for 10 bytes, 128 bytes. More than enough room on the Wi-Fi UNO for that. And then making sure that I declare some strings. I'm sorry, declare these a float value, column string, temperature, string humidity and whatnot. And then here is where a lot of the magic begins. So we're going to convert everything from a string to a character in these areas. And that way we can insert that data into my SQL. So we do that here. We say, hey, run our query, which is here, insert data. And then what items we're inserting. We create our cursor. We connect to my SQL. And here is just serial output to let you know what's going on. So it'll print out the query that you're running. It'll print out the values for temperature, humidity, dew point and heat index. It will do the inserts into the database. As you can see, the execute is here. It'll delete the cursor. It'll tell you the data is recorded. And it will close the connection. And then 15 minutes later, it'll do it all over again. So this is pretty straightforward. Not a lot of things in this that are going to be difficult to work with. And again, if you were to add an additional sensor, you could see how quickly you could get the code up to date for your next sensor. You would just define what you need here for what your data you're pulling, and then set up your character and set up your float, and then do your conversion, and then send it into the database. So let's look at the Arduino code in the Arduino IDE. So I have two sets of code set up here. So the first one we're going to look at is this one. So this is the cloud. This is the one that does the inserting. And this is what we're going to look at first. So what I want to do is I want to show you the serial monitor. And the serial monitor just attempted to connect to my network. So it's connected to my Wi-Fi network. It connected. It got its gateway, IP address. The DNS got configured. And then we connected to the MySQL server. And this is our query we're going to run. We're going to insert into the weather.cloud database. These are our columns. And these are the values we collected from the sensor. And then for debugging and viewing, I actually put serial printouts here so that you guys will see the data as you're inserting it. So it's easier to look at. And that's it. It'll run every 15 minutes and it will collect that data. If you're not sure if your data is collecting, you can always just, like, hit the reset button on your device. And it will reconnect. And it will give you more information. You can clear the output, close the serial monitor up. And then, you know, each time you open the serial monitor, it will establish and send a new connection of data. So I like that feature. You could actually turn that off by disabling the serial monitor, but then you wouldn't have debugging output. And I don't recommend that because I like debugging output. It's helpful to solve a problem. So let's go back to our presentation. And again, we just reviewed this code. So it's all spelled out here for you. And this is the remainder of the code. And then this is the section I wanted to talk to you all about the secrets, the adrenos underscore secrets.h. When you have your IDE open and you're working in your code to create the adrenos secrets.h, you just click this little down here. It will be new file. You name it to this. And then you populate it with data like this. We populate it with this data. And then it's hidden. So you don't have to code that directly into your primary code for this. It's a good practice. And it's very easy to set up. So let's move on to the database information. And so I chose a Google Cloud database. No real reason other than I like Google. I looked at AWS. I looked at Azure. But I like the Google stuff better. If you're familiar with one of the platforms more than the other, you know, definitely choose the platform you're familiar with. That way, you know, you have the most fun and you don't have the frustration of trying to figure out something that you may not necessarily want to figure out because you want to just hit the ground around it. So for this particular demonstration, we only need a one table, a cloud table. So, you know, we're going to jump in here. We're going to create an app ID called weather app to find its password. We'll grant it the necessary pool, which is and we're going to create this table. And, you know, once this table is created, you know, at that point, we're ready to start looking at sending the data from our Arduino to the database. And, you know, we just, we did that over here with this. So again, if I reopen this for us, again, it'll send a little bit more data to the database because we remitualized this serial connection. So the data will go and you know, to get recorded. So, you know, that's what we want there. So we're connecting and talking to the database now. So let's move on to the next slide. Now, I included another part of hardware here because I thought some people may not want to use the Wi-Fi. They may want to use a wire connection using an Ethernet shield. So the cost of the Ethernet shield and the Arduino, it's about 30 bucks or about 15 bucks each. To connect the, the Wi, the Ethernet shield to the Arduino, you just align the male and female pins and then gently push them together. So this would give you the option to use it wire instead of wireless. You can use either one. I wanted to include both in here so that you had an option and that you had more things to experiment with. So now I just put together a really simple query that I can send through the Arduino IDE to pull data. And, you know, if we look at this, you know, I'm just using the two of my SQL libraries, the Ethernet library and our secrets file. Now, here's where I'm defining my Google Cloud database address, the username, the password, the SSID, the secret paths, just like we did in the one that sends the data. But this one is just pulling the data. So, you know, we put together our query here. So we call it select. So we're just getting these four columns from the weather cloud table. And we're going to order it by ID to sending lemon to 12. So really, we're only going to get let's just a little bit of data back, but it's, you'll see it sequentially. So again, yeah, here's a nice little set so that you don't have to continue to calculate seconds and hours if you want to. Again, we're doing kind of the same thing here, you know, we're connecting, testing the database connection, if it works, then we're jumping over here and we're running our select. And then we are processing our select so that we can get the output in a readable format. So let's, so let's skip this and let's go to back to the Arduino IDE, clear this output. Let's go to this piece of code. This is the piece of code that we just looked at. And this is the piece of code that we're going to use real quick for our demonstration. We're going to just, I'm going to change the port real quick on the other screen so that we upload to the correct port. Choose the Arduino Uno and then let me change the, okay, so here we go. So I changed the port and it connected to the Arduino Uno for us. And then it connected to, you know, to the database and it pulled back 12 rows of data. And that's what we asked it to do. So that's just a really quick little example of how you can do that with the Arduino IDE. You don't necessarily have to use the Arduino IDE. You could always use a GUI tool like MySQL Workbench. So you could use that. Here's MySQL Workbench. And, you know, here's the query similar to the one we sent from the Arduino. So we run it here real quick. And you can see that we're pulling data back. So since I set this up, there's 780 rows of data. But you can notice right here these timestamps are close together. And those were the times that we were hitting the, opening and closing the serial monitor. And I did that so you could see that the data does get updated real time and quickly. So that's why that's there. So anything that you can use today to connect to a MySQL database, a PHP app, a Python app, a GUI tool, as long as you can plug those parameters into whatever you're using, you can connect to your cloud database to place your data and retrieve your data. I mean, as I think about this and as I try to grow this project more this year, the next step for me would be maybe looking at a mobile app for the Arduino. So I can actually look at what's going on here at home, or a mobile app for the Android that would give me Bluetooth connectivity to the Arduino. And I can begin look at the data while I'm here at home. And then if you get risky enough, you can actually go forward and maybe set some home automation up that would use this data and would consume it and set things for you. I know that Arduino has connectivity with the Amazon, Alexis, and the Google Nests. So just go out and do a quick Google search on those and you'll be able to find the information about how to do communications between them. There are a lot of APIs out there that will help you with that. So let's go back to our slide presentation. So we pulled the data, we looked at it, looked at it from both angles from the Arduino sat in from the minus QL side. I don't have a live feed setup of this one, but if you use the serial plotter tool that comes with the Arduino, you can actually leave it up and running and plot that data as it's going in. So I think this was over a few days when I set this up and ran it. And it's cool because you got the temperature here and blue and the heat index right here. And this was all done in the house, so I don't expect the heat index to really jump above the blue. Here's our dew point, which should stay relatively in line with the temperature. And then the humidity. So you can kind of notice here that the peaks with the humidity and the dew point align with the peaks with the actual temperature. And that's because we're calculating dew point, the green line, based on what the blue line and the red line and the formula. So that's why it looks, you know, there's there's some synergy in this and it looks well and it makes sense. But let's go to the next slide. What's the point of gathering data if you're not going to do something with it historically? So for a historic example, I just I just pulled up and put together a really nice little piece of Python code that would allow for us to just pull some data. So I'm going to run it and then we'll look at the code. And as we look at the code, we'll talk about what it's doing. So I run this real quick, need to pull it over from the other screen. So you'll notice here that I pulled the data over. We have a pretty big gap in between things. That's because the wireless Arduino was powered off for a while. So that's why we have this gap. But as you can see, there's this historical data, you know, temperatures. And it's for the last 24 hours, which is which is what I set up to do. There it is last 24 hours. So this is right here. And this is cool. I mean, it's kind of cool to see what happened over the last 24 hours. So that's why I included that. So let's kill this Python interpreter. And let's look at the code here. And then I'll show it to you in the slide presentation. So the code is, again, pretty simple and to the point, you'd have to do a little bit more manipulation because you want to turn your code, have it connected to the database, grab the information, and then take that information, turn it into a data frame that we can then feed to the matplotlib pipeline. So we can plot the data. So that's what we have going on here. Our drivers are loaded. We're converting some date today using the data that's coming from here into a readable format. We're connecting to the database. We're creating our cursor. We're passing our query. We're executing it. We're grabbing the results. We're pushing those results through the data frame. We're defining the columns for the data frame, the kind of plot we want. And then we're just setting up all the prettiness of the plot. We're setting up the title, the labels, the Y labels, that's the X label, the first ones. Grid true, plot legend, and keep going. So that's all we were really doing inside this. And it gives us that pretty graph. But one thing that I didn't show, I need to bring it back up. When you do the Python data graph and you do this 24-hour period that we've grabbed, you can actually take within this tool and go, hey, I want to get more specific on a certain chunk of data. And you can start drilling down on a certain chunk of data, which, you know, lets you see what's going on at a deeper level. I like that. I think that's kind of cool. I don't have to do anything different. I just run it and just start drilling down into it. So I like that feature. And it's one I definitely wanted to point out to everyone. So here's the Python code. We just kind of talked about that. But again, you're important in necessary libraries. Doing some date conversion so you can get a nice X label. That's what I'm doing here. Connecting to my SQL, set up your cursor, defining your data frame, having your plot put together, having to show the data we need. I even put in here a save if you wanted to save it and then, you know, use it as a picture or something, you could. And then, you know, close the database cursor and then close the database connection and you're done. So that's the end of the entire presentation. Now it's time for final thoughts. This project has been a labor of love. Like I said, it started before COVID-19 hit. Its intention was to go to STEM centers. It did not get to because of COVID. So I turned it into this presentation that I could share with many, many people. If you like the presentation, I encourage you to share it with anyone that has a desire to maybe get into technology. I think it might be a good starting off point. You know, you get to play with Ardeno's, Ardeno programming, Python programming, my SQL. So you've got enough to really get your feet wet and have a lot of fun. So again, if you like this presentation, share with your family and friends or with anyone that you think would might like to play with this and have a good time because that's what it was set for. For sharing, for playing, and for learning. So I want to thank everyone for coming to the presentation. I want to thank you for the questions in the chat. I hope you guys enjoyed it. I hope I didn't ramble on too much. And I look forward to seeing everyone next year when I'll be back with a new topic. Take care, everyone.