Sir Boateng Online
No Result
View All Result
  • TECH & ELECTRONICS
    • Arduino Projects
    • Proteus
    • Applied Electricity
  • TUTORIALS
    • Blogging
  • EDUCATION
    • GES Resources
    • NTC Resources
    • Scholarships
    • Universities & Colleges
  • REVIEWS
    • Comparisons
  • MORE
    • Contact Us
    • Disclosure Statement
    • Disclaimer
    • Privacy Policy
Friday, May 30, 2025
  • TECH & ELECTRONICS
    • Arduino Projects
    • Proteus
    • Applied Electricity
  • TUTORIALS
    • Blogging
  • EDUCATION
    • GES Resources
    • NTC Resources
    • Scholarships
    • Universities & Colleges
  • REVIEWS
    • Comparisons
  • MORE
    • Contact Us
    • Disclosure Statement
    • Disclaimer
    • Privacy Policy
No Result
View All Result
Sir Boateng Online
No Result
View All Result
Home Arduino Projects

Arduino Bluetooth Locking System with MIT App Inventor

Sir Boat by Sir Boat
18th August 2023
Reading Time: 8 mins read
332 3
1
MIT App Inventor 2 with Arduino Uno and Bluetooth Module
Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com
ADVERTISEMENT

Welcome to Sir Boateng Online! Today I will show you how to make an App using MIT App Inventor 2 and use it to control the Arduino Bluetooth locking system such as the Arduino-based door lock system using HC 05 Bluetooth and Arduino Uno.

If you are unfamiliar with Arduino Uno, you can start from scratch with this previous tutorial, Arduino programming for beginners.

This project is far more secure than the traditional key-based system and electronic wireless lock system because it can generate a new password each time a user unlocks it, increasing your security level even further.

One disadvantage of using a key-based system is the possibility of your key being lost or stolen. Furthermore, an electronic wireless lock system that requires a password or passcode is not secure.

You are more likely to forget the password, and there is also a greater risk of a security breach by intruders.

Recommended Posts:

  • Proteus Locking System with Keypad and Pincode
  • Arduino Uno Programming for Beginners Part 1
  • Top 8 Arduino Projects in Proteus with Source Code
  • List of Final Year Engineering Projects for Students
  • How To Fix TM1 Laptop Sound Drivers

Sir Boateng Online platform is always concerned with security. That is why we created this one-of-a-kind and more secure Do-it-yourself smart locking system, which will eliminate all security threats while also providing better and more robust locking options.

In fact, you’ll also learn how to create your own Android apps with MIT App Inventor 2.

These are the materials needed for this project.

Table of Contents

  • List of Components
    • Related Posts
    • Arduino Pro Mini for Beginners (AVR Atmel Atmega328p)
    • Arduino vs Raspberry Pi: Which one is good for your project?
    • Arduino 4-Way Traffic System with Pedestrian button in Proteus
    • Coding of the Arduino Bluetooth locking system
    • Arduino Bluetooth Control system APP with MIT App Inventor 2
    • Download codes
    • Connecting the Components of Arduino Bluetooth Locking System.
    • MIT App Inventor 2 Bluetooth Locking: Testing the Complete Project.

List of Components

  • Arduino UNO
  • Bluetooth Hc05
  • Light Emitting Diode (LED)
  • Some Wires/Jumper Wires
  • Servo Motor/ Magnetic locker
  • 5V Battery/Power Bank
  • USB Type B for Programming Arduino

We can begin the project (Bluetooth Locking System with Arduino and MIT App Inventor 2) once we have obtained all of the above components.)

Related Posts

Arduino Pro Mini for Beginners (AVR Atmel Atmega328p)

Arduino vs Raspberry Pi: Which one is good for your project?

Arduino 4-Way Traffic System with Pedestrian button in Proteus

Coding of the Arduino Bluetooth locking system

To begin building this amazing security project with an App created with an MIT App Inventor 2, connect your Arduino Uno to your computer, open the Arduino IDE, and include all of the necessary libraries as well as declare all of the variables and constants.

After including the servo library, an array to generate a password was created. Following that, we created a few more strings and declared the password, OTP, and monitoring LED pin numbers, as shown below.

Arduino code snippet for arduino based door lock system
Fig 1. Arduino Code snippet

Bluetooth serial and Baud rate settings were also set. The Baud rate was set to 9600, but you can also use the HC 05 Bluetooth module’s default Baud rate of 38400. Then, we used the servo.attach to configure a pin for the servo (PWM pin number). OUTPUT was also assigned to the monitoring LEDs.

bluetooth locking system Settings
Fig 2. Setting I/O and Bluetooth

Looping was created to validate the data from the Bluetooth module. Using the if() statement, the device id is constantly checked. If it matches, it calls the otp() function to generate OTP, as shown in Fig. 3

checking arduino code
Fig. 3 Arduino code checking device Id

The check() function was also created to determine whether or not the OTP is correct. If it is correct, the servo is turned to the open position, as shown in Fig. 4 below.

Arduino code for checking OTP, Arduino Bluetooth Locking System
Fig. 4 Arduino code for checking OTP

The Arduino coding part is complete. Nothing can stop you now 😎 Charlie! Go Go, Let’s go to the next stage.

Read Also: How to control Home appliances (Light, Fan, Socket, TV, etc.) with your voice using Google Assistant.

Yes, it’s time to Androlize our project! 😍 Let’s create an Android app so we can access the project from our phones. The app can be created using one of two platforms: Android Studio or MIT App Inventor 2. Let’s use MIT App Inventor 2 for this project because it’s simple to use and creating an App with blocks without coding is awesome.

Arduino Bluetooth Control system APP with MIT App Inventor 2

Open MIT App Inventor 2 and sign in with your Google account. Create a new project and design a layout similar to the one shown in the image (Fig. 5). It’s as simple as dragging and dropping. Alternatively, you can download and import the provided code and modify it as needed.

App interface

After you’ve finished designing the layout in MIT App Inventor 2, click the Blocks tab to go to the block editing page, where you can define all of the logic.

The Bluetooth list of available connections was initialized first, as seen in the block editing window. Then, according to our Arduino code, a button function is set to send the device id, as shown in the figure below.

MIT app invertor block for arduino based door lock system
Fig. 6 MIT app inventor 2 coding blocks

Finally, download and install the App.apk from the MIT App Inventor 2 page on your Android phone. Congratulation! You have finished the software and coding components of your Arduino Bluetooth wireless locking system.

You can get the .apk, .aia file, and code from the link below.

Download codes

Download All the Project Files

Now let’s set up the hardware by connecting the several components.

Connecting the Components of Arduino Bluetooth Locking System.

Arduino PinsComponents and Pin
Arduino Pin 9(PWM)Servo Yellow Wire (signal input wire)
RxBluetooth Module TX
TxBluetooth Module RX
GNDGND Bluetooth
VCCBluetooth VCC
Pin 12LED
GNDBattery(-VE)

The complete circuit and connections are illustrated in the picture below.

schematic diagram of Arduino Bluetooth Locking System
Fig. 7 Connections of components.

Always double-check your setup to ensure that all connections are working properly. We’ve finished our fantastic project on the OTP-based Arduino Bluetooth locking system. Congratulations!

MIT App Inventor 2 Bluetooth Locking: Testing the Complete Project.

Connect the Arduino and all of its components to a power source. Open the installed App and turn on the phone’s Bluetooth. When you tap the Bluetooth icon, a list of Bluetooth connections for pairing will appear. Choose HC 05. When pairing is successful, the App will display a ‘connected’ message, as shown below.

MIT App Inventor 2 Bluetooth Locking app on android mobile device
Fig. 8 MIT App Inventor 2 App on the phone Showing connection status

Once the connection has been established, tap the key icon to send the device id to match. Then, tap the key again to LOCK or UNLOCK the system. The servo and Arduino’s onboard monitoring LED light up to indicate a successful LOCK or UNLOCK.

The servo was only used for demonstration purposes. You can modify the MIT App Inventor 2 App and the circuit to control any locking mechanism.

If you like this Bluetooth locking system, you may consider how to use Wi-Fi to control household appliances by diving into ESP8266, NodeMCU and Wemos for Arduino IDE.

I have personally built and tested this project. I am proud to say that it works to satisfaction. if you need help or components to build this project, Whatsapp me on +233266302607

Join Our Tech & Edu Forum
Tags: arduino projectsbluetooth projects
Share153Tweet96Send
Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com
Sir Boat

Sir Boat

Boateng Oduro is passionate about learning new technologies and working on them. He is a teacher and an engineer who loves to read, write, and teach. He's always curious about things and very determined to track the latest technologies and the trends for the future.

Related Posts

arduino pro mini for beginners, pinout and how to program
Arduino Projects

Arduino Pro Mini for Beginners (AVR Atmel Atmega328p)

28th February 2023
Arduino vs Raspberry Pi: Which one is good for your project?
Arduino Projects

Arduino vs Raspberry Pi: Which one is good for your project?

28th August 2023
4 - way Traffic system using Arduino Uno and Proteus ISIS
Arduino Projects

Arduino 4-Way Traffic System with Pedestrian button in Proteus

18th August 2023
home automation
Arduino Projects

Control home appliances with voice Using Google Assistant

18th August 2023
arduino uno programming
Arduino Projects

Arduino Uno Programming for Beginners Part 2

18th August 2023
arduino uno programming
Arduino Projects

Arduino Uno Programming for Beginners Part 1

18th August 2023
Next Post
ESP8266 Development Board Programming with Arduino IDE

ESP8266 Development Board Programming with Arduino IDE

FM transmitter Project Using only transistors

FM transmitter Project Using only transistors

Leave a Reply Cancel reply

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

Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com
ADVERTISEMENT

Categories

  • Applied Electricity & Electronics (4)
  • Arduino Projects (8)
  • Blogging (3)
  • Comparisons (3)
  • Education (34)
  • Electronics (21)
  • GES Resources (19)
  • NTC Resources (8)
  • Product and Service Reviews (6)
  • Proteus (2)
  • Scholarships (2)
  • TM1 Laptop (7)
  • Tutorials (18)
  • Universities & Colleges (8)
Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com Buy all your electronics, STEM, Robotics and IoT products and sensors from DIYgh TECH HUB diygh.com
ADVERTISEMENT

About Us

Sir Boateng Online is a platform for technology and electronic projects, tutorials, and educational resources. Aside from creating Tech tutorials, we provide Education, GES, and NTC resources such as teaching syllabi, lesson notes, scheme of work, GES promotion, and NTC trial questions. We help people, especially DIY enthusiasts, to create websites for blogging, businesses, and organizations such as schools, churches, clubs, etc.

Popular Categories

Applied Electricity & Electronics Arduino Projects Blogging Comparisons Education Electronics GES Resources NTC Resources Product and Service Reviews Proteus Scholarships TM1 Laptop Tutorials Universities & Colleges

Search for Articles

No Result
View All Result

Stay Connected

Follow Us

Subscribe to receive updates
  • About Me
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

© 2023 Sir Boateng Online by Lizbotech Engineering

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • TECH & ELECTRONICS
    • Arduino Projects
    • Proteus
    • Applied Electricity
  • TUTORIALS
    • Blogging
  • EDUCATION
    • GES Resources
    • NTC Resources
    • Scholarships
    • Universities & Colleges
  • REVIEWS
    • Comparisons
  • MORE
    • Contact Us
    • Disclosure Statement
    • Disclaimer
    • Privacy Policy

© 2023 Sir Boateng Online by Lizbotech Engineering