LED Control with Relay


Great—let’s use your 5 V Songle relay to switch an LED from an Arduino Uno R4 WiFi using a safe transistor driver and a flyback diode.
Parts you’ll need
Why a transistor + diode
  • According to the SRD datasheet, the 5 V coil draws about 70 mA (coil resistance ≈ 70 Ω, pull-in ≤ 75% VNOM, drop-out ≥ 10% VNOM). An Arduino GPIO cannot source that directly.
  • Best practice: drive the coil with an NPN transistor and place a flyback diode across the coil. Knowledge rule: the diode current rating should be at or above the relay’s steady-state coil current (≥ 70 mA). Both 1N4148-1 and 1N4007RLG satisfy this.
Wiring (breadboard)
  • Power and ground:
    • Arduino 5V -> relay coil pin A2 (either coil pin; coil is non-polarized).
    • Arduino GND -> transistor emitter AND the relay’s LED return resistor’s ground.
  • Transistor driver (example uses Arduino D8):
    • Arduino D8 -> MF3W-680Ω±5%-QT73 -> PN2222A base.
    • Optional: 10 kΩ from base to GND (keeps it off at boot).
    • PN2222A emitter -> GND.
    • PN2222A collector -> relay coil pin A1.
  • Flyback diode across coil:
    • 1N4148-1 cathode to 5V (coil A2), anode to transistor collector (coil A1).
  • Relay contacts to switch the LED from 5 V:
    • COM -> 5V.
    • NO -> LED anode -> CFR-12JB-52-330R -> GND.
    • When the relay energizes, NO closes to COM and the LED turns on. If you prefer LED ON by default, move from NO to NC.
Arduino sketch (example on D8)

Cpp


const int RELAY_CTRL = 8;
void setup() {
  pinMode(RELAY_CTRL, OUTPUT);
  digitalWrite(RELAY_CTRL, LOW); // keep OFF at power-up
}
void loop() {
  digitalWrite(RELAY_CTRL, HIGH); // energize relay -> LED ON
  delay(1000);
  digitalWrite(RELAY_CTRL, LOW);  // de-energize -> LED OFF
  delay(1000);
}
Notes
  • The 680 Ω base resistor targets solid saturation for the ~70 mA coil current; 1 kΩ will also usually work for this relay, but 680 Ω gives more margin.
  • Tie Arduino GND and the relay driver’s GND together. Do not power the coil from a GPIO pin—use 5V + transistor as shown.
Want me to add these exact parts into a small schematic in your Flux project so you can follow it 1:1 on a breadboard?
Confirm relay coil wiring
Ask for Flux schematic help
Use different GPIO pin
Drive multiple relays
Ask about external supply

Name
Pin #
Type
Current
Max Current
Part Type
Terminal Order
Terminal Type
A1
A1
Passive
1A
1A
Terminal
passive
A2
A2
Passive
1A
1A
Terminal
passive
COM
COM
Passive
4.5A
15A
Terminal
passive
NC
NC
Passive
4A
15A
Terminal
passive
NO
NO
Passive
4A
15A
Terminal
passive

SRD-05VDC-SL-C