BASIC problem with Transistor as switch

kubeek

Joined Sep 20, 2005
5,794
Connecting something to ground is DEFINITELY NOT a good way of checking, as you are likely to burn the output.

If you put 4.5V straight between B and E of a transistor, then it´s toast. Go get another one.

Connect it like this and see if the leds light up when you close the switch.

Then use a mulitmeter and measure the VOLTAGE coming off your sensor when activated and when not, and post back.
 

Attachments

Thread Starter

gnolivos

Joined Jul 14, 2011
28
Kubeek, you were right... the transistor was the problem... I probably burned it earlier with some direct connection... I replaced it and now it all works fine as expected. THANKS TO EVERYONE WHO PROVIDED INPUT, I couldn't have solved this without your help!

By the way, how do you arrive to the correct resistor value of 470 ohm...?
 

kubeek

Joined Sep 20, 2005
5,794
To get a transistor into saturation, you should aim for about 1/10 of the collector current going into the base. Input is 3.3V, BE junction drops cca 0.7V, so that is 2.6V drop on the resistor.
2.6V/3mA is about 860ohms, which should be plenty enough.
I said 470 before because I wasn´t sure if that 30mA you wanted in the beginning was for one LED or both.
 

Thread Starter

gnolivos

Joined Jul 14, 2011
28
Thanks so much, very informative. I did read up on this earlier, but couldn't quite understand. Your explanation is so simple :)

So I went back to my original circuit, where I want to add a transistor based switch:
FADE IN/OUT CIRCUIT

If you look at my circuit, you will notice it allows for 2 LEDs to fade in slowly, and then when the switch opened, they discharge slowly. It works PERFECTLY as is. Note that the transistor in this main circuit serves a different purpose, not to be confused with the additional transistor I intend on adding to replace the main switch.

And here is the issue... if I understand correctly, the transistor based switch (as designed earlier in this thread) is designed to enable a ground path. However the location of my switch needs to close the 4.7K resistor leg. Is there a way to achieve this with the transistor, so that when motion is sensed, 3.3V is triggered, and the 'switch' closes the circuit at the location of the 4.7K resistor?

If it can be done, my circuit would be resolved without needing a relay!
 

kubeek

Joined Sep 20, 2005
5,794
Yes i just wanted to show how to connect it to the rest of the circuit. From top of R5 goes the base of the transistor and the rest.
 

Thread Starter

gnolivos

Joined Jul 14, 2011
28
Thanks Kubeek... you are awesome. I simulated your circuit and works excellent. The bad news is I have no PNP transistors. Is there any way to rearrange this circuit using NPNs?

I may go to Radioshack and see what they have for PNPs... from my research they only have 2n4403 and 2n2907. Will have to see if these would work if I can find specs.
 

kubeek

Joined Sep 20, 2005
5,794
When youre switching the high side you need an pnp, both those transistors will work just fine. Just watch out for the actual pinout when you use them.
 

Thread Starter

gnolivos

Joined Jul 14, 2011
28
Beautiful. The circuit works great as you've designed it! Thanks so much for your help kubeek, and to the others for valuable knowledge.
 
Top