Arduino Code and Video for Omron G3MB Solid State Relay
Arduino Code and Video for Omron G3MB Solid State Relay
In this video you will learn how to use Omron G3MB-202P 5V Solid State Relay. You will learn how to use it without Arduino and with Arduino to turn ON or turn OFF AC load. http://robojax.com/learn/arduino/
/*
* This is the Arduino code for Solid State relay to control AC load ON or OFF
* This is for the bare Omron Solid State Relay that works with 5 to
* watch video for details https://youtu.be/2y6t0GoeCZA
* Written by Ahmad S. for Robojax Video
* on Friday March 30, 2018 at 20:23 at Ajax, Ontario, Canada
* Permission granted to share this code given that this
* note is kept with the code.
* Disclaimer: this code is "AS IS" and for educational purpose only.
*
*/
int relayPin = 8;// define output pin
void setup() {
// Robojax Solid State Relay Video
pinMode(relayPin, OUTPUT);// set pin 8 (relayPin) as output
}
void loop() {
// Robojax Solid State Relay Video
digitalWrite(relayPin, LOW);// Turn the Relay OFF
delay(2000);// Wait for 2000melisecond (2 second)
digitalWrite(relayPin, HIGH);// Turn the Relay ON
delay(2000);// Wait for 2000melisecond (2 second)
}