Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Controlled Solenoid Activation via Relay Module

View and Edit Project In Cirkit DesignerImage of Arduino Controlled Solenoid Activation via Relay Module

Circuit Documentation

Summary

This circuit is designed to control a solenoid using an Arduino UNO and a 1 Channel 5V Relay Module. The solenoid is activated and deactivated alternately with a specified delay, allowing for controlled operation. The relay module acts as an interface between the Arduino and the solenoid, enabling the Arduino to control the higher voltage required by the solenoid.


Component List

Solenoid

1 Channel 5V Relay Module

Arduino UNO

Diode

12V DC Power Supply


Wiring Details

Solenoid


1 Channel 5V Relay Module


Arduino UNO


Diode


12V DC Power Supply


Documented Code

/*
 * Arduino Sketch for controlling a solenoid via a relay module.
 * The solenoid is alternately activated and deactivated with a delay.
 * The relay is controlled through digital pin D9 on the Arduino UNO.
 */

const int relayPin = 9; // Pin connected to the relay module's IN pin
const unsigned long interval = 1000; // Interval in milliseconds

void setup() {
  pinMode(relayPin, OUTPUT); // Set relay pin as an output
}

void loop() {
  digitalWrite(relayPin, HIGH); // Activate the solenoid
  delay(interval); // Wait for the specified interval
  digitalWrite(relayPin, LOW); // Deactivate the solenoid
  delay(interval); // Wait for the specified interval
}

This documentation provides a comprehensive overview of the circuit, detailing each component, its purpose, wiring connections, and the code used to control the solenoid.