A Proteus Simulator Question

Thread Starter

q12x

Joined Sep 25, 2015
1,788
This is an advanced question.
This is strictly a Proteus Simulator problem.
- How can I set up the properties of the general NPN tr, so that it is very close to a switch properties and with no other losses?
To be clear, in the scene I have a switch, a relay and a NPN tr.
Screenshot_2.jpg
Here is from where we can set it's properties, and theoretically we can tweak it to our pleasure. But with great bad luck from my part. I am struggling for literally years with this problem and I must admit, I cant figure it out.
1714324205070.png
Maybe of some help will be the following data and documentation.
In ProteusVSMSDK.pdf, at page 71 / 283 you can find all the under the hood values! for this specific component.
or you can easily search for this string: "The Bipolar Transistor Models - NPN" and get to that page, as an alternative.
1714324548689.png(Im also attaching the proteus file for your convenience)
Thank you.
 

Attachments

Thread Starter

q12x

Joined Sep 25, 2015
1,788
Another idea is to make from scratch or modify an already made component into a transistor like component that is having the same characteristics as a switch. Is my other idea. I already walk on this path as well, I learned to modify existing components, and I did modify a 555, a led and a relay but I was not able to add or substract anything from the existing details they had. If I did, I was getting some very ugly errors that I could not correct or interpret. So I remain only at -modifying- level.
1714375422847.png 1714376110968.png 1714376481861.png
 

Thread Starter

q12x

Joined Sep 25, 2015
1,788
WOW ! This is totally new to me.
Thank you !
But... this is only a part of the problem. Im only showing an example with the voltage loss in the NPN tr model. I encountered other problems but at the moment I cant remember or replicate. The idea is that here in the sim, some aspects of the general NPN tr are not working at all, while in reality, they are working. I will come back to this thing later in the future when I will re-create or encounter some other failures.
Other than that, many thanks as it is right now !
 
Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
1,788
Problem !
If we change the resistor values into 1.5-3.5 I should get a 3.5V but....
1714401719777.png
also for 0.5-4.5 = 4.5V and
also for 1k-4k = 4V
-edited-
It appears that from a 5V supply, this combo will work from 0V to 3V exactly, on these voltage dividers.
In other words, from 3V down to 0V is working excellent. Over 3V, it doesn't like it for some reason.
My tests were from 0.5 steps, and at 5; 4.5; 4; 3.5 I was getting a consistent 3.17V for each. Only at 3 I got a 3.005V and the rest down were consistent with the voltage dividers voltages.
It appears that it freeze at 3.17V from a 5V supply. What could be the cause? Hmmmm. Very intriguing !
 
Last edited:

Jony130

Joined Feb 17, 2009
5,539
5 V at the gate is too low to turn on the MOSFET. Because the MOSFET threshold voltage is around 2V. The voltage at the gate needs to be more than 2V higher than the source voltage.
So, if your voltage divider outputs 3.5V we need a minimum of 5.5V at the gate to turn on the MOSFET.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,788
4017 is supplying with a consistent 5V when is High. And with under 0V, negative voltages like -1, -3 fluctuating when is Low.
Im telling you what I see on the probes.
So...I need a buffer on the gates of the mosfets ? Up to what voltage, to get that 5V from the voltage divider?
 

Jony130

Joined Feb 17, 2009
5,539
but the pin Hi is 5V all the time, indifferent of the IC Power Voltage. Ha.
I think that it can't be changed, unfortunately.

As for the switch have you tried to use 4066? Because you still do not explain why you want to use a MOSFET switch instead of a relay?
 

Thread Starter

q12x

Joined Sep 25, 2015
1,788
Because you still do not explain why you want to use a MOSFET switch instead of a relay?
I give the reason in my OP, here:
I am struggling for literally years with this problem and I must admit, I cant figure it out.
To get into more detail than that, in reality, my transistors work just fine but here in the sim are not. Sometimes is like that(not all the time). And my conclusion, after many years of using this sim, is that the internal properties of a basic tr here in the sim is a bit too high than the ones in reality. Basically should have be modeled more like a switch. In contrast, when Im using only switches, the cct behavior is in perfect match with the one in reality. So the tr in the sim is bugged and faulty. Is my conclusion after MANY years and tries of using it. Again, sometime is working fine for certain types of ccts but other times is against everything. Very annoying. My solution, especially for a logic/digital cct is to use relays that is between a tr and a simple switch. Is slower indeed but the results are perfect match with reality. Thats the reason. More clear now?
I tried different ways to modify this model tr but with no great success. My conclusion after poking into it, it is a component inside a .dll that is made in c++ and also have certain rules of operation and philosophy that is only known by the developer itself. I know to program in c# which is a cousin of c++, but ... I had no chance to even smell the begining of how to get into modifying that .dll or the component inside. I believe it was a .dll if I remember right, I made this investigation a long time ago. I believe I even find someone actually modifying a component and it was insane, so I give up, like usual, haha.
1714536066253.png
My other most used sim, is circuitjs, its intention was to be used in a browser, so a web based app, here: http://www.falstad.com/circuit/ and it is having a completely different mechanics of functionality than Proteus which is based on Spice mechanics. Proteus is a wrapper around Spice. If I understood it right. Im mentioning this circuitjs program, because its component model of tr is modeled VERY close to the ones in reality. I remember I got 1 or 2 erroneous results from it, but a lot more from Proteus, and the effect was that here was working but in reality didnt. Opposite to Proteus behavior(where tr is not working but in reality is working). But it lacks the complexity Proteus can achieve. So I prefer Proteus in the end of the day. But this circuitjs is an excelent alternative for some buggy ccts in proteus, either to clear your mind or to test proteus if its a bitch.
Yes... complicated enough? Haha.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,788
Now, back to this specific problem with this cct test....
--The goal is to get a perfect 5V for the first column !--
The NPN version is beating the mosfet version, in the sense that the mosfet can not go higher than 3.17V (1.83V less), but anything under this value is read perfectly.
Relatively the same problem is for the NPN but is at a higher voltage than mosfet, and it is at 4.67 (0.33V less) 1714541942446.png and anything under this value is read good enough if I tweak the resistor values at very exotic values. 1714542231562.png
Screenshot_3.jpg
I didnt made this test in reality, but if it will be exactly as in the sim ... I expect excelent results without exotic tweaking.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,788
I didnt made this test in reality, but if it will be exactly as in the sim ... I expect excelent results without exotic tweaking.
And now I made the reality test on only 2 columns the 5V and the 4.5V one.
My power supply was set to 5.1V like in the sim. For the 1R I used a wire link.
It must have exotic resistor tweaking.
-
Well... it worked ok, although the values are a bit different since resistor tolerances, and also my tr that Im using, but is very close to the sim.
I got a 4.6V on the 5V output with one DMM and with another DMM I got a 4.9V. So..... hmmm I say its good enough.
It would be cool enough to have a rail to rail output.
I was thinking that 0.33V loss is due to some voltage drop over the tr itself. Most probably, because its a value that was predicted in the sim.
-
I changed the 5V module like this, since I really dont need a voltage divider for it. So now is a bit cleaned up. This increased the Output Voltage to 4.92 ! But my DMM is fluctuating in reading, but lets say it got a tiny bit increased after that resistor to gnd was removed.
Screenshot_1.jpg
 
Last edited:

sarahMCML

Joined May 11, 2019
425
And now I made the reality test on only 2 columns the 5V and the 4.5V one.
My power supply was set to 5.1V like in the sim. For the 1R I used a wire link.
It must have exotic resistor tweaking.
-
Well... it worked ok, although the values are a bit different since resistor tolerances, and also my tr that Im using, but is very close to the sim.
I got a 4.6V on the 5V output with one DMM and with another DMM I got a 4.9V. So..... hmmm I say its good enough.
It would be cool enough to have a rail to rail output.
I was thinking that 0.33V loss is due to some voltage drop over the tr itself. Most probably, because its a value that was predicted in the sim.
-
I changed the 5V module like this, since I really dont need a voltage divider for it. So now is a bit cleaned up. This increased the Output Voltage to 4.92 ! But my DMM is fluctuating in reading, but lets say it got a tiny bit increased after that resistor to gnd was removed.
View attachment 321342
What are the various output voltages going to be used for?
 

Jony130

Joined Feb 17, 2009
5,539
It seems like you do not fully understand how BJT works.

First what you need to understand is that between the base and the emitter, we have a PN junction (diode).
So if a transistor is not burned and there is a base current flowing from base to emitter. We will have a diode voltage drop between the base and the emitter.
Thus, in normal operation, the voltage at the emitter will always be lower than the base voltage.
Take a look here
https://tinyurl.com/2xfjtvhp
We also have a second diode (second PN junction) between the base and collector. And in "normal" operation (active region). The collector-base junction operates in reverse bias, meaning that voltage is applied in a way that the collector voltage is more positive (higher) than the voltage at the base terminal (for NPN BJT). This configuration allows the transistor to function as an amplifier.
And in this region (active region - VC > VB and Vbe = 0.6V ) the collector current is more or less beta time larger than the base current, Ic = β*Ib holds true. But β varies a lot due to it being a very poorly controlled property of a transistor. So you shouldn't rely on its exact value.
https://tinyurl.com/yw5rkv5h

If we by accident swap the emitter with a collector.
https://tinyurl.com/ywlcxmvj

The BJT will reverse the active region when the collector took over the role of the emitter and the emitter now takes the role of the collector.
However due to the different doping (and size) between the collector and the emitter. The reverse beta βr will be much lower than the "normal" forward beta βf.
For example, my BC548B shows this result: βf=250 at Ic = 1mA and βr=8.3 in reverse active mode for the same current.
And for BC337-25 βf = 352; βr = 38.


As a side note, the BJT will also conduct current in these two cases:
BJT as a Zener diode:
AtAxX.png



And this why
vg54l.png

Now BJT's behaviors are just like a poor man tunnel diode (Esaki effect). And tunnel diodes will have a "negative resistor" region.
This negative resistance region occurs only for NPN BJTs.
http://jlnlabs.online.fr/cnr/negosc.htm
http://www.cappels.org/dproj/simplest_LED_flasher/Simplest_LED_Flasher_Circuit.html

And I measured this Zener voltage:

BC337-40
Veb=8.2V , Vec=6.7V at I=5.5mA

BC549B
Veb=8.3V , Vec=7.2V at I=5.5mA

BD139-16
Veb=8.5V, Vec=6.7V at I=5.5mA


Now what you did was to use the BJT improperly.

11a.PNG

You also do not show us what is the load and how it is connected.
But notice that in this case if Vc < Vb < Ve the BJT will work in reverse mode.
https://tinyurl.com/yrka2jbg
 

Thread Starter

q12x

Joined Sep 25, 2015
1,788
Ahaaaa.... very interesting ! Indeed I dont know these details ! I mean, I know some stuff, but definetly not all the stuff. VERY interestingly ! Thanks !
You also do not show us what is the load and how it is connected.
All the Emitors of all the control tr's for each volt dividers are common on the same line. This line goes into a base of a single tr at the end. I didnt include it in my drawing but thats pretty much what it will drive. So that's the load.
This end tr will then drive a bigger load that I didnt decided exactly what it will be.
- I like that you get the hang of the sim. You can see how user friendly it is and is quite precise.
I suggest getting used to text labels for clarity, both for you and for participants.
Screenshot_2.jpg I am very used to using them and helped me along the road.
What are the various output voltages going to be used for?
Hold your horses, everything will come out at the right time. haha. First, the preparation, you know me. Its also highly undecided at this point.
 
Top