Go Down

Topic: i2cdevlib + MS561101BA + due (Read 5731 times) previous topic - next topic


Hi I try to talk to an MS561101BA on the due.

The newest version of i2devlib works well on the due with HMC5883L MPU6050 and BMP085.

For the MS561101BA  I use the library made by Manuel J Guisado using i2devlib, which works just fine on the arduino uno.

There is no example but this is an minimal one which works on the uno (sensor powered with 3.3V and pullups disabled):
Code: [Select]

#include "Wire.h"
#include "I2Cdev.h"
#include "MS561101BA.h"
MS561101BA baro(0x77); // address of the sensor on freeimu 0.4
float pressurem;
float temperaturem;

void setup() {
    Serial.println(baro.testConnection() ? "baro connection successful" : "baro connection failed");
    // this gives false positive value on the due I think due to the problems with wire ?

void loop() {
baro.readValues(&pressurem, &temperaturem);
Serial.print(pressurem); Serial.print("\t");
Serial.print(temperaturem); Serial.println("\t");

I get no error message while uploading to the due, but it only prints 0 values for temperature and pressure.

Any idea is appreciated.


Ok, I still have no success with the i2cdevlib but i manged to use the MS5611 using Flavio Varesano freeimu libary.
After some minor changes the raw reading function of the libary works well on the due.


I have exactly the same setup and facing the same problems. Can you please post a link to the library you have used? What have you changed?

Best regards,


You can find the original libary here:
It is not form me. I am not at home now, so I can not send you the changed one, but it is mainly replacing the int with int16_t.



Here is a copy of FreeIMU with the last updates Fabio made.


This was ported and tested on Teensy 3.0, which has a similar 32 bit ARM CPU as Arduino Due.  The 16 bit integer problems are fixed in this version.  AVR-only hacks like TWBR are surrounded by #ifdef checks.  A difficult problem with the inverse square root function when compiling on ARM was also fixed.

It hasn't been tested on Arduino Due, but those fixes for Teensy 3.0 will probably save you a lot of trouble, hopefully leaving only relatively easy stuff to support Due.


I'll give it a try and keep you posted on the results.


Did anyone manage to get the MS561101BA working with the Due?

I've spent 10 hours, trying absolutely everything but to no avail  :(


On some boards, you have to put a blob of solder on the board in order to select i2c.  So make sure that you can see the device with i2cscanner.

Also, the due has problems with i2c. If you can't see it with i2cscanner, then you have to use a modified Wire.h file - https://raw.githubusercontent.com/bluesign2k/Arduino/d8d6d62853a5308c21b95dad4bdd64e358e857cc/hardware/arduino/sam/libraries/Wire/Wire.cpp


Jun 12, 2014, 08:53 am Last Edit: Jun 12, 2014, 09:03 am by Hammad32 Reason: 1
Please somebody provide help in detail. I have the same issue with MS5611A2 (GY-63 breakout board). I2C scanner does not detect the device but it works fine on Uno board. Your help will be really appreciated as my project deadline is near. And also please mention if i should use any circuitry with the baro or i can connect it directly. Thank you


Here's a copy of FreeIMU where I've applied fixes for bugs people have discovered when used on Teensy 3.0 and 3.1.


I have no idea if this will solve your problems on Arduino Due, but since Teensy 3.1 & Due use similar ARM Cortex-M chips, it might be worth a try?

Go Up