Relay, also known as electrical relay, is an electronic control device, usually used in automatic control circuits, it is actually a kind of "automatic switch" that uses a smaller current to control a larger current. Therefore, it plays the role of automatic adjustment, safety protection, and conversion circuit in the circuit.
You will need:
Arduino Uno *1
1 relay module *1
Breadboard *1
LED *1
100 ohm resistor *1
Jumpers
Wiring:
Relay | Arduino | |
---|---|---|
IN | -> | 3 |
VCC | -> | 5V |
GND | -> | GND |
Normally Open Port | -> | 4 |
Relay | LED | |
---|---|---|
Common Port | -> | + |
Sample Code:
int sign= 3;
int led= 4;
void setup(){
pinMode(sign, OUTPUT);
pinMode(led, OUTPUT);
digitalWrite(led, HIGH);
}
void loop(){
digitalWrite(sign, HIGH);
delay(2000);
digitalWrite(sign, LOW);
delay(2000);
}
If you need 5V relay:
👉 5V Relay
If you need other relays:
👉 Other Relays
More Electronic Component,welcome to HALJIA!