Hello, i have checked all my phisical wiring and everyhting without trouble, but I still can not see the sensor, this is the code I am using other than the classic I2C scanner
#include <Wire.h>
#define AK09973D_I2C_ADDR 0x10 // Correct I2C address for AK09973D
void setup() {
Serial.begin(9600); // Use a more common baud rate for debugging
Wire.begin();
// Initialize the AK09973D
if (!initAK09973D()) {
Serial.println("No sensor found ... check your wiring?");
while (1) {
delay(10);
}
}
Serial.println("AK09973D sensor initialized");
setSensorConfiguration();
}
void loop() {
// This can be used for reading sensor data or other tasks
}
// Function to initialize the AK09973D sensor
bool initAK09973D() {
Wire.beginTransmission(AK09973D_I2C_ADDR);
if (Wire.endTransmission() != 0) {
Serial.println("Failed to initialize AK09973D");
return false;
}
Serial.println("AK09973D initialization successful");
return true;
}
void setSensorConfiguration() {
Wire.write(0x21);
// Configuration settings:
// MODE = 02h (Continuous measurement mode 1)
// SDR = 0 (Low noise drive)
// SMR = 0 (High sensitivity setting)
// STEST = 0 (Self-test disable)
byte config = 0b00000010; // Binary representation of the configuration
Wire.write(config);
Wire.endTransmission();
Serial.println("Sensor configuration set.");
}
Welcome! It appears you probably a hardware problem with something omitted. Post an annotated schematic showing exactly how you have wired it. Be sure to include power sources, grounds, and any external components. Links to technical information on the hardware items will help a lot. You posted some nice pictures but the top one does not help and the middle and bottom ones are fuzzy.
According to the datasheet you provided, the device you are using requires a voltage supply of 1.8 volts, maximum of 2.5 volts. You have probably destroyed your device with 3.3 volt supply. See page 6 of the datasheet.
If you are using the resistor combination shown in post 5 it won’t work. The resistors wil not allow a fraction of the -10 mA to +10 mA that the device uses. You need to use a true voltage regulator.
Your sensor is a 1.8V device. So, get a 1.8V regulator (search Internet) and then use a level shifter to interface the sensor with Arduino MEGA which is 5V device (Fig-1). Use short jumpers for connctions.
I believe I see a level shifter in one of the photos. In the schematic it looks like it is powered by 3.3 volts on the low side and is called a voltage regulator.
Let's put the problem where it belongs: the problem is the person that gave you that module.
Can you ask for a schematic ?
There seems to be voltage regulator on the module, but I see no level shifter for SDA and SCL on that module. The datasheet does not say that those pins are 3.3V or 5V tolerant, so we assume that they are not.
Do you have thin solder wire with a resin core ? And a solder iron for electronics ? If you "glue" two metals with solder and the solder does not flow, then it might not be electrically connected. I see a number of pins that are probably not connected.
Yes is the only thingi soldered in my life, but i checked with the multimeter and everythig is connected in the right way, so i assume the current can flo if not it would have showe OL
The datasheet is very clear on the maximum voltage on the I2C pins. It's not supposed to go over 2.1V with the chip being supplied with 1.8V. If you connected this to an I2C bus with pullups to 3.3V, you likely destroyed the sensor.
Given the soldering, I'd assume absolutely nothing, even if your DMM suggests that there's (sometimes) continuity.
Did you set the LV voltage of the level translator (not 'regulator'!) to 1.8V?
The datasheet is explicit on that the I2C pins are NOT tolerant of higher voltages:
The footnote clarifies that IF1 or IF2 = SDA.
So under no condition is this chip supposed to ever see 3.3V or higher on any of its pins.
Personally I found it very useful to use a "WireScan" example from an Arduino IDE. It scans the I2C bus and prints the addresses of devices connected. Try that first.
Check your soldering as well: I had an issue with bad GND contact on an I2C module resulting in a wierd behaviour: device was responding to a WireScan but didn't respond to actual read/write requests.
Fix it; then it won't be a problem. There's no really good way to check if poor soldering really presents a problem. The kinds of problems it typically causes are intermittent, difficult to track down and inconsistent. I.e.: a nightmare. So the only way to get past that is to learn to solder properly, or rely on a different mode of making sufficiently reliable connections. You could try a solderless breadboard in the meantime.
Do you have a spare sensor you can test with? As pointed out, there's a good chance you destroyed this one, so you might need another one to work with once you've ensured that you're supplying it with the proper voltage and do not violate the maximum ratings of any of its pins.
after some investigation i found out that the sensor is infact this one TLI493D-W2BW (infineon.com)
that can be powerd at 3.3V
i also tried to clean up the soldering
unfortunately still no I2C detected