This is a Python library for the Texas Instruments TMAG5273 low-power linear 3D Hall-effect sensor with I2C interface.
This Library for the Texas Instruments TMAG5273 linear 3D Hall-effect sensor provides access to the core functionality of the sensor. The sensor itself includes three Hall-effect sensors, providing readings around the X, Y and Z axes of the device.
SparkFun Arduino Library for the TMAG5273 provides access to the a majority of the functionality provided by the the TMAG5273 device. This includes:
- Access to X, Y and Z Hall-effect sensor readings
- Data digitized via an integrated 12-bit ADC
- Integrated temperature sensor
- Configurable to enable any combination of magnetic axes and temperature measurements
- Integrated angle calculation engine (CORDIC) provides full 360 degree position information
- Magnetic gain and offset correction settings
- Configurable I2C address, with a default value of
0x22
| Name | Pin | Qwiic Color |
|---|---|---|
| 3.3v | 1 | red |
| SDA (Data) | 3 | blue |
| SCL (Clock) | 5 | yellow |
| GND | 9 | black |
Use the following commands in the terminal, if it is enabled, the output should be a matrix of values.
sudo apt-get install i2c-tools
sudo i2cdetect -y 1
From the main folder path execcute the following commands. This will create a new virtual environment and install the dependencies.
python3 -m venv .venv
source .venv/bin/activate
pip3 install smbus2
pip3 install -e .
The examples print values in the terminal window.
python3 examples/Example1_BasicReadings.py
| Reference | Description |
|---|---|
| SparkFun Hall-Effect Sensor - TMAG5273 | Hardware GitHub Repository |
| Hall-Effect Sensor Hook Up Guide | Hardware Overview and Quick Start for the SparkFun Hall-Effect Sensor - TMAG5273 |
This product is open source!
This product is licensed using the MIT Open Source License.