Previous year, I got a Pimoroni Enviro board for a competition on E14. I was not able to complete my proposed project on time due to some technical issues and college exams (Well, the truth is that I was struggling with the Raspberry Pi the whole time, I wasted a lot of my time for just headless start of the raspberry pi but eventually I found out that the problem was with my memory card reader... LOL). Anyways, for some time I have been playing with this board.
Its features are:
- BME280 sensor (temperature, pressure and humidity)
- LTR559 sensor (light and proximity)
- MEMS microphone
- 0.96'' color LCD display
So, it has all the weather related sensors. So, I decided to make a weather station using it. I took help from the already given examples and they helped me a lot, in fact, I have used some code snippets from the examples also in my scripts, thus the main weather screen looks like the one in examples .
The Enviro board can directly be stacked on the raspberry pi.
To install the python library for the enviro board, I ran the following one line command:
curl -sSL https://get.pimoroni.com/enviroplus | bash
This will download all the necessary code to run the Enviro board.
I have also tried to create a world weather option. You just need to enter the ISO country code and the zip code of the area. The code will fetch three day forecast (maximum and minimum temperature and maximum wind speed) of the entered area. I have used simple urrlib requests to fetch data from sites in json format to implement this.
First, I thought that I will just use APIs from any online weather service but then I found that almost all of them were asking to sign up on their sites to get to use the free APIs. And I was not willing to give my email to them (I don't like promotion mails). After much searching, I found a site which gives weather data of any area. The site is 7timer.info. But this site requires latitude and longitude of the location. So, to get the latitude and the longitude of the location, I used APIs from the Zippopotamus site. But this site doesn't support all the countries. The list of the supported countries is given on the main page of the site.
The script needs to be run with the python3 interpreter and the '-B' is used to ignore the __pychache__ folder.
Maybe it is not visible in the video clearly, but in the world monitor, the background of each day shows the type of weather that day you will see.
Github link to code: weather_station