Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. jaredwolff
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    jaredwolff

    @jaredwolff

    7
    Reputation
    33
    Posts
    257
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    jaredwolff Follow

    Best posts made by jaredwolff

    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @FotoFieber how goes the testing?

      The BME680 and the SGP30 both correlate in their readings with temperature. This means when the temperature goes up and down, i've seen the TVOC reading go up and down as well. Hardly useful for a sensor that is supposed to tell you if your air is bad or not.

      Take a look at the screenshot below:

      0_1560869706305_image.png

      You can see that both sensors react wildly to temperature. Whereas the CCS811 has a bump but not significantly. If I go by the scales in the data sheets for the BME680 and SGP30, the room that these sensors are in require immediate venting.

      Even right now, the SGP30 sensor is half way to the danger zone. 😵

      Danger zone!

      0_1560869685735_image.png

      While testing that, I also threw everything together into an enclosure. Even added GPS:

      0_1560869778746_image.png

      So it sits up in the kitchen and chirps at me when I burn my food. I switch on my air purifier and the particulate level goes down pretty quick!

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @fotofieber also, I compiled my conclusions about some of the smaller form factor TVOC/C02 sensors. It was inspired by everything we talked about here. Our back and forth conversation has been awesome. So I wanted to say thanks for the inspiration šŸ™‚

      0_1557153919177_Screen Shot 2019-05-06 at 10.44.47 AM.png

      The above is a screenshot from the side-by-side data of the BME680, CCS811 and SGP30.

      The BME680 seemed impressive at first but I'm seeing a big difference in temperature and humidity. My thinking it's likely due to the heating elements inside keeping it a little less humid and a little more hot. (These are the compensated values by the way. The non-compensated values are even lower humidity and a hotter.)

      The SGP30 is a bit of a power hog but the TVOC readings seemed to align well with the response from the BME680.

      The CCS811, like we've seen throughout this thread, had some wacky responses using the 1.0.0 firmware. I haven't seen that since all of my CCS811 are up to date.

      It's a toss up between all three but I'd shy away from the CCS811. If anyone here plans on building a production device, the stock is not reliable enough. (Digikey and Mouser have been out of stock lately) I'm not sure if you'd have the same problem in the EU or how things are in Asia.

      Anyway my TLDR conclusions are here if anyone is interested. They include software implementation factors, hardware factors, availability factors and data output factors all rolled into one.

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      They know about it. They keep their library up to date on Github:

      Here's the diff:

      https://github.com/BoschSensortec/BSEC-Arduino-library/commit/e9a10fe23739bb95650d2ab89ed37764a4ba3caf

      Here's the library link:

      https://github.com/BoschSensortec/BSEC-Arduino-library

      You probably downloaded it from the website just like I did.

      I'll have to update my repo and point it to this as a submodule.

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @nca78 I am using the BSEC library. I’m using the compensated humidity and temperature so I’m sure if that. I may have to take a second look at the code for both sensors. I may have mucked something up!

      posted in My Project
      jaredwolff
      jaredwolff
    • Particle Powered Air Quality Sensor Logging to Google Docs

      Hey All,

      I recently completed a project to simplify air quality measurements throughout my home. It uses a CCS811 (TVOC + C02), Si7021 (Humidity and Temp) and a HPMA115S0 (PM2.5 and PM10)

      I did base this off of a more manual DIY project here. If you're interested in simple though, continue on!

      Gather the Goods
      0_1554836630359_image.png

      Get everything together that you’ll need for this project.

      This includes:

      • A Particle Mesh board (Argon, Boron, Xenon). You can get them almost anywhere. Buying direct always works too. Note: if you're just starting out, the Argon is your best bet.
      • Particle^2 Air Quality Sensor.
      • Honeywell HPMA115S0 Particle Sensor.
      • Cable for HPMA115S0 Sensor. ( The last three you can get here. )

      The Leg Bones Connect to The ..
      Put everything together in the short few steps below:

      1. Attach the Particle to the Particle^2 board
        0_1554836644342_image.png

      2. Connect the HPM Particle sensor to the Particle^2 using the cable
        0_1554836653470_image.png

      3. Plug in USB!
        0_1554836659251_image.png

      Configure Google Docs Script

      1. Create a new Google Sheet
      2. Then click the Tools menu and click Script Editor
        0_1554836668088_image.png
      3. Create a new script
      4. Insert the below code into the script:
        //this is a function that fires when the webapp receives a POST request
         function doPost(e) {
      
           //Return if null
           if( e == undefined ) {
             Logger.log(ā€œno dataā€);
             return HtmlService.createHtmlOutput(ā€œneed dataā€);
           }
      
           //Parse the JSON data
           var event = JSON.parse(e.postData.contents);
           var data = JSON.parse(event.data);
      
           //Get the last row without data
           var sheet = SpreadsheetApp.getActiveSheet();
           var lastRow = Math.max(sheet.getLastRow(),1);
           sheet.insertRowAfter(lastRow);
      
           //Get current timestamp
           var timestamp = new Date();
      
           //Insert the data into the sheet
           sheet.getRange(lastRow + 1, 1).setValue(event.published_at);
           sheet.getRange(lastRow + 1, 2).setValue(data.temperature);
           sheet.getRange(lastRow + 1, 3).setValue(data.humidity);
           sheet.getRange(lastRow + 1, 4).setValue(data.pm10);
           sheet.getRange(lastRow + 1, 5).setValue(data.pm25);
           sheet.getRange(lastRow + 1, 6).setValue(data.tvoc);
           sheet.getRange(lastRow + 1, 7).setValue(data.c02);
      
           SpreadsheetApp.flush();
           return HtmlService.createHtmlOutput(ā€œpost request receivedā€);
         }
      

      Configure Webhook
      0_1554836676996_image.png

      1. Go to Publish and click Deploy as Web App
      2. Set Execute the app as yourself
      3. Then set Who has access to the app to Anyone, even anonymous. (Important: if you’re working with. mission critical data, you may want a more robust and custom solution. This allows anyone, if they have your web hook link to post data to that page!)
      4. Change the Project Version to new and deploy!
      5. Copy the Current App URL that the output provides.

      Configure Particle Cloud

      0_1554836686474_image.png

      1. In the Particle.io console, go to the Integrations section and Create a New Webhook
      2. Fill in the name of the event that get’s forwarded from the code (in this case it’s blob)
      3. Enter the Current App URL from the last step in the URL Box
      4. Set the request type to POST
      5. Set the request format to JSON
      6. Target the device you’ll be using (or leave it as is if you only have one device)
      7. Click save

      Beam me up

      0_1554836693406_image.png

      It’s time to program your board. Follow the steps below:

      1. Setup your Particle Account and Particle Mesh device. Use the Quickstart if you haven’t done this before.
      2. Download Particle Workbench and install if you haven’t already. Instructions here.
      3. Get the code here.
      4. Once the code is downloaded, open it with Visual Code (that you installed in Step 1)
      5. Login to Particle if you haven’t already (The fastest way is to hit Command + Shift + P to open the command window. Then start typing login)
      6. Publish to Particle Cloud - Again this uses the command window. Use the same Command + Shift + P as above and type Cloud Flash.
      7. Once you’ve found the Cloud Flash option, press enter.
      8. Your board should be programmed shortly. You can watch the LEDs for changes during this time. Once it’s glowing blue, you’re good to go!

      Last Step (I promise)

      1. In the Google sheet you can create a header in the first row with all the labels.
        0_1554836704903_image.png
      2. You should notice by now that new data is showing up in the sheet (if you set everything up correctly). Go back to the previous steps if you don’t see it.
      3. You can graph the data by selecting a full column and creating a new chart from it.
        0_1554836712512_image.png
      4. You can graph everything in one or in separate like I’ve done above.
        If everything is working and you have some pretty graphs, congrats!! If you’re ready to move on to the next step using an IoT service like Adafruit’s check out my full guide here.

      Conclusion
      I hope you've found this useful. Especially the bit about Google Docs. (It's changed my life that's for sure!!) Now it's on to bigger and better things like getting a battery optimized version running. Now that will be fun..

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      Hey @Sebex

      After running my setup for more than 8 months here are a few suggestions:

      1. If you care about particulates then the PM2.5 sensor works wonders. I've been using the HPMA115S0. It uses UART which you should be able to use with any Arduino variant.
      2. If you're more concerned with chemicals, a MOx sensor like the CCS811 is still my choice.

      The CCS811 is available as development boards from Adafruit and Sparkfun. The HPMA115S0 can be purchased from Arrow, Mouser and Digikey.

      I actually developed an all-in-one for Featherwing board. You can check that out for inspiration as well.

      posted in My Project
      jaredwolff
      jaredwolff

    Latest posts made by jaredwolff

    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @NeverDie

      I've set up the BME680 to use low power mode. I saw that the temperature readings were much higher in normal mode. Here's the init:

        // Begin BME680 work
        #ifdef HAS_BME680
        bsec.begin(BME680_I2C_ADDR_PRIMARY, Wire);
        checkIaqSensorStatus();
      
        // Set up BME680 sensors
        bsec_virtual_sensor_t sensorList[7] = {
          BSEC_OUTPUT_RAW_TEMPERATURE,
          BSEC_OUTPUT_RAW_PRESSURE,
          BSEC_OUTPUT_RAW_HUMIDITY,
          BSEC_OUTPUT_RAW_GAS,
          BSEC_OUTPUT_IAQ,
          BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_TEMPERATURE,
          BSEC_OUTPUT_SENSOR_HEAT_COMPENSATED_HUMIDITY
        };
      
        bsec.updateSubscription(sensorList, 7, BSEC_SAMPLE_RATE_LP); //BSEC_SAMPLE_RATE_LP
        checkIaqSensorStatus();
        #endif
      

      @Sebex I agree with @Nca78, you can look into how I2C works. The cool thing is you can add up to 255 sensors as long as they have different addresses. (or if you do some tricky hardware stuff for devices with the same address) Unfortunately I only have implementations for my Featherwing.

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      Hey @Sebex

      After running my setup for more than 8 months here are a few suggestions:

      1. If you care about particulates then the PM2.5 sensor works wonders. I've been using the HPMA115S0. It uses UART which you should be able to use with any Arduino variant.
      2. If you're more concerned with chemicals, a MOx sensor like the CCS811 is still my choice.

      The CCS811 is available as development boards from Adafruit and Sparkfun. The HPMA115S0 can be purchased from Arrow, Mouser and Digikey.

      I actually developed an all-in-one for Featherwing board. You can check that out for inspiration as well.

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @nca78 agreed. It totally depends on the application. On a 225mA button cell that may not work especially if it has to last a year or two!

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @nca78 I mean, you can run it on a battery. Just need a really big one! 😬

      Because of the internal heater it does make it hard to integrate into a battery powered application.

      I haven’t measured the low power mode on the BME. What were you getting @Nca78

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @nca78 I am using the BSEC library. I’m using the compensated humidity and temperature so I’m sure if that. I may have to take a second look at the code for both sensors. I may have mucked something up!

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @FotoFieber how goes the testing?

      The BME680 and the SGP30 both correlate in their readings with temperature. This means when the temperature goes up and down, i've seen the TVOC reading go up and down as well. Hardly useful for a sensor that is supposed to tell you if your air is bad or not.

      Take a look at the screenshot below:

      0_1560869706305_image.png

      You can see that both sensors react wildly to temperature. Whereas the CCS811 has a bump but not significantly. If I go by the scales in the data sheets for the BME680 and SGP30, the room that these sensors are in require immediate venting.

      Even right now, the SGP30 sensor is half way to the danger zone. 😵

      Danger zone!

      0_1560869685735_image.png

      While testing that, I also threw everything together into an enclosure. Even added GPS:

      0_1560869778746_image.png

      So it sits up in the kitchen and chirps at me when I burn my food. I switch on my air purifier and the particulate level goes down pretty quick!

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      They know about it. They keep their library up to date on Github:

      Here's the diff:

      https://github.com/BoschSensortec/BSEC-Arduino-library/commit/e9a10fe23739bb95650d2ab89ed37764a4ba3caf

      Here's the library link:

      https://github.com/BoschSensortec/BSEC-Arduino-library

      You probably downloaded it from the website just like I did.

      I'll have to update my repo and point it to this as a submodule.

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @fotofieber I'm not sure they know.. haha I should tell them.

      Good luck and let me know how it goes!

      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @fotofieber the library does have an error I found earlier. Divide _data.temperature by 100.0f and _data.humidity by 1000.0f. This is in BSEC.cpp

      See below:

      /**
       * @brief Read data from the BME680 and process it
       */
      bool Bsec::readProcessData(int64_t currTimeNs, bsec_bme_settings_t bme680Settings)
      {
      	bme680Status = bme680_get_sensor_data(&_data, &_bme680);
      	if (bme680Status != BME680_OK) {
      		return false;
      	}
      
      	bsec_input_t inputs[BSEC_MAX_PHYSICAL_SENSOR]; // Temp, Pres, Hum & Gas
      	uint8_t nInputs = 0, nOutputs = 0;
      
      	if (_data.status & BME680_NEW_DATA_MSK) {
      		if (bme680Settings.process_data & BSEC_PROCESS_TEMPERATURE) {
      			inputs[nInputs].sensor_id = BSEC_INPUT_TEMPERATURE;
      			inputs[nInputs].signal = _data.temperature/100.0f; // Need to divide by 100 for fp
      			inputs[nInputs].time_stamp = currTimeNs;
      			nInputs++;
      			/* Temperature offset from the real temperature due to external heat sources */
      			inputs[nInputs].sensor_id = BSEC_INPUT_HEATSOURCE;
      			inputs[nInputs].signal = _tempOffset;
      			inputs[nInputs].time_stamp = currTimeNs;
      			nInputs++;
      		}
      		if (bme680Settings.process_data & BSEC_PROCESS_HUMIDITY) {
      			inputs[nInputs].sensor_id = BSEC_INPUT_HUMIDITY;
      			inputs[nInputs].signal = _data.humidity/1000.0f; // Need to divide by 1000 for fp;
      			inputs[nInputs].time_stamp = currTimeNs;
      			nInputs++;
      		}
      		if (bme680Settings.process_data & BSEC_PROCESS_PRESSURE) {
      			inputs[nInputs].sensor_id = BSEC_INPUT_PRESSURE;
      			inputs[nInputs].signal = _data.pressure;
      			inputs[nInputs].time_stamp = currTimeNs;
      			nInputs++;
      		}
      		if (bme680Settings.process_data & BSEC_PROCESS_GAS) {
      			inputs[nInputs].sensor_id = BSEC_INPUT_GASRESISTOR;
      			inputs[nInputs].signal = _data.gas_resistance;
      			inputs[nInputs].time_stamp = currTimeNs;
      			nInputs++;
      		}
      	}
      
      
      posted in My Project
      jaredwolff
      jaredwolff
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @fotofieber said in Particle Powered Air Quality Sensor Logging to Google Docs:

      Linking is no problem (after trial and error of two hours ).

      Yea it took me a bit to figure that out too. 😬

      Have you fired up the standard I2C library to see if you can talk to the BME680? Or maybe throw a logic analyzer on it to maker sure it's communicating? I'd imaging the compiler would barf if you used the wrong static library. Bosch does have an ESP32 specific one.

      Unfortunately, I don't have any way of testing that here. Keep me posted, I'm curious as to why it's not working.

      posted in My Project
      jaredwolff
      jaredwolff