Now you can check the weather of any place in the world in real-time and plan your days and trips without depending on the weather agencies! In this project, we’re going to make a weather station based on the Internet of Things (IoT) using evive, ESP8266 WiFi module, and PictoBlox – a Scratch 3.0-based graphical programming software. With the weather station, you will be able to monitor the temperature, humidity, wind speed, and visibility of any location in real-time by providing its coordinates.
You can download PictoBlox from HERE.
So, are you ready? Let’s begin right away!
Step 1: Mapping the values
First, we will make a map function. For this, we will create a new block and name it Map. This block is used to convert one value range to another value i.e. it will map or convert the value of potentiometer which is from 0 to 1023 to 0 to 23 for hours and 0 to 59 for minutes. This will help us to control the hours and minutes using the potentiometers.
Step 2: Real-Time Clock
Now, we will create a real-time clock block. This block is used to change the time being displayed on the TFT Screen.
The block will take the values from the potentiometer using the Map block and set the time accordingly.
- To adjust the time, we need to slide the slide switch 1 upward.
- To change the hour, we need to rotate the potentiometer 1.
- To change the minutes on the TFT Screen, we are going to rotate the potentiometer 2.
- Once the time is set, slide the sliding switch back to the centre for applying the changes.
Step 3: Displaying the data on the Screen
Now, let’s move on to the TFT_Screen block.
This block is used to display real-time weather data on the TFT screen. We will be using a TFT display extension for the same. We will display a number of values on the screen such as the date, temperature, city name, humidity, wind speed, and visibility.
Step 4: Completing the Script
Now, let’s write the main code – the code which will be triggering the entire event. It will begin with the evive startup hat.
We will use the connect to Wifi to connect evive to the WiFi module from IoT extension. Enter the WiFi name and the password into this block.
We need the latitude and longitude of a given location. For that, we will use the get weather data for block. You will find a section where we need to enter the API.
You can get the API from openweathermap.org. Write the complete script as shown below:
Upload the code to evive and you’re all set!
Step 5: Conclusion
With this, your IoT based weather station is now ready!
BTW, did you check out our amazing campaign yet? If not, go HERE to have a look at why everybody is loving us so much and perhaps even show some love by backing us! 😉
Make the connection as shown in the given figure.