I understand the concept of wiring a current sensor to Arduino, reading the value, and storing it to SD-card (or whatever data processing). I realize all the motors, lights, speaker, or whatever devices are driven by a PWM signal, which means - at any given millisecond, there could be a big burst of current or no current on the next millisecond when I would just randomly take a reading. If my current-reading timer coincidentally is timed on the off-duty cycle of my motor driver, I would just be logging the power consumed totally wrong.
Do the expensive current-logging tools sample current at high frequency? Seems like to me, if I don't sample current as fast as possible to sum and log the power - then it would not be accurate. That feels like too much data to log or process.
Hi,
If you limit the measurement to current created by PWM (being DC and not AC) then your options are:
-
Sample period of at least 10 x the PWM frequency. This is not a hard fast rule but a good place to start.
-
You could use a delta-sigma converter with at conversion time of >> the PWM period.
-
Create a DC average with an RC network of some low pass filter. Then measure it as a DC signal.
Keep in mind the current waveforms will be very different for different devices. The motor will likely have a triangular current wave with not a lot of variability (compared to the average current value).
A light bulb will have a current that goes form 0 to 100 percent following the PWM.
AC is a different story, and not an area I've direct experience with its measurement. However it seems to me you have at least 3 options:
-
Rectify it (with a precision rectifier) and treat as above.
-
Get some kind of RMS converter to do the conversion
-
Create an RMS converter using a resistor and a temperature measurement device.
Good luck