BLE nano 2.0 + I2C (MPU-9250)


#1

Hi, I’m trying to establish an i2c communication between a BLE nano 2.0 and, for instance, an MPU-9250 module.
Has anyone be able to do it using MBED or, even better, the Arduino IDE with the RedBear library for Arduino IDE ( https://github.com/redbear/nRF5x)? Any working example about I2C communication with a BLE nano 2.0 will be really appreciated.

Thank you in advance!


#2

Hi,

You can take a look at our example


#3

Hi Chi,

Many thanks for your help. I could establish an I2C with the BLE nano 2.0 (nRF5x - nRF52832).
In order to trace the data sent to the BLE nano 2.0 (master reader) from an Arduino (master writer) I had to use an FTDI FT232RL USB to TTL Serial Adapter. If connect the BLE nano 2.0 with the DAPLink board to the USB port of my PC the serial communication doesn’t work.

Finally, I’ve been able to establish a communication between a BLE nano 2.0 and an MPU-6050 module and read the data through the serial communication.
I’ve tried to avoid of using the “I2Cdev.h” library with the BLE nano because I get an error. So, I’ve used the short example sketch provided by the Arduino website (http://playground.arduino.cc/Main/MPU-6050). The obtained values don’t seem being correct, they are almost random values. However, I’m still working on it and I hope of finding soon a solution.
Any suggestions is more than welcome!


#4

Does anyone know if exist any valid “I2Cdev.h” library that works with BLEnano 2.0 (nRF5x - nRF52832)?
Unfortunately without it, the values after a few milliseconds, tend to be the same even if the gyroscope is set with a different angle (http://playground.arduino.cc/Main/MPU-60501).


#5

Did you ever end up getting this figured out? I’m struggling to get a MPU-9250 to work with BLE Nano V2 and can’t seem to get anywhere.


#6

Hi,
Did you find a solution? I stuck using this sensor with the redbear nano 2 as well. I don’t know if its from the custom Wire.h lib in the nrf5x file. Any recommendation would be welcome.
Thank you in advance
Michel


#7

Hello. I was able to establish I2C protocol with my BLE nano v2 including communication with LCD and gyro MPU9250. I’m using this library https://github.com/sandeepmistry/arduino-nRF5 and my code follow.
The main problem with nano 2 is that I2C is not working, if the module is connected to programmer with serial link active. You have to unplug it and use it on breadboard!!! There is pin mismatch on the board, it should be mentioned somewhere!!!

#include “MPU9250.h”
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// an MPU9250 object with the MPU-9250 sensor on I2C bus 0 with address 0x68
MPU9250 IMU(Wire,0x68);
LiquidCrystal_I2C lcd(0x27,16,2);

int status;

void setup() {
lcd.init();
lcd.clear();
// serial to display data
Serial.begin(115200);
while(!Serial) {}

// start communication with IMU
status = IMU.begin();
if (status < 0) {
Serial.println(“IMU initialization unsuccessful”);
Serial.println(“Check IMU wiring or try cycling power”);
Serial.print("Status: ");
Serial.println(status);
while(1) {}
}
}

void loop() {
// read the sensor
lcd.clear();
lcd.print(“GyroY rads”);
lcd.setCursor(0,1);
IMU.readSensor();
// display the data

lcd.print(IMU.getGyroY_rads(),6);

delay(100);
}


Unable to use I2C with BLE Nano 2 (Arduino)