1
\$\begingroup\$

Hey people I'm driving a relay with a arduino-teensy with 3.2v logic levels.

Some background. I'm going with a mosfet because the coil voltage is relatively high. The relay will have 20a/220v contact voltages. I'd like to have an LED turn on when the relay is active, and I'd like to have a manual switch to override the logic control of the circuit.

Two questions.
1) could someone verify that this is the best way to light up the LED? I read on line the parallel circuit is better than running the LED in series, if it fails then the relay fails.

2) Which choice would be best to use a circuit to override the logic level coming from my arduino? If the arduino pin mode is:
pinMode(relayPIN, INPUT);
does it care if I put 3.2v external on that thing? Or would it be better to just connect the drain side of the mofset (Q2) to ground?

thanks much.

circuit diagram for relay driver

\$\endgroup\$
  • \$\begingroup\$ Actually I just realized the mosfet is complete overkill - the coil rating on the relay is just 100 mA. If it would be appropriate to use a transistor - the same questions apply regarding the LED, and placement of the switch. \$\endgroup\$ – Owen White Sep 7 '16 at 5:05
  • \$\begingroup\$ I would recommend to use MOSFET instead of BJT. It is much more suitable for power switching. \$\endgroup\$ – Chupacabras Sep 7 '16 at 5:12
  • \$\begingroup\$ thanks - I'll find an MOSFET that's appropriate for this application. The part number listed there is a bit of overkill, so i'll look for something more suited to the mA of the relay coil. \$\endgroup\$ – Owen White Sep 7 '16 at 16:50
1
\$\begingroup\$

1) could someone verify that this is the best way to light up the LED? I read on line the parallel circuit is better than running the LED in series, if it fails then the relay fails.

It depends on details. How much current does that relay need (you did not specify the type nor parameters)? If it is higher than LED can handle then you cannot put the LED in series. Another downside is that LED in series will decrease voltage across relay coil.
I think it is much better to put in parallel, exactly as you have it. If LED fails it usually fails as dead short circuit, and relay will trigger even without LED is lit up (because it will be short). So if you would put the LED in series it will not help you at all.

2) Which choice would be best to use a circuit to override the logic level coming from my arduino? If the arduino pin mode is: pinMode(relayPIN, INPUT); does it care if I put 3.2v external on that thing? Or would it be better to just connect the drain side of the mofset (Q2) to ground?

It depends of what type of button you will use. If it is suitable for 24V and level of current that relay coil needs than IMHO it's better to override that MOSFET (that is in the second schematics).

If you would use the first one, you should put some 10k resistor on arduino pin output and it should be fine. It would prevent short circuit from your manual switch to arduino pin.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ Thanks - I think I'll go with the LED in parallel and using the version of the circuit on the right. \$\endgroup\$ – Owen White Sep 7 '16 at 16:49
0
\$\begingroup\$

Logic High looks like trouble. If Q1 fails open the override switch will be useless. If there is a strong reason to use this circuit, add a diode in series with the switch to prevent connecting the 3.2 V and 24 V supplies together via R10. D2 will also fail due to a missing path to ground.

Logic to Ground would be my preference because if Q2 fails you still have a path to ground to close relay RL1 as well as the illuminate eD4 LED. Many other options could work. Consider a low voltage/current opto-coupler as well for protection of your control IC.

|improve this answer|||||
\$\endgroup\$
  • \$\begingroup\$ thanks - you make a good point. Putting a switch across Q2 makes more sense because it would deal with cases where either the mosfet, or the logic level, fail. \$\endgroup\$ – Owen White Sep 7 '16 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.