12-08-2021 12:10 AM
Hello!
I'm currently reading in the sensor data in standalone mode using the following code:
#include "Nicla_System.h"
#include <ArduinoBLE.h>
#include "Arduino.h"
#include "Arduino_BHY2.h"
Sensor temp(SENSOR_ID_TEMP);
Sensor humid(SENSOR_ID_HUM);
Sensor baro(SENSOR_ID_BARO);
void setup()
{
Serial.begin(115200);
while(!Serial);
BHY2.begin();
temp.begin();
humid.begin();
baro.begin();
}
void loop()
{
static auto printTime = millis();
// Update function should be continuously polled
BHY2.update();
if (millis() - printTime >= 1000) {
printTime = millis();
Serial.println(String("Temperature: ") + String(temp.value(),3) + String(" Pressure: ") + String(baro.value(),3) + String(" Humidity: ") + String(humid.value(),3));
}
}
While we are getting readings in COM7, they don't seem to be accurate. Here's a sample output:
18:07:14.424 -> Temperature: 27.010 Pressure: 1004.032 Humidity: 12.000
18:07:15.405 -> Temperature: 27.020 Pressure: 1004.024 Humidity: 12.000
The temperature in the room is measured to be 23 degrees celsius and the humidity is most definitely not 12%. Does anyone know how to calibrate teh sensor or add an offset?
Thanks!
12-08-2021 04:18 AM
Hello riyapatel4400,
When you approach the sensor with a heat source, does the temperature change?