MLX90614 with stm32f103 in arduino IDE Problem

Submitted by mr.rohit on

Hello all,





I am using MLX90614 IR temperature Sensor with stm32f103 controller.

for programming i am using arduino ide.

when i interfaced IR sensor with arduino boards using adafruit mlx90614 library that time sensor works fine.



but when i tried with stm32 controller with same library that time sensor gives some 1037.55 something readings. MLX90614 sensors not work properly with stm32f controller in arduino IDE in my case.



please suggest me any solution for my problem statement.



Thanks a bunch.

The sensor works with PWM and I2C mode. If you want to use it as I2C then use stm32 controller I2C library. I think the I2C is not configured properly.

  Joined February 12, 2018      696
Monday at 02:11 PM

yes sourav i am trying with I2C in STM32f103 using softwire.h library.

i tried with ADXL345,BMP280, and sht31 i2c based sensor works fine on stm32f controller using arduino ide.

means i2c wire configured propperly

but mlx90614 is not working proper in my case

 

thanks and regards,

Rohit

  Joined September 11, 2020      4
Friday at 11:49 AM

yes sourav i am trying with I2C in STM32f103 using softwire.h library.

i tried with ADXL345,BMP280, and sht31 i2c based sensor works fine on stm32f controller using arduino ide.

means i2c wire configured propperly

but mlx90614 is not working proper in my case

 

thanks and regards,

Rohit

  Joined September 11, 2020      4
Friday at 11:49 AM

Well in such case, can you provide the code? So it is useful to debug it.

  Joined February 12, 2018      696
Monday at 02:11 PM

right now i am trying adafruit mlx90614 example from adafruit library.

you can get referance code from adafruit library from below link.

https://github.com/adafruit/Adafruit-MLX90614-Library

 

my code:

 

#include <SoftSerialSTM32.h>

#include <Wire.h>

#include<SoftWire.h>  

#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {

  Serial.begin(9600);

  Serial.println("Adafruit MLX90614 test");  

  mlx.begin();  

}

void loop() {

  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempC()); 

  Serial.print("*C\tObject = "); Serial.print(mlx.readObjectTempC()); Serial.println("*C");

  Serial.print("Ambient = "); Serial.print(mlx.readAmbientTempF()); 

  Serial.print("*F\tObject = "); Serial.print(mlx.readObjectTempF()); Serial.println("*F");

  Serial.println();

  delay(500);

}

  Joined September 11, 2020      4
Friday at 11:49 AM

i am using basic example of adafruit mlx90614 library.

https://github.com/adafruit/Adafruit-MLX90614-Library

in case of stm32 microcontroller

i am using softwire.h library with wire.h

 

  Joined September 11, 2020      4
Friday at 11:49 AM