There are many projects where you may need to measure currents. The problem is that basically microcontrollers are equipped with ADC that are used to measure voltage levels. In order to measure current you need somehow to convert current to voltage. The simplest way is to pass this current through resistor with small resistance and measure voltage drop across it. Then you can measure voltage drop across this known resistor with microcontroller ADC and then apply simple Ohm’s law to find current.
Follow this reading to find out how to expand drop voltage dynamic range so microcontroller could read it with maximum accuracy.