Other Arduino Codes and Videos by Robojax
/*
* 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)
}
If you found this tutorial helpful, please support me so I can continue creating content like this. support me via PayPal
