I am trying to figure out in this circuit, which lets the Triac 170
to conduct normally, which prevents an engine from firing, how to use an NPN transistor to replace the seat switch 154
, but I assume there is AC voltage on the 112a
line, and I know that AC would not play nicely with the transistor.
Electrical – How to pull Triac gate to ground with an NPN transistor with AC present
groundtransistorstriac
Related Solutions
Playing with mains can lead to death of drive equipment, load, TRIAC, yourself or users if you get it wrong.
Try hard not to.
Use of an isolated driver IC greatly enhances the chances of you and your drive electronics living much longer. Anything driving mains equipment directly is potentially at mains potential at any time unless you have a properly implemented isolation barrier. This applies to equipment in EITHER mains lead. Being in the "neutral" lead is no guarantee of not experiencing full mains potential.It also applies to any part of the equipment even when "switched off". Only removal from mains by physical disconnection is a certain means of mains not being absent. Then you just have storage capacitors to watch for.
Drive is from gate to main terminal 1.
As MT1 is at mains potential your driver is too.
You CAN drive directly if your port MINIMUM drive current at gate MINIMUM voltage meets gate MAXIMUM current need. The gate to MT1 is a silicon junction (or two) and requires a minimum (or greater) current to trigger the coupler reliably. A TRIAC conducts AC bidirectionally once triggered and continues to do so until the holding current in MT1-MT2 main circuit drops below some data sheet defined level.
You are very very very very strongly advised to use an isolated driver such as the
MOC30xx family optical TRIAC driver. This is a random turn on version that triggers the TRIAC when you trigger the opto coupler but you can get zero crossing versions. The driver comes in various versisons and needs as little as 5 mA or as much as 30 mA max to trigger - see data sheet page 3.
Here is a Fairchild FOD410 zero crossing optocoupled TRIAC driver.
Circuits below are examples only - see data sheet:
Lower voltages:
For a lower voltage- eg 24 VAC, the personal safety aspects are much relaxed, but the microcontroller safety aspects are still a significant consideration.
When (not if) the small TRIAC shown dies due to enthusiastic experimentation or an excess of exposure to reality, one of the failure modes will be worst-possible-input-hard-shorted-to-worst-possible-output. Murphy loves these. Connecting 24 VAC to almost anywhere on an Arduino will usually spoil its day.
An opto-coupled TRIAC driver will both provide protection against worst case TRIAC failure and also allow "floating" TRIAC drive - the opto-coupler ouput is not ground referenced or referenced to anything in the drive circuit before the OPTO COUPLER.
- Yes, you need to connect the 5V and 12V grounds in this circuit in order for the transistor to switch. Remember there must be a return path for the base current. You cannot send a signal using only 1 wire.
See above, the emitter needs to use the same ground as the signal source (Arduino) or there is no return path.
Connect the negative terminal of the bottom battery (assuming you have 8 in series) to the Arduino ground.
"Ground" is just a term for a reference point to measure voltages from in your circuit, you can pick any point, (though it's usually a net connected to the negative terminal of a supply). For example you could call the point the positive terminal connects to in the circuit "ground", and then the "original ground" (the ground as shown in your circuit) would be -12V relative to it. The negative terminal does not mean the voltage is negative, it just tells you which way the current flows.(a) R1 is to limit current to the base of the transistor. To calculate the value, we need to know how much current we are switching (i.e. how much the relay needs) and the current gain of the transistor. Lets say we are using a transistor with a current gain of 200, and the relay needs 20mA to switch. Since the current through the base is amplified by the current gain, we know the base current needs to be at least 20mA / 200 = 0.1mA.
The base voltage of a typical bipolar transistor is around 0.7V, so the series resistor (R1) needs to be a maximum of: (5V - 0.7V) / 0.1mA = 43kΩ
As the gain may vary (go from min value in datasheet to be safe) we can pick a 33kΩ to have some base current to spare. Note that to be an effective switch we want the transistor to saturate, as effective gain starts to drop at the knee between linear and saturation mode (as mentioned by Shokran). So we pick a resistor of a lower value than calculated to make sure we can pull the collector near ground. In cases with e.g. power transistors where minimising dissipation is important it is wise to pick a value of at least 5 times less than calculated (or assume gain of ~20) so we could go as low as 4.3k in the above example.(b) R2 is there to make sure the base is pulled to ground when drive current is removed. This is to stop leakage current turning the transistor partially on. The value does not need to be too precise, just enough to shunt the leakage current (datasheet) and not too low to steal too much base drive current. 5-10 times the series resistor (or 1kΩ to 500kΩ) is a rough range to go from. 100k&Omega is a reasonable value for most cases, though I'd go for 330k here as the leakage current should be minimal. If you need to go a lot lower then you have to adjust the series resistor to compensate.
Note that if the Arduino pin is driven to 0V (i.e. set to output and logic 0) then R2 is not really necessary, it's only if the pin is set to High Impedance (i.e. input)
Note 2 - that this is very rarely something to worry about with BJTs (MOSFETs are another matter and definitely do not want to be left floating) If you have a very high gain transistor (esp darlington), a noisy environment, and/or very high temperature (leakage increases with temp) and a very high collector resistor then it may cause issues, but generally the leakage current will be to small to matter.Not that I can spot right now (however it is 4:48 in the morning here so my brain may have long since retired, so I reserve the right to have missed something obvious ;-) )
Best Answer
You could use the transistor to switch a small relay. Or use a MOSFET-output SSR. Both those solutions also avoid any issues with where the grounding is.
As this is apparently lifted from a patent for a safety device - if your application is similar be sure to undertake a proper engineering review of the safety aspects. Keep in mind that semiconductors most typically fail on (but can also fail off or the connections can go open).
Edit: I am suggesting you replace the switch with the SSR- 400V or 600V units can be found, such as the TLP797J. You have to confirm that the voltage rating is adequate. This particular one can switch 100mA.
In the case of the relay you can choose whether to use a normally open or normally closed contact of a sealed SPDT relay, and replace the entire circuit. I assume they didn't do that in the patent for some reason (perhaps just the wiring) and I would want to figure out exactly why.
Again, the safety aspects need to be examined carefully at a system level as well.