RFID Badge In/Out System

Enterprise Hardware Integration & Real-Time Access Control

🏢 Project Context

During my tenure as Enterprise Systems Analyst at OMP (2014–2019), I was part of a lean but powerful IT team of 4 supporting 700 staff across the entire enterprise IT landscape. This project exemplifies the type of comprehensive hardware-software integration solutions I developed to enhance security and operational efficiency.

As a small team managing cybersecurity, programming, and IT infrastructure, we needed solutions that were robust, maintainable, and scalable. This RFID badge system demonstrates the intersection of hardware integration, real-time processing, and enterprise security requirements.

What This System Accomplishes

This RFID Badge In/Out System provides comprehensive access control and attendance tracking through seamless hardware-software integration:

  • Hardware Layer: RFID reader scans badges and transmits badge IDs via serial port (COM), USB, keyboard wedge, or network API
  • Software Layer: Custom .NET application processes RFID inputs in real-time and manages entry/exit logic
  • State Management: Intelligent tracking of badge status ("IN" or "OUT") with automatic state transitions
  • Data Persistence: Comprehensive logging with timestamps, user identification, and audit trail capabilities
  • Enterprise Integration: Designed for integration with existing HR systems and security infrastructure

Technical Implementation

The system architecture demonstrates key enterprise development principles:

  • Real-time Processing: Event-driven architecture for immediate badge scan processing
  • Thread Safety: Proper synchronization for multi-threaded badge scan handling
  • Error Handling: Robust exception management for hardware communication failures
  • Scalable Design: Easily extensible for additional RFID readers or integration points
  • Audit Compliance: Complete logging for security and compliance requirements
C# Implementation - RFID Badge System
using System;
using System.Collections.Generic;
using System.IO.Ports;

class Program
{
    // In-memory badge states: badgeID => true (IN) or false (OUT)
    static Dictionary<string, bool> badgeStates = new();
    static SerialPort serialPort;

    static void Main(string[] args)
    {
        Console.WriteLine("RFID Badge In/Out System Starting...");

        // Configure RFID reader's COM port and settings
        serialPort = new SerialPort("COM3", 9600, Parity.None, 8, StopBits.One);
        serialPort.DataReceived += SerialPort_DataReceived;

        try
        {
            serialPort.Open();
            Console.WriteLine("Listening on COM3 for RFID badge scans...");
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Failed to open serial port: {ex.Message}");
            return;
        }

        Console.WriteLine("Press any key to exit...");
        Console.ReadKey();

        if (serialPort.IsOpen)
            serialPort.Close();
    }

    private static void SerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
    {
        try
        {
            string badgeId = serialPort.ReadLine().Trim();

            if (string.IsNullOrEmpty(badgeId))
                return;

            ProcessBadgeScan(badgeId);
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error reading serial data: {ex.Message}");
        }
    }

    private static void ProcessBadgeScan(string badgeId)
    {
        lock (badgeStates)
        {
            bool isIn = badgeStates.ContainsKey(badgeId) && badgeStates[badgeId];
            bool newState = !isIn;
            badgeStates[badgeId] = newState;

            string stateText = newState ? "IN" : "OUT";
            string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

            Console.WriteLine($"[{timestamp}] Badge {badgeId} scanned: {stateText}");
            
            // Enterprise Integration Points:
            // - Save to SQL Server database
            // - Send to SIEM for security monitoring
            // - Update Active Directory last logon
            // - Trigger email notifications for after-hours access
        }
    }
}

Enterprise Impact & Results

This project delivered measurable improvements to OMP's security and operational efficiency:

  • Security Enhancement: Real-time access monitoring and automatic audit trail generation
  • Operational Efficiency: Eliminated manual attendance tracking, reducing HR administrative overhead
  • Compliance: Automated logging ensured consistent security audit trail for 700+ employees
  • Scalability: System architecture supported additional readers and integration points as needed
  • Cost Effectiveness: Leveraged existing badge infrastructure with minimal hardware investment

Technical Notes

Implementation Details: This sample demonstrates core system architecture and can be adapted for various RFID hardware configurations. COM port settings should be adjusted based on specific hardware requirements. Production implementations would include database persistence, web service integration, and comprehensive error handling.

Disclaimer: This is a representative example of work completed at OMP, designed to showcase technical capabilities and system design approach. Code samples are illustrative and do not contain proprietary or sensitive information.