New guy, new question

BobTPH

Joined Jun 5, 2013
11,515
There is a tutorial on this site about using a transistor as a switch. That is what you need. A transistor lets a small current switch on or off a larger current, much like a relay. In this case, the small current from the vibration sensor will be applied to the base of a transistor. This will allow a larger current to flow from the collector to the emitter. The relay coil goes between the power and the collector. The emitter goes to ground. The above is true if using an NPN bipolar transistor. A 2N2222 or 2N3904 would be appropriate transistors.

http://www.allaboutcircuits.com/vol_3/chpt_4/2.html

Bob
 

Thread Starter

Strip

Joined Feb 19, 2014
10
There is a tutorial on this site about using a transistor as a switch. That is what you need. A transistor lets a small current switch on or off a larger current, much like a relay. In this case, the small current from the vibration sensor will be applied to the base of a transistor. This will allow a larger current to flow from the collector to the emitter. The relay coil goes between the power and the collector. The emitter goes to ground. The above is true if using an NPN bipolar transistor. A 2N2222 or 2N3904 would be appropriate transistors.

http://www.allaboutcircuits.com/vol_3/chpt_4/2.html

Bob
Ahaa! This was the info I needed!!! Thank You sir!! Now to purchase a transistor! Radio shack carry these? Will give this a shot ASAP.
 

R!f@@

Joined Apr 2, 2009
10,004
Mind you that you chose proper value resistors so you won't fry the shock sensor.

I suggest you show us the circuit wiring diagram you are going to make before you actually power the thing
 

Thread Starter

Strip

Joined Feb 19, 2014
10
BobTPH, I do have a question. When looking at the link about transistors I am a bit confused. On a PNP transistor is the 3rd leg going to be ground (-) switched? My thinking is I am going to place the transistor in line between the + side of battery and the coil. Then I will run a wire from the pos side of battery through vibration switch then to middle leg of transistor? Or does this need to go to ground side of battery. all of the drawings show NPN so I am confused. Thanks
 

R!f@@

Joined Apr 2, 2009
10,004
BobTPH, I do have a question. When looking at the link about transistors I am a bit confused. On a PNP transistor is the 3rd leg going to be ground (-) switched? My thinking is I am going to place the transistor in line between the + side of battery and the coil. Then I will run a wire from the pos side of battery through vibration switch then to middle leg of transistor? Or does this need to go to ground side of battery. all of the drawings show NPN so I am confused. Thanks
You need a proper diagram.
Read my posts above and answer accordingly.
I will draw up a schema for you
 

BobTPH

Joined Jun 5, 2013
11,515
Here is a schematic for you:

transswitch.JPG

The resistor is chosen to put about 2mA to the base, which should be plenty to trigger the relay. The diode is there to prevent a high voltage spike when the relay is turned of.

Bob
 

R!f@@

Joined Apr 2, 2009
10,004
Here is a schematic for you:

View attachment 65106

The resistor is chosen to put about 2mA to the base, which should be plenty to trigger the relay. The diode is there to prevent a high voltage spike when the relay is turned of.

Bob
Is it wise to let the base float like tht ?
May be a high value R from base to ground should be used.
 

BobTPH

Joined Jun 5, 2013
11,515
It couldn't hurt, though I have never had a problem with bipolar transistors turning on with a floating base. If it were a MOSFET, the pulldown would be a necessity.

Something like 10K would be good.

Bob
 

Thread Starter

Strip

Joined Feb 19, 2014
10
Bob, Thank you for the schem and the advise. I must admit I am plumb stupid when it comes to this stuff. Let me see if I have this right. This schem shows a 5.6k resistor between the vibration switch and the base of the transistor? L1 is the coil connected to the collector side and the emitter side goes to ground? the coil will be turned off via a switch placed in line between + and the vibration switch loop. will I still need the diode? how can it spike when power to the whole circuit will be opened? If so it's no biggie, I'm just curios. Now when I hooked this up tonight, the transistor heated up pretty warm before I ever made a base connection. is this normal?
 

R!f@@

Joined Apr 2, 2009
10,004
Bob, Thank you for the schem and the advise. I must admit I am plumb stupid when it comes to this stuff. Let me see if I have this right. This schem shows a 5.6k resistor between the vibration switch and the base of the transistor? L1 is the coil connected to the collector side and the emitter side goes to ground? the coil will be turned off via a switch placed in line between + and the vibration switch loop. will I still need the diode? how can it spike when power to the whole circuit will be opened? If so it's no biggie, I'm just curios. Now when I hooked this up tonight, the transistor heated up pretty warm before I ever made a base connection. is this normal?
The coil is the coil of the relay.
You need a diode to protect the transistor when the it switches off the relay. It's all technical but you need it or the transistor will fail.

The Transistor should not heat up if wired correctly and base open or grounded by a 10KΩ resistor. If the transistor is heating up you are making some connection mistakes.

Can you post a picture of your circuit wiring.
 
Last edited:

R!f@@

Joined Apr 2, 2009
10,004
I suggest that you use a 10K ohm resistor between base and ground
Next connect ground to emitter of Tr.
Next collector of Tr goes to relay coil.
Other end of Relay coil goes to +12V
A diode like 1N4001 should be wired across the Relay coil.
Diode anode must be connected to collector of Transistor. Connect the wrong way and your Tr will get fried.

If above is wired correct the Transistor should be cool and relay off.
To test just connect the 5.6KΩ resistor to positive +12V and base of Tr.
The Relay should click.

If this works connect the sensor and 5.6KΩ in series as shown.
 

BobTPH

Joined Jun 5, 2013
11,515
All good advice. I hope to hear that the OP has gotten this to work sucessfully. If there was no diode, as he implied, I suspect that problem was inccorrectly identifying the leads on the transistor.

Bob
 

Thread Starter

Strip

Joined Feb 19, 2014
10
I havnt had time to pick up the resistor and diode yet, so no further testing has been done. I will try to get this done this week and give you guys some feed back. Again, thank you so much for your feed back.
 
Top