Chili Monitor
by JayPi4c
The idea for this project was build up over multiple years. I guess the very start was the summer 2018. I had my room in the attic and it got really (!) warm in there. I had a AC but it did not have a remote controll nor was it possible to porgramm it to start at a given time or temperature. So I build an easy device with an Arduino to measure the temperature and store it on a server. Additionally, I created a Twitter-Bot that would tweet me the current temperature and if I wanted also the graph of the last 24 hours. This way I could just ask my bot to get me the current temperature and I decided wether I wanted to go up there and do stuff or if I would just stay downstairs. The first tries looked something like this:
It did work but after the very warm week was over I had no reason to continue this project and I abandoned it. I knew what was possible but I had other stuff to do.
Fast forward 1 year. I had graduated from High School and started my voluntary year in late 2019. Again the summer was quite warm (climate change doing its thing I guess…). And I again wanted to have a look at the temperature development in my room. Especially since I wasn’t always warm and some other people might had access to my room in the dorm, it would have been nice to see the curve. Also it would allow me to check if other people have entered my room as opening the door would have resulted in a temperature change. Maybe just slightly but I guess still enough that I could see it. So I remembered that I did a similar project already, I pulled back my code and started to make some changes to get it working again. (In fact that’s the project InfoBot, which will get a nice documentation maybe sometime soon. Check out the project’s Wiki for more information.) Anyway, I got it working again but the Twitter API had changed until then and I didn’t really understand what was going on. Having seen the alternative Mastodon, I decided to give it a try and changed the network to Mastodon. And in fact, it worked. I even had a little command parser implemented so I could fetch specific intervals:
The only problem was, that I did not have a server that could run all day long and also the network access count was limited so I had just three devices to be allowed in the dorm network. So what I did was to take an old FritzBox and created my own network in which my laptop took place as server (which wasn’t the best idea as it went into sleep mode quite fast and would not register any new data entries from the temperature measurement) and the Arduino could measure the temperature in my room. As I wanted to use the Laptop in the dorm network having Internet it wasn’t a network access wasted. It kind of acted like a gateway between the local offline network and the whole internet dorm network. But the laptop often went to sleep mode and did not allow any remote interaction anymore, which lead to me give up on the project some time soon.
Fast forward again. For my studies I moved into a shared apartment. One of my roommates really knows his stuff when it comes to plans. So one time he came back with a chili plant and in the late summer of 2021 we could harvest many chili peppers. The next year I tried to grow a new plant from the seeds in one of the peppers. And it went really good. But sometimes I forgot to water the plants so I decided to repurpose my old code yet again and create a bot that informs me whenever the waterlevel is too dry so I know I have to water the plants. For that I connected sensors to an Arduino as shown in the following picture:
Furthermore, I implemented a REST-API for the data. So the Arduino could send the data to the API and other applications (bot, dashboard) can get the values from the API to process or show the data. Now as I implemented the whole code in Java the backend- and dashboard stuff was really easier. Using Spring-Boot for both projects, I could easily create a REST-API and a dashboard to show the data. The dashboard is shown in the following picture:
The only problem right now is that there is no really good Mastodon library for Java yet. The one advertised on the mastodon website is quite old and frankly seems to be unmaintained. I found an alternative called BigBone. But it is in early development and I’ll have to wait until the features are implemented that I want to use. Still I can see the current water level in the dashboard and this is a good start. I’ll keep you updated on the progress of this project.
Repository: https://github.com/JayPi4c/Chili-Dashboardtags: chili, iot, ardino, java, spring
Back Home