
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
Materials for this step:
SparkFun Inventors Kit - V3.21 багц
Arduino Uno R31 ширхэг
Breadboard1 ширхэг
NPN Transistor (P2N2222A)1 ширхэг
Diode (1N4148)1 ширхэг
5mm LED1 ширхэг
330 Ohm Resistor2 ширхэг
Jumper Wires8 ширхэгTools needed:
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.
Materials for this step:
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.
Materials for this step:
Arduino Uno R31 ширхэгTools needed:
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- $105.00
- 1 ширхэгPlaceholder
- 1 ширхэгPlaceholder
- SPDT Relay1 ширхэг
- 1 ширхэгPlaceholder
- Placeholder
- $3.00
- $5.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 Нийтийн домэйн
Энэ загвар CC0 дор гаргагдсан. Та зөвшөөрөл авахгүйгээр хуулах, өөрчлөх, түгээх, ашиглах боломжтой.
Загвараар дамжуулан бүтээгдэхүүн худалдаж авч Бүтээгчийг дэмжээрэй Бүтээгчийн шимтгэл Борлуулагчаар тогтоосон, эсвэл энэ загварын шинэ хувилбар үүсгэж орлогоо хуваахын тулд өөрийн загварт холбоос болгон оруулна уу.