I found this circuit for a relay driver. It is similar to others I have seen, though it appears to have two extra parts that others do not have.
I mostly understand how it works, but I would like to understand it thoroughly, so I have some questions in my attempt to analyze it. This is not homework for a class. Rather, I am attempting to educate myself. My questions come after studying tutorials online, but I still have questions.
- I usually see an input-base resistor around 4K7. I think it determines the current flowing from base to emitter when an input is applied. I think it needs to be high enough for the transistor to saturate, and no more than the maximum CMOS load, which I think is 20mA.
I want to understand why the resistor is 4K7. My analysis: The Vbe(sat) for the 2N3904 is about 0.7v. If the input voltage is 12v, the load on the input voltage is (12 – 0.7) / 4700, or about 2.3mA, ok for CMOS. I have a 12v relay that has a DC coil resistance measuring 392R, so at (12 – 0.7)v, that means about 29mA to actuate it (too much for a CMOS load without a driver). The 2N3904 has a beta / hFE of 300 (max), so the minimum Ib I need for saturation is 29mA / 300, or 96uA, though it should be higher to be reliable. I think the input base resistor could be as high as (12 – 0.7)v / 150uA, or about 75K, but a lower value would be more reliable for a wider range of loads.
With the 4K7 resistor, 2.3mA is the load at 12v input, so a load of (300 * 2.3mA) or 67mA is possible. The 2N3904 can dissipate 200mADC, but for a load that high, the 4K7 resistor would be more like 1K5.
Is my analysis correct?
This circuit adds a 2K2 resistor from base to emitter (ground), something I do not usually see in other circuits. I think this may change the bias voltage for the transistor, but I don't know why you would do that here. What is the purpose of this resistor, i.e. what problem does it solve?
For relay control, I always see a "flywheel diode" across the relay, with anode at transistor collector and cathode at Vcc, as shown in this diagram. I understand that the inductive effect of the relay coil causes a backward voltage spike to occur as the magnetic field collapses, and the diode protects the transistor from too large a reverse spike.
I think if I connect a diode across a power supply with anode at Vcc and no current limiting resistor, it will burn out. The backward spike would seem to do the same. Can you explain why it does not? Is it because the spike is too brief to burn out the diode?
Most circuits have only the one diode across the relay, but some also have one from the emitter to the collector. This circuit has one (it is not certain that it is actually connected to the collector, as there is no junction dot in the diagram there). I have a feeling there is another spike, perhaps on power on, but I don't know why that would happen, and I would like to understand. What problem does this second diode solve?
I have a new oscilloscope, but I don't know how to apply it to this circuit. In particular, if there is a transient across the relay when it turns off, do I simply connect the scope across the relay to see it? If the answer to #4 is "another spike," where do I connect the scope to see it, across C and E? Do I have to remove the second diode to see it?
Do you think that this is a suitable circuit using best practices? If not, please critique.