# How can I wire a 12V LED switch so that it is powered, but my Arduino only receives a 5V signal?

My arduino is powered by 12V. I am getting some cool looking 12V led switches from amazon, but they need 12 volts to light up. My arduino will perform an override function when it detects the switch is closed. the digital pins can only handle 5V. How can I step down the 12V signal that powers the switch to the 5V that the pin can handle.

12V supply -> 12V led switch -> reduce 12V to 5V -> arduino digital pin

• What is a "12V led switch"? – Milliways Sep 14 '17 at 8:00
• Could you provide a link to the switch in question, please? Depending on how it's made, you may not need to do anything. – Mark Smith Sep 14 '17 at 21:36
• you can power the switch's LED with only 5v, it will be dimmer but should work. – dandavis Sep 15 '17 at 2:30

You need a voltage divider:

The formula is:

V1 = 12V

R2 = 5V max

R1 = The rest (V1-R2)

And then you have to calculate max current. If you use 1/4watt resistors, you have to convert watt to current, P = U x I.

Pmax = 0,25W

R1volt = 7 volt

Imax for R1 = P/U = 0.25/7

Imax for R2= P/U = 0.25/5

Now you have the current and voltage for R1 and R2

And the relation between R1 and R2 is:

R1 = 7/12 x Rtotal

R2 = 5/12 x Rtotal

Rtotal = R1 + R2 simulate this circuit – Schematic created using CircuitLab