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

Active Buzzer Module

Active Buzzer Module

Below the corresponding code://Example code KY012 active buzzer int speakerPin = 8;void setup () { ..

1.95€ Ex Tax: 1.61€

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€

2 Color LED Module RG Small

2 Color LED Module RG Small

Below the corresponding code:// Arduino test code for KY011 int redpin = 11; // select the pin for ..

2.29€ Ex Tax: 1.89€

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€