We are a group of three students living together in a shared apartment. Of course all of us have our own keys, that are held on a shared keyholder. We regularly run into the problem that one of us forgets or can't find his key. That is why we created our project Practikey, a smart keyholder that keeps track of our keys and displays the current status of each key in a Web-App that all of us can see.
First stepsIn order to implement this project, we needed to think about some technical aspects. One of the most important aspects is, how the detection of different keys at the keyholder board can be implemented. After considering different technology approaches we evaluated that we want to do detection with keychains similar to the popular Marshall keyholders.
Key detectionThe key detection works through different resistors that are mapped to the different keys of the roomates.
The electrical circuit has a fixed resistor of 220 Ohm for each keyhole in the board. For the measurement of the resistor in the key we use a ohm-meter that is described in this article. This is a quick schematic of the electrical circuit:
In our case the unknown resistor is the one that is soldered into the jack plug. In our github repository you can see how the code looks like to calculate the resistance at the analog inputs of the controller.
Architecture OverviewThe device comes with cloud support out of the box, this makes it easy to Publish cloud events. To have access to the internet the Particle Photon needs to be connected to a local Wifi network, that supports 2, 4Ghz. Particle makes it easy to flash code onto the device with their Web IDE.The next component is a small node.js webserver that subscribes to the events of the Particle Photon and provides a HTTP-web api. The API is then used in a frontend component (written in react in our case).
Since we use the Particle Photon microcontroller, we have direct access to the Particle Cloud, that allows us to receive events from the controller.There are two events used to communicate the status of each key. The event "Came Home" is triggered when a key is inserted into the keyholder and "Left Home" is triggered when a key is removed. The events contain data, which holds the name of the person mapped to the key. The status is updated through regular polling of the measuring analog inputs. The event stream is then accessed with the Particle API JS SDK. The SDK allows us to subscribe directly to the relevant event names.
WebAppThe UI of the web app is written in React and has a minimalist design. The initial version of the web app fetches the current status of each key from the API and displays which key is currently on the keyholder.
For future versions, more customization options are planned, as well as a chat function within the web app, which has already been teased alongside the current status.
DesignTo hide the technology from a user, everything is placed in a 3D-printed enclosure. The Enclosure is printed in PLA. You have the option to adjust the infill settings, ranging from 10 to 100%. For a higher quality feel of the enclosure, it is recommended to opt for a higher infill percentage. The printing duration is approximately 20 hours on a standard mid-range printer.
The easiest method to secure the jack plugs in the enclosure is to drill holes at the marked locations. There are threads on the back of the jack plug, allowing you to firmly secure it in place.
Comments
Please log in or sign up to comment.