I have a " SparkFun Linear 3D Hall-Effect Sensor - TMAG5273 (Qwiic)" wired to my Adafruit Feather 2040 with ground to ground, 3.3 to 3.3 volt, SDA to SDA, and SCL to SCL. I’m attempting to run the example code “TMAG5273 Example 1: Basic Readings,” but it seems to keep failing the setup. We’ve tried looking into the i2cAddress and found that we have a B1 version of the chip, which corresponds to the 0x22 that the code is trying to use.
The example code can be found here: Basic Example - Hookup Guide - SparkFun Qwiic Hall-Effect Sensor - TMAG5273
My board can be found here: Pinouts | Introducing Adafruit Feather RP2040 | Adafruit Learning System
Other troubleshooting we’ve done:
tried multiple chips in case this one was bad
writing our own code in CircuitPython, but it too had trouble with the setup (though AI mostly made this code, so I don’t really trust it much anyway).
So I’ve already followed the steps from Adafruit to set my board up to run off of Arduino Code (C++ I believe?), and it runs sample code in that language just fine, such as the example blink code. If there is a way to convert your library to CircuitPython, that would help a lot, as the rest of my project is in CircuitPython. Either way, it seems not to be connecting to the TMAG5273 chip. I did try this in CircuitPython first (as said above) with help from ChatGPT (of which I don’t really trust fully). If you have a better way to translate over to CircuitPython, that would be a big help.
Is there anything else I can try to get the sensor to setup and talk with my board?
For reference, here is the code ChatGPT gave me to try and connect with the chip via CircuitPython. It does get stuck on the set-up line and doesn’t move past there; this is on line 24 : tmag = I2CDevice(i2c, TMAG5273_ADDRESS) TMAG5273 CircuitPython Code_5-13-2025.txt (1.6 KB)
We don’t generally have coding advice, but here’s what I’d do:
Instead fo relying on one AI model, I use ChatGPT, Claude.ai, and perplexity.ai all side-by-side and pilfer through their suggestions…if they all have similar but slightly different implementations, I try them all, continue from there, etc
Awesome, I can try those out in looking at switching languages. Though I worry that I’ll have the same issue anyway if I can’t get it to work in the native language. Any suggestions on how to move forward with Arduino code and this board? Arduino code seems to work just fine with the board, just having issues connecting to the sensor. Just to be sure on connections, I’ve attached a photo of the wiring. Apologies for the awkward angles.
Wire colors to pins: GND-Black, 3V3-White, SDA-Green, SCL-Blue