2026-01-31 2:23 AM
Hello ST Community,
@pavel_A
@erwan_C
I am working on a project using STM32 NUCLEO-F446RE and the SmartElex Power Meter (ACS37800) for voltage, current, and power measurement over I²C.
https://robu.in/product/1-month-warranty-1276/?gad_source=1&gad_campaignid=18585959909&gbraid=0AAAAADvLFWd-Gp59GIu3AsyVYZj3ppOY9&gclid=Cj0KCQiA7fbLBhDJARIsAOAqhsePuiSx2qOJKlmgFcZN2-_7bfwkDHpCOUyG6G9Q4REJXpOXr7KYUEIaAq3dEALw_wcB
Hardware details:
MCU: STM32F446RE (NUCLEO-F446RE)
Sensor: SmartElex ACS37800 (Allegro ACS37800 IC)
Interface: I²C1
SCL: PB6
SDA: PB7
VCC: 3.3 V
External pull-ups: 4.7 kΩ on SDA/SCL
I²C speed: 100 kHz
Software details:
STM32CubeIDE v1.19.0
The sensor works correctly with ESP32 using the SparkFun Arduino library, but I am looking for a proper STM32 HAL-based reference or sample code specifically for:
Correct I²C initialization and addressing
16-bit register access required by ACS37800
Reading instantaneous voltage, current, and power
Recommended power-up timing and initialization sequence
I have seen Arduino and ESP32 examples, but I would prefer:
An official ST reference
Or a known-working STM32 HAL example for the ACS37800 (or similar Allegro power monitors)
If anyone has:
Sample code
Application notes
GitHub references
Or experience interfacing ACS37800 with STM32 (F4 series)
your guidance would be greatly appreciated.
Thank you in advance for your support.
Best regards,
Gnanendra Sai
2026-01-31 2:32 AM - edited 2026-01-31 2:54 AM
Welcome to the community.
@Gnanendra wrote:SmartElex Power Meter (ACS37800) for voltage, current, and power measurement over I²C.ai
That's not an ST product, so you can't expect ST to provide specific support for it.
The only bit that's specific to the STM32 is the microcontroller's I2C host code - ST do provide examples of that.
For specific details of the ACS37800, you will need to go to the manufacturer - Allegro Microsystems:
As you already have the SparkFun Arduino library working, you could use that as the basis of your code ...
PS:
Note that there is an Arduino core for the STM32:
https://docs.arduino.cc/libraries/stm32duino-examples/