You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`class`[`ModulinoClass`](#modulinoclass)| The base class for all Modulino components, providing essential functionality and structure for all subsequent Modulino modules. |
72
-
|`class`[`ModulinoButtons`](#modulinobuttons)| Handles the functionality of Modulino Buttons, enabling detection of presses and handling input events. |
73
-
|`class`[`ModulinoBuzzer`](#modulinobuttons)|Handles the functionality of Modulino Buzzer, enabling the sound generation for feedback or alerts. |
74
-
|`class`[`ModulinoPixels`](#modulinopixels)| Handles the functionality of Modulino Pixels, managing LEDs strip color, status and brightness. |
75
-
|`class`[`ModulinoKnob`](#modulinoknob)| Handles the functionality of Modulino Knob, interfacing with the rotary knob position. |
76
-
|`class`[`ModulinoMovement`](#modulinomovement)| Handles the functionality of Modulino Movement,interfacing with the IMU sensor to get acceleration readings. |
77
-
|`class`[`ModulinoThermo`](#modulinothermo)| Handles the functionality of Modulino Thermo, managing temperature sensors to provide real-time temperature and humidity readings. |
78
-
|`class`[`ModulinoDistance`](#modulinodistance)| Handles the functionality of Modulino Distance, enabling distance measurement using ToF (Time-of-Flight) sensors for precise range detection. |
|`class`[`ATM90E32`](#ATM90E32)| The base class for the MCM Energy Monitor, it provides essential functionality and structure for all subsequent methods. |
72
+
73
+
### Electrical Parameters Methods
74
+
75
+
-`GetLineVoltageA()`: Returns the RMS voltage value of channel A
76
+
-`GetLineVoltageB()`: Returns the RMS voltage value of channel B
77
+
-`GetLineVoltageC()`: Returns the RMS voltage value of channel C
78
+
79
+
-`GetLineCurrentA()`: Returns the RMS current value of channel A
80
+
-`GetLineCurrentB()`: Returns the RMS current value of channel B
81
+
-`GetLineCurrentC()`: Returns the RMS current value of channel C
82
+
-`GetLineCurrentN()`: Returns the RMS current value of Neutral
83
+
84
+
-`GetActivePowerA()`: Returns the Active Power (W) of channel A
85
+
-`GetActivePowerB()`: Returns the Active Power (W) of channel B
86
+
-`GetActivePowerC()`: Returns the Active Power (W) of channel C
87
+
88
+
-`GetTotalActivePower()`: Returns the Active Power (W) of all channels
89
+
-`GetTotalActiveFundPower()`: Returns the total active fundamental power
90
+
-`GetTotalActiveHarPower()`: Returns the total active harmonical power
91
+
92
+
-`GetReactivePowerA()`: Returns the Reactive Power (VAR) of channel A
93
+
-`GetReactivePowerB()`: Returns the Reactive Power (VAR) of channel B
94
+
-`GetReactivePowerC()`: Returns the Reactive Power (VAR) of channel C
95
+
-`GetTotalReactivePower()`: Returns the Reactive Power (VAR) of all channels
96
+
97
+
-`GetApparentPowerA()`: Returns the Apparent Power (VA) of channel A
98
+
-`GetApparentPowerB()`: Returns the Apparent Power (VA) of channel B
99
+
-`GetApparentPowerC()`: Returns the Apparent Power (VA) of channel C
100
+
-`GetTotalApparentPower()`: Returns the Apparent Power (VA) of all channels
101
+
102
+
-`GetFrequency()`: Returns the grid frequency (Hz)
103
+
104
+
-`GetPowerFactorA()`: Returns the Power Factor of channel A
105
+
-`GetPowerFactorB()`: Returns the Power Factor of channel B
106
+
-`GetPowerFactorC()`: Returns the Power Factor of channel C
107
+
-`GetTotalPowerFactor()`: Returns the mean Power Factor of all channels
108
+
109
+
-`GetPhaseA()`: Returns the Phase Angle of channel A
110
+
-`GetPhaseB()`: Returns the Phase Angle of channel B
111
+
-`GetPhaseC()`: Returns the Phase Angle of channel C
112
+
113
+
-`GetImportEnergy()`: Returns the active energy imported in (Wh)
114
+
-`GetImportReactiveEnergy()`: Returns the reactive energy imported in (VARh)
115
+
-`GetImportApparentEnergy()`: Returns the apparent energy imported in (VAh)
116
+
-`GetExportEnergy()`: Returns the active energy exported in (Wh)
117
+
-`GetExportReactiveEnergy()`: Returns the reactive energy exported in (VARh)
118
+
119
+
### Calibration Methods
120
+
121
+
-`CalculateVIOffset(unsigned short regh_addr, unsigned short regl_addr, unsigned short offset_reg)`: Returns the offset of the voltage and current channels to be used within the `setVIOffset()` function.
122
+
123
+
This function admits several parameters, see the following example as reference:
124
+
125
+
```arduino
126
+
void VIoffsetCal()
127
+
{
128
+
// Voltage Offset Calibration
129
+
mcm.CalculateVIOffset(UrmsA, UrmsALSB, UoffsetA);
130
+
mcm.CalculateVIOffset(UrmsB, UrmsBLSB, UoffsetB);
131
+
mcm.CalculateVIOffset(UrmsC, UrmsCLSB, UoffsetC);
132
+
133
+
// Current Offset Calibration
134
+
mcm.CalculateVIOffset(IrmsA, IrmsALSB, IoffsetA);
135
+
mcm.CalculateVIOffset(IrmsB, IrmsBLSB, IoffsetB);
136
+
mcm.CalculateVIOffset(IrmsC, IrmsCLSB, IoffsetC);
137
+
}
138
+
```
139
+
140
+
The `VIoffsetCal()` function from above will calculate and return the offset of each input channel of the system. Take notes of the results because will be needed for the next method explained.
141
+
142
+
**Note:** The offset must be calculated without voltage and current input. No grid voltage and no powered loads connected to the CTs.
143
+
144
+
-`setVIOffset(unsigned short VoffA, unsigned short VoffB, unsigned short VoffC, unsigned short IoffA, unsigned short IoffB, unsigned short IoffC)`: Configures the offset for each channel to compensate the initial error of the ADC input stages.
145
+
146
+
This function admits several parameters, see the following example as reference:
**Note:** Enter the offset values in the same order the `VIoffsetCal()` function prints them.
153
+
154
+
-`CalculatePowerOffset(unsigned short regh_addr, unsigned short regl_addr, unsigned short offset_reg)`: Returns the offset of the power registers. Optional depending on your setup.
155
+
156
+
-`CalibrateVI(unsigned short reg, float actualVal)`: Returns the calibration factor of your voltage and current readings using a known voltage and current.
157
+
158
+
This function admits the register to be calibrated and the voltage or current value measured by a reference tool. See the following example for reference:
159
+
160
+
- I measured a voltage of **121.54 VAC** with my lab multimeter. (The MCM Split-Phase Energy Monitor only uses channels A and C for voltage).
161
+
- I measured a current of **0.4815 Amps** with my lab multimeter. (The MCM Split-Phase Energy Monitor only uses channels A and C for current).
162
+
163
+
With those known values currently being present in the system input, run the following functions:
164
+
165
+
```arduino
166
+
VCalibration(121.54, 0, 121.54); // Voltage in A, Voltage in B, Voltage in C
mcm.CalibrateVI(IrmsA, CurrA); // Voltage Channel A, Actual Reference Voltage
189
+
mcm.CalibrateVI(IrmsB, CurrB); // Voltage Channel B, Actual Reference Voltage
190
+
mcm.CalibrateVI(IrmsC, CurrC); // Voltage Channel C, Actual Reference Voltage
191
+
delay(1000);
192
+
}
193
+
```
194
+
195
+
The functions from above will print in the Serial Monitor the calibration factors of each channel. Write them down and use them to populate the `begin()` function of the ATM90E32 class as explained in the [beginning](#library-initialization).
0 commit comments