Hi, I am trying to connect a Sparkfun qwiic MMA5983MA magnetometer to a prom mini using I2C. I'm not getting any response from the magnetometer. The connection is via n Adafruit logic level shifter, since the mini is 5V and the magnetometer is 3.3 V.
I'm using the I2C Scanner software to faultfind.
The power supply is the correct 3.3V and the LED lights on the mag.
I've verified the level shifter connections by replacing the magnetometer with another device, which I2C scanner finds OK, With the magnetometer I get "No I2C devices found."
I wondered about the CS input on the magnetometer, which the data sheet says should be held high for I2C. When it is high I get the above message, if it is held low I2C scanner hangs and doesn't return anything, I guess means the device is trying to interpret what it sees as SPI and the result is confusing the I2C scanner software.
I'm wondering if the mag is dead. Any suggestions? I guess I could try to talk to it with SPI, but QWIIC is supposed to be I2C so it ought to work.
Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project See About the Installation & Troubleshooting category.
The pro mini is running the standard I2C scanner software. It is not a genuine Arduino, but since it detects a different I2C device connected to the LV side of the level shifter it must be OK, andI have tried two of them anyway. Any problem pretty much has to be the magnetometer itself.
John
I have never needed a level-shifter, but where is the power supply and what is the "Regulator" doing? Also, which level-shifter are you using? Is it bi-directional?
Why don't you just use a 3v3 board like the Wemos D1 Mini?
Because I don't have a 3.3 Volt device lying around, apart from a Due which is already in use in a circuit...and also uses a similar level shifter since it needed to talk to a peripheral that was 5 V only. I have some on order, with luck they might arrive within a couple of weeks or maybe a month.
Where it says 5 Volt on the left side of the regulator is the 5 volt supply, which is common to the pro mini board.
The regulator is dropping the 5 Volts to 3.3 V for the mag sensor and the low voltage side of the level shifter.
It is of course a bidirectional shifter, it contains four channels of which I need two and I have tried swapping them around to check them. As mentioned earlier, I have detected another device through the level shifter, so it does work.
This is really only a test circuit, it is connecting the pro mini via I2C to the sensor and using the I2C scanner to see if there is any response. With a level shifter to take care of the voltage difference. I've confirmed that the mini is putting out signals on the SCL line with a scope. I am pretty certain that any problem is with the sensor, either it is dead or there is something about the chip select that is wrong...but the data sheet is pretty definite that it should be held high for I2C.
It should work, perhaps something is broken.
My guess is that it is something very simple, a bad soldering or a broken wire, or a cheap USB cable.
Do you use jumper wires, they can be broken.
Do you use a breadboard, they can have bad contacts.
You have to check everything. Do you have a multimeter ?
Upload a empty sketch with only Wire.begin().
Check the voltages of GND, 5V, 3.3V. and all the I2C bus on the high side and low side.
Then shortcut SDA to GND and measure if it is also lowered on the other side of the level shifter, then the other side, then SCL.
Check the module for bad solderings with a magnifier.
If nothing works, then buy a new sensor module and a new level shifter and maybe a new Arduino board, new power supply, new USB cables, new wires. Just ignore that something worked in the past or with other hardware. Your combination of things does not work, so replace everything