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: 9
  • 2.49€

  • Ex Tax: 2.06€

Similar Products

Analog Temp Sensor Module

Analog Temp Sensor Module

Below the corresponding code:#include <math.h>  int sensorPin = A5; // select the input ..

2.36€ Ex Tax: 1.95€

Touch Sensor Module

Touch Sensor Module

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

2.36€ Ex Tax: 1.95€

Infrared Emission / Sender

Infrared Emission / Sender

Below the corresponding code:# Include <IRremote.h> int RECV_PIN = 11; / / define input pin o..

2.36€ Ex Tax: 1.95€

7 Color LED Module

7 Color LED Module

Below the corresponding code:/ * BlinkTurns on an LED on for two second, then off for two second, r..

2.36€ Ex Tax: 1.95€