Tool/software:
I want to use TMAG5273A2QDBVR Hall effect sensor as a magnetic rotary dimmer switch. Which parameters should be considered (taken from the sensor) for this application, and how must the magnetic placement be with respect to the IC?
Tool/software:
I want to use TMAG5273A2QDBVR Hall effect sensor as a magnetic rotary dimmer switch. Which parameters should be considered (taken from the sensor) for this application, and how must the magnetic placement be with respect to the IC?
Hi Gayathri,
Thank you for posting to the Sensors forum!
I would recommend ensuring that the magnet is placed on-axis, such that the magnet center lines up with the sensing element of the TMAG5273.
For this application, I would recommend ensuring that at least 2 axes are enabled and that you have angle calculation enabled. This will allow the device to calculate the angle position of the magnet instead of having to calculate it yourself. Regarding the magnet itself, I would recommend using a diametric magnet.
Best,
~Alicia
i'm receiving the XY angle but it keeps constantly changing.
TMAG5273_REG_DEVICE_CONFIG_2, 0x02
TMAG5273_REG_DEVICE_CONFIG_1,0x2
TMAG5273_REG_SENSOR_CONFIG_1, 0x31
TMAG5273_REG_SENSOR_CONFIG_2, 0x4 is the configuration settings and for getting the xy angle
uint8_t reg = TMAG5273_REG_ANGLE_RESULT_MSB;//0x19
if (I2C_transaction(I2C_FLAG_WRITE_READ, TMAG5273_I2C_ADDR, ®, 1, &Mbuf, 1) != i2cTransferDone) {
return 0.0f;
}
// // Read LSB
// uint8_t lsb = 0;
reg = TMAG5273_REG_ANGLE_RESULT_LSB;//0x1A
if (I2C_transaction(I2C_FLAG_WRITE_READ, TMAG5273_I2C_ADDR, ®, 1, &Lbuf, 1) != i2cTransferDone) {
return 0.0f;
}
// Combine into 12-bit value
uint16_t rawAngle = ((uint16_t)Mbuf << 8) | Lbuf;
rawAngle = rawAngle>>4; // Mask to 12 bits
// Convert to degrees (datasheet: 0–4095 = 0–360°)
float angleDeg = (rawAngle * 360.0f) / 4096.0f;
Am i missing anything in the configuration
Hi Gayathri,
From your settings, it looks like you have enabled continuous measure mode. With this setting, the device is constantly measurements which would be why you are constantly seeing the values get updated. If this is not what you want, then I would recommend putting the device into standby mode and only triggering measurements when you want them.
Best,
~Alicia