Bosch Sensortec Community

    cancel
    Showing results for 
    Search instead for 
    Did you mean: 

    MKR1310 IAQ Calculation Stagnant - Duty Cycle Culprit?

    MKR1310 IAQ Calculation Stagnant - Duty Cycle Culprit?

    heyhaiden
    New Poster

    I'm using a MKRWAN 1310 and a single BME688 sensor.

    My device is battery-powered and is sending data via LoRa to The Things Network, so I'm using the "

    config/generic_33v_300s_4d/bsec_iaq.txt" config file in ULP mode.
     
    I put my device to sleep between measurements and think that may be preventing BSEC from calculating the IAQ reading-- it's stagnant at 50 with an accuracy of 0.
     
    In the BSEC integration guide, I see there are "sleep until the measurement is finished" and "sleep until next time bsec_sensor_control() asks to be called." Is there a way to call this from inside BSEC, or do I need to be inputting the calculations? 
     
    I'm using flash storage as a substitute for EEPROM since my board does not offer that. I was able to get an accuracy of 1,2, and 3 using the sample program in continuous 3s update mode but haven't been able to with my current program.
     
    Any help would be appreciated. Can share code snippets if helpful.

     

    4 REPLIES 4

    BSTRobin
    Community Moderator
    Community Moderator

    Hi heyhaiden,

    As you used config/generic_33v_300s_4d/bsec_iaq.txt" config file, your host had enough time to sleep for power save, and call bsec_sensor_control() when your host is awakened and 300s have arrived. This function should be called by host.

    I'm looking at the ESP32DeepSleep example where it says in the readme:

    compensated temperature, compensated humidity, IAQ & Static IAQ are not supported in this example code because bsec expects the time to be ticking but during deepsleep the time resets to 0. To overcome this the sleep duration can be added to the millis and passed to bsec from the example code.
    Changes in bsec.c is also needed for this to work.

    What would those changes be?

    BSTRobin
    Community Moderator
    Community Moderator

    Hi heyhaiden,

    Because the sleep time is 300 seconds, it is a long time, so temperature and humidity will have no meaning in compensating after 300 seconds.
    If your host platform uses RTC, counting will work properly regardless of whether the host is running or sleeping. After the host wakes up and before executing BSEC, you can read the real-time timestamp of RTC and provide it to BSEC.

    Hello @BSTRobin 

    I'm using an esp32 and it has RTC.
    Based on the esp32DeepSleep.ino 
    example using the configuration:
    config/generic_33v_3s_4d/bsec_iaq.txt

    What should I change to have the IAQ & Static IAQ value, I know that I should pass the millis value and pass it to the BSEC, but how do I do that, can you give a brief example of how to do it?



    Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist