Maker Pro
Maker Pro

BS170 FET logic switching problem - advice needed

R

Rob

Jan 1, 1970
0
I tried using a BS170 FET to supply / power-down sections of a circuit under
control of a PIC port pin.

The connections were:

Gate - port pin via 100R
Drain - to +5V
Source - to circuit to be supplied / depowered.

It didn't work! The FET appears not to turn on hard enough. Adding a pullup
to the gate did not help. The load being switched is in the low milliamps
range. Any suggestions as to a solution?

Thanks
rob
 
B

Ban

Jan 1, 1970
0
Rob said:
I tried using a BS170 FET to supply / power-down sections of a
circuit under control of a PIC port pin.

The connections were:

Gate - port pin via 100R
Drain - to +5V
Source - to circuit to be supplied / depowered.

It didn't work! The FET appears not to turn on hard enough. Adding a
pullup to the gate did not help. The load being switched is in the
low milliamps range. Any suggestions as to a solution?

Thanks
rob

Rob,
the BS170 is an N-mos Fet and cannot switch positive voltages. It can switch
to gnd only(low-side). If you want a high-side switch, you have to take a
PMOS loke the BS250 or BSS92.

ciao Ban
 
B

Ban

Jan 1, 1970
0
Ban said:
Rob,
the BS170 is an N-mos Fet and cannot switch positive voltages. It can
switch to gnd only(low-side). If you want a high-side switch, you
have to take a PMOS loke the BS250 or BSS92.

ciao Ban

Don't forget that the PMOS is turned on with logic low level

ciao Ban
 
F

Fred Bloggs

Jan 1, 1970
0
Rob said:
I tried using a BS170 FET to supply / power-down sections of a circuit under
control of a PIC port pin.

The connections were:

Gate - port pin via 100R
Drain - to +5V
Source - to circuit to be supplied / depowered.

It didn't work! The FET appears not to turn on hard enough. Adding a pullup
to the gate did not help. The load being switched is in the low milliamps
range. Any suggestions as to a solution?

Thanks
rob

An N-channel MOSFET typically requires a few volts across gate to source
in order to establish an internal electric field for the requisite low
resistance path from drain to source. If the PIC is raising the gate
terminal to 5V and the load circuit on the source is 5V, then the gate
to source voltage is 5V-5V=0V- or no voltage in other words. This means
the load voltage does not rise to 5V, it will actually rise to 5V-Vgs,th
where Vgs,th is the MOSFET gate source threshold for small currents in
your case, and this can be a few volts, typically 2V for the BS170,
meaning you only get 5V-2V=3V across the load this way. If your load is
connected between VCC and the drain with source grounded, then when the
PIC applies 5V to the gate, the gate to source voltage will be 5V-0V=5V,
large enough to create an internal low resistance drain to source
channel, meaning the drain goes very close to 0V and 5V appears across
the controlled load.
 
W

Winfield Hill

Jan 1, 1970
0
Fred Bloggs wrote...
An N-channel MOSFET typically requires a few volts across gate to source
in order to establish an internal electric field for the requisite low
resistance path from drain to source. If the PIC is raising the gate
terminal to 5V and the load circuit on the source is 5V, then the gate
to source voltage is 5V-5V=0V- or no voltage in other words. This means
the load voltage does not rise to 5V, it will actually rise to 5V-Vgs,th
where Vgs,th is the MOSFET gate source threshold for small currents in
your case, and this can be a few volts, typically 2V for the BS170,
meaning you only get 5V-2V=3V across the load this way. If your load is
connected between VCC and the drain with source grounded, then when the
PIC applies 5V to the gate, the gate to source voltage will be 5V-0V=5V,
large enough to create an internal low resistance drain to source
channel, meaning the drain goes very close to 0V and 5V appears across
the controlled load.

Right -- after that excellent detailed answer, Fred ran out of energy to
suggest a solution. :>) So Rob, you'd best apply the entire 5V PIC
output to the FET's gate, by grounding the FET source and switching the
load from the drain to +5V (or higher if desired). Althernately, if you
really need a grounded load, change to a p-type MOSFET with its source
connected to +5V. In either case the FET will be inverting the signal,
so a logic HI will turn on the n-type FET and a logic LO the p-type FET.

Thanks,
- Win

whill_at_picovolt-dot-com
 
C

CBarn24050

Jan 1, 1970
0
yes that will never work, use a small pnp bipolar transistor instead. emitter
to 5v, base to port pin via a 100R resistor, collector to external circuit. you
will get a small votl drop 0.3-0.5v, if that is not acceptable for your
circuit you could try a germanium transistor, otherwise you will be beter using
a power management chip.
 
F

Fred Bloggs

Jan 1, 1970
0
Winfield said:
Fred Bloggs wrote...



Right -- after that excellent detailed answer, Fred ran out of energy to
suggest a solution. :>) So Rob, you'd best apply the entire 5V PIC
output to the FET's gate, by grounding the FET source and switching the
load from the drain to +5V (or higher if desired). Althernately, if you
really need a grounded load, change to a p-type MOSFET with its source
connected to +5V. In either case the FET will be inverting the signal,
so a logic HI will turn on the n-type FET and a logic LO the p-type FET.

Thanks,
- Win

whill_at_picovolt-dot-com

If the OP's main supplier is Radio Shack then he can still use the BS170
and a voltage doubler high side driver like so -providing speed is not
all that important:

Please view in a fixed-width font such as Courier.


HC04

|\ 1N4148 5V
+-| o--|>|---+ |
| |/ | |
| \ |-d
| 560 +---g| BS170
+------+ \ | |-s
| / | |
| | | +---->Vout
|\ | | 1N4148 |
PWM >---+---| o--+-||--+--|>|--+---+ to load
| |/ 10n | |
| | \
| HC04 | 100k
| === \
| 10n /
from PIC | 100k | |
_ _ +---/\/\---------------+---+
____| |_| |_ |
---
10K-100KHz 50% GND



The 10n are 0.01uF . To turn load ON, apply PWM to output pin, and for
OFF just park it LOW.
 
F

Fred Bloggs

Jan 1, 1970
0
Fred said:
If the OP's main supplier is Radio Shack then he can still use the BS170
and a voltage doubler high side driver like so -providing speed is not
all that important:

Please view in a fixed-width font such as Courier.


HC04

|\ 1N4148 5V
+-| o--|>|---+ |
| |/ | |
| \ |-d
| 560 +---g| BS170
+------+ \ | |-s
| / | |
| | | +---->Vout
|\ | | 1N4148 |
PWM >---+---| o--+-||--+--|>|--+---+ to load
| |/ 10n | |
| | \
| HC04 | 100k
| === \
| 10n /
from PIC | 100k | |
_ _ +---/\/\---------------+---+
____| |_| |_ |
---
10K-100KHz 50% GND



The 10n are 0.01uF . To turn load ON, apply PWM to output pin, and for
OFF just park it LOW.

This small change makes things less stressful:

Please view in a fixed-width font such as Courier.

5V
HC04 |
|
|\ 1N4148 1N4148 |-d
+-| o--|>|---+---|>|--+---+--g| BS170
| |/ | | | |-s
| \ | \ |
| 560 | 100k +---->Vout
+------+ \ === \
| / 10n / to load
| | | |
|\ | | | |
PWM >---+---| o--+-||--+ | |
| |/ 10n | |
| | |
| HC04 | |
| | |
| | |
from PIC | 100k | |
_ _ +---/\/\----------------+---+
____| |_| |_ |
 
F

Frank Bemelman

Jan 1, 1970
0
Fred Bloggs said:
This small change makes things less stressful:

Please view in a fixed-width font such as Courier.

5V
HC04 |
|
|\ 1N4148 1N4148 |-d
+-| o--|>|---+---|>|--+---+--g| BS170
| |/ | | | |-s
| \ | \ |
| 560 | 100k +---->Vout
+------+ \ === \
| / 10n / to load
| | | |
|\ | | | |
PWM >---+---| o--+-||--+ | |
| |/ 10n | |
| | |
| HC04 | |
| | |
| | |
from PIC | 100k | |
_ _ +---/\/\----------------+---+
____| |_| |_ |

Nice circuit! If the PIC runs a (timer interrupt) loop, and
a spare output pin is available, you can save the HC04
inverters. Just toggle 2 outputs inside such loop.
 
F

Fritz Schlunder

Jan 1, 1970
0
CBarn24050 said:
yes that will never work, use a small pnp bipolar transistor instead. emitter
to 5v, base to port pin via a 100R resistor, collector to external circuit. you
will get a small votl drop 0.3-0.5v, if that is not acceptable for your
circuit you could try a germanium transistor, otherwise you will be beter using
a power management chip.

Lessee here. 5V @ Emitter minus 0.7V Emitter-Base drop = 4.3V

V=IR

4.3V=100*I
I=43mA (when pin low)

The PIC I/O lines are normally only rated for 25mA maximum. You will be
abusing your PIC by using such a small base resistor. Since the OP only
needs load current in the "low milliamp range" he should use a much larger
base resistor if he is going to go this route. Something in the range of
1k-4.7k would probably be a better choice. Some PNP device like the 2N4403
or 2N3906 aught to work fine. If the load current is small enough the
emitter collector drop may even get smaller than 0.3V-0.5V.

Or to use one less resistor just do what others are suggesting and switch
the load from the low side with the N-Channel device, or switch it high side
with a P-Channel MOSFET instead. The 100 Ohm gate resistor isn't strictly
necessary, although some engineers will argue with great conviction that it
is. The MOSFET based solution will switch a fair amount faster than the BJT
method.
 
C

CBarn24050

Jan 1, 1970
0
thank you for that correction, I'd like to say it was a typo, the truth is i
was too lazy to calculate it. On the bright side, it still looks like the best
solution on offer so far.
 
R

Rob

Jan 1, 1970
0
Many thanks for your suggestions and help Fred, Win and others.
regards
rob
 
Top