INA260 Current Sensing chip
I2C interface. Libraries for both Arduino and Raspberry Pi and can be run with 3.3V.
In this diagram, the shunt resistor is only 2 milliohms. It is capable according to technical notes of voltages up to +36V and 15A continuous (DC only).
You would connect the load under test as in the diagram above or below.