# BASIC problem with Transistor as switch

#### gnolivos

Joined Jul 14, 2011
28
OK, this is a very basic step I am taking, to test a larger circuit. Since my circuit wasn't working as expected, I stripped it down and started with just the transistor switch design.

I built this circuit, and I am getting a very very low current out of the emitter just downstream of the resistor. About 64uAmp (microAmp) instead of 35mAmp (milliAmp).

I can't figure out what's wrong, can someone please enlighten me? The transistor is a BC547 NPN.

#### CDRIVE

Joined Jul 1, 2008
2,219

#### kubeek

Joined Sep 20, 2005
5,770
I see Ib 350uA and IC 35mA. What is the problem?
(Except that the circuit is not a switch but a voltage follower, which acts kinda like a switch but not really)

#### gnolivos

Joined Jul 14, 2011
28
Well, what should the current out of E be? According to the circuit, including the 30ohm resistor, it should be around 35mA (same as IC). I am getting extremely dim LEDs, and measuring only 64uA into the pair of LEDs... why?!

I see Ib 350uA and IC 35mA. What is the problem?
(Except that the circuit is not a switch but a voltage follower, which acts kinda like a switch but not really)

#### kubeek

Joined Sep 20, 2005
5,770
What is the Vf of your LEDs? The circuit gives only Vb-0.7V output to the 30ohm resistor.

#### gnolivos

Joined Jul 14, 2011
28
Fwd Voltage of the LEDs is 1.8V.

Also, reading your comment below... I thought the voltage coming into the base Vb was only responsible of saturating the transistor, and opening it up so that the Voltage at the Collector would become the 'main' circuit feeding through the emitter and to the resistor, down to the LEDs...?

What is the Vf of your LEDs? The circuit gives only Vb-0.7V output to the 30ohm resistor.

#### gnolivos

Joined Jul 14, 2011
28
Kubeek,

Would this configuration make more sense for a switch, triggered by my 3.3V source?

CIRCUIT #2

#### kubeek

Joined Sep 20, 2005
5,770
No, the simulators is quite right, it shows exactly what you told it to. There has to be something different from the actual circuit.

Anyway, if you are just trying to power two leds, based on a 3.3V signal, look at this picture: http://sub.allaboutcircuits.com/images/03098.png

R1 would be about 470ohm. You should have a resistor separate for each led, do you want 17.5mA through each?

#### kubeek

Joined Sep 20, 2005
5,770
About right, but you need the 470ohm resistor in series with the base, and swap the battery with the diode.

#### gnolivos

Joined Jul 14, 2011
28
Isn't it equally correct to add a single resistor (half the ohm), before the parallel LED branch?

Yes, ~17mA for each is about where I want it.

You should have a resistor separate for each led, do you want 17.5mA through each?

#### kubeek

Joined Sep 20, 2005
5,770
It is not good to parallel LEDs, their Vf can be different so they will have different brightness because one will use most of the available current. You should count with cca 0.2-0.4V drop on the saturated transistor, so 150ohm for each LED should be ok.
I think that putting the leds in series would be too close for the 4.5V supply.

#### gnolivos

Joined Jul 14, 2011
28

I think my problem is that the 3.3V signal is actually from a motion sensor (PIR). I think the issue may be that the 3.3V output trigger has a very low rating on the output current... probably too low into the transistor's Base, and therefore the entire circuit is feeding a much lower current to the LEDs.

Here is the spec: http://www.futurlec.com/PIR_Module.shtml

So, my solution will likely be to use a ~ 3V relay if I can find one. DO you think a relay can properly operate from the low current 3.3V trigger output, without amplification?

Thanks!

#### Pencil

Joined Dec 8, 2009
272
I'm coming in to this late, correct me if I am not understanding.

You have a PIR module.
The output from PIR module is 3.3V, unknown output current.
You wish to power 2 LEDs with a 1.8 Vf at 17mA each for testing purposes.
The "datasheet" on PIR module shows it driving an NPN transistor.

Have you tried hooking it up as I have shown in attachment?
Are you sure you are connecting the pins on the transistor properly?

I have attached a datasheet for BC547 transistor for reference.

#### Attachments

• 36.3 KB Views: 23
• 44.9 KB Views: 13
Last edited:

#### gnolivos

Joined Jul 14, 2011
28
Thank you Pencil.

I went ahead and built the circuit as you suggested, but I did not put the 750ohm resistor to the base of the transistor. It did not work... it seems as if the transistor is not saturating, and hence the ground at the emitter not 'opening up'. No current flowing on the main circuit, and zero voltage measured across components. I do have 3,3V out of the output of PIR (confirmed). What is the function of the 750ohm resistor?

EDIT: I measured the current out of the PIR 3.3V output, straight to ground, and I obtain 2.04mA. Is that the limit of the PIR? And wouldn't I need more than this to drive the transistor?

I'm coming in to this late, correct me if I am not understanding.

You have a PIR module.
The output from PIR module is 3.3V, unknown output current.
You wish to power 2 LEDs with a 1.8 Vf at 17mA each for testing purposes.
The "datasheet" on PIR module shows it driving an NPN transistor.

Have you tried hooking it up as I have shown in attachment?
Are you sure you are connecting the pins on the transistor properly?

I have attached a datasheet for BC547 transistor for reference.

Last edited:

#### kubeek

Joined Sep 20, 2005
5,770
Ok, so first try connecting the input end of the 750ohm resistor straight to the 4.5V supply, leaving the other at the transistors base, and see if the LEDs get lit.

After that, the datasheet mentions an open collector option, are you sure you don´t have this version?

Pencil: the datasheet say TTL compatible, so there should be some current available with no problems.

Joined Dec 26, 2010
2,148
It may also be worthwhile checking that the LEDs and resistors are correctly connected. If you bridge across the collector and emitter, do the LEDs light?

Never take anything for granted.

#### gnolivos

Joined Jul 14, 2011
28
Ok, so first try connecting the input end of the 750ohm resistor straight to the 4.5V supply, leaving the other at the transistors base, and see if the LEDs get lit.
OK, I went ahead and tried that... I fed the base straight from the 4.5V source, and nothing. I did it with and without resistor.

After that, the datasheet mentions an open collector option, are you sure you don´t have this version?

Pencil: the datasheet say TTL compatible, so there should be some current available with no problems.
I am not sure whether it is an open collector version... I did not request it that way, so I assumed I was getting the standard option. Any way to verify?

#### gnolivos

Joined Jul 14, 2011
28
I bridged it between Collector and Emmiter, and the LEDs light up perfectly and bright. So I know the rest of the circuit is fine.

I double checked the connections on the transistor, and everything is good. I even read ~ 3V from C to E when using the Motion sensor at the Base. So the transistor is doing something....

I still believe that the Motion sensor is not able to output enough current to make this work. I am reading about 2 mA from the 3.3V output, when I connect it directly to ground. Is this the right way to read max output?

It may also be worthwhile checking that the LEDs and resistors are correctly connected. If you bridge across the collector and emitter, do the LEDs light?

Never take anything for granted.

Last edited: