Using multiple TLE493d-w2b6

I am trying to use 4 TLE493d-w2B6 sensors. Each one has a different i2c address (product types: A0, A1, A2, A3). I have tried to use the library posted on Github (GitHub - Infineon/TLE493D-3DMagnetic-Sensor: Library for Infineons's 3D magnetic sensor TLE493D for Arduino.) and I can communicate with one of the sensors on the bus (the 493d w2b6-A0). I can't communicate with the other 3 sensors. Here is the code that I am using. Anyone have any thoughts?

#include<Wire.h>
#include <Tle493d.h>

Tle493d Tle493d_A0 = Tle493d(Tle493d::AccessMode_e::MASTERCONTROLLEDMODE, Tle493d::TypeAddress_e::TLE493D_A0);
Tle493d Tle493d_A1 = Tle493d(Tle493d::AccessMode_e::MASTERCONTROLLEDMODE, Tle493d::TypeAddress_e::TLE493D_A1);
Tle493d Tle493d_A2 = Tle493d(Tle493d::AccessMode_e::MASTERCONTROLLEDMODE, Tle493d::TypeAddress_e::TLE493D_A2);
Tle493d Tle493d_A3 = Tle493d(Tle493d::AccessMode_e::MASTERCONTROLLEDMODE, Tle493d::TypeAddress_e::TLE493D_A3);

void setup()
{
Serial.begin(9600);

Tle493d_A0.begin();
Tle493d_A1.begin();
Tle493d_A2.begin();
Tle493d_A3.begin();

}

void loop()
{

Tle493d_A0.updateData();
Serial.print(Tle493d_A0.getX());
Serial.print(" ; ");
Serial.print(Tle493d_A0.getY());
Serial.print(" ; ");
Serial.println(Tle493d_A0.getZ());
Tle493d_A1.updateData();
Serial.print(Tle493d_A1.getX());
Serial.print(" ; ");
Serial.print(Tle493d_A1.getY());
Serial.print(" ; ");
Serial.println(Tle493d_A1.getZ());
Tle493d_A2.updateData();
Serial.print(Tle493d_A2.getX());
Serial.print(" ; ");
Serial.print(Tle493d_A2.getY());
Serial.print(" ; ");
Serial.println(Tle493d_A2.getZ());
Tle493d_A3.updateData();
Serial.print(Tle493d_A3.getX());
Serial.print(" ; ");
Serial.print(Tle493d_A3.getY());
Serial.print(" ; ");
Serial.println(Tle493d_A3.getZ());
Serial.println("__________________");
delay(1000);
}

Most likely they are not at those addresses.
Can you run a I2C Scanner sketch ?
You should find all four: 0x35, 0x22, 0x78, 0x44.

After that, can you connect just one and test all four (one by one) ?

Some libraries have a little tiny bug, and that prevents it to be use multiple times. Do you know if the library is capable to use multiple sensors ?

If it is still not working after that, please tell us which Arduino board you use, which modules (with a link to them), a photo of the wiring, do you use flat ribbon cable or other cable, and so on.

I used an i2c scanner program to find the correct i2c address of the chips and updated the library to the right address's (the ones that you listed above is what I found as well). The TLE493d chips are on a custom board that I made. I am thinking that the library may not be able to correctly use multiple chip address's or I am not initializing the class correctly to accommodate the change in address. The default address for the class is TLE493D-A0 and that is the chip that I can communicate with currently, no problems. I am using the adafruit esp32 feather board.

Look at the issues: Issues · Infineon/TLE493D-3DMagnetic-Sensor · GitHub.

It has trouble with the Due and Teensy boards. Those are fast processors running at 3.3V, and so is your ESP32.
It has trouble with 4 pieces of those sensors.

I have a strong déjà vu feeling.
This sketch might be extended for four sensors: TLE493D-W2B6 and Arduino (2nd attempt) - Programming Questions - Arduino Forum.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.