Maker Pro
Maker Pro

Voltage Drop across NPN BJT C&E?

Perhaps you find it easy, but I don't find it to be trivial. Especially trying to design a circuit to have a clean on/off controlled by the presence/absence of 2-3v. The difficulty I allude to is selecting an appropriate transistor to do the job based on the datasheet.
All I can say in general is that the BJT must be saturated to be on. How it performs depends on the components you select and put together. Perhaps a BJT is not the best component to use. Don't manufacturers sell solid state switch modules?

Ratch
 
Last edited:
I was implying my own difficulties, see post #41
I hope we are not mixing up the selection of a switch component with the circuit design after it has been selected. Since I don't know exactly what you are doing, and you have received help from several members, I don't think I can help you further. I only observe that it is easy to make a switch from a BJT, even if it is just a mediocre switch and might not satisfy your needs.

Ratch
 

hevans1944

Hop - AC8NS
I thought the comparator would be sufficient for the LDR setup
It is. Your comparator works just fine. This thread is discussing how to modulate (switch on and off) the power to conserve coin-cell life. Sorry for the tangent discussion, which I finish below.

What a log amp could do is make it easier to set a threshold level for switching between full daylight and full darkness, somewhere between dusk and dawn for your application over a wide range of light levels. Your current design works fine, but the voltage divider resistors that set the switching threshold were determined by trial-and-error. Not much illumination lee-way is provided with a linear potentiometer in series with the voltage divider, nor does that much accommodate variations among LDR sensitivities if you need to build more than one.

A log-amp would compress the huge range of LDR resistance variations that occur as a function of light intensity into a linear span from which you can easily pick a threshold level from full daylight to pitch black darkness. Of course the span isn't really linear, it's logarithmic, but the effect is to "linearize" the LDR response.

I think it might be worth your effort, from an educational point of view, not for your Halloween decoration, to at least breadboard a simple logarithmic amplifier circuit and "play" with it. You could start with circuits that use just one BJT and one op-amp to do this, but of course simple circuits are extremely sensitive to variations in temperature.

LDRs aren't the only devices that benefit from a log-amp. Have you ever been annoyed when the TV program switches to commercial and the sound level appears to double? A log-amp can help to fix that and restore "normal" sound levels. I am still working on a reliable method to automagically mute the sound when commercials appear, and there are probably others who claim to be able to do just that. My solution, so far, is to just watch programs on streaming media like Netfilx and Amazon Prime or watch Blu-Ray DVDs.

This is what makes it difficult for a hobbyist to use these devices as a simple switch, there is a lot more going on than a simple on/off action!
That is true, there is a lot going on "under the hood" but you don't need to know everything yet to get moving down the road. The thing that distinguishes most hobbyists from "professionals" is we have the luxury of having time and materials to experiment and learn new things. In a commercial environment, time and materials cost money and have to result in profit. Hence there is a strong incentive to have the knowledge to "get it right" the first time when designing "new" circuits for commercial use. That's why engineers spend big bux for an education, and employers spend years exposing new graduates to the real world.

You, OTOH, have the "free" time to "play" with an assortment of inexpensive BJTs, choosing bias, choosing different voltages to drive the base and collector terminals, and choosing different resistors to limit the base and collector currents, while observing and measuring (and hopefully making journal entries of) the collector-emitter voltage (the thing you want to switch), aiming for no voltage drop when the switch is "on" and dropping all the voltage available from the supply across the collector and emitter terminals when the switch is "off". You may not reach those exact goals, but you will learn a lot about BJTs along the way.

Personally, at the low voltage you get from a single coin-cell, I would try to do this "switching" with a MOSFET. Unfortunately, if you just substitute a MOSFET for the BJT, you now have a source-follower and you have to make the gate voltage for turn-on larger than the output voltage by whatever the threshold voltage for MOSFET happens to be. And you need to find a MOSFET with not too much rd(on) resistance.

Maybe it is time to consider using a small electromagnetically operated reed relay.:eek: You can bias a normally-open reed switch with a permanent magnet so it latches on, allowing you to remove the coil excitation. Later, to turn it off, reverse the coil current (or use another coaxial coil) with a pulse to release it from the latched state. The magnetically latching reed relay draws zero power except when changing states.

Hop
 
You are making some assumptions there about how I calculate bias, which are incorrect. First of all, one does not want a stiff divider, this will lower the input impedance too much.

I originally stated that I know that is is Vbe that controls the current, so no, I have never claimed that Ib controls Ic, only that pretending it does produces the correct results.
1.) Quotes Horowitz/Hill (Art of Electronics):
* We make the impedance of the DC bias source small compared with the load it drives. This is approximately equivalent to saying that the current flowing in the voltage divider should be large compared with the current drawn by the base.
* The base voltage can be provided in a number of ways. A voltage divider is OK as long as it is stiff enough.

2.) In post#17 I have mentioned some observable effects and circuits which can be explained with voltage control only. Furthermore, some different operating modes (class A, class B,..) are defined and can be explained using the exponential Ic=f(VBE) characteristic only.

3.) Please notice that I have attached a file which contains a rough hand-made drawing which shows what`s really happening when we bias a BJT.
In the drawing I have shown the stabilization line which defines the DC operating points (for two different Ic=f(VBE) characteristics). For biasing I have compared two extrem cases:

(a) Using RE-feedback and a "stiff" base voltage divider
(b) so called "current injection" using a very large base resistor and a driving voltage Vo.

Any REAL design may be somewhere between these cases.

As we can see, in both cases the change in collector current is relatively small. Hence, the sensitivity of the circuits to the actual VBE voltage (0.65...0.7 V) to be assumed for calculation purposes is rather small.
That means: Even in case of "current injection", it is the voltage VBE that determines the DC operating point.
However, it is not too important if our design starts with 0.65V or 0.7V. (This can serve as a counter argument against many contributions stating that due to this uncertainty the voltage-control view wouldn`t work).

The graph shows that, of course, it should be our goal to have a stabilization line with a very small slope only - and from the drawings it is easy to see what happens as a result of some parameter changes (uncertainties, tolerances, temperatur changes):
Temperatures, saturation current Io, B value, RE, RB, Vo, VB.
 

Attachments

  • BJT_bias.pdf
    486 KB · Views: 62
Last edited:
nor does that much accommodate variations among LDR sensitivities if you need to build more than one.
That is critical information as I intend to develop a handful - is there really that much variance in a batch of LDR's these days?

I will look at some inexpensive(?) Log amps today.

As for the mosfet, I didn't realize that two voltages were needed and will nix it from the design. To be honest, it isn't needed since we are not exceeding the current carrying capacity of the pic pin! We can simply switch the circuit on and off with one of the pic gates :D That simplifies things abit, LOL. I will play with an assortment of bjt's later to get a better grasp as well as try to construct a log amp. Thanks for the direction!
 

hevans1944

Hop - AC8NS
LDRs are inexpensive thick-film devices that can have a lot of variation. A bunch from the same lot will probably track fairly close in resistance versus illumination intensity, but I have seen "grab bag" lots that include a lot of different LDRs. It would be nice to have a circuit that would allow you to use any one LDR from a mixed lot and easily adjust the trip point according to the luck of the draw.

Of course this is all just speculation on my part... I haven't played with LDRs in decades, and longer ago than that for log-amp circuits. Unlike most photo-diodes, it's hard to find good specifications (or even good datasheets) for LDRs. See the range of sensitivites from this Adafruit page:

graph.jpg

If you stick with "identical" LDRs from the same manufacturer your original Halloween toy should work just fine. I'm just trying to show you another path. Stay away from the Dark Side, even though they have cookies. Well, maybe small steps to the dark side are okay, but the important thing is to have FUN!.:rolleyes:
 
Stay away from the Dark Side, even though they have cookies.
It's hard! The allure of completing a project versus correctly designing one!! LOL I appreciate the time you take to explain and offer guidance to the correct design. I am home now and can begin to play with my log-amp experiment. ;)
 
You, OTOH, have the "free" time to "play" with an assortment of inexpensive BJTs, choosing bias, choosing different voltages to drive the base and collector terminals, and choosing different resistors to limit the base and collector currents, while observing and measuring (and hopefully making journal entries of) the collector-emitter voltage (the thing you want to switch), aiming for no voltage drop when the switch is "on" and dropping all the voltage available from the supply across the collector and emitter terminals when the switch is "off". You may not reach those exact goals, but you will learn a lot about BJTs along the way.
Well I tried doing this today and found it to be very tedious with discrete resistors... It made me think that a pcb with a series of resistors mounted on it with a header strip to allow for pins to connect to the test circuit would be easier. Some type of variable power supply would be useful too :rolleyes: LOL. I think even a board of wood with some single AA battery holders that I can gang in series and tap at points to produce different voltages could come in handy :eek::p, well, now here I go off on a tangent!
 
This is just a claim - are you able to give any proof or explanation/justification?

Is it a question of EITHER base current OR base voltage? We can't change one without changing the other. It is convenient to find gain using base and collector currents. But it is easier to explain a current mirror by looking at base voltages. Both are important.
Under some specific base voltage and current can we get various collector voltages and currents?

(edited to add ...)

VCC = 5 V
Base resistor = 470K
Base voltage = 0.64 V
Base current = 9.27 uA
chosen to avoid saturation

Collector resistor = 1K
Collector voltage = 4.28 V
Collector current = 0.00072 A
Gain = 77

Collector resistor = 2K
Collector voltage = 3.68 V
Collector current = 0.00066 A
Gain = 71

No change in base voltage or current.

???
Do I need to get a more precise base voltage measurement? My meters are not precise enough to measure the difference.
 
Last edited:

hevans1944

Hop - AC8NS
I appreciate the time you take to explain and offer guidance to the correct design.
I enjoy taking the time to explain things... the Albert Einstein way. At this time I can't do any bench experiments to guide you, but if we close on our "dream home" this month, an electronics workshop setup (even if it has to be in the garage instead of in one of our two "spare" bedrooms or the laundry room) is high on my list of things to do.

As for "correct design"... that can be somewhat subjective. If a "design" works and doesn't catch on fire, some hobbyists would say the design is correct, even if they have to replace six "D"-sized cells every hour or so to keep it working. That's what wall-warts are for, eh?. An competent engineer might look at it and see some room for improvement, but nothing succeeds like success. If you are happy with it, and don't know of a "better" design, I would go with that for now. Years later you can look back on your notes and say, "Gee... if I only knew then what I know now..."

It also helps to know when to quit. Don't spend the rest of your life trying to get logarithmic amplifiers to work. Putter around a little until that "Ah ha!" moment of clarity occurs, then either put it aside for something more interesting or prepare to dive further down the rabbit hole. As I mentioned, the 24-bit ADC has pretty much eliminated the need for log-amps in most applications.

A simple log-amp is just a grounded-base transistor in the negative feedback path of an op-amp, plus an input resistor. The devil is in the details of getting a circuit that works well. You might want to look at this page to get started. Maybe start another thread on the subject to see if anyone is interested. Back in the day, the log-amp was the only reasonably high-speed way to multiply or divide two analog variables, mostly in analog computers. You can still purchase log-amp and analog multiplier modules even today, so they aren't totally useless or obsolete yet.
 
an electronics workshop setup (even if it has to be in the garage
Don't do it - it's too hot and humid, everything gets rusty real quick!! I had to resort to putting a finish on my cast iron surfaces to give myself years of rust free service! Imagine what the inside of some of your test equipment would look like in short order!!! Inside is a must for electronics.

It also helps to know when to quit.
Not in my book, I thought you knew that by now ;):D

Don't spend the rest of your life trying to get logarithmic amplifiers to work. Putter around a little until that "Ah ha!" moment of clarity occurs, then either put it aside for something more interesting or prepare to dive further down the rabbit hole.
Yes, the log amp got shelved today as I ran into something more interesting having just come up from a long rabbit hole dive, LOL. See your inbox :D:D:D Don't worry, its a quick one - I hope!

I actually did come across that very same page today on CT!! I scrapped the idea of replacing the comparator because the log-amp is too expensive in comparison. You are correct in that the LDR's range quite a bit, but for a small production of a handful, I think I can simply check each in turn. The program I had one revision ago will work as is, so I might just make a batch, let the kids enjoy them and learn the real time battery life of the non-optimized deal and then maybe revision 2.0 will be with that pic pin turning on every 1 second and checking the LDR status for light or dark.
 

hevans1944

Hop - AC8NS
You would still have to use a comparator (or an op-amp connected as a comparator) at the output of the log-amp, unless you ran the log-amp output into an ADC input on the PIC. The log-amp and ADC would then replace the comparator functionality, but with the advantage that four or five decades of LDR resistance change gets converted to a zero to five volt change in the ADC input.

[BEGIN SIDETRACK] You might want to investigate the magnetically latched reed relay too. I would start with this one available from Littelfuse. Ask them for samples. You can charge up a capacitor and then discharge it through the relay coil(s) to latch and un-latch the reed switch contacts. Try a few hundred turns of 30 AWG, scramble wound on a soda straw (try the smaller size served with adult beverages) the length of the reed switch.

It will be tricky sizing and placing the permanent magnet since you want its field to hold the contacts closed, not actuate them. The N-S poles of the PM should be parallel to the reed switch, establishing a weak magnetic field along the axis of the switch. Once you find the "sweet spot" where the coil actuates the switch, and it stays actuated after current is removed from the coil, you can hot-glue the magnet to the reed switch and coil. Don't use a powerful neodymium cobalt magnet, or if you do, only a small fragment will be sufficient.

This will be a lot of fun to play with and you will get a "gut" feeling for magnetic fields in the process. The leads of reed switches are themselves ferromagnetic and form part of the external magnetic circuit. You can play with this by using soft iron pole pieces, insulated from the wire leads with a thin film of super-glue, to guide the external magnetic field toward the axis of the switch. Soft-iron florist wire is useful for this purpose. [/END SIDETRACK]
 
Is it a question of EITHER base current OR base voltage? We can't change one without changing the other. It is convenient to find gain using base and collector currents. But it is easier to explain a current mirror by looking at base voltages. Both are important.
Under some specific base voltage and current can we get various collector voltages and currents?

(edited to add ...)

VCC = 5 V
Base resistor = 470K
Base voltage = 0.64 V
Base current = 9.27 uA
chosen to avoid saturation

Collector resistor = 1K
Collector voltage = 4.28 V
Collector current = 0.00072 A
Gain = 77

Collector resistor = 2K
Collector voltage = 3.68 V
Collector current = 0.00066 A
Gain = 71

No change in base voltage or current.

???
Do I need to get a more precise base voltage measurement? My meters are not precise enough to measure the difference.

No question about it, the Vbe controls the emitter/collector current. Why? The physics of the BJT show that it does. Without going into great detail, the BJT is a diffusion device whose rate of diffusion is determined by Vbe. Since the emitter/collector current is determined by the diffusion, Vbe controls the the emitter/collector current. That makes the BJT a transconductance device, which means input voltage controls output current. No matter that you can put a lot of resistance in the base and emitter circuits to make a current amplifier circuit, the BJT is still being controlled by its Vbe.

Ratch
 

hevans1944

Hop - AC8NS
Done and done, it is an interesting hack, good thinking outside the box Hop. LOL
I don't think I was the first person to try this, but it is effective. Since the leads and the moving, as well as the fixed contact, in a reed switch are made of ferromagnetic materials it requires a greater magnetic field externally to close the contacts than it does to maintain the contacts in a closed position. The permanent magnet, externally positioned, doesn't provide enough field to close the contacts, but once they are closed by an additional field supplied by the coil, there is now a magnetic circuit (without an air-gap) through the reed switch that the external magnet takes advantage of to maintain the closed position after the coil field goes away. Then It doesn't take much of an additional field, in the opposite direction, from a coil around the reed to reduce the total magnetic field sufficiently to open the magnetic circuit (and the switch contacts) again. Fun concept to play with.
 
No question about it, the Vbe controls the emitter/collector current. Why? The physics of the BJT show that it does. Without going into great detail, the BJT is a diffusion device whose rate of diffusion is determined by Vbe. Since the emitter/collector current is determined by the diffusion, Vbe controls the the emitter/collector current. That makes the BJT a transconductance device, which means input voltage controls output current. No matter that you can put a lot of resistance in the base and emitter circuits to make a current amplifier circuit, the BJT is still being controlled by its Vbe.

Ratch

You are correct, of course, but can you change voltage without changing current? I draw a specific current through the base to get a certain voltage.
With the same base voltage and current can I have different collector conditions? I cannot calculate collector voltage knowing base voltage, or can I? I can take collector current, divide it by gain and get base current. Can I calculate base voltage know collector voltage?
 
Top