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

Arduino Nano-Controlled Bluetooth Relay for Solenoid Lock

View and Edit Project In Cirkit DesignerImage of Arduino Nano-Controlled Bluetooth Relay for Solenoid Lock

Circuit Documentation

Summary

The circuit is designed to control a 12V solenoid lock using an Arduino Nano microcontroller and a 1-Channel Relay. The Arduino Nano is interfaced with an HC-05 Bluetooth Module to receive commands wirelessly. The relay acts as an electrically operated switch that controls the power to the solenoid lock. The power source for the relay and the Bluetooth module is provided by the Arduino Nano's 5V output, while the solenoid lock is powered by a separate 2x 18650 battery pack.

Component List

Arduino Nano

HC-05 Bluetooth Module

1-Channel Relay (5V 10A)

2x 18650 Battery Pack

12V Solenoid Lock

Wiring Details

Arduino Nano

HC-05 Bluetooth Module

1-Channel Relay (5V 10A)

2x 18650 Battery Pack

12V Solenoid Lock

Documented Code

// sketch.ino

String readString;
#define relay1 3    // Connect relay1 to pin D3

void setup()
{
  Serial.begin(9600);          
  pinMode(relay1, OUTPUT);  
  digitalWrite(relay1, LOW);  
}

void loop()
{
  while(Serial.available()) 
  {
    delay(10);           
    char c = Serial.read(); 
    if (c == '#'){
      break;            
    }
    readString += c;               
  }
  if (readString.length() >0)
  {
    Serial.println(readString);
              
    if(readString == "f success"){
      digitalWrite(relay1, HIGH);
      delay(3000);
      digitalWrite(relay1, LOW);
    }
    readString="";
  }
}

Code Explanation