Relay 5V Using Arduino

by MrSottong in Circuits > Arduino

2158 Views, 4 Favorites, 0 Comments

Relay 5V Using Arduino

IMG_7130.JPG
IMG_7134.JPG

Relay is an electromagnetic switch.

The relay consists of two parts. Coil part and switch part.

The coil part consists of a wire wrapped around an iron. If the wire is turned into electricity, a magnetic field will arise on the iron. This magnetic field is used to pull or release the plate that is on the switch. So the switch can open or close.

Relay

IMG_7127.JPG
image1594.png

Relay Modul specifications :

  • 5V DC
  • Active low
  • Two Output (NO and NC)
  • Power Indication
  • Relay Indication

Required Component

IMG_7133.JPG
IMG_6883.JPG
IMG_7140.JPG

Required component :

Connect the Relay Module to Arduino

SKEMA 1.png

To connect Relay to Arduino. You can see the picture above or the description below.

Relay Module to Arduino

VCC ==> +5V

GND ==> GND

IN ==> D12

Upload Sketch

SKETCH.png

This is a sketch I made to try the relay module. You can copy and paste it in your sketch.

<p>//define pin relay <br>const int RelayPin = 12;</p><p>void setup() {
  pinMode(RelayPin, OUTPUT); //Sets the RelayPin as an Output</p><p>}</p><p>void loop() {
  digitalWrite(RelayPin, LOW); //Relay On
  delay(2500);
  digitalWrite(RelayPin, HIGH); //Relay off
  delay(1000);</p><p>}</p>

I also provide the sketch file. You can download it below.

Downloads

Result

IMG_7142.JPG
IMG_7137.JPG

This relay module is active low. The relay will on if INPUT gets a low trigger.

When the relay is on, the NO switch will become NC and the NC switch will be NO.

Based on the sketch that I made. The relay will "ON" for 2.5 seconds and then "OFF" for 1 second. And will continue to repeat until the supply is cut off.

Thank you for reading, see you in the next article