Safe w/ Fingerprint ID and Keypad
There are 3 components to the fingerprint ID and keypad-locked safe; the safe itself, the fingerprint sensor module, and the 4×4 keypad. They are all controlled by an arduino and powered by a set of batteries. The arduino will only send the unlocking signal when it receives signals of verification from the two sensors.
Area of Interest
My third milestone, and probably the most difficult one, was to combine both sketches of code into one final sketch. There was no guide or tutorial for how to do this, I had to try things over and over until I thought I found a result that I thought would be worth pursuing. At first I tried to use an if statement within an if statement, but the overhead statement was already inside of a function. I then learned that I could use boolean statements to register whether a character had two values, true, or false. I used boolean statements to register whether a statement was correct or incorrect. Using these statements, I was able to compile a proper sketch. I then wrote a bit of code that allowed for a blue LED to turn on when both boolean statements were true.
For my second milestone, I compiled a successful sketch of code used to control the keypad sensor. My plan was to compile a keypad sketch and a fingerprint ID sketch and to combine them later into a final sketch; this would be my third milestone. I had some trouble finding the code to use, but eventually I found some code that would become the foundation of my sketch. After programming a new passcode, flipping the keys, and writing a bit of code to use LEDs to recognize a correct and incorrect password, my keypad sketch was incomplete.
My first milestone was getting the fingerprint ID sensor to correctly function and also give me an output to differentiate recognized fingerprints from intruders. I wouldn’t say I had the best of starts; I couldn’t find a good enough diagram that matched the fingerprint sensor model I had so I had to play around a bit with the wires to figure out which ones were meant for inputs, ground, and power. I also had a lot of trouble wiring my LEDs and figuring out how to code them to work. With little prior knowledge to coding, it took a large chunk of time but eventually I figured it out. My final product works exactly as intended; A green LED shines when an enrolled fingerprint is recognized, and a red LED will blink when an unrecognized finger is tried.
How to customize the modules
All the customization is done in the config.js file within the MagicMirror folder. However, if I wanted to use a third party module, I would have to clone the repository into the MagicMirror/modules folder first. In the config.js file, I can choose where to display the module (top_left, center, bottom_bar, etc), the header, and the configurations specific to the individual modules. The configurations can be found at the GitHub repository.
Most modules use an Application Programming Interface. An API is set of protocols and routines to build software applications. For example, I use Twitter’s API. There are two types: Rest API (Data Base) and Search API (Connects to my account). In order to use an API, I needed an API key. API keys are used to track and control how to the API is being used i.e to prevent malicious use of the API. It also acts as unique identifier and as a secret token for authentication.
Every single module on my MagicMirror uses an API because I wanted a customized interface that suited my personal needs.