Git Product home page Git Product logo

16chcurrent2mqtt's Introduction

16 Channel Current Meter to MQTT Gateway

This sketch runs on an ESP8266 and reads data from 16 Channel Current Measurement Module over RS485 Modbus and publishes the data over MQTT. This module is available Aliexpress on the following link: https://www.aliexpress.com/item/1005002090646451.html

Setup

This sketch publishes the 16 channel current information and some auxillary data. This unit is supposed to measure frequency as well, but for some reason it does not work for me. So I excluded that from the sketch. There is no voltage measurement, therefore to calculate power consumption you need a separate device to measure the exact voltage. You can see below the data published to MQTT. Current measurement is 10 mA resolution.

MQTT Data

Install

Download this repository and build and flash your ESP. You need an Arduino IDE with ESP8266 configuration added. You need a few additional libraries (see below). And before you build open the settings.h and set your credentials. I think they are self explanatory. Compile and upload.

Libraries

The following libraries are used beside the "Standard" ESP8266 libraries:

  • FastLED by Daniel Garcia
  • ModbusMaster by Doc Walker
  • ArduinoOTA
  • SoftwareSerial

PCB

I designed a custom PCB for this board (for a previous project), you can order if from here: https://www.pcbway.com/project/shareproject/ESP8266_Modbus_board.html

These are the components you need to build this. I purchased most of them a long time ago. I don't have the original listing, so I included a similar Aliexpress listing.

With these two components you can power the board using the micro USB on the Wemos D1 mini. My PCB includes components for mains supply:

And if you want to wire them yourself, these are the connections:

Wemod D1 mini (or other ESP)            TTL to RS485
D1                                      DE
D2                                      RE
D5                                      RO
D6                                      DI
5V                                      VCC
G(GND)                                  GND

Videos

I explain everything about this project in this video:

Full review

Current Reader Documentation

I copy here the documents that were on the original Aliexpress listing in case the listing disappers from Aliexpress.

Dimensions

Modbus registers

Modbus registers

Wiring

Below is the description of the Aliexpress listing

Type 1: 40A threading transformer Type 2: 80A threading transformer Type 3: 40A opening and closing transformer Type 4: 120A opening and closing transformer

Parameters

  • Power voltage: DC8~28V (with self-recovery insurance)
  • Rated power consumption: 3W
  • Ac current measurement error: Typical value ±2%50Hz, ±5% non-50hz
  • Frequency measurement error: Typical value ± 2.5hz/frequency division coefficient
  • AC current resolution: 0.04A (40A range)
  • Data refresh frequency: >5Hz/ frequency division coefficient
  • Communication interface: RS485 isolation band TVS protection
  • Operating temperature: -20℃ ~ 50℃
  • Working humidity: 5%~90% no condensation
  • Operating frequency: [10Hz*5/ frequency division coefficient]~400Hz
  • Communication baud rate: Default 9600, N, 8, 1
  • Same network node: Maximum 32

Modbus-RTU communication protocol Function code: 0x03, read multiple registers Example: 01 03 00 00 00 38 44 18

Read 56 word data from device 01 address 00 Example: 01 06 00 03 00 02 F8 OB

Write data 0002H to device 01 address 03 Function code: 0x10, write multiple registers Example: 01 10 00 03 00 01 02 00 02 27 A2 Write data 0002H to device 01 address 03

Matters needing attention

  1. Only operators with certain electrical knowledge can conduct wiring and other operations on the product. If there is any unknown use, please consult our company.
  2. Avoid using in high temperature, humidity and dust, and avoid direct sunlight.

16chcurrent2mqtt's People

Contributors

nygma2004 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.