12v illuminated toggle switch

Hello! :slight_smile: I am trying to wrap my head around how to properly wire this 12v illuminated switch from radioshack with the Arduino for reading on/off state into one of the digital input pins. I have been able to successfully get the Arduino reading it with a pull up resistor and using just the switch's SPST contacts (labelled "ACC" and "POWER"), but I am trying to get the LED in the switch lighting up, too.

The toggle switch wants 12v to power it's LED and I have a 12v supply powering the Arduino. Judging from what I have found so far I think I need some sort of voltage divider and pull up/down combo platter? I just don't know enough about electrical engineering to know how to wire it (and I've tried about every combination I can think of so far)

Anyone know how this can be done?

Is the LED driven by its own pin? If so, you will need to switch the 12V supply to it using a transistor.

If it is integral to the switch and cannot be controlled separately, then you will have to come up with some form of 12V->TTL switching circuit. Possibly involving a voltage divider, or transistors, or whatever.

Thanks for the reply majenko

I believe that the LED load is shared, so it definitely cannot be controlled separately.

Then you are going to have to switch 12V on and off to a voltage divider.

12v->switch->divider "high" -> input + divider "low" -> ground.

You will need to size the divider to give enough voltage to switch a digital input on, but not overpower it. 47K? and 22K? should do the trick. To be safe, measure the voltage in the middle node of the divider before you connect to the arduino.

I'm still kind of a beginner and having trouble visualizing the circuit and where exactly things attach to the arduino / switch pins. Is it too much trouble to ask for a schematic or description of exact connections? This is my first thread here and I don't want to overstep any bounds!

Thank you for the help!

I've got a switch almost exactly like this one, It's got the exact same base, and mine lights up too. I don't, however, have a 12V power supply hooked up to it. I've got 2 C-cell alkaline batteries hooked up to it, and the LED lights up just fine. You might have a dud LED. Try taking the switch back to Radioshack for a trade-in or a refund.

The LED works, I've tested it with a 12v circuit and it lights up nice n bright :smiley:

You may be able to run the LED from 5V, although it will be less bright. If it takes less than 40mA when run from 5v, you can drive it directly from an Arduino output pin.

dc42:
You may be able to run the LED from 5V, although it will be less bright. If it takes less than 40mA when run from 5v, you can drive it directly from an Arduino output pin.

Tried it. Works great- plenty bright enough for my tastes. Dunno why I didn't think just to connect the 5v and try it. Thanks!

i would really like to see a pic of how you did it plus scetch

Good luck getting an answer from a very dead seven year old thread where the original poster is no longer a member. Please don’t resurrect old threads. Link to them if they are relevant but don’t be lazy, start your own thread and ask your own question.

Please read and follow the fourm rules: How to use this forum

Radio Shack 275-0692

The AC 'HOT' input is the terminal labeled 'HOT'
The SWITCH OUTPUT HOT is the middle terminal.
The Neutral terminal is the top (third) terminal.