What happens if I supply 18V to a 12V lighted switch?
I take from context you have a lighted switch that expects 12V, but you didn't specify whether the switch uses an LED or something else, like an incandescent bulb (older style).

Two 9V batteries can also supply 9V if connected in parallel. Because you stated 18V, it's apparent they are connected in series. Note that had you omitted the voltage, specifying a quantity of batteries alone is not enough information to know the supply voltage.

One of the first don'ts of electrical engineering is Don't supply higher voltages than a device is designed for. This is especially true when working with higher power devices. Connecting something designed for 110V mains into a 220V supply could be disastrous.

In the case of your device, let's assume the switch contains a red LED and a current limiting resistor. A red LED typically has a forward voltage (\$V_f\$) of about 2V, and forward current (\$I_f\$) of about 20mA. This means that the remaining 10V needs to be dropped on the current limiting resistor. Ohm's law states:

$$R = \frac{E}{I}$$

This means that we can determine the value of the resistor by knowing the voltage across it (E) and the desired current through it (I).

$$\frac{10}{0.02}=500\Omega$$

Thus, a lighted switch that includes a red LED designed for 12V will also include a current limiting resistor of approximately 500&Omega;.

If you supply 18V instead, we can calculate the new current. The LED will still drop about 2V, leaving 16V across the resistor.

$$I = \frac{E}{R}$$

$$\frac{16}{500}=0.032A$$

The LED has about 32mA instead of 20mA. Is this bad? Not necessarily. Some LEDs can operate at 40mA or more. It depends on the LED. Information about what it can handle and for how long is provided in datasheets. Datasheets are product specifications that manufacturers provide to show the tolerances and usage of any given electrical component. Your switch might have a datasheet with specifications about the current rating of the switch in general, but might omit information about the internal LED specifically.

Let's assume the LED is basically okay with 32mA. It will be brighter, and may not last as long as it would with 20mA. In other words, it will dim appreciably faster. After months or years of continuous use, it may be more dim than it otherwise would have been at 20mA.

Turning our attention back to the current limiting resistor: A "typical" common through-hole resistor can dissipate 1/4 watt (250mW). How much power does the resistor actually need to dissipate under normal circumstances? Using numbers from before:

$$P = I\times E$$

$$0.02\times 10 = 200 mW$$

How much is it dissipating with the higher voltage supply?

$$0.032\times 16 = 512 mW$$

Now we have a problem. What is the actual power rating of the internal resistor? The manufacturer might have used a higher 1/2 watt resistor, at greater expense, for an additional margin of safety/quality. Maybe not.

Resistors dissipate power as heat, so the higher voltage results in additional power that is bled off as heat. If the resistor isn't rated for the higher power, it will eventually fail. Failure modes of resistors might be open or short, so once it fails the LED will either be permanently off or have insufficient current limitation, glow very brightly for a brief time, and also fail.


  I saw a post earlier saying that some devices can go over the voltage on said device a little with some exceptions to sensitive devices.


This is true. For example, a typical LED might have specifications that include various current specifications at different duty cycles. Perhaps 20mA at 100%, 40mA at 50%, and 100mA at 10%. Beyond 100mA, at any duty cycle, it isn't guaranteed to operate within the specifications given.

The extra voltage or current that a component can handle is dependent on several things. How well-built is it? What sort of heat-sink or power dissipation is in effect? Is it sensitive to rapid changes?

An analogy: You can probably safely move 12 tons across a bridge rated for 10. The risk and cost of failure is quite high, though, so you probably wouldn't take the chance. You might be able to power a 12V device with 18V, but not for as long. The risk is perhaps a few dollars of wasted expense if it fails.



As an addendum, if you want to stick to 18V, you could add another resistor to drop the voltage further and limit current to the lighted switch. It would help to measure the current (at 12V) with a multimeter, so you can better determine what's contained in the switch.

Another option might be an inexpensive linear voltage regulator like the LM7812 or TI TL780-12KCS. A more efficient option would be a switching regulator (buck regulator). If the prospect of including additional components is unwanted, you could switch to 8 AA-size cells in series: