1
\$\begingroup\$

I'm upgrading the interior lights on an older model vehicle. The plan is to tap into the very simple lighting circuit (always hot with a switch for on-off-door) to detect each scenario. Light switch on, stock lights come on = Arduino does something; Light switch in door position and doors open = stock lights come on, Arduino does something different.

In response to a similar question a few years ago, Phil Frost uploaded the following diagram, which uses a pull-up resistor before the optocoupler:

Arduino with pull-up resistor before optocoupler,

I would like to modify this circuit, such that current only flows on the Arduino side if it is also flowing on the 12V side. Here's what I've come up with:

schematic of proposed design

There are a lot of other details to this project, but the questions I have are just regarding this circuit:

  1. Will this work just as well as the original?
  2. Is there any benefit to using the modified version over the original?
\$\endgroup\$
1
\$\begingroup\$

An arduino input is very high resistance, generally in the multiple Mega-ohm to Giga-ohms, so the consumption through the arduino input will be very low, the arragements just change whether it is idle high or idle low, which as far as the arduino's actual power consumption is a hair lower if the pin is towards its positive supply rail,

If you wanted to simplify things, you could likely use the arduino's pin pullup instead of an external resistor, this way you could turn off that sensor when the lights are on, and just poll it occasionally.

The 4N25 will actually leak some current, it never fully switches off, however its generally pretty low,

\$\endgroup\$
  • \$\begingroup\$ Thank you! I think I will go for simplicity and use the internal pullup. \$\endgroup\$ – Brian Aug 31 at 23:21

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.