Sanity check on using a transistor as a switch...

Thread Starter

Non-Sequitur

Joined Oct 27, 2014
85
Many thanks to those that replied... I am a systems programmer/analyst who knows just enough about electronics to be dangerous. So I appreciate the suggestions thus far. I think I will look into the "N-type, logic-level MOSFET rated to 20A" from WAYNEH on Mouser and see what I can dig up.

BTW, there are so many really awesome examples in the projects folders!

My question is this... I would like to use the output of an RS-232 signal (e.g., CTS/RTS for example) to drive a transistor that would open the flow of a 12 VDC 8 Amp supply. The RS-232 is TTL voltages. Would it be best to use a NPN or PNP circuit? What advice does anyone have and are there existing examples?

Thanks!!!!
 
Last edited:

wayneh

Joined Sep 9, 2010
17,496
I think you'll need a darlington, or better yet a MOSFET, to get 8A. I don't believe RS232 can drive enough current into a single BJT to ensure a full 8A. An N-type will maintain the logic so that TTL high turns on the transistor. A p-type would reverse that, and has the additional problem of level-shifting the base voltage from TTL up to the 12V supply.

In other words, use an N-type, logic-level MOSFET rated to 20A or so. That will give you a nice safety factor.
 

philba

Joined Aug 17, 2017
959
A clarification on the term RS-232. Perhaps you are using RS-232 to simply mean serial but in case you aren't, that defines a signalling protocol for a serial connection. A 1 bit has a voltage of -3 to -15 and a 0 has a voltage of +3 to +15. It is most definitely not TTL. If you are using an RS-232 connection off of a PC you should be aware of that. There are chips that will take the rs-232 signals and convert them into TTL though if you are just using a signal like CTS/RTS you could probably skip the converter.
 

Reloadron

Joined Jan 15, 2015
7,501
I would think about, as was suggested, using a logic level MOSFET as your switch. An N Channel like the FQP30N06 can be had for about $1.00 USD or a FQP27P06 P Channel for about the same. Just as a footnote I have used a Keyspan USA-19HS USB to RS232 adapter and on the CTS and RTS lines the logical states are Off is -5.3 volts and the logical state On is 5.3 volts. I see as I slowly typed philba covered the logical states. :) You want to keep that in mind.

Ron
 

Thread Starter

Non-Sequitur

Joined Oct 27, 2014
85
I think you'll need a darlington, or better yet a MOSFET, to get 8A. I don't believe RS232 can drive enough current into a single BJT to ensure a full 8A. An N-type will maintain the logic so that TTL high turns on the transistor. A p-type would reverse that, and has the additional problem of level-shifting the base voltage from TTL up to the 12V supply.

In other words, use an N-type, logic-level MOSFET rated to 20A or so. That will give you a nice safety factor.
OK, so I looked athe Mouser site and I have no idea what all of the parameters to be searched means. 700-MAX8536EUA was the proposed solution given what I provided. But thus far there was no mention of an ORing gate driver. Do you have a part number of an example of the type of IC you are talking about so I can look up its data sheet and read about how it functions?
 

Reloadron

Joined Jan 15, 2015
7,501
In other words, use an N-type, logic-level MOSFET rated to 20A or so. That will give you a nice safety factor.
All you need is a logic level MOSFET. If you want to buy from Mouser here is the one I suggested from Mouser. Here is the data sheet which I linked to earlier. Use it to switch the low side of your motor. A Google of FQP30N06 Circuits will present some drawings. Place a 100K resistor to ground from the gate just to make sure when the MOSFET turns off it is off. There really isn't much to it.

Ron
 

AnalogKid

Joined Aug 1, 2013
10,986
Something not covered yet - there are two places to put a switch between a power source and a load. In the case of a positive voltage DC source, the switch can go in series with either the + lead (the "output"), called a high-side switch, or the - lead (the "return" or ( usually) "ground"), called a low-side switch or switching the ground. The type of switch transistor and its control circuit change depending on where the switch is in the circuit.

Depending on what the load is and whatever else the load is interacting with, one switch type might not be appropriate. Switching the ground is by far the most simple way to go, but if the load is a circuit that is connected to other circuits that still are powered up when the load is not, then opening up the ground to the load could have consequences down the line. High side switching is a small bit more complex but the safer way to go if you are not sure about how the entire system might react, because maintaining a common ground connection among system elements usually is the more stable and predictable condition.

So, which do you want to do, high or low side?

ak
 

Thread Starter

Non-Sequitur

Joined Oct 27, 2014
85
Something not covered yet - there are two places to put a switch between a power source and a load. In the case of a positive voltage DC source, the switch can go in series with either the + lead (the "output"), called a high-side switch, or the - lead (the "return" or ( usually) "ground"), called a low-side switch or switching the ground. The type of switch transistor and its control circuit change depending on where the switch is in the circuit.

Depending on what the load is and whatever else the load is interacting with, one switch type might not be appropriate. Switching the ground is by far the most simple way to go, but if the load is a circuit that is connected to other circuits that still are powered up when the load is not, then opening up the ground to the load could have consequences down the line. High side switching is a small bit more complex but the safer way to go if you are not sure about how the entire system might react, because maintaining a common ground connection among system elements usually is the more stable and predictable condition.

So, which do you want to do, high or low side?

ak
Um... those are all good points and valid questions. And being a 1's and 0's kind of guy I have to admit I'm not sure. So I will describe what my goal is based on what I think you've relayed. I have a microprocessor with an RS-232 serial communications port. The state of the modem control lines are normally not raised. There is the microprocessor and several pieces of gear that are all powered from the output of an AC/DC converter that produces a 12VDC voltage with maximum of approximately 8 amps. If the microprocessor's internal temperature detects that there is an anomally (e.g., heat, bus failure, etc.), I'd like to be able to raise an RS-232 control lead and have the MOSTFET "open" up a path for the DC voltage to pass to another peice of equipment that would otherwise be unpowered under normal operating situations.That piece of gear would draw approximately 12VDC and 5 Amps.

Bottom line up front, processor detects problem, raises RS-232 modem control lead, MOSFET triggers and powers heads to another piece of gear.

Not the most technically sound description, I'm sure. But not too bad for a device driver programmer-type.
 

Reloadron

Joined Jan 15, 2015
7,501
Below is a little software routine which may be of some help to you. Here is a screen shot:
IO Port Test.png

You can download the program here. The program downloads as a .zip file so just open the file and extract the contents, click the executable (setup.exe). The little program will install and run run on about any Windows from Win 98 through Win 10. Choose the comm port before opening the port. Checking DTR or RTS will provide an output on the selected line. The CTS, DSR and DCD pins change color on logic High inputs. This affords you to actually measure the voltages on the two output lines as in using the port as a DIO. Maybe the little program will be of some help in your testing.

Ron
 

Thread Starter

Non-Sequitur

Joined Oct 27, 2014
85
Below is a little software routine which may be of some help to you. Here is a screen shot:
View attachment 136647

You can download the program here. The program downloads as a .zip file so just open the file and extract the contents, click the executable (setup.exe). The little program will install and run run on about any Windows from Win 98 through Win 10. Choose the comm port before opening the port. Checking DTR or RTS will provide an output on the selected line. The CTS, DSR and DCD pins change color on logic High inputs. This affords you to actually measure the voltages on the two output lines as in using the port as a DIO. Maybe the little program will be of some help in your testing.

Ron
VERY NICE!!!!!! Thank you! Okay if I pass that around to other techs around here? We are a limited on new toys out here and this one is slick!
 

Thread Starter

Non-Sequitur

Joined Oct 27, 2014
85
All, looks like we have a reel (about 100 or so) of SQJ464EP-T1_GE3 (Mouser) from Vishay/Siliconix. Based on all of the inputs I'm assuming this will do? We also have a boatload of 100K resistors in both SMD and through hole varieties to make sure the MOSFET is actually off, when off. Please advise if this will in face do the trick?
 

AnalogKid

Joined Aug 1, 2013
10,986
Based on your description, I'd say you want a p-channel power MOSFET as a high-side switch. CTS or whatever goes high, turns on a small-signal npn transistor like a 2N4401 or 2N3904, and that transistor turns on the power MOSFET. The 4401 is acting as both a logic inverter and a level translator, since the uC output pin cannot drive a gate referenced to +12 V.

My schematic system is having a hissy-fit, but I'll try to get out a schematic.

BTW, an "open" circuit is one that does *not* pass any current. An open water valve is the same as a closed electric switch, so in your case the uC closes the FET switch.

ak
 

Thread Starter

Non-Sequitur

Joined Oct 27, 2014
85
I found this schematic on-line, and from the description, it sounds like the direction I need to go. Can anyone please confirm?
Thanks!!!!!
 

AnalogKid

Joined Aug 1, 2013
10,986
I found this schematic on-line, and from the description, it sounds like the direction I need to go. Can anyone please confirm?
That is exactly it. R2 can be anything larger; I'd go with 10K. The 3904 is ultra-common in this type of application. For the p-channel FET, it mosly depends on where you ae located and what components you have access to. To go fishing, you want a FET with at least 30 V Vds and 20 A Id. These come from the standard rule of thumb for electronic components - for reliability, double everything. Need to withstand 12 V, use a 30 V part. Need to source 8 A, use a 20 A part.

To determine the heat generated in the FET when it is on, look at the Rds(on) spec. This is the minimum drain-source resistance, usually in milliohms for a power part. Joule's Law is power equals resistance times the square of the current, or p = i^2 x R. That power, plus the package and the ambient air conditions, determines if you need a heatsink. In very round numbers, you do if the device power is 1 W or more. If the size or weight of a heatsink is a problem, you can spend your way out of it. A FET with a higher current rating than you need and lower Rdson spec will cost more, but run cooler.

ak
 

Thread Starter

Non-Sequitur

Joined Oct 27, 2014
85
That is exactly it. R2 can be anything larger; I'd go with 10K. The 3904 is ultra-common in this type of application. For the p-channel FET, it mosly depends on where you ae located and what components you have access to. To go fishing, you want a FET with at least 30 V Vds and 20 A Id. These come from the standard rule of thumb for electronic components - for reliability, double everything. Need to withstand 12 V, use a 30 V part. Need to source 8 A, use a 20 A part.

To determine the heat generated in the FET when it is on, look at the Rds(on) spec. This is the minimum drain-source resistance, usually in milliohms for a power part. Joule's Law is power equals resistance times the square of the current, or p = i^2 x R. That power, plus the package and the ambient air conditions, determines if you need a heatsink. In very round numbers, you do if the device power is 1 W or more. If the size or weight of a heatsink is a problem, you can spend your way out of it. A FET with a higher current rating than you need and lower Rdson spec will cost more, but run cooler.

ak
The resistors? What power rating do you prescribe for the two resistors? Is there a formula to determine that based on their position in the circuit? This is cool stuff. Nice break from endless hacking.
 

phranzdan

Joined Aug 4, 2017
40
Many thanks to those that replied... I am a systems programmer/analyst who knows just enough about electronics to be dangerous. So I appreciate the suggestions thus far. I think I will look into the "N-type, logic-level MOSFET rated to 20A" from WAYNEH on Mouser and see what I can dig up.

BTW, there are so many really awesome examples in the projects folders!

My question is this... I would like to use the output of an RS-232 signal (e.g., CTS/RTS for example) to drive a transistor that would open the flow of a 12 VDC 8 Amp supply. The RS-232 is TTL voltages. Would it be best to use a NPN or PNP circuit? What advice does anyone have and are there existing examples?

Thanks!!!!
 
Top