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

Temp and humidity Sensor

Temp and humidity Sensor

Below you can see the corresponding code: An example of a project for the DHT11/* Author: Danny va..

2.99€ Ex Tax: 2.47€

Soil Moisture Sensor Module

Soil Moisture Sensor Module

Below you can see the corresponding code :An example of a project for the soil moisture sensor//auth..

2.49€ Ex Tax: 2.06€

Ultrasonic capteur Distance - HC SR04

Ultrasonic capteur Distance - HC SR04

Below you can see the corresponding code :An example of a project for Distance Sensor/* Author: Dan..

2.99€ Ex Tax: 2.47€

Line Tracing Sensor Module

Line Tracing Sensor Module

Below you can see the corresponding code:An example project for Line Tracing Module/* Author: Danny..

2.49€ Ex Tax: 2.06€