USB containing encrypted binary file (key) gets inserted into microcontroller. Microcontroller sends file via Bluetooth to parent App on PC. Parent app decrypts file and verifies whether or not it is valid. If it is valid, parent app sends a signal to microcontroller to trigger unlocking mechanism. If file is not valid, parent app sends microcontroller a failure message and sends a text message to administrator's phone.
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Plan
Make a plan for the design of the system.
Step 2: Hardware (Part 1)
Connect microcontroller to PC via PmodBT2 to enable Bluetooth connection. USB is inserted in microcontroller, microcontroller reads binary file from USB and transmits byte by byte to Brain App. Receives response over same stream after Brain is done processing.
If received string == "Success"
assert drawer mechanism
flash red LED
Step 3: Hardware (Part 2)
Design and laser cut drawer components. Design lock mechanism. Build drawer. Connect drawer to microconroller assert pin, determined by breadboard connection. Sends voltage to pin and asserts servo motor.
Step 4: Software (Part 1)
Code parent app. Key encryptor creates a binary file and writes to mounted USB. Brain app is paired with microcontroller already. Waiting for data transfer in an infinite loop. Once byte stream is detected, read in ALL bytes and compare to accepted byte array. If it is a COMPLETE match, send success string to microcontroller. If not, send failure string and text message to group members.
Step 5: Brain App Sim
u + Enter simulates a positive match. It is actually reading from G drive on a PC so make sure a USB with the valid key is plugged in. It will send a "Success" text message to Cammi and Greg.
i + Enter simulates a failure. It will send a "Failure" text message to Cammi and Greg.
Executable is attached but will likely fail every time with no USB connected to G drive.
Step 6: Text Message Alerts
We used the Twilio API to programmatically send text messages to our group members. We had to buy "messages" and a phone number and the feature works flawlessly.
Step 7: Demo
Attached is a video of our Brain app demo. The iPhone screen shot contains the resulting alerts that were programmatically sent.
Step 8: Closing Remarks
What we got done: