Introduction: How to Make Pocket Sized IoT Weather Station
In this instructable you will learn how to make small Weather Cube using the D1 mini(ESP8266) which is connected to your home WiFi, so you can look at it's output anywhere from earth, of course as long as you have internet connection. Overall making this project isn't too difficult nor resource heavy, so it will be perfect as your first IoT project. So let's get started.
PS: Keep in mind that this is my first Instructable so not everything will be perfect. :)
Step 1: Resources
As I mentioned in the introduction, this project is very easy to construct and doesn't require too much components. Here is the parts list:
I2C OLED Display(128x64)
1.5mm Brass Rod or Iron Rod
NOTE: If you want more info about theese parts for ex. where to get them, you can look into Step 7!
Tools for prototyping and testing the circuit:
USB wire - Micro USB Type B to USB Type A
Bench vice - not mandatory
Small hammer - not mandatory
Step 2: Prototyping on Breadboard (Skip to Step 3 If You Want to Go Straight to Code and Assembly)
If you don't have your pins soldered on your D1mini/OLED/BME280, now is the time to do it!
First of all lets place all our components on the breadboard. We will start by placing the D1mini on 2 separate rails(picture no.1). After that we will place the BME280 fair distance from it(picture no.2). And finally we will place the OLED on the opposite side of the BME280(picture no.3). Now, let's connect them together.
Here are all the connections:
D1 pin to SCL/SCKpin on the OLED and SCL/SCK pin on the BME280
D2 pin to SDA pin on the OLED and SDA pin on the BME280
G pin to GND pin on both, the OLED and BME280
3.3V pin to BME280 VCC pin
And finally 5V pin to OLED VCC
Check your connections again before connecting it to your computer and uploading code to it! You don't want to burn anything.
Step 3: IoT Part
This part is really simple. First of all, go to AppStore and download Blynk app. After that, open it and sign up. Next create new project. I called mine WeatherStation but you can name it anything you want. After that, set the device option to ESP8266 and connectivity type to WiFi(picture no.1). Next tap create project. You shoul get an email with your verification token. Now jump into the code(download link below) and replace highlighted parts. After that, jump back into the Blynk app project workspace, tap on the screen to open widget box(picture no.2). Now place 3 labeled value boxes by tapping on them(picture no.3). To set them up, tap on first one and set it's name. I called it temperature(this is not mandatory but it makes everything simpler and more organised). As input select virtual pin 1 and in the label part type "°C"(picture no.4). After that you can go and set up the other labeled values.
Here is small chart:
Labeled value no.2:
Input: Virtual pin V2
Labeled value no.3:
Name: Altitude or pressure - depends on which code you choose
Input: Virtual pin V3
Label: Altitude or pressure - depends on code
If you have done everything correctly, upload your code to D1mini, wait for a little while and then the values should pop up on the OLED and in your Blynk app(picture no.5)(you need to press play button in the top right corner of the screen). If nothing shows up, go to the troubleshooting part.
Step 4: Freeforming the Circuit
Okay, this will be the hardest part so get ready. Prepare your brass rods/iron rods(I will use brass coated iron hooks because I couldn't find brass only rods) and heat up your soldering iron. Now you can form it into anything you want! I will form it into a simple cube. This process requires patience and time, so don't rush it if you don't want to break your whole circuit. You can see the finished circuit in picture no.2. I decided to use 1,5mm rods on the outside, but thinner rods in the insede(1mm) for easier management.
WARNING: Solder only in well-ventilated space, soldering can put out toxic fumes!
For bending rods use bench vice and a small hammer - if you don't have bench vice, nor hammer, pliers and bare hands will be enough.
Use tape or helping hands to hold rods together while you solder them. It's much easier.
OR if you are using iron rods like me, you can use 2 strong magnets to hold them in place(picture no.1).
If your joints don't hold together, unsolder them and roughen them up with sandpaper.
If your solder doesn't flow into the gaps, use a bit of soldering flux or heat up the joint a bit more.
Step 5: Finale
Now the only thing remaining to do is to connect it to 5V 1A PSU. If you have done everything correctly, it should work just fine(don't forget to upload your code if you didn't already). If nothing shows up or something isn't right, jump over to the troubleshooting section.
Step 6: Troubleshooting
Display showing nan: Check your wiring! Your sensor isn't connected propperly.
BME280 outputing 0.0: Check your wiring! Your sensor isn't connected propperly.
Black display/sensor data not showing up: Check your I2C adresses using I2C scanner or check wring.
Device offline in app: Check if you entered your Token/WiFi name/WiFi password correctly. If yes, check your wifi signal. It might be weak or you don't have internet connection.
Still having trouble or you found mistakes in this instructable? Write down in comments and I will get to you ASAP. :)
Step 7: Where to Get Theese Parts?
Are you new in electronics? No problem! Here is brief explanation on some physical parts, how they work and how to get them the cheapest:
1. Where do I get all theese electronic parts?
Aliexpress. By me, Aliexpress is the best site, by far to get all of theese parts for cheap price. The only downside is that basic shipping is usually takes a lot of time (Anywhere from 2 Weeks to 1,5 Months).
2. What is BME280?
BME280 is a sensor that can measure Temperature, Relative Humidity and Atmospheric Pressure. It's really convenient to use in theese small form-factor aplications like pocket sized electronics. More about it here.
NOTE: D1mini, BME280 and OLED display were all ordered from AliExpress.
First Prize in the
Pocket Sized Contest