Arduino IoT Cloud Weather Station

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back to element14 presents i'm clem and there are plenty ways to skin a cat but this is not about cats it's about weather stations specifically diy weather stations the easy way amazing hacks inspired designs [Music] each week element 14 presents brings you innovative projects using electronics engineering and more the easiest version of a diy arduino weather station might be putting a string on an arduino hanging it outside and riding down if it gets wet or not but that's not really functional today we are going to build an easy to use arduino weather station that is made with the arduino iot cloud because a it's very beginner friendly b you don't have to make very complicated web server code and also you can access it from everywhere in the world where you have internet access in a safe way not by opening your router up to the world and possibly endangering your network so that is why i like the arduino iot cloud for this project and we're gonna use the mkr wifi 1010 because that gives us the easiest setup also it has a nice led on board and to all of you advanced makers out there yes you can make all these stuff with esp32s and similar boards you can make your own pcb you can write your own web server code everything's possible but that's like not very approachable for beginners so we do it the easy way first and if you want to see the hard proper way in the future leave it in the comments below so we can maybe pick that up for a future episode [Music] the parts of this project our intangible part is the arduino iot cloud this is a web service that runs on the internet of course you find it on arduino.cc and it allows you to connect an arduino board that has wi-fi to your network and then to that arduino cloud to update variables over the cloud and share it among different devices and visualize them in a very easy way to set up if you would code all that on your own you would spend quite a lot of time in debugging to make that work and to make it safely work without other people accessing your data or with like weird behavior that you didn't expect it's a much more approachable way the other parts are more tangible we need an arduino mkr wifi 1010 you can use any wifi enabled board for this project but it happens that if you use an original arduino board the setup is even easier and it's less complicated with the wi-fi libraries because most of the stuff is pre-made and you just have to insert the functions we can use basically any form of sensor that we want everything is interfaceable with the arduino and with the cloud but because we used a weather station as this project's example i'm just using a classic dht11 sensor that gives me temperature and humidity which are like the two key things that you want to know about weather because that is how you tell weather if it rains or not and if it's humid or not and hot and cold that's the stuff you always want to know but you can attach more sensors to it and i'm making this project in a modular fashion so if i want i can add other sensors later and i'm still free on measuring whatever i want maybe gases and air quality and light so i can determine if it's night or day or when the sun rises a lot of interesting stuff and of course we power it with a lipo the mkr wi-fi 1010 has already built in lipo charging so very easy for us to use and i put it in a case that i designed myself that has the modular approach with a bottom half that has all the electronics that should be encased so if we place it outside it wouldn't like damage that from the weather and have the measuring parts in the second module that is exposed to the elements and if it breaks over time with the weather we can just remove that one or repair that one without having to rebuild the whole project for the assembly of the project i have first made a case designed it in freecad and i've made it like in a modular fashion so you can just exchange parts whenever you want this is consistent of 3d printed parts and i opted to use some laser-cut sheets for the middle section kind of an afterthought because hey there is a big bright led an rgb led directly on the mkr wifi so why not use that to give me an indication when the device is actually measuring stuff so i laser cut that out of acrylic and put it in between but of course you can make your case out of whatever you want as long as it's protecting the electronic components from the environment let's see how the weather is outside looks like there is weather so we should get started with the coding segment to get this project up and running [Music] for this project i recommend the homegrown garden variety of code very nice for this project or you can just write your own in the arduino iot cloud maybe let's do that welcome to the arduino iot cloud on my computer as you can see i have already done two things and when we uh look at create thing i have already reached the limit of the free plan which is two things but you can do like a lot with just one so you don't really have to upgrade until you're getting advanced so you can basically try that for free those things are both connected to arduino mkr wi-fi 1010s and i have left them untitled and used the names that the arduino iot cloud just told me for a simple reason when i gave custom names it sometimes did not really connect so when i left it at default it always worked so maybe if you have trouble with names that you selected just try the default names sometimes they work we can see an id for the device here so you know that is exactly that device and also this device is only connected to one sketch on the arduino iot cloud and if you connect that board to the computer it knows that this is that board and not the other one so you won't mix up your sketches with your devices on one side we have the setup function this is where we define our variables if i want to add a function i just give the name this is like example thing we select what type of variable we want we have like different types here like the typical energy stuff like temperature sensors which would be obvious for our project but guess what i don't want that i want a floating point number because when we have just basic numbers and values we have the ability to sync them with other numbers and values pretty easily so usually on temperature sensors it's a read only thing but with numbers you can change them in both ways so if you want to let this box know what another box has measured because it might like relay some signals maybe give a status indicator led for the other one on every one of these boxes that you built you can do that so that's pretty cool uh we have here um floating point for the humidity a floating point number it's read and write and every time it changes it also updates the iot cloud so let's look at the sketch when you have set up your device and your values or your variables that you use over the web keep in mind these are only the values that are synced over the arduino iot cloud not every variable that you need in your sketch so you can do that like normal but the ones that you want to send over the network you define here and then it takes these values and put them in the sketch for you it also lists them at the top so you know how they are actually called in the code for example it's easy to know but i have like made a typo on the led variable and the first letter is a small one not a capital one so if i would type like normal led in there it wouldn't find it because i have to like type it the right way that's pretty handy that it does it on the top let's look at the code that we wrote specifically for that project it's pretty straightforward hello i'm james from workbench wednesdays a show about the stuff found on your electronics workbench look for new episodes on well wednesdays you can connect with me over on the element14 community i look forward to seeing you for now it is time to get back to watching this week's project video okay i have connected the battery so this thing connected to my wi-fi network and we can already see we could over the air update it if we would have the upgraded plan so in the free plan you can only update it with the usb port and if you have like the upgraded plane you can even over the air update means i can deploy them where they need to go and then i don't have to collect them to give them new code i can just click here and it sends over the code and flashes them directly over the network which is awesome imagine you have put it like high up on a tree somewhere or on your roof and then you can still access them and change your project later after deploying it and that is a feature that's really hard to do if you would do everything on your own so awesome that you can do it directly with the arduino iot cloud now we are in the dashboards section uh you click just on dashboards and then you have your dashboard which i left untitled because with my title i had troubles and here we can see the first one of our devices i actually made two of them but this is the only one that's completed in the box so i have temperature and i have humidity right now and i should have like here are my latest readings for temperature and humidity so i can plot them over time and to see if it actually works i can also click the led button here and when it updates which takes uh some time because it updates only every eight seconds yeah and in here now a little green no a little orange led is now uh lit up which you could see hopefully so i know the connection is established and if i click the button and remove it again then the led is out again and every time the big led does something it gets connected also it sends like non-viable data if the module is not connected so if i put them together then it collects correct data again and i can just influence that by briefing on it to get a different reading and now we have to wait for a little bit to update there it is 95 because yeah humid moist air from my mouth and then it should go down when it dries off and because this is in a separate box the actual electronics the sensitive part is not exposed to my breath and the environment and both can be pretty deadly [Music] so now that we have a working iot weather station that gives me readings every few seconds to get a faster plot in reality you would let it not read that often because hey it's weather it doesn't change every second let's deploy that and see how far my wifi network can reach we have left the device outside for a while like for a few minutes and now we can see how the graph is behaving we have a little bit more humidity outside than inside and of course it's a lot colder outside but that is actually not the real outside temperature right now because it's still like coming down from the inside temperature so it will take a while to reach the real outside temperature which is about 10 degrees celsius i think so it still has some way to go but you can see the humidity dropped right down and we are pretty much stable on that one so device works i can monitor the outside temperature and humidity and lock that right in the arduino iot cloud and if i'm like on vacation and i wanted to know how is the status at home i can log into it and have access to all my stuff and i even could update the code from abroad so if i would go to like america and i would want to change the code on an arduino at home i could do it which is amazing if you want to try out this project yourself remember that all the code all the files are free to download at element14.com forward slash presents link is in the description my little iot enabled weather cube turned out pretty good delivers the data it's modular and i can easily replace sensors for it also the free plan of the arduino cloud is more than enough for this project so it doesn't cost me anything to run it and access my data over the internet and it's a lot safer than forwarding my port and it was a lot less work than coding all the web server stuff myself and i wouldn't trust myself to be good at that how's your start into iot or into home automation projects going do you have ideas for further projects would you like to try out these on your own let us know on the element14 community i gotta go there's another project waiting for me you
Info
Channel: element14 presents
Views: 24,076
Rating: undefined out of 5
Keywords: electronics, hardware, hacking, mods, weekly, element14, maker, engineering, element14presents, arduino, cloud, DIY, Testing, Weather, Station, IOT
Id: VlU5H6nstJM
Channel Id: undefined
Length: 16min 12sec (972 seconds)
Published: Fri Nov 12 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.