3
\$\begingroup\$

I'm writing an Arduino communication library that uses differential Manchester coding (see: http://forum.arduino.cc/index.php?topic=257985.0). I'm wondering how to communicate between two Arduinos that are far enough apart that connecting their power supply grounds is not practical, but without resorting to a wireless system. In that case, a physical communication system that does not need to pass current is needed. I thought of using Toslink fiber optic modules that are typically used for digital audio signals.

The only concern that I have is that the bit rate that my Arduino library (and the Arduino hardware itself) will be able to support is not more than about 20k bps. Digital signals typically carried by Toslink have a bit rate starting at about 1M bps. Since I am not familiar with fiber optic hardware I am concerned that the typical digital audio implementation (e.g. the TX & RX hardware and associated passive components) would not support a relatively glacial data rate of 20k bps.

I could just purchase some Toslink modules and try it out, but I thought that before I buy any parts I would make an attempt to learn about the hardware and ask if there are any inherent pitfalls in sending data at kHz (or slower) rates over Toslink.

So, is this feasible? Are there any obvious problems that will come up?

\$\endgroup\$
  • 2
    \$\begingroup\$ From one random marketing brochure "Data rate: DC to 50 Mb/s (NRZ)" But have you considered using a differential pair? \$\endgroup\$ – Chris Stratton Jul 31 '14 at 18:17
  • \$\begingroup\$ While the initial test will be done using two Arduinos connected by a wire, I realized that they need to be electrically connected. Thus the idea for Toslink. Once I have everything working, I plan to send the data over an analog RF wireless (FM modulated) system. For this reason I am not considering RS232 and differential signals. There are lots of off the shelf communication devices for the Arduino but I like to build and design things so that I learn the ins and outs of how things work. Therefore I am trying to build this from scratch myself. \$\endgroup\$ – Charlie Jul 31 '14 at 18:25
  • 3
    \$\begingroup\$ It's not really clear what you are trying to do with toslink then. But the view here seems to be that they "probably" go down to DC. If they do not, you can always use your data signal to enable/disable an oscillator at a suitably higher frequency, and then demodulate (detect the presence of) that high frequency signal to recreate your data the receiver. Basically, you would be building a radio modem, but with fiber instead of antennas. \$\endgroup\$ – Chris Stratton Jul 31 '14 at 18:28
  • 1
    \$\begingroup\$ If you want to bake a pie from "scratch" you first have to invent the universe -Carl Sagan. Yes I am not planning to fabricate any semiconductors at this time.... :) \$\endgroup\$ – Charlie Jul 31 '14 at 18:31
  • 1
    \$\begingroup\$ @Chris Stratton: One datasheet that I have seen says: Transfer rate (NRZ signal) 0.1 - 16 Mb/s. I don't see why a pulsed LED could not go down to DC, so I am wondering why there would be a lower limit for these devices. Here is a link: mouser.com/ds/2/143/PLR135_datasheet-50987.pdf \$\endgroup\$ – Charlie Jul 31 '14 at 18:37
6
\$\begingroup\$

The answer is: it depends!

It seems that most or all Toslink transmitters have bandwidth right down to DC. On the other hand, most Toslink receivers require a minimum of 100kHz for the modulation frequency for the part to function. That's too bad, because Toslink is a very practical medium for electrically isolated communication and the TX or RX hardware, as well as the fiber optic cables, are pretty inexpensive.

I did find one RX by Toshiba that is specified for operation down to DC, the TORX1952. Here is a link to the part at Mouser (The US supplier) and the datasheet:

Toshiba TORX1952(6M,F) at Mouser.com
DATASHEET

It's not exactly cheap at $10 each for QTY 1 but it should work for low speeds.

.

\$\endgroup\$
  • \$\begingroup\$ What happened? Did you get it to work? \$\endgroup\$ – user391339 Jan 29 '18 at 8:21
2
\$\begingroup\$

I'd say you can go as slow as you want.

Communication in an optic fiber is achieved pulsing a light, usually of a "single" wavelength, and detecting the pulses on the other side. Speed is limited by the speed of the emitter and the receiver, and of course by the lowpass response of the fiber. There is no low limit to bandwidth though, this sort of connection even allows DC: if you leave the emitter on the receiver would detect a steady ON.

It might be that if you buy a module it can include some sort of circuitry that may or may not limit the badwidth on the low side.

If you just buy the connector with the emitter/receiver indside and hook it directly to the micro you are good to go.

If you really need to avoid current flow optic fiber is a great idea, I'd like to know why you have such a specification because maybe a differential/twisted pair is suitable too. You can insulate the devices using optocouplers and call it a day.

\$\endgroup\$
  • 1
    \$\begingroup\$ I've looked at some datasheets for the Toslink receivers and have found listed: Transfer rate (NRZ signal): 0.1 - 16 Mb/s. This would indicate a lower limit... \$\endgroup\$ – Charlie Jul 31 '14 at 18:33
  • \$\begingroup\$ Would you please add a link to this datasheet in your question? \$\endgroup\$ – Vladimir Cravero Jul 31 '14 at 18:36
  • 4
    \$\begingroup\$ Often (in fiber optics generally; I don't know details about TOSLink) the receiver has an automatic gain control circuit that can mess things up if you try to send too slow a data rate, or if your signal has a long run of either 1's or 0's. \$\endgroup\$ – The Photon Jul 31 '14 at 18:49
  • \$\begingroup\$ @Charlie I've found some a datasheet that corresponds to your description, that's probably because the interface includes some sort of driving circuitry that does not work down to dc. You should be able to find "bare" modules that do not include anything, and use them as you please. \$\endgroup\$ – Vladimir Cravero Jul 31 '14 at 18:50
1
\$\begingroup\$

LVDS and RS-422 signaling standards work very well in this type of scenario. Driver chips for the two standards are readily available as well. Both standards work very well to support multi-MB data rates and below.

They solve the problem by providing a differential pair of signals, which means that the voltage and current transmitted on the positive side is always matched by the negative side, such that there is no net current from one side of the interface to the other.

\$\endgroup\$
  • \$\begingroup\$ I am not sure how you answer addresses the question, moreover I need clarification about the implication "differential pair->no net current". I mean, can you provide an example of an interface where there is a net current flow? That may lead to interesting results. \$\endgroup\$ – Vladimir Cravero Jul 31 '14 at 18:23
  • \$\begingroup\$ See comment added to opening post. I am not looking for a differential signal solution. \$\endgroup\$ – Charlie Jul 31 '14 at 18:26
  • 1
    \$\begingroup\$ Well on single-ended signaling methods, there is typically a net current flow from the driver to the receiver. This current typically returns through the ground. The differential signaling eliminates this (and therefore eliminates the need to connect the grounds) by adding a negative side that is always 180 degrees out of phase, providing an equal and opposite current over the interface. \$\endgroup\$ – kjgregory Jul 31 '14 at 18:26
  • \$\begingroup\$ Fair enough. I was thinking of something that pushed current without a ground return, and that was quite puzzling me... \$\endgroup\$ – Vladimir Cravero Jul 31 '14 at 18:36
  • \$\begingroup\$ Differential signalling still needs a ground reference, because the receivers generally have a limited common-mode voltage range that they can handle. Transformer coupling can eliminate this (e.g., Ethernet), but then we lose the ability to transmit DC or low-frequency signaling. In any case, -1 for not actually answering the question. \$\endgroup\$ – Dave Tweed Jul 31 '14 at 21:40
0
\$\begingroup\$

The simplest solution would be to use signaling via current rather than voltage.

In current loop signaling, you signal a one by sending 5ma (for example) around a loop. On the other end, the loop is directly fed through the LED side of an optocoupler and not electrically connected to the reciever at all.

There is no common ground, it is immune to interference and since the current is the same around the entire loop it is independent of the length of the cable, no voltage drop.

This is exactly the method MIDI uses to avoid ground loops in musical equipment. The only bad part is that it is single duplex so you need two loops with 4 wires total for bidirectional traffic but it is dead simple to implement. There are a variety of MIDI interface circuits online that you can directly use.

\$\endgroup\$
  • \$\begingroup\$ I already addressed this: I do not want to use a system in which there is a loop, like with an optocoupler or balanced line. This is because I will move on from two Arduinos connected by a wire to using an analog RF communications system, so there can be only one signal transmitted. I suppose you could consider this as two loops: one from the TX Arduino to the RF TX and back, and the other from the RX RF to the RX Arduino and back. In between there is wireless... \$\endgroup\$ – Charlie Aug 3 '14 at 6:42
  • \$\begingroup\$ A current loop is a single bit of information that can be scaled to any speed, exactly as you would get with the TOSlink cables or half-duplex RF links from the arduino side but simpler to implement. It sounded like you wanted to prototype communication as it would be with RF without a common electrical ground which is what this does. It makes no electrical connection between the arduinos either. \$\endgroup\$ – John Meacham Aug 3 '14 at 11:35
  • \$\begingroup\$ I'm not at all disagreeing with your definition of a current loop, but it's still a physical (wired) connection between the systems. And what if that distance is 50m? 500m? 1km? In that case, it's not so practical... this is exactly the kind of jump I want to be able to make using an RF based link once I get the system working with a short wired connection. \$\endgroup\$ – Charlie Aug 4 '14 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.