How to detect how much battery power is drawn?
To measure current, you need a multimeter (technically just an ammeter). Some bench multimeters have a graphing or datalogging function which allow you to connect a device and let it run for a while and examine measured values later.

The basic current measurement involves inserting the meter in the circuit in a series connection:







simulate this circuit &ndash; Schematic created using CircuitLab

This provides a measurement of the current draw of the device in real time. But if you're interested in knowing the long-term power consumption, you need to record the current draw at regular intervals and average it out.

For example, if you want to know how much power your refrigerator uses, you have to measure its current draw (using a Kill-a-Watt meter, for example) when the compressor is running, again when it is off, and then figure out how long the compressor runs versus how long it is idle. It gets more complicated because these durations will vary based on the ambient temperature of your house, etc.

If you don't have a datalogging multimeter, you can take measurements from various behaviors of your device and determine the time that each behavior or state is active. For example, if your device sleeps for 59 minutes, wakes up for one minute to do something, then you can take two measurements and calculate based on a 59:1 ratio. For example, if the device draws 2mA while sleeping and 10mA while working, you would have (\$59 * 2 + 10 * 1\$) 128 mAh.

For something that is more variable, you'll just have to take measurements at regular intervals and average it out.