This paper proposes an innovative method for power consumption measurement in microcontroller-based systems that provides high accuracy on a wide dynamic range of current values, which makes it particularly suitable for all those applications characterized by alternating low-/high-power modes and fast current variations. We demonstrate that using an op-amp-based voltage feedback configuration, it is possible to use shunt resistor values higher than usual to obtain increased voltage drops without affecting the microcontroller's power supply voltage. Consequently, it is possible to directly use a data acquisition board to acquire the shunt voltage, eliminating all those common errors, like offset and gain, due to the use of an additional intermediate amplification stage. The proposed scheme has been successfully used to accurately characterize the power consumption of a single sensor node of a wireless sensor network.