0
\$\begingroup\$

a little diff question, have googled to get clues but apparently I don't know what exactly to seats for.

Im trying to turn on a led with arduino when a external source triggers 12v. basically that ext source swaps between 12v when active and 11v when inactive. I hoped for that 11v to be 0v so I could use transistor or relay with arduino but unfortunately the low state on external device is 11v.

how can I check with arduino when the ext source is at 11v and how do I tell arduino that this is the low state. I just want to light up a led with arduino whenever the ext source is 12v and kill the led light when it's 11v. I tried with 2 1M resistors on that 11v but I got it down to 9v and I don't like the idea of chaining resistors.

is there any other possible components that I could use for this purpose ?

\$\endgroup\$
  • \$\begingroup\$ but does the arduino analog handle 11-12v ? I'd assume it doesn't :/ \$\endgroup\$ – Deko Sep 14 '15 at 11:26
  • \$\begingroup\$ A couple of resistors wired as a potential divider should bring the voltage into range. \$\endgroup\$ – HandyHowie Sep 14 '15 at 12:04
  • \$\begingroup\$ I had no success with 1M resistor didtnt even get supply down below 12v :S \$\endgroup\$ – Deko Sep 14 '15 at 12:08
  • \$\begingroup\$ One resistor wont do what you want see - en.wikipedia.org/wiki/Voltage_divider \$\endgroup\$ – HandyHowie Sep 14 '15 at 12:12
2
\$\begingroup\$

The part you're looking for is a comparator. Set a threshold with resistors at 11.5 volts. The arduino is not required here, but could still be used if additional behavior is desired.

schematic

simulate this circuit – Schematic created using CircuitLab

Alternatives:

  • There is probably a diode-based option, but the comparator will be simpler.
  • As mentioned by others, you can use a resistor divider into an A/D and then do the threshold logic in software.
\$\endgroup\$
  • \$\begingroup\$ which comparator would be suitable for me ? \$\endgroup\$ – Deko Sep 14 '15 at 11:13
  • \$\begingroup\$ What voltages do you have handy? \$\endgroup\$ – Houston Fortney Sep 14 '15 at 11:14
  • \$\begingroup\$ arduino runs on 5v and the external device is 13.8v Max and I assume somewhere around (Max) 5-10amp... is the turning signal light that I what to get that signal from into arduino \$\endgroup\$ – Deko Sep 14 '15 at 11:28
  • \$\begingroup\$ @DanelK When the external device is running at 13.8 volts is the "operating good" output at 12V or 13.8 volts? \$\endgroup\$ – Andy aka Sep 14 '15 at 11:48
  • \$\begingroup\$ @DanelK would you like to eliminate the arduino from the design if possible? \$\endgroup\$ – Houston Fortney Sep 14 '15 at 11:49
0
\$\begingroup\$

Use a voltage divider and sense the voltage state using and analog to digital converter. If your paranoid place a 5.1v zener diode on the pin to protect it just in case. Also remember that sampling does take some current. The current is minuscule but it does limit the maximum value of the divider.

\$\endgroup\$
0
\$\begingroup\$

enter image description here

schematic

simulate this circuit – Schematic created using CircuitLab

Use the above voltage divider schematics,,you should now be able to map 11v and 12v to some analog values in arduino,,you will have to do R&D with code to pull this off

Vr2=(Vin*R2)/(R1+R2)

Vr2=(12*10000)/(10000+100000)=1.0909V

Vr1=(Vin*R1)/(R1+R2)

Vr1=(12*100000)/(10000+100000)=10.909

hope this helps

\$\endgroup\$
  • \$\begingroup\$ correct me if I get this wrong, the 100k R reduces the +ve (12v) down to 10v... but arduino analog can handle Max 5V ? \$\endgroup\$ – Deko Sep 15 '15 at 23:52

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.