On REV 2 of the Nano 33 BLE Sense the sensors have been replaced, so new libraries need to be used when updating from the previous version of the board.
LSM9DS1 (9 axis) IMU Inertial Measurement Unit sensor is replaced by BMI270 (6 axis Accelerometer and Gyroscope) and BMM150 (3 axis Magnetometer). A new library is available as Arduino_BMI270_BMM150.h.
The HTS221 temperature and humidity sensor is replaced by a HS3003 sensor.
For the new IMU this is the basic code to get the readouts:
// updated from the sample code for the original board by Riccardo Rizzo
// update the library from Arduino_LSM9DS1.h to this:
#include <Arduino_BMI270_BMM150.h>
// x, y and z are on a scale of -8192 to +8192;
// x and z are the fraction of the gravitational pull, so not the angle; y = rotational force
float s, x, y, z;
String oBuf = "";
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("Started");
if (!IMU.begin()) {
Serial.println("Failed to initialize IMU! Halted.");
while (1);
}
}
void loop() {
if (IMU.accelerationAvailable()) {
IMU.readAcceleration(x, y, z);
s = IMU.accelerationSampleRate();
}
oBuf = String(s) + " " + String(x) + " " + String(y) + " " + String(z);
Serial.println(oBuf);
}
Hi! did you have time to test the new modules? I am pretty interested in the IMU (I use mine a lot of my nano BLE).
do you think a separate magnetometer give more accurate results, or just simpler to communicate with ?
Hi i have bought both of the nano 33 ble sense, and what really sucks is i havent found a good library, The library thats given above, actually for either of the BLE sense , only gives the raw analog data. Which means it has to be calibrated and filtered and fused... Paul mcwhorter on you tube has a good imu tutorial. What I really want is solid quaternion data like you can get with the BNO055 or the Waveshare 10dof(MPU9255) , those modules are great. i think the accuracy will only depend on the calibration code. I may try to write my self , The data sheet for BMI270 is over 170 pages. I got reading to do .
I see you're looking for accuraute measure and high level calibration!
To write your own library must not be so complicated: I wrote mine for LSM9DS1 (and LSM6DS for the nano 33IOT) using examples as models. This way, I export data the way I want (And I have work left to handle it properly!)
For sure, the data sheet is mandatory if you want to get the best of your module! And I bet you will find into some critical info!
im not even sure i want to start it . I feel like someone else is already writing one , and they probably have better coding skills than me. But I know i will learn alot if I try it. With so many projects out there its hard to decide what to focus my time on. good day to you GrandPete, I think these nano 33 modules have alot to offer , i just didnt realize there were no formal libraries.
Yes I did. Resolution of the accelerometer is -8192 to 8192. That is pretty impressive and it is quite fast, but also very instable. Just leaving the board on you desk gives 90 readings per second with variations of 20 points. Fine for my purposes, but it could be a killer for some applications.