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

Sound Sensor Module Small

Sound Sensor Module Small

Below the corresponding code:Example code: Digital output.int Led = 13 ;// define LED Interfaceint b..

2.29€ Ex Tax: 1.89€

NTC Waterproof Thermistor/ Temperature sensor

NTC Waterproof Thermistor/ Temperature sensor

Length 50 cm.Below you can see the corresponding code:An example of a project for the sensor./* Aut..

2.36€ Ex Tax: 1.95€

Hall Magnetic Sensor Module

Hall Magnetic Sensor Module

Im Folgenden finden Sie den entsprechenden Code zu sehen:Ein Beispiel für ein Projekt für die K..

2.36€ Ex Tax: 1.95€

Heart Beat Pulse Sensor Module

Heart Beat Pulse Sensor Module

Below you can see the corresponding code: An example project for the KY-039/* This example will sh..

1.95€ Ex Tax: 1.61€