Help on simplifying circuit... pull-up resistors enabled by transistors

My project is meant to interface with Chrysler vehicles pre-2008. Between 1996 and 2002(ish) they used pin 7 of the OBD-II connector for both ISO9141 and SCI protocols.

What this means in Arduino terms is a pin that can be input or output at 12 volts(ISO9141), or a 5 volt input(SCI). Either way, I must pull up the pin to the desired voltage in such a way that any incoming data from the ECU can’t damage my MCU. The incoming data isn’t my concern right now though, it’s the large circuit I had to design to enable the 5V or 12V pull-up.

If I wasn’t limited by size (this is meant to be a dongle that can plug into the OBD-II port without interfering with your feet while driving) I would have simply used a relay, but to try and save space I used transistors. The circuit I posted works, but it just feels too complex. Is there a way I can simplify this configuration?

Just to explain the picture a bit, J1962-7 refers to pin 7 of the OBD connector. ISO-K-EN and SCI-A-RX-EN come from the MCU, when they go high (3.3V) one pull-up or the other is enabled.

schematic_pullup.png

Perhaps using opto couplers is simpler? The level shifting is required, the PNP device is needed to switch the pullup.

An opto coupler can level shift and pull up in one.

And please draw circuits the right way up, its so much easier to read at a glance(!)

MarkT:
Perhaps using opto couplers is simpler? The level shifting is required, the PNP device is needed to switch the pullup.

An opto coupler can level shift and pull up in one.

And please draw circuits the right way up, its so much easier to read at a glance(!)

That's a great idea! I always forget optocouplers/optoisolators exist.

What do you mean by right side up? Is there a style guide I should be following?

Consider using MOSFETs (avalanche type prefered) the high gate impedance and voltage range eliminates the need for all the resistors. Also FETs typically have a lower leakage current then a bipolar device. You can then use a much higher pull up resistor. Devices You could put the whole circuit on an area less then 1/2 of a postage stamp if you use surface mount components.
Good Luck & Have Fun!
Gil

gilshultz:
Consider using MOSFETs (avalanche type prefered) the high gate impedance and voltage range eliminates the need for all the resistors. Also FETs typically have a lower leakage current then a bipolar device. You can then use a much higher pull up resistor. Devices You could put the whole circuit on an area less then 1/2 of a postage stamp if you use surface mount components.
Good Luck & Have Fun!
Gil

I did a bit of research, and looked up the data sheet for the STN1110, one of those OBD2 ICs, https://www.scantool.net/scantool/downloads/97/stn1110-ds.pdf

On page 18 it shows a circuit for enabling the ISO pull up, driven by a 3.3v logic pin, which is way way simpler than mine. MOSFETs are new to me so I dont understand them all that well, but 2 questions here:

  1. So I need to connect the MOSFET gate to 3.3V to turn it on? Is that what it means by P channel? Where does the component get its ground from?
  2. Could I use a MOSFET to just connect pin 7 to my ISO-RX circuit or SCI-RX circuit? If I write a logic 0 with the MOSFET enabled from ISO-RX, would it actually drive pin 7 low, or does the MOSFET turn off like a BJT?

EDIT: realized I posted the wrong schematic, must have been an old version... corrected the link and updated the page number.

OK, I think I might have found a decent MOSFET for me, RUM002N05 https://www.rohm.com/datasheet/RUM002N05/rum002n05-e Looks like I can drive it from 3.3V logic and it should drive the 12V and 5V serial logic circuits, it should be perfect for this application right?

I have one concern before I go ordering this thing and building a schematic around it though.

On page 9 there's a note at the bottom: "This product might cause chip aging and breakdown under the large electrified environment. Please consider to design ESD protection circuit."

So this thing can burn out chips if I don't design an ESD protection for each MOSFET I use? The last thing I want is to cause damage to a vehicle's circuits.

OK I mocked up kinda what the “final” version of the circuit will kinda look like. The top right is the MOSFET portion of the circuit and the rest is the circuits leading up to the ISO-K and SCI-A-RX lines that are connected to J1962-15 by the N-MOSFET. I swear I’ve seen something like this work, an N-MOSFET as a multiplexer, but I’m not sure I’m doing it right.

Am I on the right track with this circuit? Could this work?

Bump.

Could really use some guidance here. I dont think the N mosfet setup I posted will work, it's kinda looking like I will just need to do the same thing I was doing originally, but instead of an NPN BJT connected to a PNP BJT to enable the pull up, I'll connect an N MOSFET to a P MOSFET for each voltage source I must enable, 12V, 5V, and also 8V(that's for GM VPW). If that makes sense.

The last image:

If you learn how to inline images more people will look at them and may help you.

OK sounds good.

I realized the N MOSFET configuration wasn't going to work anyway so I switched back to basically what I was doing, but I'm using an N MOSFET connected to a P MOSFET like so:

The relevant portions that I'm concerned about is the SCI-A-RX-EN circuit and ISO-K-EN circuit.

Katemonster33:
That's a great idea! I always forget optocouplers/optoisolators exist.

What do you mean by right side up? Is there a style guide I should be following?

Supply rail at the top, ground at the bottom, current flow vertical (if possible), signal flow left to right (if possible). This is the "received pronunciation" of circuit schematics - learn to read schematics and you'll figure it out. Often for digital circuits supply connections are omitted (they are assumed), as are decoupling caps.

For RF circuitry often the signal path is dominant and other bits of circuitry appended to it, its a different dialect of circuit diagram (with things like microstrip and stray impedances being represented directly).

Good style means losing clutter (old fashioned diagrams of large circuits are often horribly unreadable
due to this). Break the circuit into logical sections and use named signals to imply the connections between sections.

The key fact to remember is that a circuit diagram is not a wiring diagram, its abstract and uses symbols to explain the circuit to the reader, its a visual language. It is never a blueprint for making the circuit, that's a
wiring diagram (which is a picture)