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

Arduino UNO Controlled Relay System with Infrared Proximity Sensors

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled Relay System with Infrared Proximity Sensors

Circuit Documentation

Summary

This circuit is designed to control multiple 12V single-channel relays using an Arduino UNO microcontroller. The relays are used to switch various loads, potentially solenoid valves, as indicated by the presence of Plastic Solenoid Valves in the circuit. The circuit also includes E18-D80NK infrared proximity sensors that likely serve as inputs to the Arduino to control the state of the relays. A DC Source provides power to the system, and terminal blocks are used for organizing connections.

Component List

12V Single Channel Relay

Arduino UNO

E18-D80NK Infrared Proximity Sensor

DC Source

Terminal Block (04-01)

Plastic Solenoid Valve

Wiring Details

12V Single Channel Relay

Arduino UNO

E18-D80NK Infrared Proximity Sensor

DC Source

Terminal Block (04-01)

Plastic Solenoid Valve

Documented Code

void setup()
{
  pinMode(13, OUTPUT);  // Set pin 13 as output
  pinMode(3, INPUT);    // Set pin 3 as input
  Serial.begin(9600);   // Start serial communication at 9600 bps
}

void loop()
{
  if (digitalRead(3) == LOW)  // Check if the input on pin 3 is LOW
  {
    digitalWrite(13, HIGH);   // Turn on the LED on pin 13
    delay(10);                // Wait for 10 milliseconds
  }
  else
  {
    digitalWrite(13, LOW);    // Turn off the LED
    delay(10);                // Wait for 10 milliseconds
  }
}

The code is written for the Arduino UNO and controls an LED connected to pin 13. It checks the state of pin 3, which is set as an input. If the input is LOW, the LED is turned on; otherwise, it is turned off. The code includes a 10-millisecond delay after each state change of the LED.