In this project, we’ll create a unique door lock that can be opened and closed without the need of a keycard, a password, or biometric identification. The lock will be operated through a smartphone via Bluetooth.
This door uses a solenoid lock, which is an electrically-activated locking mechanism that is triggered by a latch. It also has an LED indicator that displays whether the door is locked or unlocked, as well as a buzzer to notify when the door is opened or closed. Additionally, the door is equipped with a vibration sensor, which serves to detect any unauthorized or forceful attempts to access the door and triggers a warning signal.
For this project, we will be using an Arduino NANO board and a smartphone with Bluetooth connectivity. The Arduino NANO board will be used to control the communication between the smartphone and the device. We will start by creating a block diagram that will outline the overall structure of the project. Following this, we will create a circuit diagram that will explain the various components and their connections in the project.
System block diagram
The main components of the system are:
- An Arduino NANO board
- The Bluetooth Module HC05
- A relay
- A solenoid lock
- A 12 V buzzer.
We’ll also use a few other blocks to help us achieve our goals.
- LEDs
- A mini buzzer
- Vibration sensors

Bluetooth Connectivity
The Smartphone is connected via Bluetooth to transmit commands to lock or unlock the door. The Bluetooth app sends these commands to the Arduino board through serial communication.

Vibration Sensor
A vibration sensor is used to detect movement or vibrations on the door when it’s locked. If the sensor detects strong vibrations, it sends an alert to the Arduino board.

Relays
Two relays are used in this project. Relay 1 activates (energizes) the solenoid lock, requiring 12 V to power the internal coil. Relay 2 utilizes 12 V to power the big buzzer.

Solenoid Lock
The solenoid lock is used to lock the door.

Big Buzzer

The 12-V big buzzer generates an alert if anyone attempts to forcefully open the door when locked (without using the smartphone).
Mini Buzzer
The mini buzzer alerts whenever the door is locked or unlocked by generating a long or short beeping sound, respectively.

LEDs
Green and red LEDs indicate if the door is locked or unlocked.
The Arduino NANO
The Arduino NANO is a small, breadboard-friendly board based on the ATmega328 (Arduino NANO 3.x) or ATmega168 (Arduino NANO 2.x). It has more or less the same functionality of the Arduino Duemilanove, but in a different package. It lacks only a DC power jack, and works with a Mini-B USB cable instead of a standard one. It includes an FTDI FT232RL chip for USB to serial communication. The NANO has 8 analog inputs, 14 digital I/O’s, and an ICSP header. It operates on 7 – 12V, and can be powered via the Mini-B USB connection, or with a 7 – 12V jack. It has an onboard voltage regulator, so it can accept voltages up to 12V.

Schematic diagram:

Circuit connections:
- The Bluetooth Module HC05 has four pin connections: Power (VCC), Ground (GND), Transmitter (Tx), and Receiver (Rx).
- Arduino supplies the VCC pin with 5 volts.
- The GND pin is connected to the common ground of the circuit.
The Arduino’s digital pins D11 and D12 are connected to the Tx and Rx pins, respectively.- The red and green LEDs connect to digital IO pins 9 and 10.
The digital IO pins D7 and D8 are connected to the coils of Relay 1 and Relay 2, respectively, by transistors.- The collectors of two BC547 NPN transistors are connected in a switch configuration, which is used to drive the relay coil.
- The Relay 1 NO output is used to activate the buzzers, while the Relay 2 NO output is used to energize the solenoid coil
- Both relays have 12V supplied to the common (C) terminal, which is used to power either the buzzer or the solenoid lock.
- The 5V mini buzzer connects to digital pin number d5.
- The vibration sensor module has three pins: VCC, GND, and D0.
- Arduino supplies a voltage of 5 V to the VCC pin.
- The GND pin is connected to the circuit’s ground.
- The D0 pin connects to Arduino’s digital pin d6.
- The Arduino board takes 12V of input from its VIN pin, which is then regulated to 5V using its onboard voltage regulator. This regulated 5V is then supplied to other modules.
Circuit operation:
The circuit begins to function when it is supplied with 12 V, causing the solenoid to lock the door and the red light to turn ON, indicating that the door is locked.
Open your smartphone’s Bluetooth application and pair it with the HC05 module, entering the default passkey of 1234. Once the pairing is complete, the HC05 module will blink at a slow rate, indicating that it is ready to receive commands.
Send the command “ULCK” to the HC05 module via your smartphone’s Bluetooth app to unlock the door. The module will then pass this command on to the Arduino serially through the Tx-Rx pins.
When Arduino receives the command, it will send a logic signal of HIGH to the D8 pin, turning on Relay 2 and activating the solenoid, thereby unlocking the door. Simultaneously, Arduino sends an acknowledgement signal to indicate that the command has been successfully received.
The D9 pin is set to Logic 1, illuminating the green LED to indicate that the door is unlocked.- “Set a logic 0 to the D10 pin, disabling the red LED (only used when the door is locked).”
- Apply a HIGH voltage (1) to the D5 pin for one second to activate the mini buzzer and create a long beep, indicating that the door is unlocked.
The HC05 module will receive the command “LOCK” and then pass it onto Arduino, which will switch off Relay 2 by sending a Logic 0 signal to the D8 pin, thus deactivating the solenoid and locking the door.
Arduino also sends:
- Logic 1 is sent to the D5 pin for half a second, which causes the mini buzzer to emit a short beep, indicating that the door is locked. This also causes the green LED to turn off.
- The red LED is illuminated when Logic 1 is applied to the D10 pin, indicating that the door is locked.
- Set the D9 pin to Logic 0, turning off the green LED (used only when the door is unlocked).
Once the door is locked and a shock, force, or vibration is detected by the vibration sensor, an alert signal is sent to Arduino via Logic 1. Arduino will then activate Relay 1 by sending Logic 1 to the D7 pin, which will trigger a 12 V big buzzer alarm.
This circuit operates due to the program written in C/C++ and compiled in the Arduino IDE software that is downloaded into the internal FLASH of Arduino’s ATMega328.