MultiTrans: Multi Channel Transceiver (just 1 pin per transceiver!)

After extensive stress tests and after months of use in production, I’m happy to announce MultiTrans, an implementation of a multi channel transceiver. Find MultiTrans in the Arduino library manager or in the GitHub repo feklee/multitrans.

New in version 1.2 is binary communication, i.e. sending and receiving messages that may include the null character.

I’m happy to answer any questions!

Features:

  • Transceiver: Transmit and receive simultaneously via a single pin. (No clock line needed.)

  • Multi channel: Multiple pins can transceive simultaneously.

  • Collision detection: One pin can start sending without worrying if the other side is sending as well. Collisions are automatically detected and circumvented. No information is lost.

  • Maximum uni-directional data rates on an Arduino Uno / Pro Mini:

  • Communication with one peer: 12 kbit/s

  • Communication with four peers: 3 kbit/s
    Bi-directional data rates are a little less than half of the above rates in each direction.
    Limitations:

  • Buffers:

  • The buffer on the transmitting end can contain 256 bits at the most. For each character, 21 bits are necessary. This equates to 12 characters.

  • The buffer on the receiving end can only contain up to 255 pin change events.

  • Flushing the buffer on the receiving end takes some time.
    The system is thus best used for short bursts of data with sufficient idle time in between.

  • No built-in error checking. You may want to implement your own error checking, to take care of:

  • If you have a flaky connection between the Arduinos, for example due to bad electrical contacts, then bits may get lost.

  • Theoretically, i.e. if timing is perfectly right, the collision detection built into MultiTrans may fail resulting in bit loss.

  • It only works with AVR based Arduinos. In fact, code so far has only been tested with the Arduino Pro Mini and the Arduino Uno.

  • Timers are occupied:

  • 8-bit Timer/Counter2 (TC2), for transmitting

  • 16-bit Timer/Counter1 (TC1), for receiving

Examples:

Interesting. I am bookmarking this in the hope I find time to try it.

Have you any information about the maximum length of wire over which the system works?

I presume you need a GND connection as well as the data wire?

...R

Sorry for the late reply. I didn’t see your response as I forgot to subscribe to the topic. Yes, I’m very interested that other people try the library and I’m happy to get feedback!

Robin2:
Have you any information about the maximum length of wire over which the system works?

I use it over distances of about 150 mm. It’s digital communication. So I presume the maximum distance is comparable to that of SoftwareSerial.

I presume you need a GND connection as well as the data wire?

Yes, I had to obey the laws of physics. :wink:

feklee:
I use it over distances of about 150 mm. It’s digital communication. So I presume the maximum distance is comparable to that of SoftwareSerial.

I, too, had forgotten about it, and I doubt if I will get time to try it for a few more days.

I would expect a regular Serial connection to work over a much greater distance - certainly 1500mm and maybe 5000.

...R