Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 17 of 17

Thread: midi in with 3.5mm connector overvoltage protection cuircuit

  1. #1

    midi in with 3.5mm connector overvoltage protection cuircuit

    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:
    Click image for larger version. 

Name:	helpu.png 
Views:	29 
Size:	63.3 KB 
ID:	23222

    Here is my own schematic:
    Click image for larger version. 

Name:	Schematic_fiverrscehme_2021-01-12_17-32-03.jpg 
Views:	27 
Size:	88.9 KB 
ID:	23221

    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)
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Schematic_fiverrscehme_2021-01-12_17-29-27.jpg 
Views:	23 
Size:	86.4 KB 
ID:	23220  

  2. #2
    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)

  3. #3
    Senior Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    203
    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.

  4. #4
    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

  5. #5
    Quote Originally Posted by MatrixRat View Post
    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?

  6. #6
    Quote Originally Posted by PieterP View Post
    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

  7. #7
    maybe a 74AHCT240 will do the trick, or MC74VHC1GT04?
    Last edited by mah; 01-13-2021 at 11:33 AM.

  8. #8
    Click image for larger version. 

Name:	nymidi.png 
Views:	24 
Size:	110.3 KB 
ID:	23247 like this maybe?

  9. #9
    Senior Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    203
    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.

  10. #10
    Senior Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    203
    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.

  11. #11
    OK, but then i could probably use my original schematic, but changing it like this?
    Click image for larger version. 

Name:	midigein.png 
Views:	21 
Size:	131.9 KB 
ID:	23267
    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"

  12. #12
    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: Click image for larger version. 

Name:	midigeintest.png 
Views:	15 
Size:	127.5 KB 
ID:	23268
    Last edited by mah; 01-14-2021 at 12:34 PM.

  13. #13
    Senior Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    203
    Ok, mockup completed. Along the way noted circuit post #12 shows R118 as 10K, should be 110R.

    Click image for larger version. 

Name:	ProtectedMidiOut.jpg 
Views:	18 
Size:	167.2 KB 
ID:	23288

    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?

  14. #14
    Quote Originally Posted by mah View Post
    OK, but then i could probably use my original schematic, but changing it like this?
    Click image for larger version. 

Name:	midigein.png 
Views:	21 
Size:	131.9 KB 
ID:	23267
    Just wanted to know if it was safe to try this, changing the power to 5volts? And change r114 from 10k to 110R? Don't wanna fry (another) teensy

  15. #15
    Senior Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    203
    changing the power to 5volts? And change r114 from 10k to 110R?
    Looks good to me.

  16. #16
    Quote Originally Posted by MatrixRat View Post
    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.co...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"

  17. #17
    Senior Member
    Join Date
    Aug 2019
    Location
    Melbourne Australia
    Posts
    203
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •