The Arduino Nano 33 BLE Sense Rev2 (Part: ABX00069) is a powerhouse for edge computing, packing a 9-axis IMU, environmental sensors, and a microphone into a 45x18mm footprint. However, the transition from Rev1 to Rev2 changed the underlying sensor silicon, breaking countless legacy tutorials. This guide targets the Rev2 variant specifically, walking you through building a standalone inertial and environmental data logger with onboard MicroSD storage.

Difficulty: Intermediate | Time: 45 Minutes | Target Board: Arduino Nano 33 BLE Sense Rev2 (nRF52840)

Parts List and Board Specifications

Before wiring, verify your board revision. The Rev2 board swaps the STMicroelectronics sensors used in Rev1 for Bosch and Renesas alternatives. If you attempt to compile Rev1 libraries on a Rev2 board, you will hit immediate I2C initialization faults.

Required Hardware

  • Microcontroller: Arduino Nano 33 BLE Sense Rev2 (ABX00069) - ~$65.00
  • Storage: Adafruit MicroSD Card Breakout Board+ (Product ID: 254) - ~$7.50
  • Power: 3.7V LiPo Battery (500mAh minimum) with JST-PH 2.0 connector - ~$8.00
  • Media: Class 10 MicroSD Card (8GB to 32GB, FAT32 formatted)
  • Wiring: 24 AWG solid core jumper wires, half-size breadboard
Safety Note: When working with raw LiPo cells, never discharge below 3.0V or charge above 4.2V. The Nano 33 BLE Sense has an onboard BQ24074 charge controller, but it lacks deep-discharge protection. Always pair it with a protected LiPo cell or an external fuel gauge.

Sensor Silicon: Rev1 vs Rev2 Comparison

Sensor TypeRev1 (ABX00031)Rev2 (ABX00069)Required Rev2 Library
9-Axis IMUST LSM9DS1Bosch BMI270 + BMM150Arduino_BMI270_BMM150
Humidity/TempST HTS221Renesas HS3003Arduino_HS300x
Barometric PressureST LPS22HBST LPS22HBArduino_LPS22HB
Gesture/ProximityBroadcom APDS9960Broadcom APDS9960Arduino_APDS9960

Pin Mapping and Wiring Guide

The Nano 33 BLE Sense operates strictly at 3.3V logic. Feeding 5V into any digital I/O pin will permanently damage the nRF52840 SoC. The Adafruit MicroSD breakout includes a 3.3V voltage regulator and logic level shifters, making it safe to interface with the 3.3V SPI bus.

MicroSD Breakout PinNano 33 BLE Sense PinFunction
VIN (or 5V)5V (or VUSB)Power input for SD regulator
3VNot ConnectedLeave floating (output only)
GNDGNDCommon ground
CLKD13 (SCK)SPI Clock
DOD12 (CIPO/MISO)Master In, Slave Out
DID11 (COPI/MOSI)Master Out, Slave In
CSD10SPI Chip Select

Note: While the nRF52840 supports multiple SPI instances, using the default hardware SPI pins (D11, D12, D13) ensures maximum transfer speeds and compatibility with the standard Arduino SD.h library.

Complete Data Logger Firmware

The following code targets the Arduino Nano 33 BLE Sense Rev2. It initializes the BMI270 IMU and HS3003 environmental sensor, then logs the data to the MicroSD card at 10Hz. Error handling is built into the setup() loop to halt execution and report faults via the Serial Monitor if hardware initialization fails.

#include <Arduino_BMI270_BMM150.h>
#include <Arduino_HS300x.h>
#include <SD.h>

// Pin Definitions
const int SD_CS_PIN = 10;
const int LED_ERROR_PIN = LED_BUILTIN;

// Data logging interval (milliseconds)
const unsigned long LOG_INTERVAL = 100; 
unsigned long lastLogTime = 0;

File dataFile;

void setup() {
  Serial.begin(115200);
  while (!Serial) {
    ; // Wait for serial port to connect (needed for native USB)
  }

  pinMode(LED_ERROR_PIN, OUTPUT);

  // Initialize IMU (BMI270 + BMM150)
  if (!IMU.begin()) {
    Serial.println("ERROR: Failed to initialize IMU!");
    blinkError(3);
    while (1); // Halt execution
  }
  Serial.println("IMU initialized successfully.");

  // Initialize Environmental Sensor (HS3003)
  if (!HS300x.begin()) {
    Serial.println("ERROR: Failed to initialize HS3003 Humidity/Temp sensor!");
    blinkError(4);
    while (1);
  }
  Serial.println("HS3003 initialized successfully.");

  // Initialize SD Card
  if (!SD.begin(SD_CS_PIN)) {
    Serial.println("ERROR: SD card initialization failed! Check wiring and FAT32 format.");
    blinkError(5);
    while (1);
  }
  Serial.println("SD card initialized.");

  // Open file for appending
  dataFile = SD.open("datalog.csv", FILE_WRITE);
  if (dataFile) {
    // Write header if file is empty
    if (dataFile.size() == 0) {
      dataFile.println("Timestamp_ms,Accel_X,Accel_Y,Accel_Z,Gyro_X,Gyro_Y,Gyro_Z,Temp_C,Humidity_Pct");
    }
    dataFile.close();
  } else {
    Serial.println("ERROR: Could not open datalog.csv for writing.");
    while (1);
  }
}

void loop() {
  unsigned long currentTime = millis();

  if (currentTime - lastLogTime >= LOG_INTERVAL) {
    lastLogTime = currentTime;

    float ax, ay, az, gx, gy, gz;
    float temp, humidity;

    // Read IMU data
    if (IMU.accelerationAvailable() && IMU.gyroscopeAvailable()) {
      IMU.readAcceleration(ax, ay, az);
      IMU.readGyroscope(gx, gy, gz);

      // Read Environmental data
      temp = HS300x.readTemperature();
      humidity = HS300x.readHumidity();

      // Write to SD
      dataFile = SD.open("datalog.csv", FILE_WRITE);
      if (dataFile) {
        dataFile.print(currentTime);
        dataFile.print(","); dataFile.print(ax);
        dataFile.print(","); dataFile.print(ay);
        dataFile.print(","); dataFile.print(az);
        dataFile.print(","); dataFile.print(gx);
        dataFile.print(","); dataFile.print(gy);
        dataFile.print(","); dataFile.print(gz);
        dataFile.print(","); dataFile.print(temp);
        dataFile.print(","); dataFile.println(humidity);
        dataFile.close();
      }
    }
  }
}

// Helper function to blink LED on fatal errors
void blinkError(int count) {
  for (int i = 0; i < count; i++) {
    digitalWrite(LED_ERROR_PIN, HIGH);
    delay(250);
    digitalWrite(LED_ERROR_PIN, LOW);
    delay(250);
  }
}

Debugging: Resolving IMU and I2C Initialization Faults

When working with the Nano 33 family, I2C bus lockups and library mismatches are the most common points of failure. If your Serial Monitor outputs ERROR: Failed to initialize IMU!, follow this diagnostic path.

The First Three Things to Check

  1. Verify the Board Revision and Library: Open the Arduino IDE Boards Manager. Ensure you have the Arduino_BMI270_BMM150 library installed. If you are using Arduino_LSM9DS1, it will compile but fail at runtime on a Rev2 board.
  2. Check the I2C Pull-up Resistors: The Nano 33 BLE Sense routes its internal sensors to the external I2C header (pins A4/A5). If you have external sensors connected that are dragging the bus low, or if the internal pull-ups are disabled via software, the internal IMU will fail to enumerate.
  3. Inspect the 3.3V Rail: The onboard IMU requires a clean 3.3V supply. If you are powering the board via a weak USB hub or a damaged cable, the voltage may droop below 3.0V during IMU startup, causing the BMI270 to brown out and reject I2C addressing.

Ranked Causes for 'Failed to initialize IMU!'

RankCauseFix / Measurement
1Wrong Library for Rev2Replace Arduino_LSM9DS1 with Arduino_BMI270_BMM150 in the Library Manager.
2I2C Bus CollisionDisconnect all external devices from A4 (SDA) and A5 (SCL). Re-test.
3Corrupted Core VariantUpdate the 'Arduino Mbed OS Nano Boards' core to the latest version (3.x+).
4Hardware Defect (Cold Solder)Measure continuity from the BMI270 VCC pad to the 3.3V rail. Should read < 1 ohm.
Pro-Tip for I2C Debugging: If the bus is locked, the nRF52840 can sometimes get stuck in a state where the I2C peripheral refuses to reset. Power cycle the board completely (remove USB and battery) for 10 seconds to drain the capacitors and force a hard reset of the sensor silicon.

Extending and Simplifying the Build

Depending on your project constraints, you may need to alter the architecture of this data logger.

How to Simplify (Drop the SD Card)

If you don't need long-term standalone storage, remove the MicroSD breakout and stream the data over Bluetooth Low Energy (BLE). Use the ArduinoBLE library to create a custom BLE service with characteristics for Acceleration and Temperature. This reduces power consumption by roughly 40% and eliminates SPI bus overhead, allowing you to push the IMU sampling rate to 100Hz+.

How to Extend (Edge Machine Learning)

The nRF52840 features 1MB of Flash and 256KB of RAM, which is sufficient for running TinyML models. Use Edge Impulse to capture gesture data via the BMI270, train a neural network, and export it as an Arduino C++ library. Replace the SD logging loop with an inference loop that triggers a digital pin when a specific motion signature (like a 'wave' or 'drop') is detected.

Frequently Asked Questions

What is the difference between Arduino Nano 33 BLE Sense and Nano 33 IoT?

The Nano 33 BLE Sense uses the Nordic nRF52840 SoC, features Bluetooth 5.0, and includes a dense array of onboard environmental and motion sensors. It is designed for edge AI and sensor fusion. The Nano 33 IoT uses a Microchip SAMD21 Cortex-M0+ paired with an ESP32 module for WiFi and Bluetooth 4.2, and lacks onboard environmental sensors. Choose the IoT variant if your project requires WiFi connectivity and HTTP requests; choose the BLE Sense for low-power, sensor-heavy, offline, or BLE-mesh applications.

Can I power the Arduino Nano 33 BLE Sense directly with 5V on the VIN pin?

No, the Nano 33 BLE Sense Rev2 does not have a traditional VIN regulator like the older Nano V3. The pin labeled '5V' is an output when powered via USB, or an input if you solder the VUSB jumper pad on the bottom of the board. To power it from a 5V source without USB, you must bridge the VUSB pad on the underside, then feed 5V into the 5V pin. Alternatively, feed a regulated 3.3V directly into the 3.3V pin, bypassing the USB circuitry entirely.

How do I reduce power consumption on the Arduino Nano 33 for battery projects?

Out of the box, the board draws roughly 25mA. To drop this into the microamp range for LiPo battery longevity: 1) Turn off the power LED by desoldering the resistor or cutting the trace. 2) Use the NRF_POWER->SYSTEMOFF = 1; command to put the nRF52840 into deep sleep, waking it via an interrupt on the BMI270's INT1 pin. 3) Ensure no external sensors are pulling current from the 3.3V rail when the board is asleep. With these optimizations, you can achieve a sleep current of under 15µA.

Why is my Serial Monitor printing garbage characters or failing to connect?

The Nano 33 BLE Sense uses native USB via the nRF52840, not a separate USB-to-Serial IC like the ATmega16U2 on older boards. If the firmware crashes before Serial.begin(), or if the Mbed OS core hangs, the USB CDC enumeration will fail. Double-tap the reset button quickly to force the board into bootloader mode (the LED will pulse), then re-upload a known-good sketch like 'Blink' to restore USB communication.