MIDI Line Driver over Cat5

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

alauth

Member
Joined
Mar 25, 2024
Messages
5
Location
France
Hello everyone !

My first time posting a thread here, hope I won't break any rule ! (don't hesitate to tell me :) )


I play in a band and we use MIDI to control our pedalboards. My goal is to create a solution to run MIDI over more than the 15m limit.

I saw this schematic about building a MIDI Line Driver over Cat 5 : https://www.edn.com/send-midi-signals-over-long-distances/

So I recreated the schematic in EasyEDA and worked on the PCB to make it work.


Four questions :

- Do you think I did anything wrong in my PCB or in my schematic ?

- On the schematic, I don't really understand the role of R3. Is it some kind of biasing of the signal between the 4N25 optocoupler and the input from the 74LS07 ?

- LED receive and send are supposed to show MIDI Data activity but I don't understand the setup with the +5V input on one side of the LED and the 74LS07 on the other side, could someone explain this to me ? (or point me to the right direction to understand this by myself ?)

- On the original schematic, there's C4, a 100nF cap between +5V and Ground, I thought it was just for stability improvement but with my power supply design, I think I don't need it anymore, am I right ?


My questions are probably quite basic but I'm learning all by myself so obvious things are sometimes not that obvious for me :D


Have a nice day everyone, thanks !

Arthur
 

Attachments

  • PCB_PCB_MIDI-Line-Driver-A-Type_2_2024-10-06 Bottom.pdf
    123 KB
  • PCB_PCB_MIDI-Line-Driver-A-Type_2_2024-10-06 Top.pdf
    130.5 KB
  • Schematic_MIDI-Line-Driver-A-Type_2024-10-06.pdf
    62.8 KB
Agree, MIDI works with almost anything you throw at it

Technically it's just a simple 31KHz serial data stream, optically isolated, no handshake. Very far from today's near-GHz and handshake -based USBprotokols - these require an answer from the other end within a handful of nS, making length matter a lot.

I've used din/xlr converters to get through a 75m stage/mixer cable
 
Last edited:
I'll test that ! Thank you guys for your answer :)

But I'm still interested in knowing if what I designed is right, if you guys have time to have a look at my schematic and PCB :D
 
As already stated, MIDI is low speed, opto-coupleted current loop, asynchronous, which make it a strong signal.

Design seem ok, which is just a buffer and a sym Tx/Rx IC.
I suppose it could be doubled to offer 4 lines on a single cable which to me is the only benefit of this.

But I'm not sure about the 5V within the CAT5 line ?!? is that to offer supply from one side only ? then I'll be concerned about that more than the signal for long distance, current is low but cable is thin, voltage drop may be calculated for long length ?

For really long distance and network abilities, RTPmidi is an option...
 
Yeah, it would be for supplying power to the second unit ! You think on a, say, 30m length, voltage drop would be an issue ?
 
I don't know what is the overall consumption... 60mA for the status LEDs, about 2x50mA for line TxRx (not sure about it in datasheet)+ buffer ?
So saying 200mA...for 30m, AWG24 @ 25°C...voltage drop is 514mV

You should double check the math, and see how will behave IC with that in real life.
Knowing that Line Tx and Rx -recommanded operating condition- give Vcc min @4.75V... possible issue...

Now if you have extra wire/pair available on the CAT5 you can lower that, with 2 pair for 5V you get 1/4, about 125mV

Another questioning is the shared 0V and shield with your single -GND- label/net ? some may have answer about it.

The initial MIDI current loop wont suffer from this, as everybody say before just test with a quality mic cable before jumping on a design that request extra stage box, power supply, more connector junction, and time to build...
 
Maybe I could send the +9V down the Cat5 instead of the +5V ? This way, each unit would have regulated +5V but I'd only need one 9V power supply ?

And I could use two different lines from the Ca5 for the power supply.

Would it be a good improvement ?
 
I don't really understand the role of R3.

According to the optocoupler symbol pin 5 is just the collector of a transistor. When the transistor is biased on current can flow from pin 5 to pin 4, but that current comes from somewhere. When the transistor is biased off only a miniscule current will flow, but without a source of current nothing would change on that pin. The connection to the power supply through R3 causes the voltage at pin 5 to be very close to the same as the power supply voltage when the transistor is off, and close to 0V when the transistor is on.

I don't understand the setup with the +5V input on one side of the LED and the 74LS07 on the other side

An LED will light when current flows through the LED. The voltage across the LED will be close to constant when that occurs, varying with the chemical composition. Around 1.4V for a typical red LED. In general, TTL devices are capable of sinking more current than they can source (i.e. they can keep the output low with more current flowing into the device to the 0V/gnd connection, while attempting to provide the same amount of current from the power supply through the output will cause the output voltage to drop. Because of that it is common to connect the power supply to the anode of the LED, and drive low with the TTL device to turn on the LED (in which current flows from the power supply, through the LED, through the TTL output, to 0V connection and from there back to the power supply, completing the circuit). When the TTL device drives high the output is not quite all the way to the power supply voltage, but it is close enough that the LED no longer conducts and so turns off.

In this specific circuit the 74LS07 is not a typical TTL logic device, however. It is an open-collector device, with the same style of output shown in the optocoupler symbol. Because of that a 74LS07 device can never drive the output to high voltage, it can either be high impedance, in which case almost no current flows through the device and the voltage is defined by other circuitry connected to the output, or it is low impedance, sinking current to keep the output low until the current limit is reached, at which point the output voltage will rise (and potentially damage the device).

On the original schematic, there's C4, a 100nF cap between +5V and Ground, I thought it was just for stability improvement but with my power supply design, I think I don't need it anymore, am I right ?

It is always good practice to place a small capacitor physically near each device. Even with a perfect power supply the connections from the power supply to each device has resistance and inductance, and the current used by the device will cause a voltage drop across that impedance (i.e. resistance plus inductive reactance). I would put more than 0.1uF at the line drivers, 1uF would probably be a good choice, right at the device power pin and directly to the 0V plane.

I believe there is a mistake in the original EDN article. The 74LS07 is an open collector output, i.e. it cannot drive the output high, only pull the output low.
I do not see any way that the connection from U1.1 output to U4 input pin 2 can ever go to logic high. That connection needs a pull-up resistor (1K like R3 would be fine).

The design also has no termination resistance on the receiver. The EDN article claims distances of over 100m possible, but I would like to see the waveforms at each end, because I suspect they do not look good with no source or receiver termination. I would expect the reciever to have a 100 Ohm resistor between the + and - input pins to match the twisted pair characteristic impedance.
It is also good practice to add ESD suppression at the line connector, although I know a lot of people just rely on the device clamping diodes, but at least series resistance at the input pins to limit ESD current should be used.

Maybe I could send the +9V down the Cat5 instead of the +5V ?

That would provide much better power quality at the far end. Also run the power return connection on the other side of the same pair for lower inductance. So if you keep your current power connection on pin 5 put return on pin 4. With the return currently on the shield pin you are forced to use shielded cable, even though it isn't really needed, and forces you to tie shield to circuit power return at that point with no flexibility.

And just to emphasize, pin 9 is the shield connection. You show it connected to the "GND" net which you are also using for the 0V power reference everywhere. It is bad practice to have a shield connected only and directly to your internal reference plane, because any external noise picked up on the cable is injected directly into your circuit. A shielding connection surrounds a circuit to protect from electrostatic noise, and you should have a controlled connection point or points to tie the circuit reference voltage to the shield at a point which does not induce noise into the circuitry. That could be at the connector shield pin, but could be elsewhere depending on physical layout.

Speaking of shield pins, note that MIDI pin 2 should be the chassis connection. The MIDI spec uses different symbols to indicate that the shield connection and the circuit reference/"circuit ground" connection are different, but the language is not as clear as it could be.
 
Back
Top