CO2 sensor support?

Issue #175 resolved
connochaetes created an issue

Hi.

In times of COVID-19, I became aware of projects like this one: http://esp8266-server.de/CO2Ampel.html Since a CO2 sensor isn’t the cheapest sensor, I wanted to ask, if there are experiences with CO2 sensors and MicroBlocks (MG811, MH-Z19, …).

Greetings.

Comments (10)

  1. John Maloney repo owner

    Glad you asked before buying a sensor. That particular sensor appears to communicate using a serial connection (UART). MicroBlocks does not currently support serial connections, although that is a feature we’re considering on boards that have the hardware to support it. (The micro:bit and Calliope mini do NOT have the necessary hardware.) There are likely C02 sensors that communicate via i2c protocol, which MicroBlocks does support.

    I’ll check with the rest of the team to see if anyone has a recommendation. I know Kathy Giori has been running some sort of a gas sensor to monitor air quality. She lives close to a part of California that was impacted by wildfires recently and so monitoring the air quality was very relevant to daily life.

  2. John Maloney repo owner

    Did some Googling. There are definitely many I2C C02 sensors available. This discussion might be helpful:

    https://www.element14.com/community/thread/59331/l/co2-sensor-recommendation

    This one seems pretty cheap, is i2c, and runs on 3.3 volts. But check the specs; it might have limited range or accuracy compared with one costing 5x to 15x as much.

    https://www.newark.com/amphenol-advanced-sensors/mics-vz-89te/gas-sensor-2000ppm-3-3v/dp/45AC9641?gclid=CjwKCAjw8-78BRA0EiwAFUw8LMRjV0pUIC9mlePkEUEbRg42za0Ify5fHwxE6mrFPMhlVppysWcXpxoCLacQAvD_BwE&mckv=sHkYbANS6_dc|pcrid|434136793437|plid||kword||match||slid||product|45AC9641|pgrid|100464451386|ptaid|pla-901985920013|&CMP=KNC-GUSA-GEN-Shopping-NewStructure-Sensors-Transducers

    Once you have an i2c sensor, you’ll need to read the data sheet to figure out how to interact with it via the MicroBlocks i2c blocks. Those blocks are in the “Comm” category which is hidden until you enable “show advanced blocks”. A strategy I often us is to google for an Arduino code example that uses the same sensor and study the source code for that.

  3. connochaetes reporter

    @John Maloney Thank you for your thoughts and recommendations regarding this issue. I hope, I’ll soon find the opportunity to follow this lead.

  4. José García

    Hi all,

    We have almost ready libraries to support for CCS811 and SGP30 CO2 sensors. In few days we will publish-them.

    Regards.

  5. connochaetes reporter

    That’s promising. Thank you. So, I’ll upgrade my MicroBlocks installation regularly and keep looking into the sensing folder of the library section.

    I just ordered one of the supported sensors. I am eager to see it’s functionality.

  6. Markus Gälli

    @connochaetes Guess you have seen it but to be sure: The lib for the sdc30 is included in the latest versions of Microblocks .

  7. connochaetes reporter

    @ Markus Gälli : Thanks. I have to admit, that I lost focus on this subject. Now, I am curious to check out Microblocks again.

  8. José García
    Hi,

    If you’re interested, I’m working on a library for the SenseAir S8 sensor (using series), which is quite accurate and has low power consumption.

  9. connochaetes reporter

    @ José García : Thank you for this information. That’s good to know for the future. (Right now, I’m busy otherwise.)

  10. Log in to comment