Due I2c with MLX90621 not working

Hi everyone,

I made a sketch to print data from the MLX90621 via I2C to the serial together with a timestamp and sampling time. It worked perfectly on the Arduino uno, but on the Due it gives a lot of problems.

Can someone help me with my problem? I already tried to change the wire library with searching on forums but than I get a compiling error.

Here is my code:

#include <Arduino.h>
#include "MLX90621_due.h"
#include <Wire.h>

MLX90621 sensor;

void sendTemperatures(){

Serial.print(millis());
Serial.print(",");
for(int y=0;y<4;y++){ //go through all the rows
for(int x=0;x<16;x++){ //go through all the columns
Serial.print(sensor.getTemperature(y*4+x)); // extract the temperature at position x/y
Serial.print(",");}
}
Serial.print("\n");
}

void setup(){
delay(500);
Serial.begin(230400);
sensor.setRefreshRate(RATE_32HZ);
sensor.setResolution(RES_15bit);
sensor.setEmissivity(0.8);
sensor.initialize ();
Serial.println(F("sensor initialized. LET'S GO!"));
delay(3000);
}

void loop(){
long startTime = micros();

sensor.measure(true); //
sendTemperatures();

long elapsed = micros() - startTime;
Serial.print("measure time = ");
Serial.print((float)elapsed/1000);
Serial.println("ms");
}

See link for wiring. google drive link
Hope someone can help.

Is this because of 3.3 V logic vs 5 V logic?

A picture is not a schematic.

Do you add pull-ups on SDA/SCL lines ?

Here is the schematic I used for my UNO and that worked.

https://drive.google.com/open?id=1Rl5MiKo5lyuctCVDqW8i2KaZAfCwzfYo

But now with the due I get all very high 'temperatures' for every thermopixel (460°C).

On a DUE SDA/SCL ahve already pull-ups, furthermore your breakout board should be powered with 3.3V, not 5V. I read.

yes I use 3.3v for powering the breakout board

Do I need to use pinMode(20, INPUT_PULLUP) ?

Cam I get workable code for arduino