
Using Relays — SIK Circuit 13
Hướng dẫn
Parts & Introduction
Parts & Introduction
A relay is an electrically-operated mechanical switch. A small current energizes a coil that physically moves a contact arm, switching a separate circuit. Relays can control high-power devices (motors, lights, appliances) from low-power Arduino signals. This experiment uses an SPDT (Single Pole Double Throw) relay to alternate between two LEDs.
Parts Needed
- 1x Arduino Uno + USB cable
- 1x Breadboard
- 1x SPDT Relay
- 1x NPN Transistor (P2N2222A)
- 1x Diode (1N4148)
- 2x LEDs (different colors)
- 2x 330Ω Resistors
- 14x Jumper Wires
Vật liệu cho bước này:
SparkFun Inventors Kit - V3.21 bộ
Arduino Uno R31 cái
Breadboard1 cái
NPN Transistor (P2N2222A)1 cái
Diode (1N4148)1 cái
5mm LED1 cái
330 Ohm Resistor2 cái
Jumper Wires8 cáiCông cụ cần thiết:
Hardware Hookup
Hardware Hookup
Wiring Instructions
Transistor + Relay Coil
- Connect transistor Base through 330Ω resistor to Arduino Digital Pin 2.
- Connect transistor Emitter to GND.
- Connect one side of the relay coil to transistor Collector.
- Connect other side of relay coil to 5V.
- Flyback Diode: Band (cathode) to 5V, anode to Collector.
Relay Contacts + LEDs
- Connect relay COMMON through a 330Ω resistor to 5V.
- Connect relay NC (Normally Closed) to LED 1 positive leg.
- Connect relay NO (Normally Open) to LED 2 positive leg.
- Connect both LED negative legs to GND.
Vật liệu cho bước này:
NPN Transistor (P2N2222A)1 cái
Diode (1N4148)1 cái
5mm LED1 cái
330 Ohm Resistor2 cái
Breadboard1 cái
Jumper Wires8 cáiArduino Code
Arduino Code
Open the Arduino IDE and upload the following sketch to your Arduino board.
Vật liệu cho bước này:
Arduino Uno R31 cáiCông cụ cần thiết:
Test & Experiment
Test & Experiment
What You Should See
You should hear the relay clicking, and see the two LEDs alternating — one on, one off — switching every second.
Troubleshooting
- LEDs not lighting: Check LED polarity — longer leg is positive.
- No clicking sound: The transistor or coil circuit isn't working. Verify transistor orientation and coil connections.
- Relay not making good contact: The SIK relay is designed for soldering, not breadboarding. Press it firmly to ensure all pins contact.
- Confusion: Don't mix up the TMP36 temperature sensor with the transistor!
Experiments to Try
- Replace the LEDs with a motor on the NO contact — use the relay as a motor on/off switch.
- Use a button to control when the relay toggles.
- Add variable delay to create morse code patterns.
Vật liệu
9- $105.00
- 1 cáiTạm thời
- 1 cáiTạm thời
- SPDT Relay1 cái
- Tạm thời
- Tạm thời
- $3.00
You can swap these in
Can't get one of the materials? Swap it for an equivalent — these work just as well.
- Instead of Relay Module, try:
Gadgeteer - Motor Driver L298 Module
MicroView - OLED Arduino Module
MPU6050 6-Axis Accelerometer & Gyroscope Module
ZigBee CC2530 Module
Arduino Relay Module (4-Channel)
MCP4725 12-Bit DAC Module (3-Pack)
IGBT Transistor Module (600V/25A)
Gadgeteer - Accelerometer Module
ADH8066 GSM Module - Instead of Arduino Uno R3, try:
Prototyping Shield for Arduino Uno (3-Pack) - Instead of 5mm LED Assortment Kit (300pcs, 5 Colors), try:
WS2812B NeoPixel LED Strip (1m, 60 LEDs) - Instead of Diode Kit, try:
Bridge Rectifier Diode Kit (20pcs)
Recommended for this build
Products makers often use with builds like this one.
Servo MotorUsed together and in similar builds
Resistor 10K Ohm 1/6th Watt PTH - 20 packUsed together and in similar builds
DC MotorUsed in similar builds
Push Button - 33mmFrequently used with this build's materials
Temperature SensorUsed in similar builds
Flex Sensor 2.2 InchUsed together and in similar builds
LED - RGB Diffused Common Cathode - 5mmFrequently used with this build's materials
USB CableFrequently used with this build's materialsRelated blueprints
Other builds that share materials, tools, or techniques with this one.






CC0 Phạm vi công cộng
Bản thiết kế này được phát hành theo CC0. Bạn tự do sao chép, sửa đổi, phân phối và sử dụng cho bất kỳ mục đích nào mà không cần xin phép.
Hỗ trợ nhà sáng tạo bằng cách mua sản phẩm qua bản thiết kế, nơi họ nhận Hoa hồng nhà sáng tạo do nhà bán hàng đặt, hoặc tạo phiên bản mới và kết nối trong bản thiết kế riêng để chia sẻ doanh thu.