AI

The **WMS2-G3-R** is a high-performance, single-phase, bidirectional AC energy metering module. It is widely used in IoT energy monitoring, smart plugs, and industrial power management systems.
---
### 1. Key Technical Specifications
| Parameter | Specification |
| :--- | :--- |
| **Input Voltage Range** | 100V - 240V AC |
| **Maximum Current** | Up to 16A (typical) |
| **Measurement Accuracy** | Class 1.0 (Active Energy) |
| **Communication Protocol** | UART (Universal Asynchronous Receiver-Transmitter) |
| **Frequency** | 50Hz / 60Hz |
| **Parameters Measured** | Voltage, Current, Active Power, Power Factor, Energy |
---
### 2. Core Electronic Components & Architecture
The WMS2-G3-R functions by converting analog signals from the AC line into digital data that a microcontroller can read.
* **Shunt Resistor / Current Transformer:** Used to sample the current flowing through the load. Most compact modules use a high-precision shunt resistor.
* **Voltage Divider Network:** A series of high-impedance resistors that step down the mains voltage to a safe, measurable level for the internal IC.
* **Metering IC (SoC):** The "brain" of the module. It performs high-speed sampling of the voltage and current waveforms and calculates Root Mean Square (RMS) values.
* **Optocoupler Isolation:** To protect the host microcontroller (like an ESP32 or Arduino), the UART communication lines are often isolated to prevent high-voltage surges from damaging the low-voltage electronics.
* **LDO Regulator:** An internal Low-Dropout regulator that converts the input power into a stable 3.3V or 5V for the metering chip.
---
### 3. Pinout Description
Typically, the module features a 4-pin or 6-pin interface for easy integration:
1. **VCC:** Power supply for the module (usually 3.3V or 5V).
2. **GND:** Ground reference.
3. **RX:** Receives data commands from the host.
4. **TX:** Transmits energy data to the host.
5. **CF1 / Pulse (Optional):** Some versions include a pulse output pin for energy calibration.
---
### 4. Application Logic
The module operates in a **Master-Slave** configuration. The host sends a request frame via UART, and the WMS2-G3-R responds with a data packet containing the electrical parameters.
```python
# Example Pseudo-code for reading data
import serial
# Initialize UART
ser = serial.Serial('/dev/ttyS0', 9600, timeout=1)
# Command to read RMS Voltage (specific to WMS2 protocol)
read_voltage_cmd = b'\x01\x03\x00\x00\x00\x02\xC4\x0B'
ser.write(read_voltage_cmd)
response = ser.read(7)
# Convert hex response to readable voltage
voltage = int.from_bytes(response[3:5], byteorder='big') / 10.0
print(f"Current Voltage: {voltage}V")
```
---
- ⤷
What are the specific UART register addresses for reading energy consumption?
- ⤷ Does this module support bidirectional metering for solar applications?
- ⤷ What is the physical footprint and mounting type of the WMS2-G3-R?