Description
What it is
The KCD4 round switch in black with 4 pins is an electronic component used to control electronic circuits in various projects, such as those based on Arduino. With two positions, it offers easy management of on/off functions.
Features
- Type: KCD4 Round Switch
- Chain: Black
- Pins: 4 pins
- Positions: 2 positions
- Maximum Current: 15A
- Maximum Voltage: 250V
What it is for
The switch is ideal for Arduino and ESP projects, allowing simple management of the on/off functions of devices such as LEDs or other components. It is suitable for both beginners and intermediate users.
Tutorial: How to Use KCD4 Round Switch
This switch is ideal for controlling electronic circuits, suitable for beginners and intermediates.
What you need
- KCD4 Round Switch
- Arduino or compatible microcontroller
- Power cable (2.1mm)
- Resistor (1kΩ)
Steps
- 1. Check the datasheet for power specifications.
- 2. Mount the switch on the circuit.
- 3. Connect pins 1 and 2 to VCC and GND.
- 4. Connect pins 3 and 4 to a digital pin on the microcontroller.
- 5. Add a resistor between pins 3 and 4 to protect the microcontroller.
- 6. Load the code onto Arduino.
- 7. Check connectivity.
- 8. Test the switch.
Example code
int ledPin = 13; int buttonPin = 2; int buttonState = 0; void setup() { pinMode(buttonPin, INPUT); pinMode(ledPin, OUTPUT); } void loop() { buttonState = digitalRead(buttonPin); if (buttonState == HIGH) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); } }
Mini project
Create a simple switch to turn an LED on and off.
Common mistakes
- Connect the pins to the wrong VCC and GND.
- Omit the protection resistor.
- Do not check connectivity.
- Forget to load the code.
Recommended accessories
- Arduino Uno
- LED
- 220Ω Resistor
- Power Supply Cable
Frequently asked questions
How can I protect the microcontroller?
Connect a resistor between the switch pins and the microcontroller.
What power supply specifications do I need to verify?
Check the datasheet for power supply specifications.
Can I use another microcontroller?
Yes, the switch is compatible with any compatible microcontroller.







Reviews
There are no reviews yet.