hello every body
im Beginner in electronics
how to connect a 2n3906(pnp)transistor to drive a relay with nodemcu trig?
base pin >GPIO (does it need resistor between base pin and GPIO?)
collector pin > ?
Emiter pin > ?
Have you found an example how to drive a relay with a transistor ?
Because everyone uses a NPN transistor (or a mosfet). A PNP transistor is not going to work.
The transistor is only 40V 200mA, that is a small transistor.
How much current does the relay need ?
Every transistor requires a resistor to the base pin.
This is how to use a transistor: http://www.pighixxx.com/test/portfolio-items/connect-a-relay/
Do you see the diode next to the relay ? That is the fly-back diode. You need that.
Hi,
What are you going to power the coil of the relay with, what voltage and from where?
Can you tell us the make and model and if possible a link to its spec/data?
Thanks.. Tom..
Hi,
siva_007:
how to connect a 2n3906(pnp)transistor to drive a relay with nodemcu trig?
This page covers just about all the options for driving a relay with transistors: relay-switch-circuit.html
NOTE: you can only use a PNP transistor as a high-side switch or emitter-follower if the +V rail is the same as the processor.
You usually use an NPN transistor (or MOSFET) so you can have a separate supply for the relay (if it was a 12V relay for example).
Yours,
TonyWilk
TonyWilk:
Hi,This page covers just about all the options for driving a relay with transistors: relay-switch-circuit.htmlNOTE: you can only use a PNP transistor as a high-side switch or emitter-follower if the +V rail is the same as the processor.
You usually use an NPN transistor (or MOSFET) so you can have a separate supply for the relay (if it was a 12V relay for example).
Yours,
TonyWilk
tanks tonywilk
i cant use npn transistor because when power on esp , All GPIO suddenly set to High and relay coiled.
your link was useful
i got it
base > GPIO(with resistor)
Collector >GND
Emiter >Relay coil
You can drive an NPN with a PNP if your logic pin is active low.