solenoid lock

Solenoid Lock Interfacing With Arduino

Arduino Tutorial

Introduction

Hey geeks, welcome back to Techatronic. In this article, we are going to discuss the interfacing of a Solenoid Lock with Arduino.

solenoid lock with Arduino

Do you want to know more about the Arduino UNO microcontroller board, if so you can click to read? We use a Relay module for turning the solenoid lock on and off.

Also, a Solenoid lock is just like a normal or manual lock. the difference is only the solenoid locks operate with the electricity.  so this can be used at many places just like fingerprint security door lock.

So. in this Arduino tutorial you will learn how to interface this thing with the controller so that you can use this electronic device with any of your projects.

So, here we are giving you every possible information which helps you to learn and make your project possible for yourself.

What is a Solenoid Lock

Basically, it is an Electromagnetic lock that works on the principle that a current-carrying coil produces a magnetic field near it.

if you don’t know more bout magnetism you can read it on our website.

Inside the Solenoid valve,

  • there is a coil of insulated copper wire which is wound in the shape of a hollow cylinder.
  • There is an armature inside the coil which moves freely.
  • When we pass the electric current to the coil it generates a magnetic field near it.
  • The movement of the armature depends on the magnetic field generated by the insulated copper coil.

A solenoid lock looks like this.

solenoid lock

How Does it Work?

  • The solenoid lock is controlled by Arduino, it generates the signals so the lock turns on and off after the delay of a second.
  • The lock is not directly connected with the Arduino instead of it we use a relay module.
  • As the lock works with electricity so in case of power failure the lock can’t be opened or closed. You can use different sensors with it to make a high-security lock system.
  • The solenoid lock needs a 12-volts DC supply for its functioning so you have to provide it.
  • Unlike manual locks, a solenoid lock is more secure and you don’t need any key to open it as it works on electricity.

Components Required

  • Arduino UNO
  • Solenoid Lock
  • DC 12-v supply
  • USB cable for uploading the code
  • Jumper wires
  • Breadboard

Components Table/buy link

You can buy the whole components from the given link we have to share the amazon link. from where you can get a good discount on the components.

S.NoComponent RequiredQuantityBuy Link
1.Arduino UNO1https://amzn.to/3ue2vmh
2.Arduino UNO Cable1https://amzn.to/3obXjht
312V DC Solenoid Lock1https://amzn.to/2Y89cKs
4.12V DC Adaptor1https://amzn.to/3FmT9K7
5.5 V Single Channel Relay1https://amzn.to/2Y035I4
6.Jumper Wire40https://amzn.to/39q43jr
7.Breadboard1https://amzn.to/39vsRX2

Circuit Diagram for the Project

Connection Table

Arduino UNO5V Single Channel Relay Module
( +5V ) VCC
GND GND
D12 PinIN1 Input
12V DC AdaptorSolenoid Lock5V Single Channel Relay Module
  Normally Open
Positive Common
 Positive TerminalNormally Closed
NegativeNegative Terminal 

You have to make the connections according to the circuit diagram given above.

  • Connect the 5-volts pin of the Arduino to the VCC pin of the Relay module.
  • Join the GND pin of the Arduino to the GND pin of the Relay module.
  • Attach the Relay IN pin of the Relay module with the digital-12 pin of the Arduino as shown above.
  • You have to connect the positive wire of the DC power supply to the other side of the Relay module and the negative wire to the solenoid lock as shown.
  • Connect the positive wire of the solenoid lock with the Relay module. Now upload the code to the Arduino.

Code for the Project

NOTE: Please upload the code given below to the Arduino as it is.

 // TECHATRONIC.COM   
  void setup()   
  {   
  pinMode(12,OUTPUT); // RELAY PIN   
  digitalWrite(12,HIGH); // Normally ON Only For Chanies Relay Module   
  }   
  void loop()    
  {   
  digitalWrite(12,LOW); // RELAY ON   
  delay(1000);   
  digitalWrite(12,HIGH); // RELAY OFF   
  delay(1000);   
  }   

We hope that you understand the project well. If you are facing any errors do tell us in the comments section below. Please view more Tutorials on Arduino and Raspberry Pi.

We have an E-book on Arduino which contains 10+ projects on Arduino with detailed circuit diagrams and codes. After completing the circuit please upload the given code.

HAPPY LEARNING!

Video sample

Spread the love, Share this post with friends

1 thought on “Solenoid Lock Interfacing With Arduino

Leave a Reply

Your email address will not be published. Required fields are marked *