How to Make Pocket Sized IoT Weather Station

16,890

230

27

About: I'm a 15 yo. student on SPMNDaG.

Hello reader!

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. :)

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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:

Electronic Components:

WeMos D1mini

BME280

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:

Breadboard

Jumper wires

USB wire - Micro USB Type B to USB Type A

Tools:

Soldering iron

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 SCK pin on the OLED and SCL 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:

Name: Humidity

Input: Virtual pin V2

Label: "%"

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!

TIPS:

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.

Pocket Sized Contest

First Prize in the
Pocket Sized Contest

5 People Made This Project!

Recommendations

  • Made with Math Contest

    Made with Math Contest
  • Multi-Discipline Contest

    Multi-Discipline Contest
  • Robotics Contest

    Robotics Contest

27 Discussions

None
alcurb

2 months ago

I like the open frame "enclosure". I'm a nerd in that I like to open up devices to see what makes it tick. Your design satisfies that curiosity.

1 reply
None
DanP231

Question 2 months ago

Did you use your mobile to upload the code? If so, did you use an OTG cable or WiFi? I have a NodeMCU8266 I need to upload code to.
Dan LaPine

1 answer
None
pgs070947

2 months ago

Nice project and useful.
The "frame" is a bit unusual and normally only seen in full size equipment like portable generators and compressors. I've seen compressors where the frame is use to store the compressed air. Clear acrylic is also possible or even Lego Technical.
For stuff like brass rod and sections, look at model-making supplies, typically railways.
Well done and thanks for publishing

1 reply
None
BerenV

2 months ago

Nice design! In the first paragraph, you put "ESP82660" instead of "ESP8266".

1 reply
None
DanielW375

2 months ago

Pretty cool. Although, I didn't know what a BME280 was and your article didn't mention. I'd recommend adding a description to the Electronic Components that it's the actual sensor for temperature, humidity, pressure, etc.

1 reply
None
ruth.pershing

Question 2 months ago on Introduction

I’d really like to work with my students to build this device. I don’t have much background in electronics and it would really help to have an explanation of the parts and where to get them.

1 answer
None
wildatheart123

2 months ago

I made the project. But I'm having some troubles. The display is not showing anything. I used the I2c scanner and changed the adresses for the display and the bme280 according to the printed adresses. And I'm using a compatible ssd1306 128x64 display. I also checked the wirings multiple times.
Any suggestions anyone?

1 reply
None
ViktorDemcakwildatheart123

Reply 6 weeks ago

Try to check the display with different code or the Adafruit GFX example. If it still does't work, it might be faulty display.

None
sjoerdw1

Question 6 weeks ago

How do I add a 5V battery?

None
sjoerdw1

6 weeks ago

I did build this project on a breadboard, but when I wanted to upload the provided code I got error messages. The first one was me erronously assuming the Arduino IDE had this board available, but it turned out I had to use the board manager to add the board to the list of available boards (see this video for instructions:
Once the WeMos D1 was in the list of boards I could start to compile the code and upload it to the board. But I got compile errors. It turns out one has to install a bunch of libraries which are not automatically installed or readily available: BlynkSimpleEsp8266, Adafruit_Sensor, Adafruit_BME280, Adafruit_GFX and Adafruit_SSD1306. These libs can be found either online or already available using the Libraries Manager of the Arduino IDE. After this, the upload compiled fine and it all worked! Maybe you can update your instructions with this information.

Of course I like your project, otherwise I wouldn't have build it ;-). Thanks, this was also my very first step/attempt to use IoT.

None
Cleyton

Question 2 months ago on Step 4

Could you post more pictures of the rear of the cube, please? I'm trying to see how you put it all together, and can't work out the solders.