DIY optical power meter with SFP module and Arduino idea

Fifer optics power meter is an important tool for debugging fiber optics networks. I have earlier tested a cheap commercial fiber optic power meter a at Fiber optics power meter posting.

Hardware hackers ares famous for building their own test equipment. The basic operation of optical power meter is quite simple: take a suitable detector, add amplifier or signal and add display. The practical implementation gets hard when you need to work with precision fiber optics and get the device calibrated somehow.

Hackaday Prize Entry: An Optical Power Meter article tells about an interesting project that build a fiber optic power meter using SFP transceiver module and Arduino. The most optical fiber module in today communication use form factor called SFP (small form-factor pluggable) physical interfacing. SFP is widely used in many switches, routers and many telecom devices. The trick is that SFP modules have a built-in signal level metering functionality that measures optical power in dBm. The measurements results can be read with DDM (Digital Diagnostics Monitoring ) protocol that is accessed via a 2-wire serial bus (also known as “I2C” or “I2C” protocol). The circuit is simple enough to be built on a piece of perfboard (check out the circuit diagram).

Optical Power Meter (with SFP and DDM protocol) project page shows how to DIY Optical Power Meter with SFP (Small Form-factor Pluggable transceiver) and DDM (Digital diagnostics monitoring ) protocol. This project looks like an useful instrument and teaches about SFP modules. Besides measuring laser power, the device also allows turning on the transmitting laser if needed.

10 Comments

  1. Tomi Engdahl says:

    Design of Small Form-factor Pluggable Reader using Arduino Board
    https://ieeexplore.ieee.org/document/9431389

    This paper presents the small form-factor pluggable (SFP) reader by using arduino board which perform readings the register data stored in the EEPROM of SFP device and displaying on TFT LCD. The SFP reader is to read the properties of SFP for checking the data of interested SFP. There are many brand and version of SFPs that have different properties that can cause the waste time and budget for installation with wrong devices. The results show that the proposed SFP reader can read the data properties and Tx/Rx optical power.

    Reply
  2. Tomi Engdahl says:

    Using SFP modules from a microcontroller
    https://electronics.stackexchange.com/questions/393416/using-sfp-modules-from-a-microcontroller

    Looking at what’s in the SFP modules, it may not be all that difficult to use them directly.

    Since the signals are AC coupled to LVDS, you’ll need to communicate in a DC balanced protocol such as Manchester, which your chosen ARM may or may not support (my current favorite Microchip SAME70 does support it). And, of course, add LVDS receiver/transmitters. You may be able to ignore the EEPROM since you only want to work with a single type of SFP module.

    Judging by the values shown, you’d probably have to keep the frequency at 10MHz or higher, which you will need to do anyway for that data rate.

    SFP Transceivers use high speed differential pairs for transmit/receive on the host side. These generally start at data rates of 1Gbps and go up from there, so they’re not trivial to implement and can’t just be plugged into an MCU like the STM32F4–such MCUs simply don’t have the physical interface for it. It’s really the domain of Ethernet switch ASICs and FPGAs.

    If you switch to an MCU that includes an Ethernet MAC (there are several options in the STM32F4 family), you could use a conventional PHY with an optical transceiver. TI has a dev board that shows this approach using their TLK105L PHY and a Broadcom AFBR-5803Z Optical transceiver. It appears that design materials are available, but I haven’t looked at them. Here’s the overview document for the dev board: http://www.ti.com/lit/ug/tidu366/tidu366.pdf. This should not be any more difficult to implement than a regular copper Ethernet interface, which means it still requires a good deal of care, but will be less challenging than a 1G+ SERDES. The downside is that from a quick look at the datasheets this solution will consume nearly 1W, so it likely won’t meet your power budget even accounting for the fact that your data rate will be relatively low.

    If you want an even simpler option, there are other fiber transceivers beyond TOSLINK ones. Broadcom and Avago would be key brands to look at, but just browsing Mouser’s Fiber Optic Transceiver category brings up several promising options in the 50-100Mbd range.

    Reply
  3. Tomi Engdahl says:

    Experiment With SFP Modules With This Handy Breakout
    https://hackaday.com/2021/02/13/experiment-with-sfp-modules-with-this-handy-breakout/

    While most home networking hardware comes with network ports baked in from the factory, industrial grade gear is typically more versatile. Using standards like Small Form-factor Pluggable, or SFP, network switches can be used with a variety of transport mediums by simply swapping tranceivers in and out. These network devices typically handle the nitty gritty of transmitting Ethernet over fiber optics, and for those keen to experiment, this breakout may come in handy.

    The board design comes complete with an SFP receptacle, allowing a variety of compatible receivers to be plugged in for experimentation. With the standard using differential signalling, the board carries hardware to allow the transceiver to be fed with single-ended signals instead, though a differential version is available too. The board can be used for transmitting different signals over fiber, outside just Ethernet, or used as a simple way to reprogram SFP modules via I2C. The latter can be useful to get around DRM in network switches that attempt to lock out generic transceiver modules.

    https://osmocom.org/projects/misc-hardware/wiki/Sfp-experimenter

    The Osmocom SFP experimenter board a small circuit board for experiments with (usually fiber optical) transceivers in SFP form factor.
    You can use it for e.g.

    transmitting your own signals / waveforms (not restricted to Ethernet or CPRI) over fiber optics. This is e.g. useful if you need galvanic isolation between digital circuits, or need long-distance transmission
    attach some I2C adapter to the I2C pins of the SFP module in order to re-program it
    The SFP transceivers exhibit a symmetric/differencial interface for Rx and Tx. The sfp-experimenter board contains an on-board differential transmitter and receiver so you can transmit/receive normal single-ended signals.

    If you’re interested in transmitting differential signals, please see the sfp-breakout board instead. It’s like the SFP experimenter board, but contains no differential transmitter + receivers.

    https://gitea.osmocom.org/electronics/osmo-small-hardware/src/branch/master/sfp-breakout

    https://gitea.osmocom.org/electronics/osmo-small-hardware/src/branch/master/sfp-breakout/sfp-breakout.pdf

    https://gitea.osmocom.org/electronics/osmo-small-hardware/src/branch/master/sfp-breakout/sfp-experimenter.pdf

    Reply
  4. Tomi Engdahl says:

    Arduino Uno as portable SFP DDM/DOM reader?
    https://forum.arduino.cc/t/arduino-uno-as-portable-sfp-ddm-dom-reader/151495

    Hello forum members!
    I will try to connect a SFP to a Arduino Uno to be able to read out the SFP DDM/DOM information from a SFP.

    I have read about the sfpddm project by SloMusti (GitHub – SloMusti/sfpddm: Arduino library for interfacing SFP modules and reading DDM information as per SFF-8472 22) but I want to be able to power the SFP module without the converter. After reading the pinout (Small Form-factor Pluggable – Wikipedia 3) I does not look impossible to make it work. Anybody with experience how want to share?

    First problem is to power the SFP, which pins need power? I only need the reciever part to work.

    I would guess that providing 3.3V power on pin 15 “VccR: Receiver power (3.3 v)” and Ground on pins 9, 10, 11, and 14 “VeeR: Receiver ground” would power the receiver.

    sfpddm
    https://github.com/SloMusti/sfpddm

    Arduino library for interfacing SFP modules and reading DDM information as per SFF-8472. The library is following the standard but is not yet fully compliant, some additional rarely used functions need to be implemented for that.

    How it works

    The library offers functions that return measurements in the form specified by the standerd. Handles the externally callibrated data as well, performs the necessary calculations and outputs the results as if they were internaly calibrated.

    For communication the specified I2C library is internally initialized, the default Arduino I2C library is not reliable enough and can not be used. Please obtain and install the I2C library by Wayne Truchsess http://dsscircuits.com/articles/arduino-i2c-master-library.html

    Modification of TP-Link MC220L for accessing SFP management bus (I2C)

    TP-Link MC220L media converter is an Ethernet to SFP converter for use with SFP fibre or copper modules for either 100Mbps or 1Gbps Ethernet communication and can be modified, allowing a connection of an external device sucha as an Arduino to the I2C SFP management bus.

    SFP module 4 and 5 pins are used for I2C communication and can be located on the bottom side of the PCB. There is an array of resistor footprints, most of them unpopulated. Left (orientation normal to the solder mask) resistor pads of footprints R57-SCL and R55-SDA. SFP power supply decoupling and filtering section is located on the top side of the PCB, to the right of the SFP cage. For best noise performance and decoupling of additional circuitry, 3.3V power must be taken from the mid point between the two inductors with markings IR0. Ground should be taken from the capacitor pads C58 of C57.

    Reply
  5. Tomi Engdahl says:

    Phase-2# Hello SFP from Arduino
    https://hackaday.io/project/21599-optical-power-meter-with-sfp-and-ddm-protocol/log/58579-phase-2-hello-sfp-from-arduino

    The first trial is using existing Lib for DDM interfacing. But there is not much such library and the only one in my eye is SloMusti, Arduino library for interfacing SFP modules and reading DDM.

    https://github.com/SloMusti/sfpddm

    Unluckily, lib is not work in the first try. SloMusti Github page said that “For communication the specified I2C library is internally initialized, the default Arduino I2C library is not reliable enough and can not be used. Please obtain and install the I2C library by Wayne Truchsess http://dsscircuits.com/articles/arduino-i2c-master-library.html”.

    Anwyaw, SloMusti Lib is very informative and structurally formatted and it help me alot how to do things.

    So, I try to write my own I2C code snaps with Arduino building lib and it worked. So, I developed by own SFPDDM Lib from scratch. My idea is keep it simple and forward. The first step is to read raw data format from SFP/DDM registers (96-117). These reg are used for monitoring, alarm, control and debugging. Each function of these register and explanations are worth to read from Finisar Application note.

    https://www.finisar.com/sites/default/files/downloads/an-2030_digital_diagnostic_monitoring_interface_sfp_optical_transceivers.pdf

    Connection pin outs Arduino UNO are as follow. Be sure to use 5V-3.3V level shifter board.

    VeeTs – GND

    VeeRs – GND

    VccRs – 3.3V

    VccTs – 3.3V

    MOD-DEF(2) – SDA (4)

    MOD-DEF(2) – SDA (5)

    MOD-DEF(2) – GND

    Then, I tried to read reg(96) with normal I2C Lib (Arduino buildin) and print it out to UART. Then, phrase and formatted.

    The first trial output, output from reading DDM register. Look promising.

    https://github.com/SloMusti/sfpddm

    Reply
  6. Tomi Engdahl says:

    TE Connectivity SFP Connector Female 20-Position, 1367073-1
    https://fi.rsdelivers.com/product/te-connectivity/1367073-1/te-connectivity-sfp-connector-female-20-position-1/6809718?cm_mmc=FI-PLA-DS3A-_-google-_-PLA_FI_FI_Connectors_Whoop-_-(FI:Whoop!)+Pluggable+I/O+Connectors-_-PRODUCT_GROUP&matchtype=&aud-827186183886:pla-476981918544&s_kwcid=AL!14853!3!598320122796!!!g!476981918544!&gclid=EAIaIQobChMIxprBzObx_QIVKQWiAx0viAvAEAQYAiABEgJS2vD_BwE&gclsrc=aw.ds

    Reply

Leave a Reply to Tomi Engdahl Cancel reply

Your email address will not be published. Required fields are marked *

*

*