ESP32 Based IoT Weather Station | How To Make | Complete Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video i will show you how to make a weather station using the very famous esp32 with three sensors that can measure and display live values including temperature humidity barometric pressure uv index infrared radiation and visible light the parameters are displayed on the blink iot platform both on the web dashboard as well as the phone app in the form of live values and charts this is a good project to get started with iot the code and setup part is just a bit lengthy so watch the video carefully till the end to make sure everything works and as always subscribe if you haven't so here's what you will need an esp32 obviously a temperature and humidity sensor which can be dhd1121 auto two an si 1145 sunlight sensor a bmp180 pressure sensor now i used grove sensors so for that i needed groove connector cables and lastly some jumper wires so here's the wiring diagram pause the video and have a look at it you can download it from the link in the description in order to connect jumper wires to esp32 easily i made a shield with male headers connected parallel to each pin on the esp32 i also added extra male headers to some pins like vn gnd t21 and d22 as these will be used the most first i started by connecting grove connectors to the sensors and to those groove connectors i then connected jumper wires which then go to the esp32 you only need three wires for the temperature and humidity sensor as one of the pins is not connected [Music] similarly i then connected the other two sensors as per the wiring diagram pressure and sunlight sensor both use i squared c communication so they both are connected to d21 and d22 on esp32 which are sda and scl pins respectively [Music] to make things look neat i placed esp32 with all the sensors on a piece of artboard with double sided tape then i also cleaned up the wiring using some tape [Music] and that completes a hardware part which was quite easy [Music] now for setting up the software first you will have to add esp32 to arduino ide you can skip this step if you have already used esp32 with arduino ide before first you will have to go to the official expressive documentation and copy the stable release link now on the arduino ide go to files then preferences and under the additional ports manager urls paste the copied link if you already have other links added there just separate them with a comma now go to tools board ports manager and under the search bar type esp32 you will see esp32 by espressif systems click on install button under it here i have already installed it now if you go to tools and boards you can see all the variants of esp32 boards added in order to make our code work we will have to install the necessary libraries so first download the code from link in the video description now go to sketch include library then manage libraries in the search bar type blink with a y and install the blink library again i've already installed all of them before next search for dht sensor and install the dht sensor library by adafruit [Music] now search for bmp085 by seed studio and install [Music] lastly search for sunlight sensor by seed studio and install it as well [Music] now we will have to set up the blink platform first go to blink.cloud and create a new account i already have one so i will just log in now click on new template under the name you can type anything i named it as weather station hardware has to be esp32 and connection type will be wi-fi you can also add a description if you want so our template has been created successfully we have also got a unique template id as you can see to receive data on blink from esp32 we will have to create data streams for this just go to data streams and under new data stream select virtual pin our first data stream is named as temperature pin will be virtual pin 0 or v0 data type will be double instead of an integer since you want a temperature value to be accurate unit will be degree celsius minimum value can be kept as 0 and maximum at 100 we want our values to be up to 2 decimal places so we can choose that from the decimals drop down then you can click on create next data stream is humidity [Music] for this i have assigned pin number v1 data type will be double again unit will be percentage and just everything will be the same as temperature [Music] next one is pressure pin number is v2 data type double we are measuring pressure in millibars which was not available so unit can be kept as none i kept minimum and maximum values at 0 and 2000 respectively but you can change that as per your needs now everything will be same for other data streams you just have to assign correct pin number for visible light v3 for ir radiation v4 and for uv index v5 i kept minimum and maximum values of all three as 0 and 300 respectively just make sure you assign the correct virtual pins because these match with the code that i wrote virtual pins are not actual pins on a microcontroller they are just used to signify an imaginary pin now after all the data streams have been created click on save and move to web dashboard web dashboard is a place where all the data will be displayed there are many kinds of widgets we can add some for displaying data and some for giving an output first we are going to select a label drag and place it on the dashboard you can even resize it now place five more label widgets for each of the values to configure a widget click on the gear icon on it first one will be named as temperature then we have to select a data stream from which the data will be taken and displayed select v0 for temperature now there are several options available you can explore them you can change the color of label and even make the color change depending on the value you can add a level which will show the temperature level beside the label [Music] after it's done click on save now repeat the same process for all the labels just select the right data screen for the respective labels [Music] [Music] now that we are done with labels we can add charts to see pass data just drag and drop a chart widget we cannot show two different data streams in the same chart in the free version of blink so we will need to add 6 different charts for all the values configuring a chart is also similar just select the right data stream select chart color select chart type turn on show y axis and auto scale repeat the same for all other chats [Music] [Music] [Music] so now our web dashboard is complete we can click on save keep in mind that the values it is showing currently are completely random after configuring our template now we will have to add a device to it for this first go to search click on new device select from template choose the template that we created device name can again be kept as per your choice click on create now a device has been created but still it is not online you will see some credentials at the top right corner of the screen we need to add these to our code firstly copy the blink template id go back to our code paste it under template id then copy the device name and again paste it in the code similarly copy the auth token and paste it under your author token in the code lastly we need to add our wi-fi credentials enter your wi-fi ssid which is your wifi name and your wifi password there is just one more little change that may be required if you are using dht11 or 21 temperature and humidity sensor instead of dhc2 uncomment the correct line corresponding to your sensor type and comment the dht22 line [Music] connect your esp32 to your pc with the usb cable under tools select the right board and serial port and finally you can click on upload [Music] you know the drill when it shows connecting press the boot button on your esp32 for a second or two [Music] when it's done uploading click on the serial monitor set pod rate to 115200 you will see the blink logo if it's connected successfully if it doesn't connect check your wifi credentials properly now coming back to the web dashboard now we can see our device is online and all the sensor values are being displayed [Music] to show that it actually works here i blowed air onto the temperature and humidity sensor because the air we breathe out is full of water vapor and warm on there and surrounding air you can see a spike in humidity level and some rise in the temperature level [Music] and after some time it again starts falling back into place here in the graph also you can see a spike in the humidity as well as temperature because temperature and barometric pressure are inversely related you can also see a fall in pressure value i kept the device on for around 6 hours and it worked fine without any connectivity issues has the data for past star and past exams [Music] so [Music] [Music] now i will explain how you can connect your weather station with your phone and this is completely optional first download the blink iot app from play store or app store log in using the same credentials that you used before now our device will already be added by default because it syncs with the web but we still need to set up the mobile dashboard this is almost similar to setting up the web dashboard if you click on the top right corner of the screen on the widget box you will see some new widgets we are interested in labeled value so select that place it on your dashboard and resize if needed now place five more of them click on the label to configure it now follow the same process as the web dashboard [Music] here you can add a text before and after the value so i added the respective units after the value [Music] [Music] [Music] you can also add super chats if you want again for the free version you can show only one data stream in a chart [Music] [Music] [Music] so [Music] [Music] [Music] i have turned on my device and as you can see the values are displayed directly on mobile dashboard as well [Music] the chart had really long time ranges such as one hour six hours in one day you can change that in the settings to add 15 minutes or 30 minutes the app also works well in dark mode as you can see so that's it from this video i hope you found this useful and easy to follow thanks for watching don't forget to subscribe and you can also support me on the below link if you want [Music] you
Info
Channel: Saiyam Agrawal
Views: 19,430
Rating: undefined out of 5
Keywords: internet of things, iot, weather, station, climate, temperature, humidity, DIY, project, tech, electronics, circuits, blynk, arduino, sensors
Id: GE5an3kYOKQ
Channel Id: undefined
Length: 19min 56sec (1196 seconds)
Published: Fri Jan 21 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.