Simple automotive circuit, annoying problem.

Thread Starter

JohnnyD

Joined Aug 29, 2006
79
OK, this time I got a base resistor value of just over 3K.

The PNP needs to sink around 40mA so the base current is roughly 4mA. Added to the current coming from the diagnostic pin makes roughly 14.3mA, so the current at the base of the NPN will be around 1.43mA. So the base resistor needs to drop 4.3 volts and pass a current of 1.43mA which makes it just over 3K.

How does that sound?
 

bloguetronica

Joined Apr 27, 2007
1,359
OK, this time I got a base resistor value of just over 3K.

The PNP needs to sink around 40mA so the base current is roughly 4mA. Added to the current coming from the diagnostic pin makes roughly 14.3mA, so the current at the base of the NPN will be around 1.43mA. So the base resistor needs to drop 4.3 volts and pass a current of 1.43mA which makes it just over 3K.

How does that sound?
By the way, which diagram are you using? Are you using the single NPN transistor diagram (which I think I posted somewhere)? I lost the context somewhere.
 

Thread Starter

JohnnyD

Joined Aug 29, 2006
79
Sorry, I'm using this diagram:

The ECU diagnostic pin would be connected between the collector of the NPN and the base of the PNP, which should hold the base of the PNP at 12v without needing a pullup resistor.
 

bloguetronica

Joined Apr 27, 2007
1,359
All you need to do is to calculate R4, so the job will be easier to do. If the bulb consume 40mA, you will need a 4mA (or little less) current at the base of PNP transitor. Therefore you will need 0.4mA at the base of the NPN transistor. Since you are connecting this circuit to a 5V signal, and the Vbe of the NPN transistor is 0.7V, you need to calculate the resistance with a voltage across of 4.3V and a current of 0.4mA. You will need a resistor higher than 10.75K. A 12K resistor would be fine (to avoid oversaturation).

What I've done here was to calculate the current in a load to signal fashion, since the current on the output stage is driven by the current at the input stage.

Are you using this with the ecu diagnostic pin? It would be bad practice to put the ecu diagnostic pin between the NPN and PNP transistors, since any disturbance at the base of the PNP will affect the load (unless it sources or sinks insignificant ammounts of current).

The ECU diagnostic pin would be connected between the collector of the NPN and the base of the PNP, which should hold the base of the PNP at 12v without needing a pullup resistor.
You would never need a pull up resistor. The PNP has a tendency to pull its base up by the means of the emmiter-base diode (unlike MOSFETs).
 

Thread Starter

JohnnyD

Joined Aug 29, 2006
79
Thank you for all your help, I don't know what I'd've done without it!

Here is my (hopefully) finished schematic:
http://img.photobucket.com/albums/v330/agua-moose/Electronics/ECUFlashRevC.jpg

I have used a seperate NPN transistor to ground the ECU diagnostic pin. I also adjusted the timings of the debounce circuit so when the switch is pressed, it should take around 15ms for the output of the schmitt trigger inverter to swing high and around 0.5ms to swing low again once the switch is released.

I also incorporated JoeJester's idea of using one of the unused NANDs for the power-up reset circuit. I moved this to the RESET pin instead of the SET pin, because otherwise both the transistors would have to be connected to Qbar output and I wanted them on the Q output.

The only concern I have now is the amount of current being drawn from the Q output. It is almost 1.3mA and, although the datasheet says the outputs can source up to 20mA, at 5v VDD the 4013 can only source around 1mA so it is potentially over by 0.3mA. Maybe I should find a darlington NPN to use for Q3 instead of a 2N3904?
 

bloguetronica

Joined Apr 27, 2007
1,359
The only concern I have now is the amount of current being drawn from the Q output. It is almost 1.3mA and, although the datasheet says the outputs can source up to 20mA, at 5v VDD the 4013 can only source around 1mA so it is potentially over by 0.3mA. Maybe I should find a darlington NPN to use for Q3 instead of a 2N3904?
In that case, a NPN darlington transistor would be better.
 

Thread Starter

JohnnyD

Joined Aug 29, 2006
79
Apart from that though, everything looks ok?

I've started to get the hang of TINA TI already. Using the transient analysis feature is cool but I wish they'd sort out the zoom function on the graphs, its a total nightmare to use unless I right-click on the axies and set the ranges manually.
 

Thread Starter

JohnnyD

Joined Aug 29, 2006
79
If I were to use something like a BC517 NPN darlington transistor for Q3, how would I calculate the gain? In the datasheet it says "Small signal current gain, common emitter = minimum 30,000", can I just use that figure, or do I have to assume less because it will be saturated?
 

JoeJester

Joined Apr 26, 2005
4,077
Johnny,

If you don't have a free pdf distiller, I'd recommend http://www.cutepdf.com Then you could print your schematics and all the graphics to a PDF file for uploading to here. Just remember to use your page view to organize your stuff.

You'll be able to create any size page on the pdf and the end users can view it or print it to fit their paper. I wouldn't recommend going more than a B or C size paper, as the printing to a 8.5x11 paper would be too damm small for usefullness.

Nice results.
 

Thread Starter

JohnnyD

Joined Aug 29, 2006
79
Sorry, that pic was a bit on the large size.

Thanks for the advice, I'll take a look at that program. I'm still loving this TINA program, I can't believe they give it away for free!
 

JoeJester

Joined Apr 26, 2005
4,077
The pic was just fine. I thought I'd do a pre-emptive recommendation for when you get larger files.

I forget the limitations on Tina-TI ... but there are some. Most of these "free" programs have limitations on the number of nodes or the kinds of tests.

I have the education version, not the student version. I'm sure the limitations are explained at http://www.tina.com

I started with Electronics Workbench ... but when they started their move past version 6, and charging a ton of money, I looked elsewhere.

I don't know if TINA-TI does the board layouts too.
 

Thread Starter

JohnnyD

Joined Aug 29, 2006
79
OK, I've come up against something weird... I finished the circuit on a breadboard and wanted to measure the current draw to make sure it wasn't too excessive. When the flip-flop is off, the whole circuit only draws around 2.6mA, most of which is used by the voltage regulator.

But here's the thing - when the flip-flop is on, the circuit draws around 125mA. I thought that was way too high and started measuring the current drawn by certain parts of the circuit. All was as I expected until I measured the current flowing from the base of the PNP to the collector of the NPN transistor which turned out to be over 60mA.

Just for clarity, the transistor arrangement I'm using is this:


So the current flowing from the base of the PNP to the collector of the NPN is more than the current used by the bulb, around half as much again in fact. So, to me, this indicates that the gain of the transistors is a lot more than 10, even when saturated.

So, as I don't have any formal education in electronics, I don't know what to believe. The instructional websites on the net say to use the minimum gain value in the datasheet to calculate the base current and then multiply this by some number, usually between 1.5 and 2 to ensure the transistor saturates properly.

I hope this doesn't come across as me being rude or challenging your knowlege, as I am clearly the novice here but I hope you can help me out.
 

n9352527

Joined Oct 14, 2005
1,198
You need a resistor between the base of the PNP and the collector of the NPN to limit the base current of the PNP transistor. Without the resistor, the PNP base current would be dictated by the NPN base current times the gain of the NPN, which is hard to control and in your case quite large.
 
Top