Skip to content

Start and stop building a selfmade indoor weather station

Published:

Table of Contents

Open Table of Contents

About the problem of a software developer’s ideas

I do think that now and then every software developer has those moments when he’s got relatively absurd ideas. The feeling that you just have to try out a new project and maybe have discovered the “big thing” you need to develop to make the world a better place. Maybe you know what I mean because you have had that feeling yourself. Sometimes I’m going through phases where every day feels like a little piece of code could make my life a lot better.

“Well… I know how to code, I should better build my own smart remote control”.

“Well… I know how to code, so I should better build my own note app that has exactly the features I need.”

Of course, those are great ideas and some of them can be implemented quickly. But in the end it my TV doesn’t turn on anymore and all my notes were deleted while installing a new version of my app. Great. And actually nearly everything is already existing in quite simple and good apps or projects.

In the following you can read about the story of one of those ideas that grew big in my head and wasn’t finished in the end. But don’t worry, you can still take something positive from it.

The Idea

I have been owning a raspberry pi since a long time. Actually I’m owning two of them, I got one of the third generation, so I don’t have to worry about Bluetooth compatibility with a USB adapter. But that’s not important for this story. In addition, I’m already owning a DHT11 temperature and humidity sensor that I tried earlier. After conversations have come up latley about the temperature in my room and we had problems with mold in our apartment, I came up with the brilliant idea to adress this problem with my knowledge as a programmer and build a kind of indoor weather station for it. I did take a briefly look at Amazon whether there is already something like this on stock – Yes, of course, there is already something like this and it is called “Netatmo Smart Weather Station – WLAN, wireless, indoor and outdoor sensor, weather forecast, Amazon Alexa & Apple HomeKit, hygrometer, air quality, NWS01-EC”. Price factor? 150€. If you want to buy additional modules it would cost of course more. That’s a lot of money if you consider that I only would want to keep an eye on the temperature and humidity in my room. So I started my idea of doing it all by myself.

The Beginning

It happened at the time when the exam period overtook the country and the poor students were struggling to find new ways and possiblities to procastinate with a clear conscience. In this time two students decided to rather pass their exams this semester to get an Arduino starter kit delivered on the exact day of their last exam to reward themselves afterwards. And that’s exactly what happened.

We just came out of the exam and went directly to pick up the Arduino starter kit sent to the packing station close to the university. Off to my friends home with a solid amount of food later, we started to experiment with the Arduinos straight away.

I have to add that we didn’t buy the original Arduinos but boards called Elegoo Uno. But since both products hardly differ and approximately nobody knows the name Elegoo I will simply go on with Arduino for this story. –

Sometime early in the night my Arduino was able to measure humidity and temperature and show them on a LCD display. So my weather station was build. At this point I would be able to just put the Arduino in my room and it would work out. But I wanted more.

The moment when the project escalates

One of the things I love most about the area of computer science is that moment when you realize that there seems to be no limit to what you can do, and you’re able to do almost everything you can think of. And the best about it is that you can do almost everything on your own and without spending a lot of money. You only need a computer.

So I started to form some ideas for my indoor weather station without limiting myself in my thoughts:

Statistics are awesome – I want to be able to see the historical ‘weather’ data as a graph so the data is visible even if I haven’t been watching four hours. Means you can check data of anytime in the past. Calculating average temperatures and visualizing data should be possible in any case. It’s not that complicated.

Notifications are awesome – too high humidity is a problem. If I would get a notification on my phone as soon as it’s too high, I would be able to react straight away and just open all windows and ventilate. No more mold, all problems solved. And by the way, a notification would be a good reason to show other people discreetly what a cool project I have built.

Remote access is awesome – I want to be able to see how my room is doing even when I’m not at home. If I’m out on the move and the temperature sensor shows me 200 degrees then at least I know I should call the fire department. There might be more useful use cases, but I can’t think of any other right now.

Scaling is awesome – If I would build a second device that is able to collect data in the bathroom or kitchen, I want to be able to merge the data from these two devices and theoretically have access to the indoor weather data from the whole house. There shouldn’t be limits to scale up this system.

All these ideas should be implemented as fast as possible now. I thought about something like “Nobody would look at this project later on and it is not important to code pretty and sustainable”. Maybe i should try to avoid these kinds of thoughts. I also wanted to try out many technologies that I have rarely or never used before.

I created a repository on Github and named it Microstation. That was the start of intensive development for a few weeks.

Review of the development

So what exactly did I accomplish during the time of intensive development on the Microstation project in the last few weeks?

I left the Arduino aside almost exactly as I set it up on day one. However, an Arduino alone cannot send data over a network connection. I added an ESP8266 microcontroller because some online information that said it can establish a wifi connection and talk with the Arduino. Getting the Arduino to send its data over this chip was a very complicated task for me and I had to learn how to deploy code over the Arduino to the ESP Wifi chip so these two could work together. I stopped using the Arduino IDE for programming and set it up in Visual Studio Code with Platform.io and wrote my C++ code for the microcontrollers there.

Then I needed a server to receive the data from the weather station. I used my Raspberry Pi again for this. I can handle Python reasonably well so I searched for a webframework based on python. The first search result for this on Google is Flask. It was very fast to set it up and after one or two hours of copy & paste from some tutorials I was able to write my own code. Knowledge about HTML and CSS was a condition of course, but with a littlebit of help from Google I was able to get this done. I am not a web developer and just wanted to visualize my room data, so I wasn’t thinking about having to design a fancy UI, but somehow i could figure out how to do it and create a pretty simple and fancy design. For a short time in this process a snippet of javascript flew by to display the graphs for temperature and humidity and then my whole design started to work.The data from my Arduino was now viewable on a website. After I exposed my Raspberry Pi from the local network to the whole internet, me and theoretically every other person in the world who might have been interested, could see the ‘wheather’ data of my room bouncing up and down when I opened and closed the window to cause a change in the data. Just great. Apart from the fact that the code was looking terrible and the whole thing was at most the earliest stage of a prototype, you do feel like the coolest programmer in the world when you manage to implement your project so quickly.

Following you can see some screenshots of the project:

The end of the project

As you can see in the following picture, my project was successfull because I mixed all sorts of technologies and programming languages, and all of these individual components worked together.

I used a Raspberry, an Arduino and sensors that generated data for me. I even started to work on an app for Android and iOS to access the data from the server, that’s how the Dart part of the programming languages came about because I wanted to try the Flutter framework from Google. I exposed my Raspberry so I could access this data from anywhere on the internet. And I did some frontend stuff and displayed data as graphs and tables.

But the project never went any further. The app never got finished and my ambitions to build the weather station itself in a nice wooden box were never realized. The weather station is currently not running in my room. And i am done with this project. But who knows, maybe one day I’ll pick it up again. The fundamentals are still there, right?

Conclusion

So was the whole project a big failure? What should I do differently next time?

The conclusion in 6 key points:

I have implemented a project to learn something. I think like a lot more people and especially students of computer science should try and do this. The theory is useless if you doesn’t deal with it in real life. I am not an expert of any of the technologies I have used in this project now, but I have dealt with it. That is important.

I used git. It doesn’t sound that important, may even be obvious to some, but I think git and platforms like Github are hugely important and any usage and any project you got there is one more advantage you have got.

I’ve been playing around with hardware. This usually was awful for me, but this time i really had a lot of fun. Just to be able to generate data in your own room and not only see everything you are doing on the screen. Connecting your project to the real world. I think it is important that you at least understand in principle how the access to hardware works. And it really can be motivating.

I had an idea. Quite a big achievement, I know. But to have an idea and don’t throw it away immediately because it might can’t be realized is good practice. To keep working on something and just think more than 3 seconds about how something could be done is usually never the wrong way.

I should have set myself a fixed goal. My motivation for the project was gone at some point. And I think that’s the same reason for many developers in private projects, because you may doesn’t have the goal to ever finish an application completely. It’s more about developing our personal skills and see what we can do. But as soon as this feasibility is proven, you usually reached your goal and start to lose the motivation to work on this project. It would have been a lot cooler to build a product or at least a decent portfolio entry or a clean public project on Github. It also would have been a good goal to complete the project so far, that I at least could use the system for myself at home. As many cables were hanging out of the prototype and as unfinished as the visualization was, I didn’t feel like using it every day.

I had fun. This fact on it’s own is enough to consider the whole project a success. And if this fact doesn’t apply to you in a private project, then you should strongly reconsider what you are doing.

If anyone is interested in what my project looked like, you can look up the code on Github, but as you’ve read my text you are hopefully warned about what you’ll find.

https://github.com/rklimpel/MicroStation

If you are interested about the stuff I bought for this project, look here: