# ESP32-C3 TDM2507 Power Measurement Module Test Guide

> Source: https://maker.tdlogy.com/wiki-doc/esp32-c3-tdm2507-power-measurement-module-test-guide/

> [!NOTE] ELECTRICAL SAFETY WARNING: 
>  <br>Circuits that use 220V alternating current (AC) voltage are dangerous. Please <strong>COMPLETELY DISCONNECT THE POWER SUPPLY</strong> before proceeding with the connection operation. Re-energize only when all joints have been thoroughly checked and secure insulation is ensured.

## I. Hardware Connection Instructions

### 1. Component List

### 2. High voltage part connection guide

Make the connection at the wiring station assembly (green Domino) located at the top of the Power Measurement Module. Note: Screw tightening is required to avoid electric motors.

Equipment/ConductorsPlug Position (On Module)FunctionAC Plug (Red Wire)L LegPhase Wire (Hot) of 220V mainsAC Plug (Black Wire)Pin NNeutral (Cold) wire of 220V mainsCT Coil (Red Wire)Pin + (Cluster +CT-)Positive Current Variable SignalCT Coil (Black Wire)Leg – (Cluster +CT-)Negative Current Variable Signal

### 3. Low Voltage Part Connection (Communication with Microcontroller)

Connect at the 4 headers located at the bottom of the Power Measurement Module to transmit data and supply DC power to the system.

Pins on Module (Left to Right)Wire color on diagramConnecting to the MicrocontrollerPin No. 1 (Far left)BlackGND Foot (Mass)Pin No. 2GreenRX PinsPin No. 3BlueTX FootPin No. 4 (Far right)Red5V Pin (Power Supply)

> [!NOTE]  IMPORTANT NOTES WHEN MEASURING CURRENT WITH CT COIL:
> <strong>In</strong> order for the module to be able to read the current parameter (Amps) and calculate the power consumption, You are <strong>REQUIRED to pass 01 single wire</strong> (L wire or N wire for the load consuming device) through the round hole in the middle of the black CT coil.<br><br> <em><strong>Absolutely do not pass both wires (L and N)</strong> at the same time through the CT coil because the magnetic field will cancel each other out, resulting in a measurement result that is always displayed as 0.</em>

#### Detailed wiring diagram:

## II. Instructions on how to load code and read sensor data

### 1. List of required resources

### 2. Instructions for loading the code

Step 1: After connecting the microcontroller (ESP32-C3) to the computer, check which COM port the device is receiving by opening Device Manager.

Step 2: Once you've identified the COM port, go to the folder that contains the code file you just downloaded. Right-click on the file and select Edit.flashcode.bat

Step 3: Proceed to fix the COM port according to the data you just saw in Device Manager. After editing, press Ctrl + S to save it.

Step 4: Finally, right-click on the file you just edited and select Open (Or double-click to run). At this point, the code will be automatically loaded into the ESP according to your port.flashcode.bat

### 3. Check the actual data

After loading the code, we proceed to read the log to check the measurement parameters: