Measuring power is number one task when you need to control it’s usage. And there are many various ways of measuring power, but probably better is to use specialized chips to do the task. Here is a simple project on a TI launchpad which measures power using TI’s INA219 current/power monitor chip. It is interfaced using I2C.
It accepts voltages up to 26V and currents from -4 to 4A. Launchpad reads current, voltage and wattage and displays values on Nokia 5110 LCD display. Program is written in C++ language that can be expanded with more functionality like graphing, logging and PC interface.