You are doing several things incorrectly.Hello all. I am trying to setup a constant current source using a 2n3904 and a Motorolla LM358N. I want to ensure 4mA collector current regardless of my load. Here is a screen shot of the circuit, an explanation of my rationale, and the problem I am having.
Using the datasheet, to the best of my ability, it looks like my DC current gain would be 70. By that logic my base current, 3.68V/23k = 160µA, multiplied by 70 should give me a collector current of 11.7mA (NOTE: The LM356N does not go rail-to-rail so the output is 3.68V). When the voltage across my sense resistor exceeds 4V, 4mA total current, the LM356N will output low unbiasing the 2n3904. I know I may have to implement some hysteresis into this circuit.
1. I am pretty sure I'm interrupting the datasheet incorrectly. Could someone explain this section to me?
How I see it if I'm fully on, what would my collector current be? Well in this case it would be 5v/1k which is 5mA.
With that information I assumed I would reference the 3rd entry for the behavior I could expect. Also, Vce is listed as 1V here.
How does this factor in?
2. As it stands right now, I get 2.8mA of total current through my sense resistor. What exactly am I screwing up here?
3. Lastly, I've heard it is poor practice to use an op-amp as a comparator without some sort of hysteresis. How can I implement this here?
Thank you all so much for any input. Hopefully, I was clear in my explanation.
That will be fine for what I am doing. Do you have any links to a decent tutorial to help me understand DC current gain? The math seems incredibly straight forward, beta = Ic/Ib, but the application is tricky for me. Do I determine the base current only after I have determined the collector current?Some beta data for 2N3904.
View attachment 142714
Beta for a typical transistor in the 1-10mA range is a minimum of 70-100, with a maximum of 300.
If you had a transistor that gave a beta of 100 at 4mA, the base current would be 40uA; so collector current would be 3.96mA. A 1% error. Is that close enough?
Thanks for the reply, I did design it and I am learning. I've always stayed away from the analog side of things and favored microprocessors, PIC especially. I wanted to start to learn.You are doing several things incorrectly.
It pretty much goes downhill from there. Where did you get this circuit from, any way? The circuit itself is reasonable, but it's pretty evident that you did not design it because you seem to have any idea of how it works to achieve the goal you stated.
It seems that these calculations rely heavily on "assumption" due to the nature of the 2N3904. For example, given the table on the 2N3904 datasheet, am I wrong for expecting a beta anywhere from 100 to 300? I understand my Vce is not 1V in this case.The base current cannot be easily calculated in your new circuit without a series base resistor. If you use a transistor with high hFE then the base current is very low. I think you are using a general purpose 2N3904 that does not have a very high hFE, it is from 80 to 250 or typically 230.
With your ref at +2.5V then the sense resistor will also have about 2.5V across it which creates an emitter current in the transistor of about 2.5V/619 ohms= 4.04mA. The base current will typically be 4.04mA/230= 17.7uA and the collector current will typically be 4.02mA. The base voltage will be about +3.2V.
You need to read the datasheet and operate the opamp within it's specified parameters.I did design it and I am learning.
At Ic=10mA, Vce=1.0V, and temperature=25C.am I wrong for expecting a beta anywhere from 100 to 300?
A good way to think of the datasheet values for hFE is to use them to determine how much base current your circuit needs to be able to supply, at a minimum, so that you don't starve the transistor's base current needs.It seems that these calculations rely heavily on "assumption" due to the nature of the 2N3904. For example, given the table on the 2N3904 datasheet, am I wrong for expecting a beta anywhere from 100 to 300? I understand my Vce is not 1V in this case.
https://www.onsemi.com/pub/Collateral/2N3903-D.PDF Page 2
1. Anywhere from 0 to 500ohms@ odm4286:
1) What is the range of load resistances that you want this circuit to maintain 4 mA in?
2) What is the accuracy that you need for this 4 mA?
3) What is the tolerance of your supply voltage?
So part of your design is going to have to allow the collector voltage to go down as far as 3 V. If you want to keep the transistor well out of saturation, the keeping Vce above 1 V is a good idea, since you had data sheet values for minimum hFE at that collector-emitter voltage.1. Anywhere from 0 to 500ohms
Not gonna happen with 1% tolerance components. A good rule of thumb is that your component tolerances need to be about an order of magnitude better than your target, so you would need 0.1% tolerance components. But if you were shooting for that level you probably need to start doing a proper propagation of errors.2. Within 1% would be nice, not too concerned with this at the moment.
3. At the moment I'm using 1 percent resistors and a regulated supply, so I don't see the reference voltage varying much.
There really isn't that much to understand.I just want to be clear on one thing, I still don't quite understand the concept of DC current gain fully but it seems Ie ≈ Ic in this circuit. Correct?
Thanks a lot for the detailed reply. This will be my last post in this thread but I just want to check in with you one last time to make sure I've wrapped my head around this finally. Here is a table of the predicted values for Ib. Using the values I found on this datasheet : https://www.sparkfun.com/datasheets/Components/2N3904.pdfSo part of your design is going to have to allow the collector voltage to go down as far as 3 V. If you want to keep the transistor well out of saturation, the keeping Vce above 1 V is a good idea, since you had data sheet values for minimum hFE at that collector-emitter voltage.
You've got it. There are exceptions to every rule, but that rule will serve you well for most purposes.I think I understand now. Beta is not a definite parameter, especially in the way that I am using this transistor. The best you can do is calculate a "window" for Ib and design accordingly.
Close, but not quite.I think I understand now.
Here is the latest. Thank you all for the help.Close, but not quite.
While it's true that Ic = βIb, you're setting Ie and Ie = (β+1)Ib.
So for Ie = 4mA, Ib = 4mA/(80+1) = 49.4μA;
How did you arrive at a minimum β of 80? From the graph, I'd take it to be closer to 95.
At any rate, knowing the base and emitter currents, you can calculate the percentage error in Ic:
Ib/Ie*100. For Ie = 4mA, that gives 49.4uA/4mA*100 = 1.2% (using your numbers) or 1.0% using mine.
EDIT: Add error calculations:
View attachment 142743
When you get down to the 10's of mV range on the input, you need to consider the input offset voltage spec. Don't know if you're using LM358 or LM358A. For the former, Vos is 7mV max, 2mV typical. 7mV would give you an additional error of approximately 15%.Here is the latest.
|Thread starter||Similar threads||Forum||Replies||Date|
|2N3904 as a switch||General Electronics Chat||5|
|E||LTSpice Question Re 2N3904 Definition||General Electronics Chat||2|
|P||Transistor type 2n3904 would not saturate(maybe?)||General Electronics Chat||52|
|E||2N3904 Maximum Allowable Ratings||General Electronics Chat||12|
|Use of 2N3904 instead of BC337, getting a bit hot||General Electronics Chat||5|