The Arduino Nano 33 BLE Sense Rev2 packs a 9-axis IMU, environmental sensors, and an nRF52840 BLE radio into a 45x18mm footprint. Unlike the original Rev1, the Rev2 upgrades the motion sensor suite and alters internal power routing, meaning older codebases will fail to compile or initialize. This guide walks through building a low-power BLE telemetry beacon, providing exact pinouts, compilable C++ code targeting the Rev2 hardware, and hardware-level debugging for its specific sensor suite.

Arduino Nano 33 BLE Sense Rev2: Sensor Specs and Power Profile

Before wiring external components, you must understand the internal I2C bus architecture. The Rev2 routes all onboard sensors to a dedicated internal I2C bus, leaving the external SDA/SCL pins (D18/D19) free for your own peripherals. This prevents address collisions and bus capacitance issues that plagued early Rev1 prototypes.

Onboard Sensor Suite and Power Draw (Rev2 ABX00069)
Sensor IC Function Interface / Address Active Current Measurement Range
BMI270 6-Axis IMU (Accel/Gyro) I2C (0x68) 0.68 mA (normal) ±16g / ±2000°/s
BMM150 3-Axis Magnetometer I2C (0x10) 0.5 mA ±1300 µT
LPS22HB Barometric Pressure I2C (0x5C) 0.04 mA (1Hz) 260 - 1260 hPa
HTS221 Temp / Humidity I2C (0x5F) 0.01 mA (1Hz) -40 to 85°C / 0-100% rH
APDS9960 Proximity / Light / Gesture I2C (0x39) 0.3 mA (LED off) 10 - 2000 µW/cm²
MP34DT05 Omnidirectional Mic PDM (D22/D23) 1.2 mA 120 dB SPL AOP
Rev1 vs Rev2 Critical Difference: The Rev1 used the STMicroelectronics LSM9DS1. The Rev2 uses the Bosch BMI270 and BMM150. If you attempt to compile Rev1 code using Arduino_LSM9DS1.h on a Rev2 board, the I2C initialization will silently fail, returning 0 on IMU.begin(). Always use the Arduino_BMI270_BMM150 library for Rev2.

Parts List and Pin Mapping for BLE Telemetry

This build creates a standalone beacon powered by a lithium-polymer cell, transmitting temperature and vibration data over BLE. We avoid the onboard USB regulator to minimize quiescent current draw during sleep states.

Bill of Materials

  • Microcontroller: Arduino Nano 33 BLE Sense Rev2 (Part# ABX00069)
  • Power: 3.7V 500mAh LiPo with JST-PH 2.0 connector (e.g., Adafruit 1570)
  • Enclosure: Hammond 1593VBU (43x22x14mm, fits Nano + thin LiPo)
  • Decoupling: 100µF 16V X7R Ceramic Capacitor (0805 SMD or radial)

Pin Mapping and Internal Routing

Function Physical Pin nRF52840 Port Notes
External I2C SDA D18 P0.14 Has 4.7kΩ internal pull-ups enabled by default
External I2C SCL D19 P0.15 Do not use for analog input
PDM Mic Clock D23 P0.17 Routed internally to MP34DT05
PDM Mic Data D22 P0.16 Routed internally to MP34DT05
Battery Input (VBAT) 3.3V Pin VDD Feed regulated 3.3V or raw LiPo (board has diode)
RGB LED Blue LEDB P0.24 Active LOW (write LOW to turn on)

Compilable Code: BLE Environmental and Motion Beacon

The following C++ code targets the Arduino Nano 33 BLE Sense Rev2 specifically. It initializes the BMI270 IMU and HTS221 climate sensor, wraps them in a custom BLE service, and broadcasts the data. It includes explicit error handling: if the IMU fails to initialize, the blue LED will strobe rapidly; if the BLE radio fails, it halts and prints to Serial.

#include <ArduinoBLE.h>
#include <Arduino_BMI270_BMM150.h>
#include <Arduino_HTS221.h>

// Custom BLE Service and Characteristics (UUIDs generated via uuidgen)
BLEService sensorService("19B10000-E8F2-537E-4F6C-D104768A1214");
BLEFloatCharacteristic tempChar("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLENotify);
BLEFloatCharacteristic accelChar("19B10002-E8F2-537E-4F6C-D104768A1214", BLERead | BLENotify);

// Pin definitions for Rev2 onboard LED (Active LOW)
#define STATUS_LED LEDB

void setup() {
  Serial.begin(115200);
  // Wait for serial monitor to open (optional, remove for standalone battery use)
  // while (!Serial); 

  pinMode(STATUS_LED, OUTPUT);
  digitalWrite(STATUS_LED, HIGH); // Turn off (Active LOW)

  // 1. Initialize Rev2 IMU (BMI270 + BMM150)
  if (!IMU.begin()) {
    Serial.println("FATAL: Failed to initialize BMI270 IMU!");
    // Blink LED rapidly to indicate hardware I2C failure
    while (1) { 
      digitalWrite(STATUS_LED, !digitalRead(STATUS_LED)); 
      delay(100); 
    }
  }

  // 2. Initialize Climate Sensor
  if (!HTS.begin()) {
    Serial.println("WARNING: Failed to initialize HTS221!");
  }

  // 3. Initialize nRF52840 BLE Radio
  if (!BLE.begin()) {
    Serial.println("FATAL: BLE.begin() returned 0! Radio failure.");
    while (1);
  }

  // Configure BLE Advertising
  BLE.setLocalName("Nano33Rev2_Beacon");
  BLE.setAdvertisedService(sensorService);
  
  sensorService.addCharacteristic(tempChar);
  sensorService.addCharacteristic(accelChar);
  BLE.addService(sensorService);
  
  BLE.advertise();
  Serial.println("BLE Beacon active. Waiting for central...");
}

void loop() {
  BLEDevice central = BLE.central();

  if (central) {
    digitalWrite(STATUS_LED, LOW); // Turn ON LED when connected
    float x, y, z, temp;
    
    // Poll IMU at ~100Hz default rate
    if (IMU.accelerationAvailable()) {
      IMU.readAcceleration(x, y, z);
      // Transmit magnitude of X-axis for simplicity
      accelChar.writeValue(x);
    }
    
    // Poll Temperature (HTS221 updates at 1Hz internally)
    temp = HTS.readTemperature();
    tempChar.writeValue(temp);
    
  } else {
    digitalWrite(STATUS_LED, HIGH); // Turn OFF LED when disconnected
  }
  
  delay(50); // Yield to nRF52840 RTOS stack
}

Debugging: First Three Things to Check When It Fails

When working with the nRF52840 and dense I2C buses, failures usually manifest in three specific ways. Here are the first three things to check, ranked by likelihood.

1. Compilation Error: Missing or Incorrect IMU Library

Exact Error String: fatal error: Arduino_BMI270_BMM150.h: No such file or directory (or conversely, code compiles but IMU.begin() returns 0 at runtime).

Ranked Causes & Fixes:

  1. Wrong Library Installed: You are using the Rev1 library (Arduino_LSM9DS1). Open the Library Manager, uninstall LSM9DS1, and install Arduino_BMI270_BMM150.
  2. Board Package Mismatch: You have an outdated Arduino mbed OS Nano Boards core. Update to version 4.0.8 or newer via the Boards Manager to ensure the Rev2 I2C routing patches are applied.

2. Runtime Error: BLE Radio Initialization Failure

Exact Error String: FATAL: BLE.begin() returned 0! Radio failure. (Printed to Serial, board halts).

Ranked Causes & Fixes:

  1. 3.3V Rail Brownout: The nRF52840 draws up to 15mA spikes during BLE transmission. If powered solely via a weak USB hub or a depleted LiPo, the voltage sags below 2.7V, triggering the radio's internal brownout reset. Fix: Solder a 100µF X7R ceramic capacitor directly across the 3.3V and GND pins on the header.
  2. Antenna Proximity: The PCB trace antenna on the Rev2 is highly sensitive to ground plane encroachment. If you mounted the board flat against a metal chassis or copper tape, the VSWR spikes and the radio refuses to initialize. Fix: Maintain a 5mm keep-out zone around the antenna trace.

3. Runtime Error: IMU I2C Bus Lockup

Exact Error String: FATAL: Failed to initialize BMI270 IMU! (Blue LED strobes rapidly).

Ranked Causes & Fixes:

  1. External I2C Drag: You connected external sensors to D18/D19 without realizing the Rev2 internal bus is separate. However, if you bridged them or added long unshielded wires, bus capacitance exceeds 400pF. Fix: Add 2.2kΩ external pull-ups to 3.3V on your external SDA/SCL lines.
  2. USB-C Power Negotiation: Some USB-C to USB-A cables lack the CC resistors required to negotiate power properly with the Nano's USB-C port, causing intermittent boot states where the I2C multiplexer doesn't latch. Fix: Use a verified USB-C data cable or power via the 3.3V pin directly.

Extending and Simplifying the Build

Depending on your deployment environment, you may need to scale this architecture up for industrial logging or down for ultra-low-power coin-cell operation.

How to Extend: Add Local SPI Flash Logging

BLE range is limited to ~15 meters indoors. To prevent data loss when the beacon is out of range, add a W25Q128JVSIQ (128M-bit SPI Flash) chip. Wire it to the Nano's external SPI pins (D12 MISO, D11 MOSI, D13 SCK, D10 CS). Use the SerialFlash library to buffer IMU readings at 50Hz, then burst-transmit the logged CSV blocks when a BLE central reconnects. This increases average current draw by ~2mA but guarantees zero data loss.

How to Simplify: Advertising-Only Mode

If you only need to broadcast temperature to a nearby smartphone and don't care about two-way communication or high-speed IMU data, drop the BLEService entirely. Instead, pack the 16-bit temperature integer into the BLE Manufacturer Data advertising packet. This eliminates the connection handshake overhead, allowing the nRF52840 to sleep for 99% of the duty cycle. A 500mAh LiPo will last over 6 months in this advertising-only mode, compared to ~48 hours in connected mode.