The optical port adapter for metering device IEC1107 IEC62056-21

The optical port adapter for metering device IEC1107 IEC62056-21

Description

This is a optical port adapter for metering device (i.e. electricity) to read data. It use optical serial communication and data exchange protocol IEC 1107 (old) or IEC 62056-21 (new). This type optical port interface is rather expensive (>30 Euro), but very simple. I use cheap electronics modules: tracking sensor module with small mods (soldering) and optional USB to TTL adapter (if you want to connect to the computer trough USB port). I created adapter with FreeCAD to fit tracking module (like this https://www.aliexpress.com/item/4000480007388.html - with two holes). This module need de-soldering potentiometer and solder it on the opposite side of PCB (to easy set optimal sensitivity) on power meter. Additionally this module need to cut a trace to IR transmitter, and solder additional resistor (220 ohm), to drive it from TX line (see schema). The tracking module and adapter is joined with two short M3 screws. I use two side glue tape to join magnet (cuted from magnetic fridge sticker) with my adapter. The adapter use magnet to join with power meter (the steel ring). To test transmission and set sensitivity, connect the adapter to USB2TTL module and connect to the computer. Fix adapter about 10 mm above any reflective material. Then use a serial terminal app (minicom or cutecom on Linux, PuTTY on Windows), set the transmission speed to 300 BD (chr/s). Then type any characters and regulate sensitivity with the potentiometer to see received (reflected) characters in terminal. Some corrections may be needed after mount on power meter. After successful testing close adapter with the cover part. If the electric meter is mounted at sunny place, the black PLA/ABS cover is needed (or use the black tape on internal side of cover) to block strong light. The cover and the adapter are joined with two M3 screw, FreeCAD file attached. Initial transmission parameters in IEC 1107 is 300 BD and 7N1 (7 bits and even parity and 1 stop bit). I wrote a small bash script (Linux only!) to test reading values from electricity meter: ----------------------------------------------- `#!/bin/bash` `#Simple text in polish about IEC1107 protocol `#https://www.elektroda.pl/rtvforum/topic2015208.html `#port setttings` stty -F /dev/ttyUSB0 raw speed 300 cs7 evenp `#send request` echo 2f3f210d0a |xxd -r -p >/dev/ttyUSB0 sleep 0.1 `#optional set speed to 4800 BD for faster transmission if supported by metering device` `#(sleep 15;killall cat)&` `#echo 063034300d0a|xxd -r -p >/dev/ttyUSB0` `#stty -F /dev/ttyUSB0 speed 4800 ` `#` `#read response` cat /dev/ttyUSB0 ` Finally I created Arduino program to read measurements every 2 minute with speed 9600 bd. To use 4800 or 9600 speeds you must set lower sensitivity with the potentiometer.

Statistics

Likes

15

Downloads

0

Category

Electronics