Introduction: Energy Meter

    Caution - We are not responsible for any mishappening while reproducing this project by anyone.

    Energy Meter using XMC1100 and TLI 4970 & Wi-Fi module NodeMcu(ESP8266)

    The Energy meter is as an application of TLI4970 (Current Sensor ) and XMC 2Go and is a plug and play device to any electrical socket with AC supply

    In this application, Energy meter has the following features

    • Displays Power, Energy Consumed by the appliances & an estimation of the bill one may incur.

    • Remotely Monitor the energy of home appliances.

    Power from the AC mains is drawn and passed through a fuse for avoiding any damage to the circuit board during the accidental short circuit.

    Then the AC power line is distributed in two parts:

    1. To the load through the current sensor (TLI4970).

    2. 230V AC/5V DC Power Supply module.

    The current sensor measures the amount of current passing through a load and sends a 16-bit SPI data (13-bit current value) to the XMC 2Go in which energy, power, and bill calibration takes place.

    XMC 2Go sends the data to the cloud (Thingspeak) using Nodemcu and it also displays on an OLED.

    For powering up the devices, Buck converter is used to step down 230v AC to 5v DC

    Step 1: Components/hardware & Tools Used

    • Tli4970 :
    • The TLI4970 is a high-precision current sensor based on Infineon's proven Hall technology. Its AC & DC measurement range up to ±50A and SPI output of 16bit (13-bit current value). It’s an easy-to-use, fully digital solution that does not require external calibration or additional parts such as A/D converters, 0 pAmps or reference voltage.

    It's has a ready to use Arduino library.

    Please find the datasheet of the TLI4970 variant here.

    • XMC2Go:
    • The XMC 2Go Kit with XMC1100 is maybe the world’s smallest, fully-featured Microcontroller Evaluation Kit showcasing - XMC1100 (ARM® Cortex™-M0 based) - On-board J-Link Lite Debugger (Realized with XMC4200 Microcontroller) - Power over USB (Micro USB) - ESD and reverse current protection - 2 x user LED - Pin Header 2x8 Pins suitable for Breadboard.
    • It can be programmed using the Arduino IDE. Link
    • The user manual can be found here.
    • NodeMCU:
    • Wi-Fi board for further info link
    • AC-DC Dual Output:
    • Steps down 220v Ac to 5v Dc. Link
    • Oled I2C display:
    • Link
    • Prototype Board :
    • Link
    • 5 in 1 Extension Box:
    • Link
    • Electrical wires
    • Tools used-
    • Small flat-head screwdriver
    • Soldering iron, desoldering braid
    • Wire cutters
    • Dremal or similar tool

    Step 2: Install Arduino and Make It Ready to Compile the Examples

    • Install the Arduino IDE. Link
    • Install the Infineon board package to compile the example code.
    • Follow the installation step one by one. Link
    • Install the board package for ESP8266.
    • Follow the installation steps one by one. Link

    Install the extra libraries required to compile the example code-

    1. TLI4970
    2. OLED Screen

    Note:- You can either download the zip and add in your Arduino IDE by adding .zip file(if don't know, follow the steps given in TLI4970 sensor lib in readme file), else you can install both the libraries from library manager in IDE.

    Step 3: Connection Diagram

    The Connection is as follows:

    • XMC 2Go ---- > Tli4970

    Vss --------->GND

    Vdd --------- > 3.3V

    P0_6 -------- > MISO

    P0_8 ------- > SCK

    P0_9 ------- > CS

    • XMC 2Go ----- > Nodemcu

    Vss ---------- > GND

    Vdd ---------- > 3.3

    VP2_0 ------ > D6

    • Nodemcu ----> OLED

    GND -------- > GND

    3.3V --------- > 3.3V

    D1 ------------ > SCK

    D2 ------------ > SDA

    Step 4: Setting Up ThingSpeak to Visualize the Data

    • Create an account in ThingSpeak
    • Create a channel in the ThingSpeak account
    • Take the credentials of ThingSpeak Channel and Write API Key and update the details in the secret file present along with .ino file that is to be flashed in the NodeMCU.

    Step 5: Final Steps

    Flash the code given in rar file after replacing the pins_ardiuno given in the package.

    Note: Copy pins_arduino.h and replace with the pins_arduino.h present in path C:\Users\....\AppData\Local\Arduino15\packages\Infineon\hardware\arm\1.4.0\variants\XMC1100\config\XMC1100_XMC2GO\pins_arduino.h

    Note: From the buck convertor take 5V output and power up both XMC2Go and NodeMcu.

    Step 6: Flow Diagram & Circuit Connection

    Flash the code check the connections, energy meter is ready to calculate the power consumed by any appliance connected to the energy meter.

    In this project board with fuse is being taken which increases the price of this maker project, this thing could also be done just by using one socket in which load could be plugged in. But if you are using a single socket without fuse be double protective while handling the AC power supply.

    Caution - You'll be working with AC household 230V power supply which can be deadly if mishandled.