Relay Module + Solenoid Door lock How to control them with an Arduino




Schematic diagram




Hardware


- Arduino UNO
- 12VDC Solenoid Door Lock
- 1 - Channel Relay Module
- Breadboard




Arduino Sketch


int relay_pin = 7;
void setup() {
  // put your setup code here, to run once:
   pinMode( relay_pin , OUTPUT);
 
}

void loop() {
  // put your main code here, to run repeatedly:
   digitalWrite( relay_pin , HIGH);
   delay(5000);
   digitalWrite(relay_pin , LOW);
   delay(5000);
}

ความคิดเห็น