Thanks to various customer projects in IoT environments, we have relevant experience and expertise in developing our own hardware components. In one of our previous blog posts (HR dashboard), we already reported on how our Xperts are using their expertise to take our internal processes to a new level.
Our Xperts are currently working on a new solution for the check in and check out process for the free lunch buffet at our offices. The buffet is offered twice a week as part of the Work & Enjoy programme and not only makes for an entertaining break, but also helps build good team spirit. This offer creates a non-cash benefit that leads to tax liability. In order to tax the benefit correctly, a list has so far been provided on which employees note their participation on the respective day.
Even if this list seems to be the most obvious and simplest choice, it does have some disadvantages:
- Data protection concerns
- Excessive data collection
- Complex analysis
- Does not meet the requirements of a modern IT company
How can this process be simplified and improved with the expertise of our Xperts?
In order to fulfil our own standards, we finally decided to go digital. The main aim was to reduce the effort involved in collecting and processing data. The decision was quickly made in favour of a solution that utilized our door opening chip, which all IT Sonix employees have and use on a daily basis. This chip can be read with an RFID reader and the recorded data can then be stored and analysed anonymously in a web application.
The door chip is read via an ESP8266 chip that is connected to an RFID reader. We rely on the proven D1 Mini development board for this. Availability and price were the key factors in this decision. In addition, this IoT module supports USB and the necessary I/O ports are also easily accessible. In order to best fulfil the desired hardware requirements for our use case, we created our own casing using a 3D printer and then positioned the hardware appropriately. An external power bank provides the power supply via USB.
For ease of use, we installed the "Tasmota" firmware on the D1 board using the web installer. This allowed us to use the 125KHz RFID reader type RDM6300 without any programming effort, which was easily soldered to the I/O and power pins of the D1. All that remained to be done was to select the correct pin via the Tasmota web interface and the ID of each door chip will be read out. As these IDs represent indirect personal data, they are hashed using the bcrypt method and a random salt and thus anonymised.
We decided to use AWS as our cloud infrastructure for the following reasons:
- Sales aspects due to increased customer enquiries
- Knowledge building for the Xperts involved
- Simple connection from Tasmota possible
- Serverless MQTT broker through AWS IoT without configuration effort
Based on our experience with IoT applications, we have decided to keep the majority of the required infrastructure (messaging, persistence) serverless. This approach is not only common practice, but also offers considerable cost benefits.
Implementation in AWS
Tasmota creates a message with the identification number of the door chip including date and time. This is sent to AWS IoT and then forwarded to AWS SQS (Simple Queue Service) using an IoT event rule. AWS IoT works without persistence in principle, so the ability of SQS to retain the data for four days created a suitable solution. In this way, data loss can be avoided in the event of a short-term failure of the backend service.
The service was created with Spring Boot and consumes the messages stored on the SQS Topic and stores the data in a NoSQL database (DynamoDB). The solution also prevents events from being processed multiple times which can be caused by employees repeatedly holding their door chip to the reader. An e-mail with the number of events is automatically sent to our accounting department every day. The data is also provided via a REST interface.
We plan to extend the system to be able to query the number of seats still available based on the check-in events. This should be made usable for all employees via an intuitive web application. An anonymized feedback function including evaluation is also in the planning.