The optical port adapter for metering device IEC1107 IEC62056-21

The optical port adapter for metering device IEC1107 IEC62056-21

thingiverse

This is a high-tech optical port adapter for measuring electrical energy to interpret data. It utilizes advanced optical serial communication and data exchange protocol IEC 62056-21, which has replaced the older IEC 1107 standard. The cost of this type of optical port interface can be quite steep, exceeding 30 euros, but it's a straightforward design. To build this adapter, you'll need some affordable electronic components: a tracking sensor module with minor modifications (soldering) and an optional USB to TTL adapter for connecting to your computer via the USB port. I created the adapter using FreeCAD software to fit the tracking module precisely, similar to the one available on Aliexpress. This module requires some adjustments: de-soldering the potentiometer, soldering it on the opposite side of the PCB to optimize sensitivity, and cutting a trace for the IR transmitter while adding an extra resistor (220 ohms) to drive it from the TX line, as per the circuit diagram. The tracking module and adapter are joined securely with two short M3 screws. To attach the magnet, I used two-sided glue tape, connecting it to my adapter. The adapter relies on a magnet to link with the power meter's steel ring. To test transmission and set sensitivity, connect the adapter to the USB2TTL module and your computer. Hold the adapter about 10 mm away from any reflective material. Then use a serial terminal application (minicom or cutecom for Linux, PuTTY for Windows) to set the transmission speed to 300 bps. Type characters and adjust the sensitivity using the potentiometer until you see the received characters in the terminal. Some fine-tuning may be necessary after mounting on the power meter. Once successful, close the adapter with its cover part. If your electric meter is exposed to direct sunlight, a black PLA/ABS cover or internal black tape will block strong light. The cover and adapter are joined securely with two M3 screws. The FreeCAD file for this project is attached. Initial transmission parameters in IEC 1107 protocol are set at 300 bps and 7N1 (seven bits, even parity, and one stop bit). To test reading values from an electricity meter, I've created a simple bash script (available on Linux only): ``` #!/bin/bash # Simple text about IEC1107 protocol in Polish # https://www.elektroda.pl/rtvforum/topic2015208.html # Port settings 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 bps 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 developed an Arduino program to read measurements every two minutes at a speed of 9600 bps. To use 4800 or 9600 speeds, you'll need to adjust the sensitivity using the potentiometer accordingly.

Download Model from thingiverse

With this file you will be able to print The optical port adapter for metering device IEC1107 IEC62056-21 with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on The optical port adapter for metering device IEC1107 IEC62056-21.