4 Current Measurement (Current Sensing) Example

Some analog sensors, for example photodiodes and phototransistors, generate a current output. It may also be interesting to measure the current at a point in a circuit. In this example, the AVR EA microcontroller periodically measures a current using its internal ADC peripheral. Because the ADC can only sample a voltage, the current is sent through a “sense” resistor with a known resistance value to convert the current to a voltage. The current can then be calculated from the measured voltage.