24V 'logic' out from PIC 5v

Thread Starter

Torbek

Joined Apr 19, 2019
66
Hi everyone I am trying to get a floating output of 24v from a 5v TTL level from my PIC and I thought a transistor pair would be adequate, as shown below. However, I always see 24v on the output of the PNP despite lightly loading it.

Is this a situation where I would be better off with a half bridge or have I done something wrong?

Also why do I measure 0.6v at the base of the NPN despite the micro being low?

Thank you.

upload_2019-4-19_10-51-23.png
 

Thread Starter

Torbek

Joined Apr 19, 2019
66
BTW this is for a circuit that normally recieves a 24v pulse form a PLC of about 10mS so I did not want to use a relay due to bouncing and the short period involved!
 

Thread Starter

Torbek

Joined Apr 19, 2019
66
Hi Eric the load is just a voltage divider consisting of 1k8 and 470R resistor, so that would be 2k27 plus the impedance put on the output which will be nil.

Not actually hooked it up yet to be fair!
 

ericgibbs

Joined Jan 29, 2010
18,873
hi T,
If you add those resistors to your original,on A & B. it will show why you have the problem, you cannot create a 'floating' output in that way.
E
 

Thread Starter

Torbek

Joined Apr 19, 2019
66
I am not sure I understand. I would have thought the 47k resistor would normally turn off the pnp with no signal to the base of the NPN and with a small load you would get the full voltage across the PNP?
One thing I have failed to make clear in the circuit above is that the 'a' terminal is common ground to micro and output!
 

danadak

Joined Mar 10, 2018
4,057
When you say no signal to base of NPN, was that floating ? If
so could be leakage current could potentially turn it on.


Regards, Dana.
 

Thread Starter

Torbek

Joined Apr 19, 2019
66
Hi Dana, no it is attached to an output of a PIC, which was logic '0'. The 0.65v is the other side of the resistor at the base junction.
it suggests there is current flowing from collector to base which I would think the reverse biased diode would not allow?
 

Attachments

danadak

Joined Mar 10, 2018
4,057
Transistor bad ? Base should go to ~ ground in Voltage.

Try disconnecting the collector, see if base goes to ground.



Regards, Dana.
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
Something is nuts here.

Take transistor, put a 1K in collector to some + supply,
ground emitter, and using 1 K into base ground input side of R,
and measure base. And measure collector with base grounded
and with it driven by a V > 1V, say 5V.


Regards, Dana.
 

Thread Starter

Torbek

Joined Apr 19, 2019
66
Strange, anyway, so I have replaced the NPN with a NVNL110A N channel FET and it now works perfectly!

Not sure what was going on with my original concept I will prep on a breadboard and try again some time with fresh transistors.

Any ideas of why it refused to work would be appreciated but for now, thank for any pointers...

upload_2019-4-19_13-40-6.png
 

BobTPH

Joined Jun 5, 2013
9,003
There is nothing wrong with the circuit. So, either a component is bad or it not wired correctly, or you are measuring it incorrectly.

Did you verify the 0 output on the PIC?

What voltage do you see at the collector of Q1 and at the base of Q2?

Bob
 

Thread Starter

Torbek

Joined Apr 19, 2019
66
Hi Bob, So collector of Q1 was 24V, q2 I cannot remember now tbh. I will rebuild on breadboard when I get a chance and try to work out what went wrong. To be fair the Veroboard is a little cramped however the fet went in part for part and the circuit worked perfectly first time! Almost as if the npn was just passing enough current to allow the pnp to conduct. Saved original transistors so I will try as above and post back here with the results :)
 
Top