CMOS output protection

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, luketeaford, Joe.

Post Reply
User avatar
msboude
Wiggling with Experience
Posts: 299
Joined: Mon Nov 21, 2016 6:22 pm

CMOS output protection

Post by msboude »

Circuit is being driven by a CDd4017BE. Am I going to the extreme using these diodes for reverse voltage protection? I think the transistors should be protection enough?
cmos-output.PNG
cmos-output.PNG (7.94 KiB) Viewed 1165 times
Thanks!
User avatar
msboude
Wiggling with Experience
Posts: 299
Joined: Mon Nov 21, 2016 6:22 pm

Re: CMOS output protection

Post by msboude »

Also, should I throw a resistor between the output of the 4017 and the transistor base?
jorg
Super Deluxe Wiggler
Posts: 1284
Joined: Fri Apr 03, 2015 9:38 am
Location: East Coast USA

Re: CMOS output protection

Post by jorg »

R7 is redundant.
If the CD4017 pin goes low, your output is floating. Is that the desired result? In most synths, it would not be. You might want a pair of diodes at the transistor's emitter, both "pointing up" - one will prevent the emitter from going much below ground; one to prevent it from going much above V+. Keep the series resistor in place between the emitter and the tip contact of the jack.
Also, the tip contact on your jack is labeled "IN." It's meant to be an output, correct?
LogicOut2.PNG
LogicOut2.PNG (23.28 KiB) Viewed 1141 times
User avatar
msboude
Wiggling with Experience
Posts: 299
Joined: Mon Nov 21, 2016 6:22 pm

Re: CMOS output protection

Post by msboude »

Thanks for your reply, Jorg!

Yes, the "in" on the jack is actually an out, it's labeled as "in" on my thonkjack library part.

I see what you are saying about R7 being redundant. Thank you!

I'm hoping I can do without the diodes.... ?

I take it this fixes the floating output?

Thank you, I really appreciate the advice.
cmos-output.PNG
cmos-output.PNG (6.89 KiB) Viewed 1126 times
User avatar
guest
Super Deluxe Wiggler
Posts: 8053
Joined: Mon Aug 19, 2013 11:49 am

Re: CMOS output protection

Post by guest »

out of curiosity, what is the failure mode that you are concerned about here?
openmusiclabs.com
Duga-3
Learning to Wiggle
Posts: 7
Joined: Wed Feb 05, 2020 3:49 am
Location: Berlin

Re: CMOS output protection

Post by Duga-3 »

msboude wrote: Tue Feb 04, 2020 6:00 pm
I see what you are saying about R7 being redundant. Thank you!

I'm hoping I can do without the diodes.... ?

I take it this fixes the floating output?
Without R7 the output will still float below about +2V (depending on the LED color). I think, the design with R7 included is much cleaner.
User avatar
msboude
Wiggling with Experience
Posts: 299
Joined: Mon Nov 21, 2016 6:22 pm

Re: CMOS output protection

Post by msboude »

Okay, I think I have this sorted..

I heard that you want to protect CMOS chips from the outside world, so I am going to use this on each CMOS output. I am also trying to avoid a floating output and any issues when another output gets plugged into this output. I'm designing the output for a flip-flop module. This is for eurorack.

Don't mind my MS Paint picture, I'm at work and don't have access to Eagle.

Let me know if you see any issues that may arise. Thanks everyone, I appreciate you help!
CMOS-OUTPUT2.png
CMOS-OUTPUT2.png (9.42 KiB) Viewed 1064 times
jorg
Super Deluxe Wiggler
Posts: 1284
Joined: Fri Apr 03, 2015 9:38 am
Location: East Coast USA

Re: CMOS output protection

Post by jorg »

Duga-3 wrote: Wed Feb 05, 2020 5:00 am Without R7 the output will still float below about +2V (depending on the LED color). I think, the design with R7 included is much cleaner.
Yes, you're absolutely correct. I woke with a start last night when I realized I'd given bad advice.
Duga-3
Learning to Wiggle
Posts: 7
Joined: Wed Feb 05, 2020 3:49 am
Location: Berlin

Re: CMOS output protection

Post by Duga-3 »

msboude wrote: Wed Feb 05, 2020 8:40 am
Let me know if you see any issues that may arise. Thanks everyone, I appreciate you help!

CMOS-OUTPUT2.png
Now floating anymore - but in this design, the output's "high" level is at only +9.5V (assuming the transistor gets +12V at its base). Putting the 10k resistor between emitter and ground would help. Outputting a high should then give about +11.4V at the output.

BTW: how can I quote with graphics included? I always only get the file name of the pic :-(
jorg
Super Deluxe Wiggler
Posts: 1284
Joined: Fri Apr 03, 2015 9:38 am
Location: East Coast USA

Re: CMOS output protection

Post by jorg »

Duga-3 wrote: Thu Feb 06, 2020 8:11 am Now floating anymore - but in this design, the output's "high" level is at only +9.5V (assuming the transistor gets +12V at its base). Putting the 10k resistor between emitter and ground would help. Outputting a high should then give about +11.4V at the output.
True.
Also, omitting the diodes will allow an errant input (or static discharge) to drive the emitter beyond the rails.
User avatar
msboude
Wiggling with Experience
Posts: 299
Joined: Mon Nov 21, 2016 6:22 pm

Re: CMOS output protection

Post by msboude »

Alright! I have updated this!

Thanks for you help, guys!

I'm looking at the doepfer version of a similar output, looks like they use the transistor outs, but no diodes are there.. I think I should be okay?
CMOS-OUTPUT2.png
CMOS-OUTPUT2.png (8.93 KiB) Viewed 1011 times
doepfer_a161.jpg
doepfer_a161.jpg (442.24 KiB) Viewed 1011 times
User avatar
msboude
Wiggling with Experience
Posts: 299
Joined: Mon Nov 21, 2016 6:22 pm

Re: CMOS output protection

Post by msboude »

And I understand the use of the diodes, I just think it's going to take up a bit too much room on the board.. but, maybe I can gravestone them.
User avatar
the bad producer
Super Deluxe Wiggler
Posts: 2652
Joined: Tue Mar 17, 2009 8:43 am
Location: Clapton Pond

Re: CMOS output protection

Post by the bad producer »

I've always used Ken Stone's outputs:


schem_cgs36v14_pulse_divider.gif
schem_cgs36v14_pulse_divider.gif (16.76 KiB) Viewed 997 times
jorg
Super Deluxe Wiggler
Posts: 1284
Joined: Fri Apr 03, 2015 9:38 am
Location: East Coast USA

Re: CMOS output protection

Post by jorg »

Looks like Ken Stone and Dieter Doepfer both do about the same thing. I haven't built anything for the mass market so I will definitely defer to their more experienced opinions.
User avatar
guest
Super Deluxe Wiggler
Posts: 8053
Joined: Mon Aug 19, 2013 11:49 am

Re: CMOS output protection

Post by guest »

i was curious about the failure modes, so i got some 4000 series logic, put a 1k resistor at its output, and hit it with +/-12V. it survived just fine regardless of intended output state. where it didnt do so well, was when the power was disconnected from the chip, and the output was driven. it still worked but the body diode on the N channel output fried. what it really didnt like was getting an input signal with the powersupply disconnected, fried it entirely. the body diodes seem to do a decent job of protecting the chip when its powered, but something else goes when power isnt connected, and i havent figured out exactly what that is.
openmusiclabs.com
User avatar
hox3d
Common Wiggler
Posts: 231
Joined: Fri Feb 02, 2018 6:30 am
Location: Finistère, au sud

Re: CMOS output protection

Post by hox3d »

Hm, weird: in the Music Thing Modular Turing Machine expanders (for instance Pulses), the 4081 output basically is a 1k resistor in serie. That's all.

Does it make it the module more prone to failures?
If I understand well, the problem could come from a hanging cable while the synth is unpowered?
User avatar
msboude
Wiggling with Experience
Posts: 299
Joined: Mon Nov 21, 2016 6:22 pm

Re: CMOS output protection

Post by msboude »

Awesome, some great information in this thread. I really appreciate all the help!

Thanks to guest for doing some further testing, that was a great experiment. Funny, I fried a few chips when I first started by not having power connected to them, now I double-check that power is connected every time. I also turn off power before making changes...

Thanks for the schematic, bad producer.. That helps confirm some things as well.
User avatar
guest
Super Deluxe Wiggler
Posts: 8053
Joined: Mon Aug 19, 2013 11:49 am

Re: CMOS output protection

Post by guest »

ive found that the 4000 series CMOS is pretty sensitive, in particular when the power is off. the lower voltage HC logic is more robust.
openmusiclabs.com
imrae
Common Wiggler
Posts: 138
Joined: Fri May 11, 2018 12:22 pm
Location: United Kingdom

Re: CMOS output protection

Post by imrae »

Semi-necro, but I have a similar question for a different chip and it might make a difference.

I'm working on something with complementary logic and LED outputs using a CD4041 running from 0/+12V. The first draft had one set of outputs look like this:
yes-transistor.png
but I'm wondering if it would actually be ok to do away with the transistors and have this:
no-transistor.png
It's for Eurorack, so the relevant requirements are:
  • Output impedance ~1k
  • Survive an output short to +12V or -12V
  • Operate into a higher impedance, typically 100k but 50k-1M should function
Unlike many CMOS logic chips the 4041 is intended as a line driver and can dissipate 500mW. In the case of a HIGH (12V) output shorted to -12V the current draw should be ~10mA and the power draw than 150mW. (The resistor sees double that power because it has -12V on the other side... maybe a 1/8W resistor would act as a fuse?) So this situation doesn't seem to need the transistor isolation really.

The situation I'm not sure about is the case where the output is LOW and shorted to -12V. I don't see an "output LOW (source)" spec in the datasheet so it's not clear if we will essentially be connected to ground (no big deal, less power dissipation involved than above) or if this reversal is going to destroy some active circuitry that isn't designed for it.

I'm still a noob trying to get the hang of reasoning about BJTs - hopefully somebody wise in the way of CMOS/MOSFET will have an idea?

(Hmm, speaking of noobishness I'm looking at this again and wondering why the 10k resistors are there - think they can go...)
Synthiq
Ultra Wiggler
Posts: 776
Joined: Mon Feb 06, 2017 3:10 pm
Location: California

Re: CMOS output protection

Post by Synthiq »

imrae wrote: Sun Apr 03, 2022 8:52 am The situation I'm not sure about is the case where the output is LOW and shorted to -12V. I don't see an "output LOW (source)" spec in the datasheet so it's not clear if we will essentially be connected to ground (no big deal, less power dissipation involved than above) or if this reversal is going to destroy some active circuitry that isn't designed for it.
For small voltages between the source and drain the mosfet acts like a resistor and this is also true if the drain of the nmos goes negative as in this case. So the spec for the output sink current can be used and we can calculate the worst case resistance at 10V supply and room temperature to <100 ohms (VDD=10V, VO=0.5V, IOL>5mA) and typically half of it. For VDD=15V we get <79ohm worst case. For VDD=12V we get a resistance somewhere between these two, maybe 92 ohms worst case. Applying -12V via a 2.2kohm resistor, and the 92ohm output resistance, will give a 5.2mA current. So the worst case voltage drop over the output transistor will be -482mV and this is within the spec and typically it will only half of it.

A more foolproof way would be to split the 2.2kohm resistor into two 1.1kom resistors in series and add a 1N4148 diode to ground at the junction between them and let it absorb most of the negative current before it even reaches the CD4041 output. The drawback is that it adds two more components.
jorg
Super Deluxe Wiggler
Posts: 1284
Joined: Fri Apr 03, 2015 9:38 am
Location: East Coast USA

Re: CMOS output protection

Post by jorg »

imrae wrote: Sun Apr 03, 2022 8:52 am Semi-necro, but I have a similar question for a different chip and it might make a difference.

I'm working on something with complementary logic and LED outputs using a CD4041 running from 0/+12V. ...
The situation I'm not sure about is the case where the output is LOW and shorted to -12V. I don't see an "output LOW (source)" spec in the datasheet so it's not clear if we will essentially be connected to ground (no big deal, less power dissipation involved than above) or if this reversal is going to destroy some active circuitry that isn't designed for it.

I'm still a noob trying to get the hang of reasoning about BJTs - hopefully somebody wise in the way of CMOS/MOSFET will have an idea?
I think your second scheme is reasonable.
A short to -12V seems like a fairly unlikely situation. -12V is not a normal Euro signal. Smaller negative shorts will be absorbed by the protection diodes on the chip.

You might consider running the CD4041 from +5V. Then put a Schottky diode (e.g. BAT54 or BAT85) across its output, followed by a 1k series resistor. This scheme would reduce overall power dissipation. Of course, some dissipation will essentially be transferred to a +5V regulator (assuming you don't want to count on the rack having +5V). But regulators are built for it, and on average, you end up with reduced power draw.
imrae
Common Wiggler
Posts: 138
Joined: Fri May 11, 2018 12:22 pm
Location: United Kingdom

Re: CMOS output protection

Post by imrae »

Thanks both for looking at this :mrgreen:
Synthiq wrote: Sun Apr 03, 2022 12:40 pm For small voltages between the source and drain the mosfet acts like a resistor and this is also true if the drain of the nmos goes negative as in this case. So the spec for the output sink current can be used and we can calculate the worst case resistance at 10V supply and room temperature to <100 ohms (VDD=10V, VO=0.5V, IOL>5mA) and typically half of it.
Good to hear! That inspired me to try building the CMOS output stage with MOSFETs in circuitjs and that also shows an innocuous current from ground to -12V.
circuit-20220404-2221.png
A more foolproof way would be to split the 2.2kohm resistor into two 1.1kom resistors in series and add a 1N4148 diode to ground at the junction between them and let it absorb most of the negative current before it even reaches the CD4041 output. The drawback is that it adds two more components.
Like this? That is ingenious. The only quirk I see is that the output impedance will be slightly reduced when it "sees" a negative voltage while LOW, which seems pretty harmless. The trouble is that the complexity is similar to the BJT option.
circuit-20220404-2234.png
jorg wrote: Mon Apr 04, 2022 9:46 am I think your second scheme is reasonable.
A short to -12V seems like a fairly unlikely situation. -12V is not a normal Euro signal. Smaller negative shorts will be absorbed by the protection diodes on the chip.
I didn't think the CMOS output would have protection diodes, just the input?
You might consider running the CD4041 from +5V. Then put a Schottky diode (e.g. BAT54 or BAT85) across its output, followed by a 1k series resistor.
Sorry, I don't quite follow what you mean by "across its output"? We can't have a series diode on the output because it needs to act as +ve source and as a ground sink in HIGH and LOW states respectively; "disconnected" would not be a valid output, and a pulldown/pull-up resistor would not give the correct impedance.
circuit-20220404-2251.png
A diode from ground doesn't work to protect LOW from -12V; even with a Schottky diode, the node voltage is at zero so there is no potential difference to overcome the diode drop.
circuit-20220404-2253.png
This scheme would reduce overall power dissipation. Of course, some dissipation will essentially be transferred to a +5V regulator (assuming you don't want to count on the rack having +5V). But regulators are built for it, and on average, you end up with reduced power draw.
Ooh, good point. This circuit also runs a CMOS quad XOR so potentially all the logic could run at 5V.
Synthiq
Ultra Wiggler
Posts: 776
Joined: Mon Feb 06, 2017 3:10 pm
Location: California

Re: CMOS output protection

Post by Synthiq »

imrae wrote: Mon Apr 04, 2022 5:05 pm I didn't think the CMOS output would have protection diodes, just the input?
There are always diodes between both the source and drain to the substrate (represented by the connection with an arrow in the symbol). Normally these diodes are reverse biased but when the nmos drain goes negative the diode becomes forward biased.
imrae wrote: Mon Apr 04, 2022 5:05 pm A diode from ground doesn't work to protect LOW from -12V; even with a Schottky diode, the node voltage is at zero so there is no potential difference to overcome the diode drop.
Unless the output resistance of the nmos transistor is zero, the output voltage will always be negative if loaded to the negative supply. The amount just depends on the resistance in the transistor and the load current. The Schottky diode has a lower forward voltage drop than the diode in the mosfet and shunts most of the current to ground and prevents the current in the mosfet diode from reaching a level that can trigger a latch-up that can destroy the IC.
jorg
Super Deluxe Wiggler
Posts: 1284
Joined: Fri Apr 03, 2015 9:38 am
Location: East Coast USA

Re: CMOS output protection

Post by jorg »

imrae wrote: Mon Apr 04, 2022 5:05 pm
You might consider running the CD4041 from +5V. Then put a Schottky diode (e.g. BAT54 or BAT85) across its output, followed by a 1k series resistor.
Sorry, I don't quite follow what you mean by "across its output"? We can't have a series diode on the output because it needs to act as +ve source and as a ground sink in HIGH and LOW states respectively; "disconnected" would not be a valid output, and a pulldown/pull-up resistor would not give the correct impedance.

A diode from ground doesn't work to protect LOW from -12V; even with a Schottky diode, the node voltage is at zero so there is no potential difference to overcome the diode drop.
Your second figure has it exactly correct. Any negative voltage connected to the output will pull current through the diode; the diode prevents the chip's pin from going more negative than the Schottky drop, about 0.4V, so no diode inside the chip will be forward-biased.

As you imply, the Schottky is probably redundant, thanks to the low impedance at the CMOS output.

In that case, just a series resistor is probably all you need!
imrae
Common Wiggler
Posts: 138
Joined: Fri May 11, 2018 12:22 pm
Location: United Kingdom

Re: CMOS output protection

Post by imrae »

Ah, that makes sense. Needed to account for the resistance.

I think then I will try the simple outputs for a perfboard prototype, socket the 4041, and see how it does. Maybe leave room for the Schottkys.

And then, if I come to revise the design, think about a multi-voltage scheme! Shorting a 5V HIGH CMOS output to +12 is really much the same concept as shorting the 0V LOW output to -12 after all.

Thanks for input, much appeciated :mrgreen:
Post Reply

Return to “Music Tech DIY”