paint-brush
IIOT – Receiving Data From Mercury Meters Via RS-485 Over TCP/IPby@asdx
3,526 reads
3,526 reads

IIOT – Receiving Data From Mercury Meters Via RS-485 Over TCP/IP

by Evgeny SkorlovDecember 22nd, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Industrial Internet of Things (IIoT) is a technology that is used in manufacturing, warehouses, factories, and laboratories. IIoT technology is used to automate and simplify manufacturing processes. Sensors on equipment and machines collect data about their operation and help prevent breakdowns. The data that these sensors and beacons can be downloaded into analysis systems to make predictions and study the entire plant. Smart meters not only record electricity consumption but also monitor electricity consumption, report voltage dips and spikes. This allows you to use smart meters to monitor your electrical circuit, read data from them remotely.
featured image - IIOT – Receiving Data From Mercury Meters Via RS-485 Over TCP/IP
Evgeny Skorlov HackerNoon profile picture

The Industrial Internet of Things (IIoT) is a technology that is used in manufacturing, warehouses, factories, and laboratories. It is used to automate and simplify manufacturing processes.


Some examples of IIoT:

  • Sensors on equipment and machines collect data about their operation and help prevent breakdowns.
  • Climate control systems that analyze temperature and humidity, automatically adjust the indoor climate
  • Sensors installed on products and parts to help with inventory and defective items.
  • Remote control systems allow equipment to be controlled over long distances.
  • Pollution sensors analyze the environment and monitor compliance with environmental regulations.
  • Vehicle-mounted trackers that track cargo movement in real time.
  • Sensors installed on automotive systems monitor fuel consumption, engine condition, and other parameters.


With the help of IIoT technology, it is possible to reduce production costs and avoid losses. Sensors on the equipment will inform about the need for maintenance. A climate control system will monitor that equipment does not overheat. Beacons on transports will indicate when a shipment is being delivered. The data that these sensors and beacons collect can be downloaded into analysis systems to make predictions and study the entire plant.


The IIoT system consists of several interconnected components that enable efficient digital process change in the enterprise:

  1. Communication Channels - provide the connection of sensors and sensors to the data storage, processing, and analysis system. A fast-wired network or various wireless technologies such as LPWAN, Bluetooth, Wi-Fi, GSM, and NB-IoT can be used for this.
  2. Sensors and smart devices are compact electronic devices that are used to collect information on the state of equipment, microclimate, and other parameters that need to be monitored. They are installed at facilities and periodically send data for further processing.
  3. Systems for data storage, processing, and analysis are designed to collect information from sensors, its processing, analysis, and display the results of the analysis. They can be in the form of a cluster of servers in the "cloud" or a closed enterprise network.


Problems with obsolete analog meters and sensors for monitoring?

It is no secret that all businesses sooner or later face the problem of outdated industrial equipment, meters, and sensors, which, although they perform the assigned tasks, do not have digital communication interfaces and automatic remote monitoring. Such limitations do not allow them to "fit" into the ecosystem of the Industrial Internet of Things that is being implemented, which means that the digitalization of this technological process cannot be achieved. If we talk about just one industrial facility and a small number of analog meters, the problem does not seem global. But if it is a large holding or concern, where there are many industrial sites and facilities, in this case, the transition can be very complicated, and choosing the right solution at the design stage will play a key role in the future.

Such a problem of taking states and readings from analog meters and sensors can be solved, and there are two main ways to do it.

The first way is to upgrade the existing monitoring scheme without replacing the existing meters and sensors.


The second way is to replace analog meters and sensors with their digital counterparts with wired or wireless interfaces for remote reading or status.


We have chosen to go the second way. The complete replacement of analog meters with digital ones increases the time and financial costs at the start, but in fact, is a profitable option in the long-term development and implementation of digitalization policy in the enterprise. For the development of any enterprise, it is important to think about replacing equipment that will not only automate the operation of the company but also receive more accurate indicators and signals.


About Smart Meters

Electricity affects our lives in many ways, from everyday life to business and industry. That's why it's considered an important factor in the economy. In the 21st century, the growth of digital innovation depends on efficient and reliable energy infrastructure. Therefore, it is necessary to improve energy production and delivery by making them smarter, more efficient, more reliable, and more transparent.

Smart meters not only record electricity consumption but also monitor and report abnormalities such as voltage dips and spikes. This allows you to use smart meters to monitor your electrical circuit, read data from them remotely, and manage your energy consumption more efficiently.


Our task was to organize the remote collection of readings from electric meters.


We took a modern electronic meter with an RS485 interface. We use meters manufactured by Incotex Mercury, modifications 203.2T or 204.



From the official documentation from the site Incotex - different protocols are used to poll meters:


To solve the problem I have developed a script that is connected to the meter via a converter RS485 over TCP/IP and takes the required readings for both protocols.



energymeter "Mercury M203.2T" connection diagram to RS485 over TCP/IP converter "SNR-ERD-4s".


SNR-ERD-4s is a multifunctional device for remote control and monitoring with Ethernet <-> RS485 interface converter function.


For the development I used Python3. The input to the script is the IP address of the converter, the used TCP port, and the serial number of the meter. when using the protocol for three-phase meters, the login and password can also be transmitted.  The script measures the Active and Reactive energy and gives information for each of the phases. Since the meters are multi-tariff, the consumption for each of the tariffs is output. The script returns the data in JSON format, which facilitates integration into various data processing and monitoring systems.


Example of usage

./mercury-em.py --proto=m206 --serial 39075510 --host 172.26.1.250 --port 50 | jq .

{

"info": {

"V": 208.7,

"A": 7.78,

"P": 1580,

"freq": 49.88

},

"energy": {

"A+_T1": 28382.38,

"A+_T2": 15782.03,

"A+_T3": 0,

"A+_T4": 0,

"A+sum": 44164.41

}

}



The final version of the script I posted on github.com


Links: