1 Channel Relay Module

  • 1 Channel Relay Module
Below you can see the corresponding code:
An example of a project for the ky-019
/*
Author: Danny van den Brande, Arduinosensors.nl. BlueCore Tech.
In this example i show you how to use the KY-019 Relay with the KY-004 button module.
I attached a 12v alarm siren with strobe to the relay in the video but 
you can add anything you like offcourse. the Idea now is that
it is functioning as a alarm/panic alarm that can only be turned off when reset.
If you want it to work otherwise you need to Uncomment the commented part 
in the void loop section of the code.
*/
int Relay = 3;
int Button = 10;
boolean val;

void setup() {
  pinMode(Relay, OUTPUT);
  pinMode(Button, INPUT);
  
}

void loop() {
  val = digitalRead (Button);
    if (val == 0)
    {
    digitalWrite (Relay, HIGH);
//    }      //Uncomment if you want the relay only
//    else   //to be on when holding the button.
//    {      //now the alarm need to be reset to turn it off.
//    digitalWrite (Relay, LOW);  
  }
}
Specifications
Working voltage: 3.3v-5v

Write a review

Please login or register to review

1 Channel Relay Module

  • Webwinkel Keurmerk en klantebeoordelingen

  • 14 dagen bedenktijd 
  • Verzendkosten voor eigen rekening
  • Product Code: KY-019
  • Availability: 14
  • 2.49€

  • Ex Tax: 2.06€

Similar Products

Mini Reed Module

Mini Reed Module

Below you can see the corresponding code: An example of a project for the mini reed switch//Author:..

2.36€ Ex Tax: 1.95€

Hall Magnetic Sensor Module (analog)

Hall Magnetic Sensor Module (analog)

Below you can see the corresponding code:An example of a project for the KY-035/* Author: Danny van..

2.36€ Ex Tax: 1.95€

Vibration Sensor Module

Vibration Sensor Module

Below the corresponding code:an example project for the Vibration Sensor//Author: Danny van den Bran..

2.29€ Ex Tax: 1.89€

Photoelectric sensor / photo interrupter

Photoelectric sensor / photo interrupter

Below you can see the corresponding code:An example of a project for the ky-010//Author: Danny van d..

2.29€ Ex Tax: 1.89€