Maker Pro
Maker Pro

Help using pnp switch to regulate current

I'm building a variable current regulator. I have most of the schematic complete, but I am rather stumped on how to use a pnp or npn switch properly. I have spent a lot of time searching the internet but I still haven't managed to find a straight answer.

So, if you could look at my schematic and tell me if I'm using the switch correctly I would really appreciate it.

I attached the schematic.

Thanks for reading, and thanks in advance for any help
 

Attachments

  • schemeit-project.png
    schemeit-project.png
    23.1 KB · Views: 160

Harald Kapp

Moderator
Moderator
Welcome aboard.

There are several issues with your circuit. It won't work at all.

1) Which current do you want to regulate? To which value?

2) LED L1will never light up. You have cathode to the + pole and anode to the - pole of the battery. Either the LED or the battery needs to be reversed.

3) LED L2 is also reversed and there's no way current can flow through L2 (only to charge the capacitor C1. Possibly there's a load attached to the two rightmost "pins" of the circuit, but without knowing what the load is, any further assumption is guessing with a crystal ball.

4) Q1 is also backwards ( I come to assume that it's the battery that's backwards, not all other components).

5) R3 goes from from the emitter of Q1 to the base. This will not open Q1 (neither if Q1 is NPN nor if it is PNP).

You should probably start from scratch. Ask yourself (and answer) the following questions:
- What do you want to achive?
- Do you really want to control a current, or isn't it possibly a voltage? To which value do you want to regulate?
- What is the load that is attached to the circuit?
- Which battery voltage are you using?

Chnaces are that once you (or we) know the parameters of the circuit there are lots of ready made circuits waiting to be found on the internet.
 
Thanks for the reply

Thanks for responding,

Sorry, I accidentally posted the wrong schematic. That was one of the original schematics before I went through and made sure everything was oriented correctly. I also determined that sense I had an ammeter that L2 was unnecessary.

The values of the components are:

Battery-- 9v
R1-- 4k
R2-- 2k
R3-- 5k
S1-- push button momentary
S2-- Toggle
L1-- Green LED
C1-- 470 micro farads, non-polarized

I know how to use everything but the pnp/npn switch...it's backwards? I've never used them and I don't know how to orient them. Can you please tell me how to use it correctly?

I attached the updated schematic.

Again, thanks for responding
 

Attachments

  • schemeit-project.png
    schemeit-project.png
    20.8 KB · Views: 139

Harald Kapp

Moderator
Moderator
S1 will turn on the LED, but R1 limits the current to approx. 1.8mA, That may be a bit on the low side for the LED to shine bright. You may need to reduce R1.

Q1, S2 and R3 still make no sense. As I said, connecting emitter and base of a bipolar transistor will keep it off, no matter what value R3 is.

It is still unclear to me in which way you want to "regulate the current". And you haven't answered the question about the load. What exactly do you want to achieve?
Do you want to have a constant or controlled voltage at the output pins (across capacitor C1)? Or do you want to control the current through Q1? In what range do you expect the current to be? What is the use of C1?

DO you realize that with such a simple circut you will not be able to regulate either voltage or current? Regulating means to measure a characteristic (e.g. current) and to control an element such that the characteristic is within a defined range. You will need a means to sense voltage or current and use the difference between actual value and set value to adjust it.

It looks líke you want to simply control the current (or voltage) by adjusting R3. But without the clarification requested above we're not going anywhere.
 
Sorry, I'll go into a bit more detail. I wish to be able to limit and control the current that will exit through the two points on the right side of the schematic. I want the current to stay in between .1 and 2 milliamps. I want to use the variable resistor and ammeter to manually control the current. L1 is to test the battery. C1 is to provide a more gradual start, so that instead of the current travelling through the load all at once it has to charge the capacitor.

My biggest question is simply how to use the npn/pnp switch properly.

Thanks for taking the time to reply
 

davenn

Moderator
another thing you need to learn is how to draw a circuit so its easier to follow
The convention is for the + rail to be along the top and the - rail to be along the bottom

here's one site for a fixed current limit circuit ... it could be made adjustable

Google offered many others

and another thing... you still havent answered Harald's question ... " WHAT IS THE LOAD ? "
caps and bold so you dont miss it ;)

cheers
Dave
 
Last edited:
Okay, I haven't been drawing them for a while, but I will try to make it easier to follow next time I draw one.

I haven't answered the question yet, because I don't know. I want to make this circuit multipurpose for anything I need to hook it up to, that's why I want it to be manually adjustable, even when operating.

Thanks for the link but that circuit only allows you to set a maximum current, it could be made adjustable but it's not really what I'm looking for.

Thanks for replying
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Thanks for the link but that circuit only allows you to set a maximum current

That's *exactly* what a "current regulator" does.

This is why you've been asked about the load. I the resistance of the load is higher than the voltage of your power source divided by the current you want (R > V/I), no current regulator is going to be able to maintain the desired current.

Typically current sources (another name for a current regulator) are powered from relatively high voltages so that you can use higher resistance loads. For example I have a current source that has a 100V maximum voltage.
 
I'm sorry if I got my terms confused, but I explained clearly what I wanted to do, and that is to manually maintain the current I choose by using the potentiometer and ammeter.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
No, the term is reasonable (not commonly used, but correct).

Your circuit however is not a current regulator.

The simple answer to your question is that sourcing current into the base of an NPN transistor (not switch) will allow a greater current to flow through the collector. For a PNP transistor current is sunk from the base.

Typically for an NPN transistor this means that the base is connected via a resistor or other current limiting device to a potential higher (more positive) than the emitter. Likewise the collector is connected (often through a load) to a potential higher than the emitter. For a PNP the potentials are reversed.

Your circuit, as far as I can make it out, seems to use a variable resistance to change the base current in an effort to regulate the collector current. (note that as drawn it won't do that)

Whilst this seems like a likely way to regulate current, it actually turns out to be quite inaccurate and unstable.

There are various circuits which perform the task far better, to the point of being actually useful. However in order to recommend one, we would need to know some information about the range of required currents and also likely load resistances, or a voltage range to supply to the load.

The reason we would require this is that practical considerations mean that certain designs are only suitable over particular ranges of maximum voltage or dissipation.

For example, you might say you want a variable current between 1mA and 100mA from a 12V power supply. You might tell us that the output needs to withstand being shorted. From this we could figure something out. However it's possible you will need more than just a transistor unless you're prepared to accept a switched range of currents (e.g. 1, 10, and 100 mA).
 
Steve,

Thank you, that was far easier to understand and more helpful than the stuff I found through Google. Do you think I should just get rid of the NPN, and simplify the circuit to just go through the resistor?

I wish to have the current vary from .1 - .2 mA to 2 mA.

Thanks again for replying
 

davenn

Moderator
I'm sorry if I got my terms confused, but I explained clearly what I wanted to do, and that is to manually maintain the current I choose by using the potentiometer and ammeter.

unfortunately ... not clearly

The Load ( resistance) DETERMINES the current at a given voltage.

The current to the load can be limited BUT the load needs to be known


cheers
Dave
 

davenn

Moderator
..................
I wish to have the current vary from .1 - .2 mA to 2 mA.

Thanks again for replying


Its going to be quite difficult to get that sort of accuracy ... component variations, temperature variations among other things will current variations greater than what you are trying to maintain


Dave
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
I wish to have the current vary from .1 - .2 mA to 2 mA.

I think that's doable with a fairly simple circuit.

Fortunately the current is low, so dissipation will likewise be low.

attachment.php


This requires 2 transistors, both can be the 2N3904 that you mentioned.

The way this works is that R1 turns on Q1 to allow current to flow through your load. Normally nothing would limit this current, but in this case, when the current through R2 + R3 increases enough to turn on Q2, Q2 prevents it from rising any higher.

This circuit is not perfect, but it should work over the fairly small 10:1 range you're interested in.

How to determine the component values:

1) R1 should pass about 2% of the maximum current required at the minimum input voltage less 1.4V. Let's assume that the input voltage ranges between 12V and 14V, and the max current is 2mA. Therefore the required resistance is ((12 - 1.4)/0.002) * 0.02 = 265000 ohms. A 220k resistor would be fine.

2) R2 should drop 0.6V at the maximum current. So at 2mA, R2 = 0.6/0.002 = 300 ohms. 270 ohms would be a good choice.

3) R3 should be chosen so that the voltage dropped across R2 and R3 at the minimum current is 0.7V. So R3 + R2 = 0.7/0.0001 = 7000 ohms. Thus R3 should be 7000 - 470 = 6530 ohms. The closest you're likely to come is 10k. R3 is this a 10k potentiometer.

You may note that I used 2% in step 1. I am assuming the transistor has a gain of at least 100, and that we'll have a base current twice that (so we ensure there is regulation happening). The 2N3904 specifies a minimum gain of 70 at 1mA, so we're in the ballpark.

In part (2) I use 0.6V, while in part (3) I use 0.7V -- why? Well the voltage required to turn Q2 on is typically between 0.6V and 0.7V. I use the one which tends to cause errors to widen the range of currents.

Because the current is so low, we can pass all of it through a potentiometer. You COULD NOT just change resistance values in this circuit to get currents from 100mA to 1A. The current through the potentiometer would require either an expensive potentiometer or would make it emit smoke.

Now we have the values, let's calculate how this will perform.

The constant current source will require about 1.7V to operate. Thus the maximum voltage available to the load will be about 10.3V (that's at the minimum input voltage).

At 2mA, this allows for a resistance of up to 5k ohms. At 0.1mA the maximum resistance would be about 100k ohms.

If you had a load which exhibited a higher resistance, the current would fall. You could counter this by using a higher input voltage. With the transistors chosen, the maximum input voltage would be about 40V.

The current will change slightly with the input voltage, load, and temperature, but the variation will be quite small.
 

Attachments

  • ConstantCurrent.jpg
    ConstantCurrent.jpg
    52.8 KB · Views: 264
Steve,

Thanks for the explanation and schematic. They were very helpful, and made a lot of sense. I'll be making a run to radioshack Monday to try it out.

Again thanks for helping me out
 
I think that's doable with a fairly simple circuit.

Fortunately the current is low, so dissipation will likewise be low.

attachment.php


This requires 2 transistors, both can be the 2N3904 that you mentioned.

The way this works is that R1 turns on Q1 to allow current to flow through your load. Normally nothing would limit this current, but in this case, when the current through R2 + R3 increases enough to turn on Q2, Q2 prevents it from rising any higher.

This circuit is not perfect, but it should work over the fairly small 10:1 range you're interested in.

How to determine the component values:

1) R1 should pass about 2% of the maximum current required at the minimum input voltage less 1.4V. Let's assume that the input voltage ranges between 12V and 14V, and the max current is 2mA. Therefore the required resistance is ((12 - 1.4)/0.002) * 0.02 = 265000 ohms. A 220k resistor would be fine.

2) R2 should drop 0.6V at the maximum current. So at 2mA, R2 = 0.6/0.002 = 300 ohms. 270 ohms would be a good choice.

3) R3 should be chosen so that the voltage dropped across R2 and R3 at the minimum current is 0.7V. So R3 + R2 = 0.7/0.0001 = 7000 ohms. Thus R3 should be 7000 - 470 = 6530 ohms. The closest you're likely to come is 10k. R3 is this a 10k potentiometer.

You may note that I used 2% in step 1. I am assuming the transistor has a gain of at least 100, and that we'll have a base current twice that (so we ensure there is regulation happening). The 2N3904 specifies a minimum gain of 70 at 1mA, so we're in the ballpark.

In part (2) I use 0.6V, while in part (3) I use 0.7V -- why? Well the voltage required to turn Q2 on is typically between 0.6V and 0.7V. I use the one which tends to cause errors to widen the range of currents.

Because the current is so low, we can pass all of it through a potentiometer. You COULD NOT just change resistance values in this circuit to get currents from 100mA to 1A. The current through the potentiometer would require either an expensive potentiometer or would make it emit smoke.

Now we have the values, let's calculate how this will perform.

The constant current source will require about 1.7V to operate. Thus the maximum voltage available to the load will be about 10.3V (that's at the minimum input voltage).

At 2mA, this allows for a resistance of up to 5k ohms. At 0.1mA the maximum resistance would be about 100k ohms.

If you had a load which exhibited a higher resistance, the current would fall. You could counter this by using a higher input voltage. With the transistors chosen, the maximum input voltage would be about 40V.

The current will change slightly with the input voltage, load, and temperature, but the variation will be quite small.
I think that's doable with a fairly simple circuit.

Fortunately the current is low, so dissipation will likewise be low.

attachment.php


This requires 2 transistors, both can be the 2N3904 that you mentioned.

The way this works is that R1 turns on Q1 to allow current to flow through your load. Normally nothing would limit this current, but in this case, when the current through R2 + R3 increases enough to turn on Q2, Q2 prevents it from rising any higher.

This circuit is not perfect, but it should work over the fairly small 10:1 range you're interested in.

How to determine the component values:

1) R1 should pass about 2% of the maximum current required at the minimum input voltage less 1.4V. Let's assume that the input voltage ranges between 12V and 14V, and the max current is 2mA. Therefore the required resistance is ((12 - 1.4)/0.002) * 0.02 = 265000 ohms. A 220k resistor would be fine.

2) R2 should drop 0.6V at the maximum current. So at 2mA, R2 = 0.6/0.002 = 300 ohms. 270 ohms would be a good choice.

3) R3 should be chosen so that the voltage dropped across R2 and R3 at the minimum current is 0.7V. So R3 + R2 = 0.7/0.0001 = 7000 ohms. Thus R3 should be 7000 - 470 = 6530 ohms. The closest you're likely to come is 10k. R3 is this a 10k potentiometer.

You may note that I used 2% in step 1. I am assuming the transistor has a gain of at least 100, and that we'll have a base current twice that (so we ensure there is regulation happening). The 2N3904 specifies a minimum gain of 70 at 1mA, so we're in the ballpark.

In part (2) I use 0.6V, while in part (3) I use 0.7V -- why? Well the voltage required to turn Q2 on is typically between 0.6V and 0.7V. I use the one which tends to cause errors to widen the range of currents.

Because the current is so low, we can pass all of it through a potentiometer. You COULD NOT just change resistance values in this circuit to get currents from 100mA to 1A. The current through the potentiometer would require either an expensive potentiometer or would make it emit smoke.

Now we have the values, let's calculate how this will perform.

The constant current source will require about 1.7V to operate. Thus the maximum voltage available to the load will be about 10.3V (that's at the minimum input voltage).

At 2mA, this allows for a resistance of up to 5k ohms. At 0.1mA the maximum resistance would be about 100k ohms.

If you had a load which exhibited a higher resistance, the current would fall. You could counter this by using a higher input voltage. With the transistors chosen, the maximum input voltage would be about 40V.

The current will change slightly with the input voltage, load, and temperature, but the variation will be quite small.

Please suggest me with your replied circuit how can i get 1mA to 2mA current output and current resolution with 0.1 or 0.2mA
usong potentiometer
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
That question is answered in my point 3 above.

If you want different min and max currents then change the values used in the calculations
 
Top