Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

interfacing relay with microcontroller using NPN OR PNP

Status
Not open for further replies.

venkates2218

Full Member level 6
Joined
Sep 30, 2016
Messages
354
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,298
Activity points
4,306
hai,i'm going to interface an sensor which works in 12v with PIC MCU...
My doubt is wheather i can use NPN OR PNP to control the sensor from controller...

what is the difference between each other
 

You did not mention anything about the sensor.
Also, the relay need to be connected to an output of the uC, not input.

The question is incomplete.
 

Hi,

and milions of working circuits are available in the internet.

In this forum are lots of threads, too:

Klaus
 

andre_teprom:
I'm going to connect o/p port only...12v inductive proximity sensor....
In my project the sensor will work for particular time after that it will go to off state...
My doubt is wheathear we can use NPN or PNP transistor..?

if i used NPN means i can stop only negative to sensor but positive will flow to sensor contineously..
If i used PNP measn i can control positive voltage to sensor....

We can control sensor in both method also..
My doubt is which one is effective and safe to both controller and sensor..?
 

if i used NPN means...
If i used PNP measn...

We can control sensor in both method also..

I must admit that even reading the above explanation more that once, it is still confusing for me.
The sensor must to be powered contineously, assuming that you means to "control sensor" by that.
 

Hi,

The difference is the base voltage needed to turn on the transistor? xV above 0V for NPN and xV below V+ for PNP.

It sounds like maybe you will use a BJT as a switch, so whether you use NPN or PNP ...the relay? sensor? will not be powered until the MCU turns on the BJT.

Do you mean a sensor will go into the MCU, and the output of the MCU will go into a BJT which will control a relay?

You should post a schematic of the circuit, otherwise it's just guessing what you are concerned about.
 

Hi,

With the bjt...what do you want to control?
First I thought the relay, but now it seems the sensor...

Please draw a sketch...

Klaus
 

andre_teprom:
I'm going to connect o/p port only...12v inductive proximity sensor....
In my project the sensor will work for particular time after that it will go to off state...
My doubt is wheathear we can use NPN or PNP transistor..?

if i used NPN means i can stop only negative to sensor but positive will flow to sensor contineously..
If i used PNP measn i can control positive voltage to sensor....

We can control sensor in both method also..
My doubt is which one is effective and safe to both controller and sensor..?

Are you asking "which configuration is better to use? PNP BJT as High side switch or NPN BJT as a low side switch to turn On/Off your sensor" ??
If this is your question and you want to use 12V as supply, you need to give 12V to base of PNP BJT to switch it off. Controller cannot give 12V output. You need to use one more NPN to control PNP BJT.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top