element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Arduino
  • Products
  • More
Arduino
Blog Nicla Surprise
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Arduino requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 6 Apr 2022 3:19 AM Date Created
  • Views 859 views
  • Likes 9 likes
  • Comments 2 comments
  • arduino nicla sense me
  • bosch bsec
Related
Recommended

Nicla Surprise

ralphjy
ralphjy
6 Apr 2022

I received a surprise package yesterday from Farnell.  It turned out to be a Nicla Sense ME board.  I assume that this is a result of asking a question during Enrico's recent webinar since I haven't made a project proposal for the Better World with Arduino contest.  In any case it was a pleasant surprise Slight smile.

The Cheat Sheet is a great resource - the first thing that I tried is the obligatory RGB Blinky...

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Then I went on to trying the Standalone example to display the sensors in the Serial Monitor.  That all worked as expected, so I added the output from the Bosch Sensortec Environmental Cluster (BSEC) Software library in order to see the voc_eq and co2_eq values.  That unfortunately did not work - compiled and uploaded fine, but all I got were "0" values.  That surprised me because I had seen that javagoza had already demonstrated CO2 measurements.

It turns out that the sensor in the Nicla Sense ME is using a legacy address - so I needed to change that in the program.

Here are the definitions from the SensorID.h file:
SENSOR_ID_BSEC = 115, /* BSEC 1.x output */
SENSOR_ID_BSEC_LEGACY = 171, /* BSEC 1.x output (legacy, deprecated) */

I also needed to change the default data length in the SensorTypes.h file from 10 to 30:

Here is the original definition:
#define SENSOR_DATA_FIXED_LENGTH (10)

And the comment from the SensorBSEC.h file:
If the default size of SENSOR_DATA_FIXED_LENGTH is used (10 bytes), some fields of BSEC might be always 0.

With those changes, I started to get non-zero values - but they weren't changing.  I haven't played with air quality sensors much and did not realize that these Bosch sensors require about 5 minutes to stabilize.  After 4 minutes or so I saw the accuracy value go from 0 to 1 and I started seeing the air quality values change.  I haven't seen the accuracy go above 1, so I need to do some additional reading as I think that indicates that the sensor couldn't calibrate.

The IAQ accuracy is reflects the current state of the background calibration process, such as:

  • IAQ Accuracy=0 could either mean:
    • BSEC was just started, and the sensor is stabilizing (this lasts normally 5min in LP mode or 20min in ULP mode),
    • there was a timing violation (i.e. BSEC was called too early or too late), which should be indicated by a warning/error flag by BSEC,
  • IAQ Accuracy=1 means the background history of BSEC is uncertain. This typically means the gas sensor data was too stable for BSEC to clearly define its references,
  • IAQ Accuracy=2 means BSEC found a new calibration data and is currently calibrating,
  • IAQ Accuracy=3 means BSEC calibrated successfully.

Here's an abbreviated Serial Monitor output:

19:41:05.651 -> acceleration: XYZ values - X: -3788   Y: 348   Z: 1598
19:41:05.651 -> gyroscope: XYZ values - X: 0   Y: -3   Z: -5
19:41:05.651 -> temperature: 27.920
19:41:05.651 -> gas: 10853.000
19:41:05.651 -> rotation: Quaternion values - X: 0.047   Y: 0.551   Z: 0.007   W: 0.833   Accuracy: 3.142
19:41:05.651 -> BSEC info: BSEC output values - iaq: 25   iaq_s: 25   b_voc_eq: 0.50   co2_eq: 500   accuracy: 0   comp_t: 27.83   comp_h: 31.76   comp_g: 4
     .
     .
     .
19:45:45.951 -> acceleration: XYZ values - X: -3782   Y: 355   Z: 1590
19:45:45.951 -> gyroscope: XYZ values - X: 1   Y: -2   Z: 0
19:45:45.951 -> temperature: 28.260
19:45:45.951 -> gas: 10764.000
19:45:45.951 -> rotation: Quaternion values - X: 0.046   Y: 0.552   Z: 0.008   W: 0.832   Accuracy: 3.142
19:45:45.951 -> BSEC info: BSEC output values - iaq: 25   iaq_s: 25   b_voc_eq: 0.50   co2_eq: 500   accuracy: 1   comp_t: 28.21   comp_h: 31.18   comp_g: 4
     .
     .
     .
19:45:51.935 -> acceleration: XYZ values - X: -3771   Y: 351   Z: 1581
19:45:51.935 -> gyroscope: XYZ values - X: -1   Y: -2   Z: 0
19:45:51.935 -> temperature: 28.300
19:45:51.935 -> gas: 9890.000
19:45:51.935 -> rotation: Quaternion values - X: 0.046   Y: 0.552   Z: 0.008   W: 0.832   Accuracy: 3.142
19:45:51.935 -> BSEC info: BSEC output values - iaq: 55   iaq_s: 38   b_voc_eq: 0.61   co2_eq: 552   accuracy: 1   comp_t: 28.23   comp_h: 31.13   comp_g: 4
19:45:52.963 -> acceleration: XYZ values - X: -3786   Y: 354   Z: 1596
19:45:52.963 -> gyroscope: XYZ values - X: 0   Y: -6   Z: 0
19:45:52.963 -> temperature: 28.320
19:45:52.963 -> gas: 10071.000
19:45:52.963 -> rotation: Quaternion values - X: 0.046   Y: 0.552   Z: 0.008   W: 0.832   Accuracy: 3.142
19:45:52.963 -> BSEC info: BSEC output values - iaq: 55   iaq_s: 38   b_voc_eq: 0.61   co2_eq: 552   accuracy: 1   comp_t: 28.23   comp_h: 31.13   comp_g: 4
19:45:53.945 -> acceleration: XYZ values - X: -3762   Y: 352   Z: 1567
19:45:53.945 -> gyroscope: XYZ values - X: 4   Y: 1   Z: 2
19:45:53.945 -> temperature: 28.340
19:45:53.945 -> gas: 10370.000
19:45:53.945 -> rotation: Quaternion values - X: 0.046   Y: 0.552   Z: 0.008   W: 0.832   Accuracy: 3.142
19:45:53.945 -> BSEC info: BSEC output values - iaq: 55   iaq_s: 38   b_voc_eq: 0.61   co2_eq: 552   accuracy: 1   comp_t: 28.23   comp_h: 31.13   comp_g: 4
19:45:54.966 -> acceleration: XYZ values - X: -3756   Y: 354   Z: 1584
19:45:54.966 -> gyroscope: XYZ values - X: 0   Y: 1   Z: 0
19:45:54.966 -> temperature: 28.350
19:45:54.966 -> gas: 10622.000
19:45:54.966 -> rotation: Quaternion values - X: 0.046   Y: 0.552   Z: 0.008   W: 0.832   Accuracy: 3.142
19:45:54.966 -> BSEC info: BSEC output values - iaq: 53   iaq_s: 37   b_voc_eq: 0.60   co2_eq: 550   accuracy: 1   comp_t: 28.28   comp_h: 31.05   comp_g: 4
     .
     .
     .
19:50:54.227 -> acceleration: XYZ values - X: -3775   Y: 358   Z: 1573
19:50:54.227 -> gyroscope: XYZ values - X: -4   Y: 0   Z: -1
19:50:54.227 -> temperature: 28.410
19:50:54.227 -> gas: 10687.000
19:50:54.227 -> rotation: Quaternion values - X: 0.046   Y: 0.553   Z: 0.008   W: 0.832   Accuracy: 3.142
19:50:54.227 -> BSEC info: BSEC output values - iaq: 42   iaq_s: 32   b_voc_eq: 0.56   co2_eq: 530   accuracy: 1   comp_t: 28.35   comp_h: 31.04   comp_g: 4
19:50:55.207 -> acceleration: XYZ values - X: -3774   Y: 355   Z: 1587
19:50:55.207 -> gyroscope: XYZ values - X: -4   Y: -1   Z: -1
19:50:55.207 -> temperature: 28.410
19:50:55.207 -> gas: 10720.000
19:50:55.207 -> rotation: Quaternion values - X: 0.046   Y: 0.553   Z: 0.008   W: 0.832   Accuracy: 3.142
19:50:55.207 -> BSEC info: BSEC output values - iaq: 41   iaq_s: 32   b_voc_eq: 0.56   co2_eq: 529   accuracy: 1   comp_t: 28.35   comp_h: 31.05   comp_g: 4
     .
     .
     .
19:55:54.504 -> acceleration: XYZ values - X: -3767   Y: 370   Z: 1536
19:55:54.504 -> gyroscope: XYZ values - X: -5   Y: -2   Z: -2
19:55:54.504 -> temperature: 28.110
19:55:54.504 -> gas: 10989.000
19:55:54.504 -> rotation: Quaternion values - X: 0.046   Y: 0.557   Z: 0.012   W: 0.829   Accuracy: 3.142
19:55:54.504 -> BSEC info: BSEC output values - iaq: 27   iaq_s: 25   b_voc_eq: 0.51   co2_eq: 503   accuracy: 1   comp_t: 28.06   comp_h: 31.17   comp_g: 4
19:55:55.490 -> acceleration: XYZ values - X: -3802   Y: 358   Z: 1540
19:55:55.490 -> gyroscope: XYZ values - X: 1   Y: 1   Z: 2
19:55:55.490 -> temperature: 28.110
19:55:55.490 -> gas: 11071.000
19:55:55.490 -> rotation: Quaternion values - X: 0.046   Y: 0.557   Z: 0.012   W: 0.829   Accuracy: 3.142
19:55:55.490 -> BSEC info: BSEC output values - iaq: 25   iaq_s: 25   b_voc_eq: 0.50   co2_eq: 501   accuracy: 1   comp_t: 28.05   comp_h: 31.17   comp_g: 4
19:55:56.491 -> acceleration: XYZ values - X: -3794   Y: 367   Z: 1548

Now, I can follow along Enrico's Workshops with some hardware.  Maybe I can get a project done for the contest.

  • Sign in to reply
  • Idsnif
    Idsnif 8 months ago

    Please forgive me as this is probably not the place to post a question. 

    First we are able to read all of the sensors on the Nicla Sense ME over USB on a Mac running Arduino IDE and to report data using Serial Monitor. If I can be of help let me know.

    Question: We are interested in using the BME AI Studio on the Mac to train the BME688 on the Sense ME, however only pull down choice is the BME 688 DEV-KIT BME688 Development kit. How can I get to the 688 on the Sense ME?

    Hg

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • javagoza
    javagoza 11 months ago

    During Enrico's workshop I asked him about the structure of the frames sent by the Arduino library and he directed me to the github code. In the code I saw those indications.


    Since I wanted to make the connection by BLE from an Arduino nano 33 BLE that is not supported by that library, I needed to understand the frames well.

    nicla-sense-me-fw/SensorBSEC.h at main · arduino/nicla-sense-me-fw (github.com)


    /*
    BSEC sensor frames are:
    - 18 bytes for BSEC new format (SID=115 SENSOR_ID_BSEC_LEGACY)
    - 29 bytes for legacy format (SID=171 SENSOR_ID_BSEC)
    If the default size of SENSOR_DATA_FIXED_LENGTH is used (10 bytes), some fields of BSEC might always be 0.
    Enlarge SENSOR_DATA_FIXED_LENGTH to see all the fields of the BSEC sensor.
    For the new format (SID=115), if the compensated values (comp_t, comp_h, comp_g) are not important,
    keep SENSOR_DATA_FIXED_LENGTH to the default value (10) to save bandwidth.
    */

    And the parser that already tells you the full movie.

    nicla-sense-me-fw/DataParser.cpp at main · arduino/nicla-sense-me-fw (github.com)

    There is a lot of very interesting information about the sensor on the Bosch website

    BME688 Software | Bosch Sensortec (bosch-sensortec.com)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube