> Measuring a sensor is so complicated
Well, you need something to ingest & query the data. InfluxDB or Prometheus is a good choice.
You need something compatible to display it. Grafana is perfect for that.
Docker is a pretty simple and decently-lightweight choice to standardize how this installs and runs.
And letting it run on a Pi makes it cheap and accessible.
What exactly is the problem with this setup? Not enough NIH?
> Measuring a sensor is so complicated...
I get the sarcasm, but sometimes it is useful to exercise "big boy" tools for projects that don't need it.What better way is there to learn/explore these things than with a very simple project that does something remotely interesting or useful?
Edit: current real-life example: I am currently developing a core tool for helping business users of a big industrial group. Client is amazed I was able to quickly develop a custom tool to answer their business needs. Code repo: 3 files: one HTML page, one vanilla JS file (less than a thousand lines), one lib to open XLSX files in JS.
I read that as "big boy stools".
https://github.com/mschaef/metlog
There are reasons I made the choices I did, and I think they still make sense, but there's been enough of various sorts of implementation pain that I am absolutely sympathetic to the idea that this person used some off the shelf software.
You should probably be more aware of your target's constraints and goals before you start questioning the means they used to achieve them.
https://github.com/mschaef/metlog
This was mainly an exploratory thing to learn some new technologies, but the gist is that it's a Clojure/Clojurescript application with HSQLDB on the back end. It runs reliably and has for years, but the more 'roll your own' experience means continually finding out that there's some other bit of missing functionality you either need to implement or live without.
A couple specific observations on various elements of the tech stack:
* HSQLDB - Nice little database, well documented, and has served its purpose well. Just now getting to the point where query lengths on long running time series are a performance issue. I think my mitigation strategy will be to do more in memory.
* core.async - I use this in the front end to manage sourcing data from the server and getting it into the graphing components. Three or four different approaches later, I'm still not sure I fully get how or why this should be used.
* Reagent - Definitely the right choice. About the perfect level of abstraction. Wish I'd spent a bit more time reading the docs ahead of time, though.
* Clojure - This has been a great choice, but to be honest, there's not much code on the server side, so it's not at all heavily used.
* ClojureScript - Also a good choice (Figwheelr helps), but it's fundamentally a different language with different core data structures sitting in a land that's solidly entrenched in JavaScript. That impedence mismatch is a continual low grade annoyance.
* HTML Canvas - Easy to use, but lots of tricky little edge cases to worry about. (The latest being how to find a way to get non-blurry pixel accurate display on a Retina laptop.)
"Docker induces no significant overhead on CPU nor memory usage, compared to a native execution (worse observation: -4%; 0% on all others)" [1]
[1]: https://roudier.io/2015/08/docker-vs-kvm-vs-native-performan...
It‘s a lot easier to explain that you need to pull & run some image than it is to explain installing python, get your ansible host configuration right and then run a playbook. There’s just a lot more variance (and therefore margin for error) that you don’t want to deal with when you’re explaining something else entirely.
8GB and Docker, plus a "cloud" server, seems a bit much.
I run a Luftdaten module myself (with SDS011 particulate sensor), but with no government meteorological station next to me, I don't really have a reference point. All I can say is that this SDS011 spews out some numbers, and when testing indoors those numbers got higher when I turned on my air humidifier. I have a similar concern about DHT11/DHT22 - it's a random small box I got mail-ordered from China, which purports to tell the temperature and humidity of air. But again, those are two arbitrary numbers I don't have anything to calibrate again.
Just using these sensors and trusting the results is an accepted practice in DIY electronics community. But I keep wondering - are those sensors actually calibrated, or it's that people don't really care if they get garbage results?
(Related, it's also my number one complaint against a particular air quality startup in my country. They rent out air sensors which you can't inspect (there are contractual penalties involved), and they happily market their map as a vital tool for air quality, but nobody really knows what sensors they're using, and they don't even bother to put error bars on the values they show. I mean, I thought including measurement error is how adults behave.)
I recently upgraded to double glazed windows in half the house, including all the bedrooms, and put a heat pump in each of the two used bedrooms. So I want to keep the windows closed for heat retention, but also want to keep them slightly open to reduce CO2 build up.
I sleep in my small bedroom with my two 16kg dogs, so it seems reason the CO2 level may rise to suboptimal during the night if the window is shut.
What I would like to do is make a DIY ventilation system that can move fresh, HEPA filtered, air from outside, in to the room.
Or am I over complicating things? Could I just use a small fan, something sized to replace, say, half the volume of the room every few hours, and just leave it constantly on? Or should I put a larger fan on a timer so it runs for a few minutes every hour?
Does any of this really matter?
Edit to add: any good resources to lose myself down a rabbit hole?
Is it reasonably accurate? Are there better alternatives?
PM2.5/PM10 - particles from combustion, exhaust, traffic (wheels against asphalt) etc
CO, NOx - from traffic exhaust
CO2 - from humans
VOC - volatile organic compounds, IIRC correlated with cancer and lots of unpleasant stuff. Comes mostly from paint and manufactured stuff (furniture etc) at home.
I'm about to make a small sensor thingee that measures these plus relative humidity (too dry at home, 30--50% should be good, we're at 10-15%), temperature (16-20 when sleeping), and for fun barometric pressure, ambient light.For this I'm going to use a Honeywell HPMA-115S0, and IIRC BME680 and some other stuff. If interesting I can have a closer look. Battery-operated devices are a little bit of a challenge since often some of these sensors internally use a heating element for a long duration, so they consume quite a lot of power.
The Plantower looks interesting, thanks for the link.
https://web.archive.org/web/20180130060734/https://ae-bst.re...
Thank you for linking it!
https://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_many.h...
I learned about it from DHH's talk on air quality:
My house is 56 years old. I'm guessing the kitchen upgrade is at least 5 years old. The carpet is probably at least a 5 years old. There isn't much fresh paint in here.
Am I about right to assume I probably don't have much in the way off off-gassing from anything in here, or does carpet / furniture / melamine continually off-gas for it's entire life?
Anyway, I've got some idea that CO2 buildup is a thing, and humidity, and off-gassing, so... I tend to ventilate the house frequently even during winter. Even when it's -5 outside, I'll occasionally open one or more windows / doors and turn the kitchen exhaust fan on in order to draw fresh air in and across the house. I'll also occasionally open multiple doors / windows for 10 minutes or so in an effort to replace the majority of the air in the house.
I tend to eschew yet-another-device that needs maintenance / power / charging / monitoring / fiddling because I tend to do a lot of that at work and would rather just come home and not-have-to-maintain-another-97-machines.
So I'm interested in the on average / sort of good enough / sometimes over-shoot-the-mark behavioural changes that would result if I did have air quality monitors.
I got one of those trendy Awair monitors and stuck it on my desk and hooked up the iPhone app. And sure enough, when I started not feeling well it was because the CO2 was over 1500 ppm.
I don't know about the accuracy of the actual CO2 measurement, but I figure the delta is at least good enough to spot trends. And yeah, those times I don't feel well is always associated with a rise of CO2. I "fix" it by either opening the door and/or window or running the fan of the central air system. Our system also has a "bleed air" adjustment for outside air. I turned that up a bit, too.
The Awair also does "chemicals" and PM2.5. I'm surprised our new house doesn't an issues with those, but I do see PM2.5 go up when the window in my office is open and "chemicals" fluctuates throughout the day but at a low level. I'm not exactly sure what "chemicals" means in this context; I haven't really looked into it yet.
You might consider the Awair; I've been happy with it. I have several thousand systems that need tending at work and, same as you, I don't need to come home and do more. My wife's Windows gaming rig needs enough of that as it is...
If you are looking for out-gassing (paints, carpets, furniture etc) you probably need to invest in formaldehyde and other gas sensors. In your case you ought to look at your furniture and electronics as they will produce the most out-gassing. This is different from the above particulate matter.
https://smartairfilters.com/en/blog/are-cheap-particle-count...
Depending on which part of the Middle East you’re in, you may need a PM10 (dust) monitor. The devices here just do PM2.5 (smog).
The BME680 (like other chips) measures VOC content - organic stuff like alcohol. You can also measure dust concentration, for example if you lived in China, PM2. 5 would be good to know. And you can also use CO2 concentration, but good CO2 sensors cost a lot. Some chips measure "equivalent CO2" but it's not the same.
I'm running grafana + influx and it's doing the job well. The netdata git repo is full of marketing fluff and fails to convince me it's any better.
I've built a few similar devices using ESP chips and various laser dust sensors, highly recommend the Plantower PMS5003 - laser defraction, PM1-PM10 accuracy, ~$20 and there are good libraries available on GitHub for interacting with it.
Edit: https://twitter.com/zensavona/status/1091949965306257409
Devices being tested at an EPA air quality monitoring station: https://imgur.com/a/joQvj
Desktop version: https://imgur.com/a/yT1IK
I'm wondering how the SD card gets on with the constant writes into InfluxDB (assuming the samplesa are taken frequently)