Send Accelerometer data from Arduino nano 33 ble sense data to laptop using BLE

Hello everyone,

I want to send accelerometer data from Arduino nano 33 ble sense data to laptop using BLE, will it be possible using an application like NRF connect, or any other similar application, as I require the data on a terminal.

Also what change will I have to make to the code I am already using:

#include <Arduino_LSM9DS1.h>

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

  if (!IMU.begin()) {
    Serial.println("Failed to initialize IMU!");
    while (1);
  }

  Serial.print("Accelerometer sample rate = ");
  Serial.print(IMU.accelerationSampleRate());
  Serial.println(" Hz");
  Serial.println();
  Serial.println("Acceleration in g's");
  Serial.println("X\tY\tZ");
}

void loop() {
  float x, y, z;

  if (IMU.accelerationAvailable()) {
    IMU.readAcceleration(x, y, z);

    Serial.print(x);
    Serial.print('\t');
    Serial.print(y);
    Serial.print('\t');
    Serial.println(z);
  }
}

Thank you very much !!

in a recent project using a LSM9DS1 I used Microchip transparent UART to transmit 50samples/second over BLE to an Android phone
try doing a web search for arduino ble serial and Arduino nano 33 ble you will get plenty of links to sample projects

Edit: used a ESP32 to communicate over Bluetooth Classic with a desktop PC

  1. loaded File>Examples>BluetoothSerial>SerialToSerialBT
  2. did a Bluetooth scan on desktop and connected to device ESP32test
  3. ran Teraterm terminal emulator
  4. the ESP32 appears as a COM port
  5. opened COM port and could send text between the ESP32 and desktop

simillarly connected ESP32 to Android phone running Bluetooth serial app

if you are using a ESP32 and are interested in BLE have a look at File>Examples>ESP_BLE_Arduino>BLE_uart
connects to BLE_Terminal app on an Android phone to exchange text messages

This should help... achieved about 100 samples per second. Created a custom characteristic on nano 33 BLE peripheral and used ESP32 BLE as central device attached to laptop via USB.

It sounds like you have two separate issues.

First, regarding the a BLE app on the PC I see that both nrfConnect and LightBlue have desktop/pc versions. Try and get the basic BLE library example like BatteryMonitor to work with the PC version of the BLE app.

Then, when you have the BLE app on the computer worked out, you can write you own custom service and characteristic for the accelerometer data.

Have you written any BLE programs using ArduinoBLE.h? If not, then you need to begin with some basic tutorials on the web about how to work with BLE.

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