กลับไปหน้ารวมไฟล์
access-control-with-ruby-on-rails-esp32-rfid-d25b91-en.md

***This is a proof of concept for our business.***

Our Needs

We need an Access Control System that reads from a server (lets call it "Contracts Server") if a tenant is allowed to have access to his/her office based on:

  • Is his office?
  • His/Her boss allows his/her employee to be at office before the boss arrives
  • Is the rent paid?
  • It should be bilingual

So, if is not his/her office, or the tenant do not want his/hers employees to be at office when he/she isn't, or if the rent payment is overdue, access to the office should be denied.The ERP that we are developing is being developed in Ruby on Rails.

The Development of the Proof Of Concept:

FIRST we create an extremely simple application that validates the RFID cards. This simple app lacks all security measures and data integrity. It was created exclusively to be able to test the code that will be used in the ESP32

THESE ARE THE VIDEOS FOR THE CREATION OF THE APP

Creating the App in the server with Ruby on Rails

Testing the App in the Server

Adapting the code to respond to the ESP32

Testing the responses from the server

Interaction between the ESP32 and the Ruby on Rails App

Tobedevelpedforthefinalversion(production):

  • The app will control over 60 doors, so we will install an DS2401 transistor on each circuit so it has a unique serial number that will be used for linking each door to each circuit wich might have several RFID card linked to it.
  • The code at the server, needs tons of improvements like, security, validation, sheduling, logging of the RFID cards activity, and so on
  • We need to find a library for 2 way encription of the data transmited from the ESP32/Server to presuade an attack (hacking)
  • To create the case for the circuits (printed with a 3D printer)
  • To define several mechanisms that can be adapted to the handles that the doors currently have

EXPANDED TECHNICAL DETAILS

Full-Stack IoT Integration

This project bridges the gap between low-level hardware and professional web frameworks, creating a robust, enterprise-ready access control system.

  • Microcontroller Hub: The ESP32 serves as the primary controller, utilizing its built-in WiFi to communicate with a remote server. It interfaces with an RC522 RFID reader to scan individual tags.
  • Ruby on Rails Backend: The server is built with Ruby on Rails, managing a PostgreSQL database of authorized users and access logs. The ESP32 sends a POST request with the scanned UID, and the Rails API responds with an 'authorized' or 'denied' status.

Advanced Security Features

  • Real-Time Web Dashboard: Administrators can monitor access attempts in real-time through a secure web interface.
  • Digital Logs: Every entry and exit is timestamped and recorded, providing a complete audit trail for security compliance in a modern office or laboratory environment.

ข้อมูล Frontmatter ดั้งเดิม

title: "Access Control with Ruby on Rails + ESP32 + RFID"
description: "Access control proof of concept using Ruby on Rails with ESP32 and RFID"
author: "addicttux"
category: ""
tags:
  - "esp32"
  - "ruby on rails"
  - "access control"
views: 8772
likes: 1
price: 2450
difficulty: "Intermediate"
components:
  - "1x I2C LCD"
  - "1x Pushbutton Switch, Pushbutton"
  - "1x Relay (generic)"
  - "1x Buzzer"
  - "1x ESP32"
  - "1x Arduino Nano R3"
  - "1x NeoPixel Ring: WS2812 5050 RGB LED"
  - "1x RFID Module (Generic)"
  - "1x RGB LCD Shield Kit, 16x2 Character Display"
tools: []
apps:
  - "1x Fritzing"
  - "1x Linux (Mint)"
  - "1x Arduino IDE"
  - "1x circuito.io"
  - "1x Tinkercad"
downloadableFiles: []
documentationLinks: []
passwordHash: "3b155c04fc77a6ddf447eb773de4d2545e7c78996dbfd46baa746c98bed95512"
encryptedPayload: "U2FsdGVkX1/cse+ERw+GUP+dhzFomChviudQ+WJB5PyjtFMbI10QBeUADrPEx9erTULi6a5ANCrCLdTbZ8FPgLfS/HeehQpxlivwJGWMSi8s/HOqm6/3iTuMXa8rFpflWOSV/d65bOIlka1L2eERPLTHzBqnBKln99TPycxUxc9MeUmgZaN7rQu/n4hwLr7h"
seoDescription: "Access control proof of concept using Ruby on Rails with ESP32 and RFID technology."
videoLinks:
  - "https://www.youtube.com/embed/eTyzdUI1WZo"
  - "https://www.youtube.com/embed/0M3jjU8zcDc"
  - "https://www.youtube.com/embed/Ud299vrrFuA"
  - "https://www.youtube.com/embed/koWwYBcHZcw"
  - "https://www.youtube.com/embed/s2OFASpiNh0"
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/access-control-with-ruby-on-rails-esp32-rfid-d25b91_cover.jpg"
lang: "en"