Can't initialize onboard temperature sensor

Hi everyone,

I use VS Code and PlattformIO as my primary setup – but also tested the following code with the Arduino IDE (basically modified the provided example). Hardware is the Nano 33 BLE Sense from the Tiny ML Kit. I tried with and without the provided shield. The HTS221 library is the latest from Github vor VS Code and the latest the Arduino IDE provided.

It seems I can't use the temperature sensor - it fails during the setup stage: The console output always ends up in the "Failed to initialize humidity temperature sensor!" part. Is it possible that just the HTS221 part is broken? The barometer example with LPS22HB works fine.

Hopefully, someone can point me into the right direction.

Best regards!

Partial code. The loop() stage would just print out temperature values, but I don't get that far :frowning:

#include <Arduino.h>
#include "Arduino_HTS221.h"

void setup() {
  Serial.begin(9600);
  while (!Serial);

  while (!HTS.begin()) {
  Serial.println("Failed to initialize humidity temperature sensor!");
  delay(1000);
  }
}

If you suspect a hardware problem, please post complete hardware information.

Hi, have you followed all the steps mentioned here?: https://docs.arduino.cc/tutorials/nano-33-ble-sense/humidity-and-temperature-sensor

What information are you missing?

Well, the connections would be a good start... :slight_smile:

My current setup:

Windows 10 notebook – the Nano 33 BLE Sense is connected to a USB and recognized as device oN COM5. When I upload the code in VS Code or the sketch provided by @rooppoorali I get the error that the HTS221 could not be initialized. Example from the web IDE I just tested as well:

I was referring to electronic connections. Unless the HTS221 is an on board feature of the 33 BLE Sense.

Sorry - yes the HTS221 is onboard together with a few other sensors. The microphone I tried as well and it is working. So I am a bit confused.

image

In that case, are there not HTS221 example sketches provided in the IDE with the board support for the Sense?

Yes there are and they fail like in the screenshot I provided earlier.

Are we talking one and the same, or different sketches? The IDE example, some other sourced example? So both examples fail?

Do you have another Sense to try? Maybe it's defective.

Is any additional hardware connected to the board?

No I don't have another module to try. I used the sketch that comes bundles with the library for the HTS221 and Sense. It even says so in the description:

  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

Thanks for clarifying that. It really sounds like a defective board. Unless, maybe there are jumper settings on the board that you can change.

Device returns 2 (NACK) from. I guess it is really broken :frowning:

int HTS221Class::status()
{
  _wire->begin();
  _wire->beginTransmission(HTS221_ADDRESS);
  _wire->write(HTS221_CTRL1_REG);
  _wire->write(0x84);
  return _wire->endTransmission(true);
}

USB determine just Nano BLE, and not Nano BLE Sense. Please verify card, sensor is there, or not: https://docs.arduino.cc/static/19335a6e6e521e84d1ca10dadbc89089/29114/nano33BS_01_temp_sensor.png

Hi,

Thank you for the reply. I resolved the issue meanwhile with official Arduino support. Indeed, the device does not have a temperature sensor at all, which is mentioned as a footnote on the official Arduino page for the Tiny ML Kit. Could be a bit “more prominent” there, and a separate product page for the Arduino Nano 33 BLE Sense Lite would make it easier as well.

The real issue is that many official resellers fail to mention that at all on their websites. They have in their descriptions:

Arduino Nano 33 BLE Sense Lite including sensors for temperature, humidity, …

which is not correct.

Anyway, I learned some valuable insights and will keep looking for something similar with a temperature sensor :wink:

2 Likes

Yes I have and it didn't help. I still get the same error message

hey there
mine problem is when first time I checked the temprature sensor on the board it was working​:grin::ok_hand:.
but little after it didn't work for me.:cry:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.