Pixhawk 2.4.8 with MLX90614 on I2C

Hello,

I connected with sucess a temperature sensor MLX90614 on the I2C port

with Ardupilot Temp following parameters

Here is temperature mesured OK:

When I connect 2 idendical Temperature sensors on the I2C:

with following parameters:

–>I Have issue with temperature 1 (devided by 2) and temperature 2 is empty:

I have tried different TEMP_ADDR adresses (90 for the first and 100 for the second) or Bus number (0 &1) but i have the same issue

I guess there is an I2C conflict –>Does anyone know how it works?

Thanks

Vincent

2 Likes

very cool, i didnt know those sensors were supported, it looks like you need to change the i2c address of the sensors if you want to use more than one.

On the same I2C bus each device must have a seperate HW address.
This cannot be changed just by a parameter on the FC. It must be changed on the device itself. If the module don’t has the possibility to change the address it is not possible to use it on the same bus.
So you can either use to different I2C busses if available. But this also need two HW independent I2C busses on the FC. Or you must change the HW of the sensor.
This MLX90614 has only a single fixed address. So if the module has no additional features it is not possible to use more than one MLX90614 on one I2C bus

Thanks Juergen for your useful response :grinning_face:

In reference with Ardupilot temperature Sensor (site Link), do you think other I2C temperature sensors have the same “adress” conflict (in case of multiple sensors)?

Thanks

Vincent

After a quick look to the datasheets:
MAX31865 is using SPI not I2C
MCP9600 upto eight I2C address are selectable by hardware only
TSYS01 can use either SPI or I2C. On I2C two address are selectable by hardware only
TSYS03 has one fixed I2C address but it is also possible to write an alternative I2C address to the sensor during operation. This address is temporally and is overwritten during a software reset or a hardware restart. I am not sure if this is possible by FC. Therefore the respective application notes must be checked

Hello Geofrancis,

first, those IR senso are supported by the Pixhawk 2.4.8–> have a look to the list of temperature sensors compatible here: link

second, for arduino solution: I can use the MLX90614 (your explanation) or I already tested an Arduino board with thermistor and vibration sensor for measurement


–>The question is “how to connect the Arduino to the Pixhawk and recover data with Mission Planner?

I have seen several information on the web in order to connect the Arduino to RX/TX of the Pixhawk with Telemetry Port (serial mavlink protocol) with code details

–>My question is, how to recover Data exchanged with Mission Planner (I mean wich parameter will pring the information)

I hope the request it is clear enought?

Regards

VIncent

From the datasheet it seems like your Sensor has the option to change the I2C address (smbus) in eeprom.

ok, number of the page in referential document?

and how to do that?

it is a little bit complex for me anyway

regards

ok, which page in document link?

“by harware only” means.. how to do that?

that’s complex operation anyway, I’m not sure I can do it!!

thanks for your attention

I’m studying in parallel analog connection (seams it is possible also with the MLX90614) with or without Arduino…

@YupsUAV is right I am wrong. In principle it is possible to change the address on the MLX90614 by a software protocol. The Datasheet is showing this option on page 17.
https://www.melexis.com/en/documents/documentation/datasheets/datasheet-mlx90614
But this must be done with a seperate setup or tool.
The MCP9600 has a dedicated address pin which is a analog input to the chip. The address can be selected by an external resistor network to this pin. Description in datasheet page 15

I was pointing to that article as they show how to change the I2c address of the sensors. I believe the change is saved so then it can then be plugged into the pixhawk and multiple sensors will work on the same bus

If you don’t mind my asking, what are you monitoring with those sensor? I think those are very interesting sensors but I wouldn’t think monitoring temperatures of drone components as a likely application for non-contact temperature sensing.

1 Like

Hello ddegn, those sensors are just for monitoring engine temperature…maybe I did’nt choose the right one…the MCP9600 could be better if I can changed the address with pin resistance as said Juergen

or I can use a classical thermistor on the arduino+pixhawk solution (no adress conflict and conditions are not extreme!)?

Thanks everyone for your support :grinning_face:

1 Like

Thanks GeoFrancis, I beleive your solution make reference to Code address change for Sensors→Arduino→Pixhawk connections

At the end, once everything connected (RX/TX)&configuredcan you tell me name of sensors measures that can be visualysed in Mission Planner ?

The sensors are i2c , you only need the Arduino board to change the address. Then they will work when plugged into pixhawk i2c.

1 Like

In addition to @geofrancis post, after you changed the I2C address on the MLX90614 with an Arduino (or similar board) you can use the MLX90614 as you tried in front by setting only the correct new addresses to the FC params.

1 Like

Thanks all,

–>I will try then to change I2C address on the MLX90614 (i have 4 therm)

Here is also the article I found: Multiple IR Temperature Sensors - MLX90614 : 4 Steps - Instructables

–>I will managed it with a Nano board…here are Nano pins details for SCL/SDA

Hello,

I have conected the MLX90614 on the I2C port of a Nano:

with I2C-scanner code –> I have identified with success the address: 0x5A

(Program I2C_Scanner.ino)

but when i want to use the program MLX90614_Set_Address.ino inside zip indicated on site (as you said) i have the error: “Failed to communicate with either address.”

this test is not passed on line 46: "therm.begin(oldAddress);

(SparkFunMLX90614 library added from here)

If some one has an idea?

Maybe you did it correct, but you verified a default address 0x5A, while the “set address” sketch uses by default 0x5B as “old address”

Here is set address code i have:

#include <Wire.h> // I2C library, required for MLX90614

#include <SparkFunMLX90614.h> // SparkFunMLX90614 Arduino library

IRTherm therm; // Create an IRTherm object to interact with throughout

const byte oldAddress = 0x5A;

const byte newAddress = 0x5B;

void setup() 

{

  Serial.begin(9600); // Initialize Serial to log output

  Serial.println("Press a key to begin");

  while (!Serial.available()) ;

 therm.begin(oldAddress); // Try using the old address first

  byte address;

  if (!therm.readID()) // Try reading the ID registers

  {

    // If the read fails, try re-initializing with the

    // new address. Maybe we've already set it.

    therm.begin(newAddress);

    if (therm.readID()) // Read from the ID registers

    { // If the read succeeded, print the ID:

      Serial.println("Communicated with new address.");

      Serial.println("ID: 0x" + 

                     String(therm.getIDH(), HEX) +

                     String(therm.getIDL(), HEX));

    }

    else

    {

      Serial.println("Failed to communicate with either address.");      

    }

  }

  else

  {

    // If the read suceeds, change the address to something

    // new.

    if (!therm.setAddress(newAddress))

    {

      Serial.println("Failed to set new address.");

    }

    else

    {

      Serial.println("Set the address to 0x" + String(newAddress, HEX));

      Serial.println("Cycle power to try it out.");

    }

  }

}

void loop() 

{

}
1 Like