I am trying to set up an MLX90614 sensor on the CubeCell however having no luck with getting any communications at all. If I do an i2c scan I can retrive the address of the sensor but it looks like that is all. Any register I try to read seems to just return FFFF
Initialy I thought that the issue was the i2c however I managed to find a BMP280 and that seems to be running OK.
The next step was to see if i could communicate directly with the MLX sensor directly using the Wire lib. Sadly the same issue.
#include “LoRaWan_APP.h”
#include “Arduino.h”
#include <Wire.h>#define MLXADDRESS 0x5A
// RAM
#define MLX90614_RAWIR1 0x04
#define MLX90614_RAWIR2 0x05
#define MLX90614_TA 0x06
#define MLX90614_TOBJ1 0x07
#define MLX90614_TOBJ2 0x08uint16_t ret;
void setup() {
Serial.begin(115200);
pinMode(Vext,OUTPUT);
digitalWrite(Vext,LOW);//set vext to high
delay(500); //just to make sure the sensor has powered upWire.begin();
}void loop() {
Wire.beginTransmission((uint8_t)MLXADDRESS); // start transmission to device
Wire.write((uint8_t)MLX90614_TOBJ1); // sends register address to read from
Wire.endTransmission();
Wire.requestFrom((uint8_t)MLXADDRESS, 3);// send data n-bytes read
ret = Wire.read(); // receive DATA
ret |= Wire.read() << 8; // receive DATA
Serial.println(ret, HEX);
delay(1000);
}
Does anyone have any sugestions on this?