Skip to content

reading SDM120 / SDM220 / SDM630 modbus energy meters from esp8266 arduino via rs232 to rs485 converter (tamplate library)

Notifications You must be signed in to change notification settings

mitnicki/SDM_Energy_Meter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template library for reading SDM120 / SDM220 / SDM630 Modbus Energy meters.

Reading via Hardware Serial or Software Serial (library https://github.com/plerup/espsoftwareserial)
and rs232<->rs485 converter with automatic flow direction control (look at hardware_sdm220.jpg)
or with converters with additional pins for flow control, like MAX485.
(In this case MAX485 DE and RE pins must be connected together to one of esp pin and this pin must be passed when initializing the library)

//lib init when Software Serial is used:
#include <SDM.h>
SDM<4800, 13, 15, 12> sdm;  //baudrate, rx pin, tx pin, dere pin(optional for max485)

//lib init when Hardware Serial is used:
#define USE_HARDWARESERIAL
#include <SDM.h>
SDM<4800, 12, false> sdm;  //baudrate, dere pin(optional for max485), swap hw serial pins from 3/1 to 13/15 

Tested on wemos d1 mini->ESP8266 with Arduino 1.8.3 & 2.3.0 esp8266 core

crc calculation by Jaime García (https://github.com/peninquen/Modbus-Energy-Monitor-Arduino/)

UPDATE:

2016 - 2017 Reaper7

paypal.me/reaper7md

About

reading SDM120 / SDM220 / SDM630 modbus energy meters from esp8266 arduino via rs232 to rs485 converter (tamplate library)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%