Driving open collector output at higher than VCC - Page 1
Forum section: electronics / beginners

author: richard_st
author_rank: Newbie
timestamp: March 11, 2024, 01:59:02 pm
content: I'm designing a simple fan controller circuit, currently I'm using anAS393P-E1to report the fan RPM back to the host device. In my design I'm using a 3.3v regulator to power my logic ICs.From my testing, some PC motherboards pull the RPM sense line to 3.3v, but some pull it to 12v.I've tested this with the AS393P-E1 and everything seems to work as expected, but is this reliable long-term, or might this damage the chip somehow?

author: Kleinstein
author_rank: Super Contributor
timestamp: March 11, 2024, 02:05:39 pm
content: The datasheet somehow miss out on the maximum spes for the voltage at the outputs. This should be OK up to the normal maximum supply (36 V) at least. It is common to use similart comparators (e.g. LM393 , LM339 as the quad version) with JFET switches. These are regularly used up to some 40 V - though a few (but not many) faults happen.So the 12 V max should be pretty save.

author: Ian.M
author_rank: Super Contributor
timestamp: March 11, 2024, 02:20:00 pm
content: The datasheet says "Differential Input Voltage Range Equals to the Power Supply Voltage" so connecting a signal with a 12V pullup is *risky* to an input unless you run the AS393P-E1 from 12V (with its OC output pulled up to 3.3V for your logic).Going the other way, the OC output is certainly good up to the supply voltage, but as it doesn't have a spec for the max. output voltage, above the supply is risky as you have no idea of the output transistor's isolation structure from the rest of the die. However power it at 12V and again the problem goes away.

author: richard_st
author_rank: Newbie
timestamp: March 11, 2024, 02:25:48 pm
content: Quote from: Ian.M on March 11, 2024, 02:20:00 pmIn my use case I am connecting the OUTPUT pin of the comparator to the RPM sense pin on the motherboard, that would normally go to the fan tach.i.e. my circuit is both pulling the actual RPM sense line to 3.3v, and also generating a signal to go back to the host.

author: Ian.M
author_rank: Super Contributor
timestamp: March 11, 2024, 02:27:05 pm
content: I just realised that and revised my post accordingly.

author: shapirus
author_rank: Super Contributor
timestamp: March 11, 2024, 02:43:48 pm
content: See the block diagram athttps://www.ti.com/lit/ds/symlink/lm393.pdf, section 7.The 393 comparator has an NPN transistor on the output which doesn't care what VCC is, as, regardless of the value of VCC, it'll have a maximum of one p-n diode drop across its base and emitter.You need to care about two things: 1) not to exceed its allowed sink current (which depends on the value of the pull up resistor and the rail it's connected to); 2) not to exceed its max allowed Vce voltage (which is 36 V that's way above the worst case of 12 V).p.s. it would help to draw a schematic of how you are going to connect things to avoid any possible confusion and misunderstanding.

author: Peabody
author_rank: Super Contributor
timestamp: March 11, 2024, 02:50:28 pm
content: If you have a comparator you could sacrifice in a test, it might be interesting to ramp up the OC voltage and see where it fails. If you get to 40V and it's still working fine, then 12V is almost certainly ok, even for the long run.But an alternative would be to find an NPN transistor that is speced for high C/E voltage, and insert it into the output line. Its emitter would be connected to the comparator output, its collector to the PC's sense line, and its base, through a resistor, to the 3.3V supply. Then the comparator output would never see higher than 3.3V, and polarity is maintained. But that doesn't help you on current, if that's a problem.Edit: For future reference, I want to substitute an N-channel mosfet for the NPN transistor. That's because at a high enough C/B voltage, that junction may start to act like a zener, with unpredictable results. My memory is that might happen at about 8V.

author: richard_st
author_rank: Newbie
timestamp: March 11, 2024, 02:56:59 pm
content: Quote from: shapirus on March 11, 2024, 02:43:48 pmI guess the concern would be if the AS393 is designed differently. That's the comparator I had on hand but I could swap it for a 'real' LM393.Quote from: Peabody on March 11, 2024, 02:50:28 pmI might give that a go later this evening. I don't think I can go quite that high without other problems but should be able to manage 20-25V.

author: shapirus
author_rank: Super Contributor
timestamp: March 11, 2024, 03:30:22 pm
content: Quote from: richard_st on March 11, 2024, 02:56:59 pmPretty sure it's the same stuff, hence the naming. It's a jellybean part produced by many companies. Absolute maximum ratings in the datasheet suggest this too.Besides, how would you implement an open collector output otherwise?

author: richard_st
author_rank: Newbie
timestamp: March 11, 2024, 07:50:33 pm
content: Quote from: Peabody on March 11, 2024, 02:50:28 pmJust tried this, with a 5V fan powered from an independent supply. Gradually ramped up to 30V with no issues.Think I'll stick with these comparators for the final build.

author: Nominal Animal
author_rank: Super Contributor
timestamp: March 12, 2024, 12:26:53 am
content: SeeIntel 4-wire PWM fan specification. The PWM and tach signals are open collector at less than 30kHz frequencies; no need for an analog comparator.I useNX138AKN-channel MOSFETs in SOT23-3 (AKA TO-236AB) for this; see e.g. mydual fan ATtiny85 controller, and my5V to 12V PWM fan adapter.The gate to the MOSFET is the input from either the fan (tach) or motherboard (PWM), and can handle ±20V. Even if shorted to ground or 12V, it doesn't mind. The source is always to ground, and the drain is the signal, pulled up to whatever VCC is used (down to 2V works fine) using a suitable resistor. 10kΩ is just a value I decided on looking at the current ranges one can expect based on the spec, that also seemed to behave well in simulations with acceptable amounts of waste (heat).For PWM output (to the fan) or tach output (to the motherboard), the output from my circuit is always an open collector one using NX138AKs. The drain can be pulled up to 60V without damage; my circuits don't do above 12V or 24V. For safe level translation, I use two NX138AKs in sequence, simply because a single one will invert the signal.My own controller circuits has the microcontroller handle inverted signals, so only one translator per signal (in either direction) is needed for safe inputs and outputs.It would be trivial to modify the dual ATtiny85 controller to act like a PWM modifier stage with additional potentiometer input, so that the PWM duty cycle from the motherboard is mapped arbitrarily to the actual PWM duty cycle sent to the microcontroller, and the tachometer rate similarly arbitrarily mapped from the fan to the motherboard, using just four NX138AKs,making this absolutely safewith any motherboard and fan following the Intel 4-wire fan spec at least roughly.While there are many other N-channel enhancement mode MOSFETs like BSS138 that can do the job just as well, I picked NX138AKRs because they are cheap (5.5€ for a lot of 100 at Mouser; $0.0327 each at JLCPCB assembly, 2.66€ for a lot of 100 at LCSC), easily modeled using LTspice or KiCAD/ngspice (NX138AK.libspice model), they tolerate up to ±20V between gate and source (enough for my MOSFET needs!), and behave quite well in this configuration up to pretty high frequencies (faster than BSS138 and and smaller gate charge than BSS138, but not relevant here, since the PWM is just 25 kHz, and the tach signal is just two pulses per revolution, under 1 kHz for up to 30k RPM). It's basically my current 3.3V logic level N-channel enhancement mode MOSFET for signal uses.