Hi all,
I’m hoping I can pick your brains for the issue I am having at the moment. I recently purchased the arduino tiny machine learning kit, which comes with the arduino nano 33 ble sense board.
So I plugged that into my laptop to test the onboard sensors. Every sensor works fine except for one, the humidity sensor, using the library HTS221. I used the provided examples with the library, which can be seen below
/*
HTS221 - Read Sensors
This example reads data from the on-board HTS221 sensor of the
Nano 33 BLE Sense and prints the temperature and humidity sensor
values to the Serial Monitor once a second.
The circuit:
- Arduino Nano 33 BLE Sense
This example code is in the public domain.
*/
#include <Arduino_HTS221.h>
float old_temp = 0;
float old_hum = 0;
void setup() {
Serial.begin(9600);
while (!Serial);
if (!HTS.begin()) {
Serial.println("Failed to initialize humidity temperature sensor!");
while (1);
}
}
void loop() {
// read all the sensor values
float temperature = HTS.readTemperature();
float humidity = HTS.readHumidity();
// check if the range values in temperature are bigger than 0,5 ºC
// and if the range values in humidity are bigger than 1%
if (abs(old_temp - temperature) >= 0.5 || abs(old_hum - humidity) >= 1 )
{
old_temp = temperature;
old_hum = humidity;
// print each of the sensor values
Serial.print("Temperature = ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity = ");
Serial.print(humidity);
Serial.println(" %");
Serial.println();
}
// print each of the sensor values
Serial.print("Temperature = ");
Serial.print(temperature);
Serial.println(" °C");
Serial.print("Humidity = ");
Serial.print(humidity);
Serial.println(" %");
// print an empty line
Serial.println();
// wait 1 second to print again
delay(1000);
}
However, I keep getting this message: “Failed to initialize humidity temperature sensor!”. All other library for the board I have installed and try the examples, they ran without any issue except for this one. Is it possible that the board I purchased is not functional?
Arduino reference link: https://docs.arduino.cc/tutorials/nano-33-ble-sense/humidity-and-temperature-sensor