Sir Boateng
  • ELECTRONICS
  • TUTORIALS
  • ARDUINO
  • EDUCATION
    • GES Resources
    • NTC Resources
  • APPLIED ELECTRICITY
No Result
View All Result
Sir Boateng
  • ELECTRONICS
  • TUTORIALS
  • ARDUINO
  • EDUCATION
    • GES Resources
    • NTC Resources
  • APPLIED ELECTRICITY
No Result
View All Result
Sir Boateng
No Result
View All Result

Arduino Bluetooth Locking System with MIT App Inventor

by Boateng
6th November 2022
in Arduino Projects
221 2
1
MIT App Inventor 2 with Arduino Uno and Bluetooth Module
255
SHARES
797
VIEWS
Share on FacebookShare on TwitterShare on WhatsApp

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.

Article Navigation

  • List of Components
    • 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.)

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.

SEE ALSO:  Arduino Uno Programming for Beginners Part 1

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.

SEE ALSO:  Arduino Uno Programming for Beginners Part 2

The Bluetooth list of available connections was initialised 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 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

Tags: arduino projectsbluetooth projects
Previous Post

Transistors: The grandmaster in Modern Electronics

Next Post

ESP8266 Development Board Programming with Arduino IDE

Boateng

Boateng

Leave a Reply Cancel reply

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

Recent Posts

ges vehicle maintenance allowance

GES Vehicle Maintenance Allowance Requirements

2nd February 2023
top 50 senior high schools in ghana

Top 50 Senior High Schools In Ghana 2023

26th January 2023
spiritan senior high technical school

Spiritan Senior High Technical School

19th January 2023
Innovative Project Ideas for Engineering Students

Innovative Project Ideas for Engineering Students

17th January 2023
prospectus for senior high schools in ghana

General Prospectus For Senior High Schools

26th January 2023
Courses and Prospectus of Mfantsipim Senior High School

Courses and Prospectus of Mfantsipim Senior High School

20th December 2022

Categories

  • Applied Electricity & Electronics (4)
  • Arduino Projects (8)
  • Blogging (2)
  • Business (4)
  • Education (25)
  • Electronics (21)
  • GES Resources (11)
  • NTC Resources (3)
  • Product and Service Reviews (3)
  • Proteus (2)
  • Tutorials (19)
Sir Boateng Online

Sir Boateng Online is a platform for electronics projects, tutorials and educational resources. Aside creating tech tutorials, we also provide GES and NTC resources such as teaching syllabus, lesson notes, scheme of work and NTC trial questions.

Popular Categories

Applied Electricity & Electronics Arduino Projects Blogging Business Education Electronics GES Resources NTC Resources Product and Service Reviews Proteus Tutorials

Stay Connected

  • About Me (Sir Boateng Oduro)
  • Forum
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

© 2021 Sir Boateng Online - Developed by Lizbotech.

No Result
View All Result
  • ELECTRONICS
  • TUTORIALS
  • ARDUINO
  • EDUCATION
    • GES Resources
    • NTC Resources
  • APPLIED ELECTRICITY

© 2021 Sir Boateng Online - Developed by Lizbotech.

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