We know many of you were wondering when we'll release a power meter compatible with panStamp. And here we are, sooner as expected, with a first prototype. We at panStamp are passionate about simplicity so you may guess that either electronics or firmware application have been designed to be as compact and efficient as possible.
Figure 1 : panStamp meter board
The meter board is "non-AC intrusive", meaning that all voltages handled on the board are low-level, so there is no danger for the user when in direct contact with the on-board circuits. This is achieved thanks to the external transformers (voltage and current), which free the user from having to connect regular AC wires to the meter board.
This board with the associated Arduino sketch has an input for an external voltage transformer, which powers the board and provides the voltage information for the internal calculations, six inputs for current transformers (current clamps) and three pulse counting inputs.
The hardware design still needs to be modified with some additions, including a way to store readings for a while after detecting a power outage. A seventh input for current transformer may be added to to the PCB design as well, and finally some additional filtering capacitors.
Working KiCad files can be downloaded from SVN too.
Reading from voltage and current transformers are used to calculate the following data:
On the other hand, pulse inputs are used to count pulses coming from other devices like power meters, water flow meters and gas meters. This gives up to 9 different inputs for measuring energy consumptions from different sources.
SCT-013-005 and SCT-013-030 current clamps from YHDC have been used for the tests. These transformers basically convert AC current to AC voltage (maximum amplitude = 1V) so depending on the current to be measured we may decide to use the 5A version or the 30A one... or even the 50A one. But how does the on-board panStamp calculates power consumption from real-time voltage and currents?
Calculations basically rely on the following method:
(The complete "meter" sketch can be downloaded from SVN too)
The above method is called in a loop until it gets the necessary amount of voltage and current samples to calculate RMS values, active power, apparent power, power factor and energy consumption. Then the function is able to calculate power data as follows:
P = (V0 x I0 + V1 x I1 + V2 x I2 + ... + VN x IN) / N
being N the amount of samples read. At the moment of writing this review, 80 samples are read before doing any calculation. Around 40 of those 80 samples are discarded since the board is really measuring a half-wave version of the original low-level AC voltage.
VRMS = VMAX / √2
IRMS = IMAX / √2
S = VRMS x IRMS
PF = S / P
Energy = P x time
Power factor is the cosine of the phase difference between the voltage and the current waves:
It gives an idea about the effectiveness of the energy being consumed and it basically depends on the type of load being powered.Thus, for pure resistive loads, the phase difference is 0 (voltage and current signals in phase) so power factor equals 1. The more reactive the load is the bigger the phase difference is and the lower the power factor is. The problem about transformers is that they tend to shift the signal a bit on the secondary so we need a way to calibrate this when this additional phase shift affects readings significantly.
In order to provide support for calibration, the on-board panStamp application provides some SWAP configuration registers, letting the user enter the following settings wirelessly:
For current transformer inputs:
For counter inputs:
This device is already defined in the current Device Definition Files database so SWAPdmt is able to detect it and understand the contents of each register.
As you can see, a lot of work has been done over the last weeks to get a first working version. However, we still need to run many additional tests, answer some questions... and even ask new ones before going to production. A new thread has been created in the forum in order to address questions and responses from/to our community. Feel free to drop your ideas and suggestions from there!