

A light switch is a simple yet essential electronic component used to control the flow of electricity to a light fixture. By toggling the switch, users can turn a light on or off, making it a fundamental part of residential, commercial, and industrial electrical systems. Light switches come in various designs, including toggle, rocker, push-button, and touch-sensitive types, to suit different applications and aesthetic preferences.








The technical specifications of a light switch can vary depending on its type and intended application. Below are general specifications for a standard household light switch:
A standard single-pole light switch typically has three terminals:
| Pin Name | Description |
|---|---|
| Line (L) | Connects to the live (hot) wire from the power source. |
| Load | Connects to the live wire leading to the light fixture. |
| Ground (GND) | Connects to the ground wire for safety and to prevent electrical shock hazards. |
For three-way switches, additional terminals (e.g., traveler terminals) are present to allow control of a light fixture from two locations.
A light switch can be used as an input to an Arduino UNO to detect its on/off state. Below is an example code snippet:
// Define the pin connected to the light switch
const int switchPin = 2; // Digital pin 2 is used for the light switch
const int ledPin = 13; // Built-in LED on pin 13 for output
void setup() {
pinMode(switchPin, INPUT_PULLUP); // Configure switch pin as input with pull-up resistor
pinMode(ledPin, OUTPUT); // Configure LED pin as output
Serial.begin(9600); // Initialize serial communication for debugging
}
void loop() {
int switchState = digitalRead(switchPin); // Read the state of the switch
if (switchState == LOW) { // Switch is pressed (LOW due to pull-up resistor)
digitalWrite(ledPin, HIGH); // Turn on the LED
Serial.println("Switch is ON");
} else {
digitalWrite(ledPin, LOW); // Turn off the LED
Serial.println("Switch is OFF");
}
delay(100); // Small delay for debounce
}
Note: In this example, the light switch is connected to digital pin 2 of the Arduino UNO. A pull-up resistor is used to ensure a stable HIGH state when the switch is open.
Light Does Not Turn On:
Switch Feels Warm:
Flickering Light:
Switch Does Not Respond:
By following this documentation, users can confidently install, use, and troubleshoot a light switch in various applications.