Skip to content Skip to sidebar Skip to footer

How to Control a Relay Using an Arduino Uno

How to Control Arduino Relay

Cara Menggunakan dan Mengontrol Relay Menggunakan Arduino - In many applications, the relay is the main component used. For example, turning on the lights automatically, changing the polarity of the automatic voltage, timers and others that are triggered by the microcontroller.

One of the advantages of relays is that we can connect or disconnect electricity with high current and voltage with just a 5V logic command.

Arduino Digital Pins can be used to control relays, because the voltage on this digital pin can be 5V and 0V.

Before we control relays using Arduino, we have to divide relays into two types. What we want to control is the relay module or just the relay.

A. Controlling Arduino Relay Module

If we want to control the relay module, the method is very easy. On the relay module, there are 3 input pins. The 2 input pins are used to power Vcc and Gnd. While the other 1 is for the relay control input, 5V (HIGH) for the active relay and 0V (LOW) for turning off the relay.

The picture of the relay and arduino module circuit can be seen as follows;

Cara Mengontrol Relay Menggunakan Arduino Uno
Arduino UNO Relay Module Schematics

B. Controlling Relays Without an Arduino Relay Module

If you want to use only relays, then there are 3 additional components that you must use. First resistors, transistors and diodes. For an example of a circuit and calculation of a BJT transistor that will be used as a switch, you can read the article here.

te connectivity schrack pnoz m1p mainspro comap relay seL pilz pnoz xv1p rf rele pnoz mi1p relay rf siemens 3tk28 3ua50 siemens protection relay abb ge protection relay pnoz 3 schneider sr2b121bd rm4tr32 safety relay siemens relay pw3 optomos relay omron my2in 24vdc siemens 3ua62 g5rl sr3b261bd omron g4a lr2d13 phoenix 2961121 omron g5rl relay din rail photomos easy512 he721a0510 dpc01dm48 rt424730 im03ts im23gr te schrack panasonic relay acvn51212 relay pw60 dpc01dm69 schneider tm221ce40r omron 12vdc rslzva1 schneider rslzva1 im26gr im03gr a000110 rt424005 im06dgr schneider rh99m v23234 rt314730 rt424f12 panasonic apan3124 v23134a1052c643 im03dgr he721c2410 q relay enphase siemens reyrolle he721c1210 ssr 5a pnoz mo4p pilz xv2 te relay vo14642at ly2 24vdc he721c0500 2966595 phoenix contact v23079 crydom d53tp50d ale1pb12 omron ly4 24vdc he3621a0510 he721c0510 siemens 3ua50 schneider sr3b261bd 240d25 omron g3na d2425 crydom crydom hd4850 rt314024 v23086c2001a403 rt425024 tq2sa ds2y he721a0500 pilz pnoz s7 allen bradley msr127t omron g2r 1 snd 24vdc he722a0500 omron g5q omron ly2nj im23ts schneider rm17tg20 omron my4in 24vac ds2e omron g5la pilz pnoz z rt33l012 omron g3pe lr2 d13 omron my2in omron my4 24vdc omron my2 24vdc he721c1200 usb relay linux he722a1200 g5q v23134a1053c643 omron g3vm he721c2400 kmtronic usb relay g6rl schneider zelio omron g5v omron g8n ssr dc g7l p2rf08e omron g9sa g5le1 rxze2m114m schneider aldp112w omron g5nb tx2sa optomos omron g7sa d1d40 crydom omron my4in he722a1210 pt570024 finder type 40.31 10a 250v omron mk2kp phoenix 2966016 power relay omron g8nd optorelay omron ly4n rxg22bd pilz pnoz s9 d1d40 pnoz mo1p phoenix 2961105 hf relay omron p2rf08e ssr 40a omron my4 t9as1d12 omron g2rl omron my4in 24vdc omron g2r g2r1sn rt424012 relay abb safety relay abb f3aa012e act512 vo14642aabtr phoenix 2961192 omron g5v1 he722a0510 g2rl omron g7l omron g2r1 omron ly4 omron g5le g5le pnoz x4 24vdc omron g6b ssr dc dc omron g2r2 ev relay pnoz s4 750104 abb time relay pilz pnoz s2 jw2sn sr2b121bd v23105 dc60mp relay hongfa omron 1565e schneider rsl1ab4bd omron ly2 3tk28 2966016 phoenix contact phoenix 2966171 omron g5v2 95.05 finder pf113ae finder type 65.31 30a 250v omron g6d omron mk2p g2r2 omron g6rn g2r2sn pilz p2hz pnoz s2 24vdc lorawan relay finder type 95.05 pilz pnoz e1p omron my2 pnoz xv3 omron relay 12v omron g2e ssr crydom g6rn omron g9se pilz pnoz xv2 omron g2rv pilz pnoz v pcb rele pnoz s4 24vdc relay smd omron h3y finder 66.82 omron ly2 24vdc schneider rm35lm33mw ly4n 24vdc pilz pnoz s3 g3mb202p 2967060 phoenix pilz pnoz x2 1 zelio relay schneider rxze2s114m sr2b121fu rxze2s108m rm35ua13mw 2961118 phoenix relay 4 pole relay finder 40.52 pilz pnoz s5 pilz pnoz s4 750104 schneider rm22ua33mr omron 24vdc 44.52 finder rm17te00 rm4tr32 schneider finder type 56.32 95.05 pilz x4 pilz pnoz s4 pnoz s3 24vdc omron my4n dpc01dm48 carlo gavazzi rm35tf30 omron k8ak schneider rm22tg20 mp240d4 relay weidmuller solid state relay finder rm22tg20 lan relay rm22tg20 schneider pilz s4 rm17tg00 schneider finder 44.62 s my4nj omron rxze2s111m omron type my4 rxze2m114m rm17tg20 relay 24vdc omron rm4tg20 schneider lt3sa00mw schneider omron my4 24vac g2r1 omron ssr dpa51cm44 omron my2k g2rl2 relay schneider v23134j52d642 fujitsu relay act212 relay acnh3212 pilz pnoz x2 telemecanique xpsac5121 relay ethernet finder type 40.52 s my4 24vdc finder 40.52 24vdc rm22tr33 schneider rm22tr33 finder type 40.31 rm17te00 schneider schneider ssr pilz pnoz x7 finder 95.05 spa usb relay 40.52 finder g5v2 relay finder type 40.52 8a 250v solid state relay 230v relay siemens coil 12vdc relay timer 12v ssr 10a solid state relay 3.3 v schneider rxze2s114m omron my2nj 24vdc pilz s3 my2nj iec255 my4nj ly2nj celduc ssr finder type 55.34 finder 46.61 omron relay 24v finder 40.52 8a 250v photorelay omron ly2n finder type 40.61 pilz s5 finder safety relay relay g5le pnoz 11 finder type 60.13 rm22ua33mr pnoz xv2 finder type 40.52 finder type 40.61 16a 250v finder 62.33 siemens time relay esp32 relay 60.13 finder my4in 24vdc solid state relay 220v finder type 65.31 55.34 finder finder 56.34 finder 55.34 5a 250v finder 46.52 finder 65.31 97.02 finder finder 40.61 24vdc 94.02 finder omron relay pcb murr elektronik 52000 schneider sr2b121fu relay omron my2n 220vac apan3124 panasonic msr127t relay wifi ssr dc ac 60.13 finder relay 44.62 finder finder 56.32 my4n 24vdc relay 48vdc omron g3mb ssr25dd g5v ssr ac timer relay 12vdc 12 volt dc timer relay relay v23086 relay ly4n timer omron h3y 2 220vac 55.32 finder ssr40da relay my2n 24vdc relay my2n 24vdc omron finder type 40.51 my4in relay omron fotek ssr relay sanyou ky019 smartrelay relay 3vdc wemos d1 mini relay relay 24vdc ampere relay pilz x3 95.05 spa finder carlo gavazzi dpa51cm44 omron my2n hf49fd relay omron 220v weidmuller relay 24vdc relay 48v relay 9vdc digital display timer relay relay omron ly2n ssr25da finder type 40.61 s nodemcu relay rm4tg20 omron relay 5v hf115f my2n 24vdc rm35tf30 schneider relay arduino bosch 0 332 002 156 relay ly2n hf7520 hf33f ssr 24vdc schneider sepam mini relay 5v hf32f relay my4n 24vdc relay 6vdc jqx13f relay 24v relay 12vdc hf115fk rm17tg20 schneider electric rele 230 hf32fa my4n omron ajax relay relay 5vdc jqx115f finder 40.31 24vdc srd05vdc hf46f rele din relay 3.3 v relay kulkas lg 1 pintu g3mb relay z wave my2in hf152f relay 12v relay 12v 30a i2c relay srd12vdc hf14fw hf3fd relay hf118f esp8266 relay relay 220v relay omron 12vdc rele 30a 12v relay 5v relay 6v dc relay bosch ssr 5v omron k8ds relay 220v ac relay 12v ac hf41f relay 12v 10a relay 12v 20a relay 12v omron relay 2v hongfa hf2160 hf140ff hf115fd rele 3 relay 230v modul relay 5v schmersal protect srb 301mc relay 3v jqx62f relay 220v omron relay 12v 5 pin relay 6v relay omron 12v sra 12vdc cl relay relay ac 220v modulo rele arduino relay 12v 15a rele 12v 200a relay 8 pin 220v relay 9v relay 220v 10a relay bosch 12v relay 12vdc 8 pin relay symbol syrelec agsno2 hk4100f relay fritzing 2ph63091a esp8266 wifi relay fritzing relay timer relay omron g7j aux relay g4q esp relay g7z vde 0435 hk19f mb183865 wemos relay mqtt relay dh48j octoprint relay ltspice relay fritzing relay module iec 61810 pnoz m1p eth esp01s relay abb ta25 myaa024d abb rt6 simbol relay symbol relay mengendalikam relay arduino
Rangkaian Relay Arduno UNO

You can replace the relay in this circuit with other types of relays such as te connectivity schrack, omron relay, panasonic relay and others.

To test the relay, you can simply use the Blink program that is included in the Arduino IDE. However, for those of you who are new to Arduino, please change the Delay value to 5 seconds so that the turn on and off is not too fast.


void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(13, OUTPUT);

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(5000);              // wait for 5 second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(5000);              // wait for 5 second

That's it. Hopefully this article is useful.

Post a Comment for "How to Control a Relay Using an Arduino Uno"