I was wondering if someone knew how to measure power/current and then interface it to a micro controller to store the data onto some external memory.
I basically want to measure the power a device is consuming and save the data.
I was wondering if someone knew how to measure power/current and then interface it to a micro controller to store the data onto some external memory.
I basically want to measure the power a device is consuming and save the data.
You need to capture the waveforms v(t) and i(t) at your target load. Then, multiply those two, to get the instantaneous power p(t)=v(t)·i(t), and finally (as is usually the case), average it over a certain period of time.
In summary, you need to do:
$$ P_{avg}=\dfrac{1}{T}\int_T v(t)·i(t)dt $$
You can do that either in the analog domain, using a somewhat inaccurate analog multiplier, or --preferably-- in the digital domain, using two ADCs (or a single ADC with two sample and hold front ends), and doing the multiplication and the averaging digitally.
See also this related answer.
One of the key things to emphasize is that knowing \$v_{rms}\$ and \$i_{rms}\$ is not enough to compute power, because -for instance- if v(t) and i(t) are such that there is no "overlapping" between them (v(t)·i(t)=0 for all t), then you could have zero power, but nonzero \$v_{rms}\$ and \$i_{rms}\$.
There are ICs that include two preamplifiers, two ADCs, and a digital multiplier, and simplify the task of measuring power flow.
Power = Voltage * Current
So measure voltage and current separately and calculate power of the device. I did an undergraduate project way back 10 years ago measuring the power consumed by various machines in a lab in college. Used special digital output current and voltage transducers which were connected to computer using serial ports. You can use any software or write your own code to get these inputs and calculate Real Time
power.