midi in with 3.5mm connector overvoltage protection cuircuit

Status
Not open for further replies.

mah

Well-known member
Hi, i found a nice schematic for a over-voltage protection circuit when using 3.5mm connectors for midi, as users might plug cv and gate(+-12v) in accidentally

The schematic/discussion can be found here: https://electronics.stackexchange.com/a/423181/273704

after some doing some measuring i cant see any signal after the diode:
helpu.png

Here is my own schematic:
Schematic_fiverrscehme_2021-01-12_17-32-03.jpg

Could i be using the wrong type of transistors, or inverter? should i change the resistors as im using 3.3v instead of 5v as in the original schematic?

Im using the midi out example code from here: https://www.pjrc.com/teensy/td_libs_MIDI.html
I have tried to bypass the protection circuit and that makes the midi work.

(Another problem i have encountered is that when plugging the cable in and out i causes the device i'm sending to, to stop receive the midi messages, and need to reboot the device to start receive again, might be the receiving device, need to test with something else to see where the problem lies)
 

Attachments

  • Schematic_fiverrscehme_2021-01-12_17-29-27.jpg
    Schematic_fiverrscehme_2021-01-12_17-29-27.jpg
    86.4 KB · Views: 96
I tested the "plug in and out issue" with another device(elektron machinedrum), and it does not seem to care have many times i plug the cable in and out , so i blaming the device(squarp pyramid)
 
How about using a 74HCTxxx for U5, U15 and U16 to buffer and level shift to 5v and power protection circuits with +5v?

Having said that, I think the forward drop of two BAT54s needs to be taken into account and feel that R106 and R109 need to be adjusted to compensate.
 
MIDI uses a current loop, not voltage. It's normal that you don't measure any voltage at the output of your circuit, it only needs to source current. By adding some kind of pull-up network (e.g. by connecting it to a MIDI in port), you should see a voltage after the diode.

3.3V is quite low, though, especially including the voltage drop over the diodes and transistors.

Pieter
 
How about using a 74HCTxxx for U5, U15 and U16 to buffer and level shift to 5v and power protection circuits with +5v?

Having said that, I think the forward drop of two BAT54s needs to be taken into account and feel that R106 and R109 need to be adjusted to compensate.

That sounds good, are there any 74hct that can buffer, level shift and invert the signal?
 
MIDI uses a current loop, not voltage. It's normal that you don't measure any voltage at the output of your circuit, it only needs to source current. By adding some kind of pull-up network (e.g. by connecting it to a MIDI in port), you should see a voltage after the diode.

3.3V is quite low, though, especially including the voltage drop over the diodes and transistors.

Pieter

Ye, ok thx. midi stuff don't recognize any input, so i guess this circuit don't work with 3.3v
 
MC74HC1GT04DFT2 has HC family input thresholds so probably won't work with +3.3v input signal. You need to look at 74HCTxxx family.

74HCT04 is a hex inverter and its outputs can source or sink 25Ma.

74HCT00 is a quad NAND gate which can source or sink 25Ma and can be used as an inverter by connecting both gate inputs together.

74HCT02 is a quad NOR gate which can source or sink 25Ma and can be used as an inverter by connecting both gate inputs together.
 
Just adding, in hindsight should have mentioned in my first reply that 1/8" TRS Midi hardware is on the build bench and although I don't have gear with CV or Gate (yet), a colleague does so the protection is an important design consideration.

Have decided to solder up a mockup of the protection circuit to do some steady-state measurements of how much current gets pushed thru a receiving opto. On the road so some days away.

Looking again at the circuit in post #8, MIDI_OUT_2, inverted comes out of U23 pin 4, then via 10k to base of Q1 which serves as the switch or buffer. Nothing on the base of Q1 is pulled up to +5v so I see no need for a level shift so the circuit in post #8 should work but U23 needs +3.3v for Vcc. Also, we're not feeding +5v into R119 so suggest dropping it to say 4K7. An NPN low side switch should also work in place of U23.
 
OK, but then i could probably use my original schematic, but changing it like this?
midigein.png
or should i keep 3.3v on the power protection?

The reason i sleected the MC74VHC1GT04 was because i read this in the datasheet, which sounded like what i wanted:
"The input protection circuitry on this device allows overvoltage tolerance on the input,allowing the device to be used as a logic−level translator from 3 VCMOS logic to 5 V CMOS Logic or from 1.8 V CMOS logic to 3 VCMOS Logic while operating at the high−voltage power supply.The MC74VHC1GT04 input structure provides protection when voltages up to 7.0 V are applied, regardless of the supply voltage. This allows the MC74VHC1GT04 to be used to interface 5 V circuits to3 V circuits"
 
Just tried to change the 10k resistor to a 4.7k one, keeping the power cuircuit at 3.3v and it does not seem to work

like this: midigeintest.png
 
Last edited:
Ok, mockup completed. Along the way noted circuit post #12 shows R118 as 10K, should be 110R.

ProtectedMidiOut.jpg

Don't have any BAT54s so D21/22 are 1 Amp Shottky. R204 and Red Led serve as a visible load. With Input HIGH, Led is off and Input Low, Led is on.

Measurements show Vce Q15 at 44Mv, Vce Q8 at 38Mv, D21 and D22 Vak at 242 Mv and 1.1 V across R204 so we have 5 Ma Led current so I don't see any need to fiddle with R121 or R118.

Input was connected to a T2.0 board TX and tickled with Midi and the CRO shows clean activity at Q8s Collector and repeated with a T3.5.

Do we go silly and think of how to implement software control of TRS polarity coz manufacturers have been doing it either way long before the MMA mentioned TRS hardware?
 
Looks good to me.

just changed the 10k to 110R and now its working, gonna change my new boards to 5v but for now 3.3 works

regarding software controlled trs control, it would be awesome, i read in the stackechange post something about a full wave rectifier should make the hardware accept both polarities, but maybe that was for midi in.

Edit, yes, it was for midi input:
commented on the first answer to this post https://electronics.stackexchange.com/questions/423360/±12v-protection-for-midi-input
"Seems to work like a charm in LTSpice! In addition, replacing D3 with a full-wave rectifier (made out of Schottky's) allows this circuit to accept both polarities, which is perfect now that the standard is out, but nonetheless there's still plenty of devices in the wild with the opposite polarity! – Timo Feb 21 '19 at 8:37"
 
Glad you got it working. Played with a Shottky bridge in front of the opto for receive and needed to drop the opto's series R from 220R to 200R to compensate for forward drop.

With the bridge in place, the opto has protection from reverse voltage so something may need to be added to catch any unhelpful +V.

Potential gotchas, 1/8" TS /TRS plugs may have wallwarts or several watts of stereo looking for 4 ohms lurking at the other end..

Have nutted out a schematic for sw polarity control which does not need the TX inverter, yet to mock it up for a test, distracted by different tools.
 
Status
Not open for further replies.
Back
Top