Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] BC327 transistor as switch

Status
Not open for further replies.

Veketti

Full Member level 3
Joined
Sep 14, 2014
Messages
164
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,700
Dear All,

Please help newbie in simple task why this PNP transistor doesn't work in PWM output as it should? If I supply to base constant +5v that led is on but pwm output from microcontroller doesn't dim it. Is it too slow or what's wrong? I know I should use P channel mosfet instead but I don't have them on hand at the moment..

transistor.jpg

Your help is greatly appreciated.
 

BigBoss

Advanced Member level 5
Joined
Nov 17, 2001
Messages
4,971
Helped
1,502
Reputation
3,002
Reaction score
1,341
Trophy points
1,393
Location
Turkey
Activity points
29,977
If uC output drops down to 0V, the transistor will conduct the current.But 10 Ohm is too low..
If we assume Bdc=200, this resistor should be approx. 3K Ohm.
 

Borber

Advanced Member level 5
Joined
Dec 31, 1999
Messages
1,602
Helped
235
Reputation
472
Reaction score
111
Trophy points
1,343
Location
on third flor
Activity points
11,862
It doesn't work because you used PNP transistor, small 10ohm resistor and maybe PIC is dead. Use NPN BC337 instead, 1k base resistor and hope PIC has survived. Interchange 12VDC and ground and turn arround your LED.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
19,229
Helped
4,266
Reputation
8,535
Reaction score
4,225
Trophy points
1,393
Activity points
127,665
Hi,

Your circuit doesn´t work. It is allways ON.

The PIC will switch between 0V and 5V, but emitter is at 12V.
Therefore the voltage across BE and R is 12V and 7V respectively.

********
Use an NPN as low side switch. depending on b of NPN your 3k could be sufficient. I´d rather go to 1k

Klaus
 

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,195
Helped
2,126
Reputation
4,246
Reaction score
1,955
Trophy points
1,393
Location
Toronto area of Canada
Activity points
57,759
I think the base-emitter diode of the transistor from 12V and the 10 ohm resistor caused a 630mA to 1.1A current surge to the output of the PIC that destroyed the PIC. It also probably destroyed the poor little overloaded transistor.

The maximum allowed output current for a PIC is only 25mA. The transistor is not even needed because the PIC can directly drive a 2V LED through a series resistor of about 120 ohms when the LED is connected to +5V or 0V.
 

Veketti

Full Member level 3
Joined
Sep 14, 2014
Messages
164
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,700
In the first place I thought that I'm not able to put this transistor to negative wire as it's grounded elsewhere. Am I right that if I had to put it between positive wire I need to use PNP transistor instead (transistor between positive terminal and load)?

I had the negative wire on hand too so I did like Borber described and it works. Thank you all.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
19,229
Helped
4,266
Reputation
8,535
Reaction score
4,225
Trophy points
1,393
Activity points
127,665
Hi,

@ Audioguru: The LED is rated 12V/260mA. A transistor is helpful.


@Veketti: Be sure the LED has built in current limiting resistor.
Instead of NPN you could use a N channel logic level MOSFET. (The benefit is: lower voltage drop = lower dissipated power, about no PIC pin current. )


Klaus
 

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,195
Helped
2,126
Reputation
4,246
Reaction score
1,955
Trophy points
1,393
Location
Toronto area of Canada
Activity points
57,759
I don't think you have a negative wire. Instead you have 0V (which is ground), +5V and +12V wires.
DO NOT use +12V for the transistor or for the LED if you use a PNP transistor.

Why do you power the LED from +12V?
Did you try using the PIC output to directly drive the LED to 0V or +5V directly through a series 120 ohm resistor?

- - - Updated - - -

Audioguru: The LED is rated 12V/260mA. A transistor is helpful.
Thanks, I missed that. A blinding bright 3W LED.
I was concerned about the PNP transistor, LED and power supply being upside down with grid lines all over the place.
 

Veketti

Full Member level 3
Joined
Sep 14, 2014
Messages
164
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,700
Alright, I'll use n-channel fet IRF510 which I have few extra instead.

Sorry, still bit unclear to me that is there possibility to use n-channel fet or NPN transistor between +12V and load? At least in the first place I wasn't able to make it work with IRF510.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
19,229
Helped
4,266
Reputation
8,535
Reaction score
4,225
Trophy points
1,393
Activity points
127,665
Hi,

the IRF510 is NO logic level MOSFET. Mind the guaranteed only 250uA !! at 4V Vgs.
You need Vgs-th to be lower.



Circuit:

LED anode to 12V
LED cathode to FET-Source
FET-Drain to GND
PIC port to FET-Gate

Klaus
 

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,195
Helped
2,126
Reputation
4,246
Reaction score
1,955
Trophy points
1,393
Location
Toronto area of Canada
Activity points
57,759
Use a Mosfet with the prefix of "IRL" (not IRF) where the "L" stands for Logic level.

Does the LED have a circuit or series resistor inside it that limits the current to 260mA?

Klaus describes an odd circuit using a P-channel Mosfet as a source-follower that WILL NOT light the LED.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
19,229
Helped
4,266
Reputation
8,535
Reaction score
4,225
Trophy points
1,393
Activity points
127,665
Hi,

Klaus describes an odd circuit using a P-channel Mosfet as a source-follower that WILL NOT light the LED.

Sorry, i mixed up Source and drain.
Circuit:

LED anode to 12V
LED cathode to FET-drain
FET-source to GND
PIC port to FET-Gate

Klaus
 

Audioguru

Advanced Member level 5
Joined
Jan 19, 2008
Messages
9,195
Helped
2,126
Reputation
4,246
Reaction score
1,955
Trophy points
1,393
Location
Toronto area of Canada
Activity points
57,759
In Klaus's post #12 he correctly describes how to connect a logic-level N-channel Mosfet to a 12V LED that has current limiting built inside it.
 

Veketti

Full Member level 3
Joined
Sep 14, 2014
Messages
164
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,700
Thank you all and sorry for my ignorance, I wasnt aware of these logic level fet's which turns on on lower voltage. Thought that they're all the same 4V Vgs. Just ordered bunch of IRL's.
 

SunnySkyguy

Advanced Member level 5
Joined
Sep 26, 2007
Messages
6,743
Helped
1,675
Reputation
3,348
Reaction score
1,644
Trophy points
1,413
Location
Richmond Hill, ON, Canada
Activity points
50,732
  • There are over 100 logic families but fewer input threshold standards.
  • There are many standard test thresholds for MOSFETs, 10V, 4.5V , 2.5,1.8, 1.5 0.9, etc. while the actual thresholds are lower.
  • There are over 25k different active FET p/n's.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top