0
\$\begingroup\$

enter image description hereI have a system that sometimes generates a 12V signal to a DPDT relay coil, which switches on a 12V connection through the relay pins that can be used as a boolean signal to the arduino. I plan to do this by connecting a 5V L7805 regulator, followed by a 1n4007 diode to drop the voltage to approx 4.3V +-10% which should be safe.

My question is, should I be concerned about inductance from the relay coil? I know arduinos don't like inductive loads. Also, are any additional resistors necessary in this configuration, i.e. with the arduino i/o pins configured as inputs with pullup resistors?

If you can foresee any problems with this setup, please let me know.

\$\endgroup\$
  • 2
    \$\begingroup\$ Please put together a schematic using the CircuitLab tool. I think your circuit will be fine but a schematic will improve answers and suggestions. \$\endgroup\$ – Jim Aug 9 '16 at 12:38
  • 2
    \$\begingroup\$ If it is a Boolean signal, don't use an analog input. \$\endgroup\$ – DoxyLover Aug 9 '16 at 12:41
  • \$\begingroup\$ Bit Heath Robinson this - this is the one situation where it's OK to use a voltage divider. \$\endgroup\$ – pjc50 Aug 9 '16 at 12:50
1
\$\begingroup\$

Don't bother with the 7805 - without input and output capacitors this could prove problematic and, at the very least will be "slow" in responding to the 12V input.

Just use a resistor and 4.3V zener diode like this: -

schematic

simulate this circuit – Schematic created using CircuitLab

You don't need to worry about glitches either because the relay coil is isolated from the Arduino by the relay contacts.

\$\endgroup\$
  • \$\begingroup\$ +1 This circuit also puts a reasonably high current through the relay contacts (12mA) which is often required for reliable switching. I'd stick a 1K in series with the input just for luck. \$\endgroup\$ – Spehro Pefhany Aug 9 '16 at 13:16
  • \$\begingroup\$ How would it prove problematic without the input and output capacitors? I understand it would be more stable with less ripple if you added the input and output capacitors as is recommended in the l7805 datasheet, and I did consider it. But problematic? Also, are there any distinct advantages to using your circuit? edit: Regarding response time, how much lag on an order of magnitude would you estimate? Milii/Micro? \$\endgroup\$ – Lkz Aug 9 '16 at 13:25
  • \$\begingroup\$ Problematic: it might oscillate. My circuit is smaller, cheaper and the lag will be in the order of a few nano seconds. You could even get rid of the relay and use the output from keyswitch S2 directly. Also, a 1N400x into an open circuit will not drop any voltage - it requires current flow to drop voltage. \$\endgroup\$ – Andy aka Aug 9 '16 at 14:05
0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Relay contact driving micro-controller.

My question is, should I be concerned about inductance from the relay coil?

No. There is no connection between the coil and the digital input. Therefore there is no danger of inductive transient to the input.

I know arduinos don't like inductive loads.

But you aren't driving the relay - you are monitoring a contact of it.

Also, are any additional resistors necessary in this configuration, i.e. with the arduino i/o pins configured as inputs with pullup resistors?

If you use the internal pull-up you can just use the relay contact to pull the input low when closed.

\$\endgroup\$

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.