placement of zener diode for voltage protection for harware MIDI circuit?

Status
Not open for further replies.

mmryspace

Active member
Hi Everyone,

I want to move my MIDI circuit off the breadboard and following the schematic below found on the PJRC MIDI Library page.

I am trying to determine where to place the protection diode in the MIDI out circuit.

Where it says:
The extra diode between the 2 MIDI connectors is a 5.6V zener. Other than this extra diode, the circuit board followed the schematic shown above. The zener diode is not necessary for normal opertation, but does provide extra protection if external voltage is applied to the MIDI OUT port.

Would the 5.6V zener diode be placed in parallel to the 47Ω resistor at pin 4 on MIDI out?

I am working with a Teensy LC so I am using this schematic from the PJRC MIDI Lib page:

td_libs_MIDI_sch_t3.png

Any guidance is greatly appreciated =)
 
AFAICT the zener looks like it's intended to protect the Teensy TX pin from any incoming excess voltage via the Midi out port. A 5.6v zener may be appropriate for a +5v board but I think that a 3.6v item is suggested for a +3.3v board.

Some kind of buffer is a better engineering solution.
 
AFAICT the zener looks like it's intended to protect the Teensy TX pin from any incoming excess voltage via the Midi out port. A 5.6v zener may be appropriate for a +5v board but I think that a 3.6v item is suggested for a +3.3v board.

Some kind of buffer is a better engineering solution.

Thanks for the reply @MatrixRat - ahh yep - that differentiation of 5.6v vs 3.6V is not made on the MIDI lib page depending on the board. Thank you for pointing that out.

As for the placement of the zener, that was my original question... would the zener diode then be placed in parallel to the 47Ω resistor at pin 5 or ?

Not sure I follow about the buffer? Won't the zener provide voltage protection just fine? New territory for me here so additional detail would be super helpful. thanks!
 
From the pic it looks like the Cathode end of the zener is connected to the LC's TX pin and considering that it works as a shunt, the Anode would be connected to Ground.

After thinking on it I must correct myself re the zener voltage in that a 3.3v item would be suggested, however am not convinced it would provide any real protection so have never used one here.

A while back I'd wired up this on a breadboard and for the sake of clarity have left out the Din plugs. Multimeter indicated ~ 5Ma of current flow.

IMG_20210101_0001.jpg

Generally accepted as a "standard" from back in the days when +3.3v MCU's didn't exist however some Midi gear does things a little different in the receive circuitry and will pull more current like 7.5 Ma so may not work with a +3.3v derived Midi output.

The Teensy's LC TX pins are rated at 5Ma and Ok, the duty-cycle is fairly low and usually works.
Adding some kind of output buffer between the TX pin and the outside world can act as some protection if you want.

One section of a 74HCT125 or 74HCT245 will act as a level translator providing +5v as well.
Can also be done with a transistor or two and am happy to post another pic if you're interested.
 
From the pic it looks like the Cathode end of the zener is connected to the LC's TX pin and considering that it works as a shunt, the Anode would be connected to Ground.

After thinking on it I must correct myself re the zener voltage in that a 3.3v item would be suggested, however am not convinced it would provide any real protection so have never used one here.

A while back I'd wired up this on a breadboard and for the sake of clarity have left out the Din plugs. Multimeter indicated ~ 5Ma of current flow.

View attachment 23045

Generally accepted as a "standard" from back in the days when +3.3v MCU's didn't exist however some Midi gear does things a little different in the receive circuitry and will pull more current like 7.5 Ma so may not work with a +3.3v derived Midi output.

The Teensy's LC TX pins are rated at 5Ma and Ok, the duty-cycle is fairly low and usually works.
Adding some kind of output buffer between the TX pin and the outside world can act as some protection if you want.

One section of a 74HCT125 or 74HCT245 will act as a level translator providing +5v as well.
Can also be done with a transistor or two and am happy to post another pic if you're interested.

Ahhhh, yep - thanks for the eye on that pic on the MIDI lib page in regards to the zener placement - I was trying to figure that out just from the photo too...

As for the 3.6 zener, I hear you on the current range - 5.6V zener seems a safer bet but given what your saying about the potential for 7.5 mA, maybe it won't protect...

I am definitely interested in the buffer options. Would love to see a pic of those two (the IC or transistor options). Thanks so much for walking me through these concepts!
 
Since you only need to sink current a simple NPN transistor driver is sufficient and robust enough so that the Zener isn't required.
 
Since you only need to sink current a simple NPN transistor driver is sufficient and robust enough so that the Zener isn't required.

Thanks for the advice on the tranistor. this is new territory for me here. can you elaborate a little more on using a NPN, i.e which NPN and its placement in the schematic? thank you...
 
Sorry about the delay, distracted by other work.

A single NPN pulling something LOW will work as an inverting buffer and the receiving device won't like it.

A PNP transistor pulling HIGH works, tested on a T3.5.

3v3HighSideMidiOut.jpg
 
Sorry about the delay, distracted by other work.

A single NPN pulling something LOW will work as an inverting buffer and the receiving device won't like it.

A PNP transistor pulling HIGH works, tested on a T3.5.

View attachment 23053

No worries @matrixrat , I appreciate the help and explanation! i believe I have a BC557 on hand...

To clarify: those are 1 kΩ resistors in series there at the base of the transistor?

thank you for sharing this example. super helpful and much appreciated.
 
Yup. That's how I wired it so that's how I drew it

Many thanks again @matrixrat super super helpful. I am just getting started with MIDI hardware and software implementation so these details are really important to me and hopefully for others to follow. cheers
 
hey @matrixrat - I have a follow up on this buffer circuit if you dont mind?

the sketch of the buffer circuit you shared here, I overlayed pin 4 of the MIDI OUT going to the Tx line on it and you confirmed this was correct?

I am using the schematic for the teensy LC and 3.x from the MIDI lib page, and pin 5 not pin 4 goes to the Tx line. Also, is that a ground symbol off of pin 5 after the resistor in your sketch?

td_libs_MIDI_sch_t3.png

sorry - i'm just not getting the buffer circuit yet based of the sketch you provided unfortunately.
 
Sorry it's given you a headache so I tidied it up for a photo.

BC557_3v3_MidiOut.jpg

Yellow wire > TX pin
Red wire > +3.3v
Black wire > 0v
 
Hey @MatrixRat, apologies for the delayed reply. Thank you again for your patience with my learning process and sharing the additional detail on the buffer circuit. No worries - the headache was self generated and not from your expertise =)

Here's my schematic at this point incorporating the buffer circuit you provided:

Teensy_LC_BC557_3v3_MidiOut.jpg
 
No problem, I've been on the road. Sounds like you got it working. Well done!

Couldn't have done it without your great help and patience. Thank you! I just tested on the breadboard and it is working great =)

Now, moving on to a push button encoder for the next challenge :eek:
 
Status
Not open for further replies.
Back
Top