Pages: [1]   Go Down
Author Topic: Using 12V illuminated switches as digital input  (Read 575 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Sr. Member
****
Karma: 2
Posts: 254
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a collection of SPDT illuminated rocker switches that are designed for 12V systems. I'd like to use them as digital inputs for my Arduino system (Teensy, actually), but would like to have the lights be functional. I could just connect +5V and GND to the outer lugs and the middle lug to my digital in pin, but that probably wouldn't turn on the light.

If I connect these switches to +12VDC, then feed that as input to my Arduino, will the internal protection diodes protect my board, and give me a digital HIGH? Or will it fry it?
Logged

Grad student, creative technologist, OSHW engineer
http://jason-webb.info

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
will the internal protection diodes protect my board, and give me a digital HIGH?
Sniff. Sniff. What's that smell? Uh, oh. I think you let the magic smoke out.

You could research, and use, a voltage divider (two appropriately sized resistors):

+12V --> switch --> R1 -+-> Rd --> gnd

Connect the middle of the voltage divider (the +) to a digital pin (and ground to the Arduino, too).
Logged

0
Offline Offline
Sr. Member
****
Karma: 2
Posts: 254
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh, derr, a voltage divider! I was over-complicating it smiley-razz Thanks!
Logged

Grad student, creative technologist, OSHW engineer
http://jason-webb.info

Pages: [1]   Go Up
Jump to: