Keyless / RFID Smart-City-Usecase Part 1

Written by Marvin Siegert

Open the door via RFID & MQTT

Friday, 27 May 2016 00:00

The Smart City continues to grow. In our small Lego city (Smart City), we combine many smaller showcases in the field of Internet of Things (IoT). We have found a use case for many sensors. Traffic monitoring, traffic light control, fire alarms or the trash level control have been implemented and will be reported gradually in the coming blog posts.

This article deals with yet another Showcase – the contactless opening of a door via RFID or via MQTT Message. The aim of the showcase was to employ the RFID technology and to use the communication within our MQTT network.

The User-Stories

The User-Stories

As a resident of Smart City, I should not have to carry my keys with me any more, but open the doors of my house by means of an RFID tag.

Success Criteria:
  • A house was built from Lego
  • 3 LEDs (green, yellow, red) are placed.
  • An RFID reader is mounted.
  • The green LED on the door is lit, when the door is open
  • The red LED on the door is lit, when the door is locked
  • The door opens when a known RFID tag is detected by the reader
  • The door remains open for 5 seconds
  • When an unknown RFID tag is detected, the red and yellow LEDs flash alternatingly for 5 seconds
  • When an unknown RFID tag is detected, the LED light chain available in the MQTT network is triggered to blink red for 5 seconds long.

User Story 2

As a resident of Smart City, I want to open the doors of my house by entering a 4-digit code on my smartphone.

Success Criteria:
  • A mobile application was created
  • In the application, the user can enter a 4-digit numerical code
  • In the application, the user can send the code
  • The application is available both as native as well as a webapp

User Story 3

As a resident of Smart City, I want to see my scheduled appointments for the day, as I enter my house.

Success Criteria:
  • There was a connection made to the Google calendar.
  • The scheduled appointments for the day will be filtered.
  • The user will be informed about the filtered appointments.

The Planning

For an IoT project, the implementation comprises of a combination of hardware and software. On the hardware side we will be using the following equipments:

  • The Osram Lightify Led-Stripes (Zigbee-Protokoll) from the fire-station Showcase [1]
  • A Raspberry Pi
  • An RFID Reader 125 kHz [2]
  • An LCD Display [3]
  • A Loud speaker
On the Software side the following components come of use:
  • Python Script to implement the Logic [4]
  • The Debian Derivative Raspian for Raspberry [5]
  • Paho MQTT Library (JavaScript & Python) [6]
  • Ionic Framework for the Webapp / Native App [7]
The individual components are connected to each other wireless as shown:

[1] http://www.elv.de/osram-lightify-starterset-mit-gateway-und-2-m-rgb-led-streifen.html
[2] http://www.seeedstudio.com/wiki/index.php?title=125Khz_RFID_module_-_UART
[3] http://www.amazon.de/HD44780-Module-Display-Anzeigen-Zeichen/dp/B009GEPZRE/ref=sr_1_1?ie=UTF8&qid=1446553796&sr=8-1
[4] https://www.python.org/
[5]https://www.raspberrypi.org/downloads/
[6]https://eclipse.org/paho/
[7] http://ionicframework.com/

In the next part of this blog series we will be going into the technical details precisely and explain RFID and MQTT in conjunction with WebSockets.