Abstract
Two blue-tooth modules operate as a lock and key to secure a bag. When the key is within range of the lock module, it will trigger the lock module to mechanically open the bag. When the key is not in range, the lock will automatically lock. If possible, the key module will be replaced by a smartphone in the future.
Motivation
From the penn police, we learned that the number 1 crime on campus is unattended theft and we noticed that signs are placed everywhere in public spaces such as in dining halls, pottruck, and in libraries in an attempt to warn us to be more mindful of our belongings. However, sometimes you need to get up to go to the bathroom or get another serving of food. We wanted to come up with a more tangible solution to this problem so that’s when we came up with the proximity lock. Our product incorporates the idea of using bluetooth for proximity sensing.
When our paired bluetooth modules are connected, in other words, they are within a certain proximity with one another, the lock which is controlled by a servo attached to the side of the box wired to the slave module will open. When the modules are disconnected, the servo will turn the lock and secure the box. This way, you will no longer have to think about having to lug everything with you if you needed to use to bathroom or bother the stranger at the other table to watch over your belongings. Your items will be automatically secured with the proximity lock.
We also attached a photoresistor to the inside of the box and wired it to communicate with an LED on a breadboard outside the box to conveniently inform us when the box is open and/or closed. When the box is open, the LED will light up and when the box is closed, the LED will be off.
Process & Tech Specs
We accomplished the proximity sensing with two HC-05 bluetooth modules paired as a master and a slave (or a key and lock). Each is controlled by an Arduino microcontroller. The “lock” controller is connected to a TowerPro SG-5010 standard servo that operates the latch on the box to lock it. The “key” module sends out a simple character byte ten times a second. While the lock controller is reading this data from its module, the box remains unlocked. Once the lock controller reads no data received from its module, the box locks itself. This allows the box to lock and unlock as the modules disconnect and reconnect.
The light sensing was accomplished with a photoresistor in a simple voltage divider. The changing voltage across the photoresistor is measured by the lock controller, which then turns on an LED if the voltage read is high (indicating that light is hitting the photoresistor and the box is open), and turns off the LED when the voltage read is low (since less light is hitting the photoresistor and the box is closed). Photos of the complete circuit and assembly can be found at the top of the page.
We started simply with our two bluetooth modules communicating simple logical data (sending a signal of a button pressed from the master to have the slave turn on an LED). This was just to verify that the bluetooth modules were communicating properly. Then, we were able to modify the slave or lock’s programming to control an output (still an LED turning on and off at this point) if it’s receiving the proper data sent by the key module. We then replaced the LED with the servo, having it turn to 90 degrees when the modules weren’t connected and 0 degrees when they were connected. Finally, we constructed our box and connected our servo and latch, adding the light sensor and its output LED as well.
Challenges & Solutions
One of the first hurdles we had to cross was simplifying the idea to be tangible for a finished product. Rather than a lock attached to a bookbag, we switched our idea to a lockbox in order to more clearly and consistently demonstrate the purpose of the project.
In assembling the project, simply pairing the bluetooth modules was a significant challenge. This was accomplished through lots of troubleshooting and consulting online forums. We also had problems with long response times with the modules when disconnected or connected. We found that our slave module was receiving data much faster than our controller was reading from it, resulting in the data getting backed up in the controller’s serial buffer. We fixed this by adjusting our program to read in data just as fast as it was being transmitted by the master module.
Lastly, in the physical assembly of the box, we struggled with the exact dimensions for getting a solid structured box by a press fit. This problem was dodged by wood glueing our MDF faces together to construct the box.
What We Learned
We learned that there may be a lot of improvising and that from developing our idea into a product, we needed to be more realistic about what we wanted our product to do and the way we wanted our product to look. We realized that within the limited time we were given, we wanted to focus more on getting our product to actually work so we had to sacrifice the aesthetics of the product and made it in a way to most efficiently display its function.
Next Steps
Physically, the box itself could be more structurally robust and secure. The servo blades don’t mount extremely well and could be pulled off. The concept of the project could also be easily broaden and more streamlined. The same idea using Bluetooth communication could be applied to bike locks, bookbags, cars, or buildings. Additionally, the master/key module could be replaced with a Bluetooth-enabled smartphone, which is conveniently always on your body.
Code:
https://docs.google.com/document/d/1li-JcZirdCxo1yIwwXNUzz_PvOrkN-Vju2jPxnlRl9I/edit?usp=sharing
Log in or sign up for Devpost to join the conversation.