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
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)?
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
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
@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.
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!)?
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.
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);
#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()
{
}