Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 1 month ago.
Why none of samples and libraries work with MLX90614
It is couple of days I am trying to get MLX90614 up and running and I couldn't get there. It fails to read the data.I saw people had problem with i2c and repeated start. I tried the read and write api with repeated start still didn't work. I am wondering if anybody succeed to get valid data. with this library and lpc1768 or lpc 1549.
Question relating to:
4 Answers
8 years, 9 months ago.
the data sheet says this is a 5 V part. It will NOT work by just connecting it to a LPC1768 or LPC1549 which are 3.3 v parts you will need some sort of level shifting.
http://www.nxp.com/documents/application_note/AN10441.pdf or some integrated level shifter like https://www.adafruit.com/products/757
8 years, 10 months ago.
I am trying it with a nucleo and end up with the same problem... the read always retuns false.
The12c library is changed at new mbed stack versions. There is na option to set continuous ack Si this is the working code I wrote :
i2c.stop();
wait(0.02);
i2c.start();
wait(0.01);
ch = 0; data[0]=0x00; wait for ack
ch=i2c.write(0x00,data,1,true); device ram address where Tobj value is present
data[0]=0x07;
ch=i2c.write(0xb4,data,1,true);
data[0]=0x00 ;
ch=i2c.read((0xb4|0x01),data,3,true);
i2c.stop(); stop condition
temp_val=((((data[1]&0x007f)<<8)+data[0])*0.02)-0.01;
temp_val=temp_val-273;
wait(0.1);
posted by 07 Mar 20166 years, 7 months ago.
This is sample and library for MLX90614 working both on Mbed2 and Mbed5
Import programMLX90614_Demo
Demo for MLX90614
Import libraryMLX90614
MLX90614 library. Working on both Mbed2 and Mbed5