Measuring current is a relatively simple task that can be done by connecting a shunt resistor in series with the load and measuring the voltage on this resistor. The voltage is proportional to a load current according to Ohm’s law. In order the to get a precise measurement the current sense resistor should be sufficiently small as to not to interfere with the measurements. Also, any additional wires and connections can add a parasitic resistance changing the R sense value. However, there is a better solution in form of a current sensor module like INA219. The INA219 is a current shunt monitor with I2C interface. It can provide high accuracy and precision measurements and can be easily connected to Arduino UNO board as shown in the schematic below.
The attached code is based on Adafruit INA219 library to allow easy integration and interface with Arduino platform. Load current readings are sent to the LCD display. This design was tested with 20 Ohm power resistor as a load using internal Arduino supply of 5v. With this value we should expect a 250mA current. 5v/20 Ohm. However, I’ve noticed that there is a voltage drop across Arduino 5v supply of about a 0.5v while testing resulting is smaller current as can be seen from a short video.