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);
}
}
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
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.
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.