I am looking to use the Raspberry Pi 2 to measure the power consumed by household appliances. I know that the Pi does not have an inbuilt ADC. I found that the MCP3008 can be interfaced with the Pi as an external ADC. Can I use this to measure voltage and current, and are there any tutorials that I can follow?
Here goes, quick tutorial: -
- Power = volts x amps
- This applies to AC as well as DC
- Irrespective of power factor, power = volts x amps
- You'll need to sample the voltage and current signals at about 1kHz or harmonics in the current waveforms will alias the ADC and give false readings of power
- Once you have a means of digitizing v and i multiply the instantaneous values and average the results through a digital low pass filter.
- This gives you average power
- Energy companies bill you (usually) as kW hours so integrate the average power over time to create kWh
You'll either use a small voltage transformer to give a voltage reference you can digitize or maybe a resistive potential divider BUT beware, the r-divider means your ADC and Micro are at potentially life-snuffing voltages.
For current use a hall effect device or a CT.