top of page
Search
  • Writer's pictureIfrim Ciprian

Nicla Sense ME - Main Sensors Filtering

The 3 main sensors that are used for any of the formulas to compute additional outputs.

These 3 main sensor readings are:

  1. Temperature

  2. Pressure

  3. Humidity

So in order to make sure the values are calibrated and accurate, I perform 2 systems:

  1. The first system takes 10 values every 50 milliseconds, for all 3 values, and creates a sum.

  2. Then the sum is being divided by 10 and multiplied by 0.8 and 1.2, in order to get the upper bound threshold as 120% and the lower bound threshold as 80%.

  3. Then if the new reading is within the 80-120%, which represends the outlier threshold, I take the value and add it to the EWMP filter, which uses a specific alpha value for the filtering, and I perform that 10 times every 100ms.


Moreover, to make sure the temperature is at the highest accuracy, I also run temperature fusion between the 2 temperature sensors available on the nicla in the form of the BMP390 and BME688.


These values are then put into the regression equations found 1 month ago.

float temperature_BMP390_regressed  = (1.0095 * temperature_BMP390_filtered) - 4.8051;                                                                                            
float temperature_BME688_regressed  = (1.0095 * temperature_BME688_filtered) - 4.8051;                                                                                            
float temperature_regressed_fusion  = (temperature_BMP390_regressed + temperature_BME688_regressed) / 2;                                                                         
float temperature_fusion_fahrenheit = (temperature_regressed_fusion * 9 / 5) + 32;                                                                                                
float pressure_BMP390_regressed     = 1.00718 * pressure_BMP390_filtered;                                                                                                         
uint8_t humidity_BME688_regressed   = round((1.4383 * humidity_BME688_filtered) - 2.5628);                                                                                        

The following is the output:


However, the first value is always empty:

In order to fix this, I have added a 5 seconds delay at the beginning of the setup part of the code, for the sensors to engage and update.

1 view0 comments

Recent Posts

See All
bottom of page