Introduction: Simple Weather Station V2.0
Previously I have shared a few types of weather stations which operated differently. If you haven't read those articles I recommend you check it out here:
In this instructable I will share an updated weather station with combined features of previous two plus a few additional features. Along with indoor temperature, humidity and pressure we can also fetch current weather condition and forecast for the next day. All this data will be displayed on an OLED screen, webpage and android/ios app.
So without wasting any more time, lets get started.
P.S: If you like this instructable, please vote form it in the Sensor Contest :)
Here is a list of parts we will be using for this project.
- Wemos D1 Mini (Amazon US / Amazon EU): You can use any ESP8266/ESP32 based dev-board
- BME280 Sensor (Amazon US / Amazon EU): Make sure you buy "BME280" not to confuse it with "BMP280"
- 1.3" OLED Display (Amazon US / Amazon EU): I suggest you get the same OLED as I have used, Or you might struggle with it as many OLEDs don't work with ESP boards.
- Pushbutton (Amazon US / Amazon EU): Use a momentary switch as it will switch between different modes
- Breadboard with Jumpers (Amazon US / Amazon EU): For prototyping
- Prototype Board (Amazon US / Amazon EU): To solder everything to make more permanent prototype.
- 3.7v battery (Amazon US / Amazon EU): To power the system (Optional)
Along With these parts, we also need software to make everything work
- RemoteMe: It is an IoT platform where you need to create an account to use the services. It is totally free.
- Arduino IDE: To upload the code.
Here are some tools you might need along the way:
Once you have gathered all the material we can move on to the next step.
Step 1: Creating the Web-App and Network Device:
First we need to goto Remoteme.org and sign into our account. If you don't have an account, now is the time to make one. Now that we have signed into out remoteme account we can build our weather station, refer the following steps:
- When we sign into our remoteme account, we are redirected to a page where we will see a list of projects. Here scroll down and you will find "Weather Station". Click on it.
- A pop-up window will appear, here click we can find all the necessary information about the project. If you want you can read all the details or just follow this instructable.
- We have to go to "build it" tab and fill in the information.
- First enter your WiFi name and Password. This will allow the ESP board to connect to your WiFi network.
- Next there is an option where we can select the type of board. As we are using Wemos D1 mini based on ESP8266, we will select that board.
- Now we have to enter the location, that is the city you live in. Inter the name of the city and the country code. For example: As in the image "Warsaw, PL" it means Warsaw city, Poland. After entering your city and country, Scroll down. Here you can change the name of the app and device but it is optional. So you can directly click on "Next Step".
- This is the final step here just click on "Build project". Now you can download the code generated automatically by the code wizard.
- Below that there are 3 options, Open, QR code and Install. Clicking on first option will open a webpage with the weather data. Second option will get a QR code which can be scanned using any smartphone to get the webpage on mobile browser. The third option will also give a webpage which will install a web application on Android/iPhone.
On the webpage you will notice that the first two feeds show data but the last one is empty. That's because we have to create a room weather station yet. So lets make the circuit for our weather station.
Step 2: Creating Circuit:
Now that we have the code, we need to upload it to the board. But first we have to connect the Display, BME280 sensor and a switch to the Wemos D1 mini. To do so first refer the circuit diagram above.
Here we have used the I2C protocol for connecting the modules.
- SDA to pin D2
- SCL to pin D1
- GND to pin GND
- VIN to pin 3.3v
Note: Connect SDA & SCL pins of display and BME280 to ESP. All GND pins should be connected together.
One terminal of switch is connected to D3 and other is connected to GND. If you don't know how push button works, I suggest you take a look at this article. Refer to the images above for better understanding.
Step 3: Uploading the Code:
Before you can upload the code, make sure you have all the ESP boards installed in IDE If you don't know how to do that, then watch this YouTube Video.
Also install the following libraries:
- SparkFun BME280
To install these libraries. open IDE and goto Tools>>Manage Libraries. In the search bar enter the library name one by one and install it.
Now extract the code file downloaded from RemoteMe and open it with Arduino IDE. Follow the steps below:
- Connect your wemos to the PC and select the board type (Wemos D1 R1 mini) and select the right port.
- Now upload the code and wait for it to finish.
- After the code is uploaded, the board will connect to your WiFi and start displaying the data on OLED screen.
- Pushing the button will switch between 3 mods. You can check that yourself.
Now the that everything is working as expected, we can move on to make this circuit more permanent and enclosed to make it look better.
Step 4: Building PCB and Enclosure:
To make our circuit more secure and permanent, we need to solder all the components together on a prototype board. I have shared images of my work to give a better idea. You can make different design if you want.
For the enclosure I used foam board as it is easy to use and work with. Below I have provided a CAD you can refer to make your own enclosure.
Step 5: Video Tutorial:
If you like this instructable, please vote.
Participated in the
2 years ago
Nice project. Please share the code.
Reply 2 years ago
Please go through the instructable carefully.
3 years ago on Step 3
Not mentioned are the following libraries, needed for the button to work and the sketch to compile..
Reply 3 years ago
Oh I just noticed. Thanks for pointing it out, I will make the changes straightaway.