IoT Open Native WiFi sensor
Marcus Rej?s
Senior Software Architect. CPR Instructor. Swimming coach and official. Sailor. Alpine skier. Specialist in Free Software. @[email protected]
I'm working with IoT Open but this is a personal project of mine in the spare time. Just because it is fun. And the fun in a project should not be neglected.
When working with IoT sensors and actuators there is often a need for a gateway or translator between the sensor and the system handling the data. That might of course be necessary because of the different physical aspects and protocols but some infrastructure is often already in place. In this case a WiFi network.
If a WiFi sensor has access to the Internet and can access the IoT platform I think it would be nice if it can do so without some man in the middle system but contact the IoT platform directly. This is nothing new and is done of course in most cases, but not exactly the way I want it.
Since my platform of choice is IoT Open and as you might know if you read my article on my heater integration or my Electricity meter you might recall that I really don't like to be relying on something outside my house unless needed. The sensor have two modes to operate in. Either it can connect directly to IoT Open backend or to an IoT Open Edge client in my house. In this specific case it doesn't really matter since the sensor is only monitoring the temperature, air pressure, TVOC and eCO2. No real time decisions are being made on that data, at least not today.
By the way, there were no special reason for choosing those sensors either, I just had them lying around. After all this is just for fun!
So I had the plan set up. The to play in the workshop. I took some stuff I had around and ended up with this.
I also drew it in Fritzing to make is easier to follow.
领英推荐
Then on to soldering. I love the smell. I found a case and a experiment board suitable for this and got to soldering. Since I want to analyze air I had to cut some holes in the casing to allow as much air as possible. I did turn out quite nice. Well, okay anyway.
Then to the most fun stuff. The coding. I wrote the code in Micropython since it is easy to start with. The code is available at Github free to use. This is the first code I write in Micropython so there was some searching on the net involved. Please do not judge me.
Before I started hacking away I decided that there were some features i wanted.
I think I accomplished all that and then some. I really will not walk you through the code. It is there if you want to see it.
The sensor has been running for about a month now. Works very well. I like that I can easily change the reporting interval on all parameters. That makes it easy to have different intervals in daytime and in nighttime. I can also of course send barometric pressure at one interval and TVOC at another. I can also get on demand readings. I did forget to add delta based reporting, that is left for the next version and should be no problem to implement.
Okay, on to the next project.
?? Aff?rsledare p? Berotec/2:e vice ordf?rande Barn och skoln?mnden i Norrt?lje. Hj?lper f?retag, m?nniskor och organisationer att n? sin fulla pontential.
1 年Coolt! ????