1
\$\begingroup\$

I am trying to measure the voltage on an LED in an open circuit (awfully shown below) using an arduino, however the voltages are too high for its inputs.

I have tried:

  1. Using a voltage divider (~10K total resistance), however current flows and the LED lights up (which I do not want)
  2. Bumping up the total resistance of the divider to ~10M, the LED glows extremely dimly (which is fine), but now the arduino doesn't read the voltage correctly (due to noise or something?)

So now, I have decided to use some Zener diodes to drop the voltage before connecting with the arduino, is this (theoretically) going to work? Or is there some simpler/smarter way around this?

Also stumbled on this: Measure voltage with no current, but it seems a bit more complicated than using the diodes.

awful diagram

Any input is greatly appreciated.
Many thanks

Update: Thanks everyone for all the help, ended up using the pull-up as it was the simplest

\$\endgroup\$
  • 1
    \$\begingroup\$ what is the purpose of the switch, if the circuit is to remain open? ... or did i misunderstand? \$\endgroup\$ – jsotola Dec 16 '17 at 11:52
  • \$\begingroup\$ use a voltmeter \$\endgroup\$ – jsotola Dec 16 '17 at 11:52
  • \$\begingroup\$ It's a light and I'm trying to determine whether it is on/off by measuring the voltage (drops to 0 when light is on). Yea, a voltmeter works fine, but I'm trying to automate something with the arduino. \$\endgroup\$ – Ohhai Dec 16 '17 at 11:56
  • \$\begingroup\$ connect an optocoupler in parallel with the LED \$\endgroup\$ – jsotola Dec 16 '17 at 12:02
  • \$\begingroup\$ Alright thanks, will give it a try. Any thoughts on the diodes? \$\endgroup\$ – Ohhai Dec 16 '17 at 12:08
9
\$\begingroup\$

Perhaps I am missing something here, but from your comments you seem to only need to know when the LED is on, or to put it another way, when the switch is closed.

You can do that with a simple diode and a pull-up.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • 2
    \$\begingroup\$ +1. Leave out R1 if the GPIO internal pull-up is used. \$\endgroup\$ – Transistor Dec 16 '17 at 13:11
  • \$\begingroup\$ I thought of this, but I think that the diode does not protect the pin from the 12 V... \$\endgroup\$ – Vladimir Cravero Dec 16 '17 at 16:18
  • \$\begingroup\$ @VladimirCravero it protects it about as much as anything else. If he needs full isolation than Transistor's answer covers that. \$\endgroup\$ – Trevor_G Dec 16 '17 at 16:20
9
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Opto-isolator current monitor.

As jsotola suggests, you can use an opto-isolator but rather than connect in parallel you can connect in series to reduce power consumption and save another series resistor. This will decrease the voltage available to your 12 V LED by about 1.4 V or so but this is unlikely to be an issue.

Notes:

  • The opto-isolator LED has to carry the full current for your existing LED.
  • R2 may be omitted if an internal pull-up is used. That makes it a single-component solution.

@Trevor's solution is simpler and cheaper. Use this one if isolation between the circuits is an advantage.

\$\endgroup\$
  • \$\begingroup\$ the OP said that the circuit is a "light", so it is possible that there is a fairly large current being drawn. the series connected opto-isolator may not be able to handle it. \$\endgroup\$ – jsotola Dec 16 '17 at 22:21
  • \$\begingroup\$ Thanks, @jsotola. He buried that information in the comments and I didn't see it. It should have been in the question but I addressed it anyway on the first bullet point. Oh well ... \$\endgroup\$ – Transistor Dec 16 '17 at 22:57
1
\$\begingroup\$

if you can replace the switch ...

schematic

simulate this circuit – Schematic created using CircuitLab

\$\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.