
Using Relays — SIK Circuit 13
手順
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
このステップの材料:
SparkFun Inventors Kit - V3.21 キット
Arduino Uno R31 個
Breadboard1 個
NPN Transistor (P2N2222A)1 個
Diode (1N4148)1 個
5mm LED1 個
330 Ohm Resistor2 個
Jumper Wires8 個必要な工具:
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.
このステップの材料:
NPN Transistor (P2N2222A)1 個
Diode (1N4148)1 個
5mm LED1 個
330 Ohm Resistor2 個
Breadboard1 個
Jumper Wires8 個Arduino Code
Arduino Code
Open the Arduino IDE and upload the following sketch to your Arduino board.
このステップの材料:
Arduino Uno R31 個必要な工具:
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.
材料
9- ¥164
- プレースホルダー
- 1 個プレースホルダー
- SPDT Relay1 個
- プレースホルダー
- プレースホルダー
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 パブリックドメイン
このブループリントはCC0で公開されています。許可を求めずに、自由にコピー、修正、配布、あらゆる目的で使用できます。
メイカーを応援するには、ブループリント経由で製品を購入してください。メイカーには メイカーコミッション がベンダーにより設定されています。または、このブループリントの新しいイテレーションを作成し、自分のブループリントにコネクションとして含めて収益を共有できます。