Hi, I hope you are still answering questions. My question is that if we assume NPN has a base to emitter voltage of 0.7 volts, then we have a base current around 0.43 mA and assuming a betta of 100 for NPN, the collector current will be 43 mA. Also, we know that the voltage drop across the 47k resistor is 0.7 volts, which means a current of around 14.9 uA. How can I solve this paradox?
The base resistor of Q1 will have 4.3 volts across it. This will give us 4.3/100,000 or 43uA through it and into the base of Q1. Q1 is designed to run in a non-linear saturation mode. As such, Q1 collector current is dictated by R4, the 1K resistor. The voltage at the top of R4 is 11.3v. Since Q1 is in saturation, the voltage from Collector-emitter is approx 0 volts. Thus the current through R4 is 11.3/1k = 11.3mA. The beta of a 2n3904 is close to 200. Thus, 11.3mA/200 = 5.6uA. So our 47uA at Q1 base is more than enough to drive Q1 into non-linear saturation. It is true that since the 47k resistor has 0.7v across it, the current through it is only 14.9uA, but per KCL, the current flowing out of the base of Q2 must be 11.2851mA, for a total of 11.3mA (the current through R4).
@@TheTechCircuit But if per your calculation the Q1 base current is 5.6 uA, isn't this against ohm's law? since the current through Q1's base is calculated based on it's base resistance and the voltage across this resistance?
Finally someone showing the real scenario of working relay circuit ! I really like your explanation ! but why do you need 2 transformers ? would just one be enough to start 12V circuit with base current coming from microcontroller ? thanks
You can certainly switch the relay from the low side with an NPN transistor and a microcontroller driving the base through just a current limiting resistor. That is a convenient way to do it. It is better in many cases to use a high-side driver instead though because whatever device you are driving will share a common ground with other components and when switched off, will be at ground potential instead of at Vcc or (live). By using a PNP on the high side and an NPN as a pre-driver as in the video, you reduce the required drive current from the microcontroller port, and add an extra layer between the microcontroller and the relay coil's inductive spikes - while at the same time, gaining the general benefits of high-side switching.
@@TheTechCircuit Ok Yeah it makes sense, maybe one more clarification ..so 12V is powering main Load and PNP transistor which reduces voltage to 11.3v and that goes to the second NPN transistor which saturates at 0.7 micro-controller voltage closing the circuit. And you need PNP transistor to drop current that could be too hight for micro-controller itself ? because voltage is not that diffrent but current possibly it is ? I think I can see the logic of 2 transistors. I am a novice in electronics and try to build raspberry pie water heater with pump for my van conversion. I could just buy relay board suited for that but I would rather understand what is behind it. Thanks again and have a lovely day !
@@greggil3454 11.3 volts will appear only at the base of Q2 when saturated and will be 12V when not saturated (because of the 47K pull-up resistor). The voltage at the collector of Q1 will be the same as that at the base of Q2 until Q1 is switched on, which then saturates Q2. At this point, the base of Q2 is 11.3V and the collector of Q1 is about 0V. The difference is dropped across the 1K resistor. When the microcontroller outputs 0V, the base of Q1 will be 0V. When the microcontoller outputs 5V, the base of Q1 is 0.7V. The 100K resistor drops the other 4.3V and limits the base (and microcontroller port) current to 43 uA. The reason for Q2 (PNP) is to provide source switching, rather than ground switching. You can use the NPN by itself, and it will work just fine - even though the base current will need to be higher. You would need a lower base resistor value than 100k in that case so that the relay current divided by the NPN beta (about 100) could be attained. That would all work provided you didn't exceed the microcontroller port's max sourcing current.
If configured in that way, the microcontroller output port would potentially be exposed to 11.3V (supply minus the Q2 Veb) when at a logic high, and many microcontrollers can't tolerate much more than a volt over their supply (or 6 volts for a 5V microcontroller). The NPN transistor is instead used to pull the PNP one low while only requiring a 0.7V base bias which the microcontroller can of course easily provide via the current limiting resistor.
There is no detail about transistors, their type and current and voltage requirements. There is no explanation as to why 2 transistors were used when only one can work as a relay driver.
The NPN transistor pulls down the base of the PNP, which energizes the solenoid (solenoid current passes through Q2, not Q1). As for the type of transistor, depends on how much current Q2 has to sync; Q1 can be a 2N2222, general purpose transistor.
Y can't the 47k drive the first transistor. The current flows from 47k to the base of the first transistor, which then drives the first transistor, resulting in relay to turn on. The only possible explanation is current flow from collector to the base, which then flows through 1k rather than 47k, as current prefers least resistive path, therfore requiring second transistor to be turned on.
Good question. The 47K resistor cannot drive or turn on the first transistor (Q1). It is only used to keep the second transistor (Q2) in the cutoff region until Q1 is turned on and pulls the base of Q2 low. Once Q1 pulls Q2 base low, it goes into saturation and current flows through the relay. The reason for 2 transistors in this configuration is that the microcontroller can have active high relay control and be well isolated from the relay coil's flyback voltage. Also, if the microcontroller were to drive Q2 directly, the output port would be subject to a constant 12V potential, which exceeds many microcontroller's AMRs.
Thanks for this channel. Very informative, simple and related to real circuits we encounter in Home Appliances.
You're welcome. Thanks for the kind words.
Hi, I hope you are still answering questions. My question is that if we assume NPN has a base to emitter voltage of 0.7 volts, then we have a base current around 0.43 mA and assuming a betta of 100 for NPN, the collector current will be 43 mA. Also, we know that the voltage drop across the 47k resistor is 0.7 volts, which means a current of around 14.9 uA. How can I solve this paradox?
The base resistor of Q1 will have 4.3 volts across it. This will give us 4.3/100,000 or 43uA through it and into the base of Q1. Q1 is designed to run in a non-linear saturation mode. As such, Q1 collector current is dictated by R4, the 1K resistor. The voltage at the top of R4 is 11.3v. Since Q1 is in saturation, the voltage from Collector-emitter is approx 0 volts. Thus the current through R4 is 11.3/1k = 11.3mA. The beta of a 2n3904 is close to 200. Thus, 11.3mA/200 = 5.6uA. So our 47uA at Q1 base is more than enough to drive Q1 into non-linear saturation. It is true that since the 47k resistor has 0.7v across it, the current through it is only 14.9uA, but per KCL, the current flowing out of the base of Q2 must be 11.2851mA, for a total of 11.3mA (the current through R4).
@@TheTechCircuit But if per your calculation the Q1 base current is 5.6 uA, isn't this against ohm's law? since the current through Q1's base is calculated based on it's base resistance and the voltage across this resistance?
Finally someone showing the real scenario of working relay circuit ! I really like your explanation ! but why do you need 2 transformers ? would just one be enough to start 12V circuit with base current coming from microcontroller ? thanks
You can certainly switch the relay from the low side with an NPN transistor and a microcontroller driving the base through just a current limiting resistor. That is a convenient way to do it. It is better in many cases to use a high-side driver instead though because whatever device you are driving will share a common ground with other components and when switched off, will be at ground potential instead of at Vcc or (live). By using a PNP on the high side and an NPN as a pre-driver as in the video, you reduce the required drive current from the microcontroller port, and add an extra layer between the microcontroller and the relay coil's inductive spikes - while at the same time, gaining the general benefits of high-side switching.
@@TheTechCircuit Ok Yeah it makes sense, maybe one more clarification ..so 12V is powering main Load and PNP transistor which reduces voltage to 11.3v and that goes to the second NPN transistor which saturates at 0.7 micro-controller voltage closing the circuit. And you need PNP transistor to drop current that could be too hight for micro-controller itself ? because voltage is not that diffrent but current possibly it is ?
I think I can see the logic of 2 transistors. I am a novice in electronics and try to build raspberry pie water heater with pump for my van conversion. I could just buy relay board suited for that but I would rather understand what is behind it. Thanks again and have a lovely day !
@@greggil3454 11.3 volts will appear only at the base of Q2 when saturated and will be 12V when not saturated (because of the 47K pull-up resistor). The voltage at the collector of Q1 will be the same as that at the base of Q2 until Q1 is switched on, which then saturates Q2. At this point, the base of Q2 is 11.3V and the collector of Q1 is about 0V. The difference is dropped across the 1K resistor. When the microcontroller outputs 0V, the base of Q1 will be 0V. When the microcontoller outputs 5V, the base of Q1 is 0.7V. The 100K resistor drops the other 4.3V and limits the base (and microcontroller port) current to 43 uA. The reason for Q2 (PNP) is to provide source switching, rather than ground switching. You can use the NPN by itself, and it will work just fine - even though the base current will need to be higher. You would need a lower base resistor value than 100k in that case so that the relay current divided by the NPN beta (about 100) could be attained. That would all work provided you didn't exceed the microcontroller port's max sourcing current.
@@TheTechCircuit Amazing ! U should post more videos with microcontrollers :) thanks again I got it now.
Why not drive the PNP from the micro directly. Pulling to ground from the micro switches on the pnp.
If configured in that way, the microcontroller output port would potentially be exposed to 11.3V (supply minus the Q2 Veb) when at a logic high, and many microcontrollers can't tolerate much more than a volt over their supply (or 6 volts for a 5V microcontroller). The NPN transistor is instead used to pull the PNP one low while only requiring a 0.7V base bias which the microcontroller can of course easily provide via the current limiting resistor.
There is no detail about transistors, their type and current and voltage requirements. There is no explanation as to why 2 transistors were used when only one can work as a relay driver.
The NPN transistor pulls down the base of the PNP, which energizes the solenoid (solenoid current passes through Q2, not Q1). As for the type of transistor, depends on how much current Q2 has to sync; Q1 can be a 2N2222, general purpose transistor.
Y can't the 47k drive the first transistor. The current flows from 47k to the base of the first transistor, which then drives the first transistor, resulting in relay to turn on.
The only possible explanation is current flow from collector to the base, which then flows through 1k rather than 47k, as current prefers least resistive path, therfore requiring second transistor to be turned on.
Good question. The 47K resistor cannot drive or turn on the first transistor (Q1). It is only used to keep the second transistor (Q2) in the cutoff region until Q1 is turned on and pulls the base of Q2 low. Once Q1 pulls Q2 base low, it goes into saturation and current flows through the relay. The reason for 2 transistors in this configuration is that the microcontroller can have active high relay control and be well isolated from the relay coil's flyback voltage. Also, if the microcontroller were to drive Q2 directly, the output port would be subject to a constant 12V potential, which exceeds many microcontroller's AMRs.
@@TheTechCircuit thanks