@petere the INA219 readings are erratic because the current is erratic. When the PWM pulse is off, there will be roughly 0 current (but negative right after the cutoff). When the pulse is on, the current will be the same as if you didn't use PWM. This will change about 500 times per second (on a normal Arduino PWM, not sure if the Ruideng uses a different frequency), so INA219 will read different current at different times. See if setting a longer sample time helps. Not sure which library you are using but the Adafruit library defaults to 532us sample time. The longest sample time for INA219 is 69ms which should give you readings that are stable enough. EDIT: I see now that you already got a similar (but slightly less detailed) answer 5 days ago at http://forum.arduino.cc/index.php?topic=564517.msg3846445#msg3846445