Hacker News new | ask | show | jobs
by bhouston 2702 days ago
I would have just had the CO2 level read via a $8 I2C device connected to an Esp8266/Esp32 running Arduino.

I would post the result to a web service in this fashion from the Esp8266:

https://techtutorialsx.com/2016/07/21/esp8266-post-requests/

Then just setup a nice Graphana+Prometheus as a service, graphana.com is nice and can expose a Prometheus end point over basic http auth - easy to post to. Then you can setup alerts, graphs, dashboards, etc.

In fact you could have a whole suite of IoT reports flowing in from various Arduinos really easily. Or at least a couple CO2 sensors spread around the house.

Total investment of coding would be about 30-50 lines of Arduino code for the Esp8266 and you may even get away with the free plan on Graphana.com.

I obviously like to outsource as much as possible these days. Less learning, but more efficient.

4 comments

Would you be able to share where you might get such a cheap CO2 sensor/the name of it? I've had trouble finding them for less than £60 in the UK and would like to set one up.
MH-Z14 or Z19 are cheap, but not 8$ cheap, more like 25.
https://www.co2meter.com/collections/sensors has a bunch of different ones, I usually look on Mouser also. I don't have a name of one currently. I've been using the particle.io platform with a particle device/LTE for sending out data and programming them.
None of them are in the 8$ range. There also seem to some copies which are way overpriced.
Interesting to have an arbitrary $8 price point. You only live once, get the best!
Not my restriction.
Adafruit sell a 1-60,000 ppm equivalent-CO2 sensor for £15. https://www.adafruit.com/product/3709
This doesn't measure CO2 levels. It measures volatile organic compounds and calculates the amount of CO2 that would cause the same greenhouse effect.

>The SGP30 does have built in calibration capabilities, note that eCO2 is calculated based on H2 concentration, it is not a 'true' CO2 sensor for laboratory use.

Not even that. It is designed for hvac applications and measures VOCs on the assumption that they are from human breath and have a corresponding increase in CO2 levels due to breath.
Slight aside, anyone know why all the supposedly iot-oriented small arduino devices are IPv4-only? Is everyone deploying them in some kind of NATs + port forwards / upnp system or tunneled overlay IPv4 network using external gateway devices?
Seems that both "official" SDK for esp8266 and its Arduino port support ipv6 out of the box: https://github.com/esp8266/Arduino/pull/5136.

esp8266-nonos-sdk/esp8266-rtos-sdk/esp8266-arduino uses lwip as tcp/ip stack, which supports ipv6.

Awesome. The Arduino port "IPv6 support" issue was closed 9 days ago too. No other IPv6 related issues reported yet. Off to look for reports from elsewhere of people using it...

The Espressif 8266 SDK docs make no mention of IPv6, does it really work there? (https://www.espressif.com/sites/default/files/documentation/... linked from https://www.espressif.com/en/products/software/esp-sdk/resou...)

I only found one example for the Espressif-provided RTOS, at https://github.com/IPv6-ESP8266/IPv6-ESP8266 . The example says it only works in a IPv6-only network and it's using link-local addresses, which kind of defeats the point of IPv6. No idea if these reflect limitations of the stack. It's a start at least :)

Genuine question: are Arduino's really for IOT or for prototyping? Not an expert, just read a lot about startups starting with a RaspPI or Arduino prototype for the Kickstarter or something and then getting "real" dedicated hardware for production.
It is common to start with these before the Kickstarter, just to get a proof of concept, but those boards (and the ESP8266) absolutely aren't for production. Raspberry Pis are terrible since the only way to interface with them is over a single USB 2.0 port - and that's shared with the 100M ethernet and the SD slot.

You might see an ATMega328p chip isolated, and that's "good enough" for hobbyist projects where you just want to make HID easier on yourself. But I think most shops that need one of these three would be much better off with a STM32-series chip - they cost pennies compared to consumer boards, run on microamps, and have much better documentation.

It'd be a huge red flag for me if I was interviewing with a hardware startup and they said they wanted to put Arduinos into mass production.

Arduinos are not for production, but for prototyping, hobby projects.
Totally true, but my soldering iron is in the basement, so ... ;)
And where can you buy a 8$ Co2 sensor that doesn't suck?