Prepared by Tshepho | Last Updated: May 27, 2025, 05:25 AM CAT
1. Introduction
1.1 Purpose
This document outlines the system integration design for the Inventory Tracking System, aiming to ensure seamless interaction between the Raspberry Pi 3 GUI, RF Ideas RDR-7081AKU USB RFID reader, RP2040 microcontroller (for redundancy with RFID-RC522), 16x2 I2C LCD display, and CSV database. The goal is to enable efficient inventory management, with the RP2040 processing RFID scans and updating the LCD, while the Raspberry Pi 3 handles CSV logging, GUI updates, and verification of scanned data and transactions with the RP2040, ensuring mutual confirmation and reliable operation for a storeroom environment.
1.2 Scope
The scope includes integrating the Tkinter GUI (Raspberry Pi 3), RDR-7081AKU for primary RFID scanning, RP2040 firmware (Arduino) with RFID-RC522 for redundancy, a 16x2 I2C LCD for standalone data output, and CSV file system to facilitate tool tracking, borrower registration, and quantity management with bidirectional verification. It excludes external network connectivity (e.g., cloud storage) and hardware fabrication processes (covered in separate documentation).
1.3 Definitions and Acronyms
API: Application Programming Interface (not used here, but noted for future scalability).
USB HID: Human Interface Device (protocol for RDR-7081AKU).
I2C: Inter-Integrated Circuit (communication protocol for LCD).
SPI: Serial Peripheral Interface (communication protocol for RFID-RC522).
CSV: Comma-Separated Values (file format for transaction logging).
2. System Overview
2.1 System Description
The Inventory Tracking System is a Raspberry Pi 3-based solution designed to track up to 20 tools in a storeroom. It primarily uses the RF Ideas RDR-7081AKU USB RFID reader to scan tags via USB HID, with the RP2040 and RFID-RC522 as a redundancy mechanism. The RP2040 processes RFID scans, updates a 16x2 I2C LCD with scan results and Tkinter GUI messages, and verifies data with the Raspberry Pi 3. The Raspberry Pi 3 manages the Tkinter GUI, logs transactions to a CSV file, and confirms transactions with the RP2040, ensuring mutual validation. The system ensures reliability through a dual-RFID setup and dual-display capability.
2.2 System Architecture
The system comprises:
Front-End: Tkinter GUI on Raspberry Pi 3 for user input and display.
Primary RFID: RDR-7081AKU USB RFID reader using USB HID protocol.
Redundancy: RP2040 microcontroller with RFID-RC522 for backup RFID scanning and LCD control.
Display: 16x2 I2C LCD for standalone data output, controlled by the RP2040, showing GUI messages and scan results.
Database: CSV file on Raspberry Pi 3 for transaction logging.
Interfaces: USB HID for RDR-7081AKU; serial communication (via /dev/ttyACM0) between Raspberry Pi 3 and RP2040 for redundancy, LCD updates, and verification; I2C for LCD; SPI for RFID-RC522.
Reference: See Appendix 10.3 for the architecture diagram.
2.3 Integration Objectives
Enable seamless RFID scanning with RDR-7081AKU as the primary reader.
Implement RP2040 and RFID-RC522 as a reliable redundancy mechanism.
Ensure the RP2040 processes scans and updates the LCD with scan results and Tkinter GUI messages.
Allow the Raspberry Pi 3 to handle CSV logging, GUI updates, and verify scanned data and transactions with the RP2040.
Maintain data consistency in the CSV log file through mutual confirmation.
Provide an intuitive user experience through dual interfaces (GUI and LCD).
3. Integration Requirements
3.1 Functional Requirements
Primary RFID scanning via RDR-7081AKU (USB HID keyboard emulation).
Redundant RFID scanning via RP2040 and RFID-RC522 (serial commands like “SCAN”).
User authentication via RFID borrower tags (both readers).
Real-time GUI updates on Raspberry Pi 3 and LCD updates (via RP2040) reflecting scanned UIDs and GUI messages.
Bidirectional verification between RP2040 and Raspberry Pi 3 to confirm scanned UIDs and transactions.
3.2 Non-Functional Requirements
Performance: Response time under 2 seconds for RFID scans, GUI, LCD updates, and verification handshakes.
Scalability: Handle up to 20 items and 5 borrowers without performance degradation.
Security: Local CSV access restricted to Pi; serial communication encryption for verification (future enhancement).
3.3 Constraints
Budget: Limited to ~$187.50 (including RDR-7081AKU and LCD, excluding reused components like RP2040, RFID-RC522).
Time: 2-week timeline for full integration and testing (May 27 - June 9, 2025).
Technology: Must use existing RP2040, Raspberry Pi 3, and Fab Lab tools.
4. Integration Design
4.1 System Components
Component 1: Raspberry Pi 3 GUI: Handles user interface (Tkinter), CSV logging, USB HID input from RDR-7081AKU, sends messages to RP2040, and verifies transactions.
Component 2: RDR-7081AKU RFID Reader: Primary RFID scanning via USB HID.
Component 3: RP2040 Microcontroller (Redundancy): Processes backup RFID scans with RFID-RC522, manages LCD display via I2C, and verifies data with Raspberry Pi 3.
Component 4: 16x2 I2C LCD: Displays RFID scan results and Tkinter GUI messages independently of the computer, controlled by the RP2040.
4.2 Integration Points
USB HID Interface: RDR-7081AKU sends RFID UIDs as keyboard input to the Raspberry Pi 3.
Serial Communication: Bidirectional communication between Raspberry Pi 3 and RP2040 at 9600 baud.
Command: SCAN, Response: VERIFY: (RP2040 sends UID for verification).
Command: CONFIRM: (Pi 3 responds with VALID/INVALID).
Command: TEXT: (max 32 chars), Response: OK.
I2C Interface: RP2040 communicates with LCD (address 0x27) for display updates.
SPI Interface (Redundancy): RP2040 interfaces with RFID-RC522 for backup RFID scanning.
4.3 Data Flow
Data flows from the RDR-7081AKU to the Raspberry Pi 3 as USB HID keyboard input, updating the Tkinter GUI and logging to CSV after verification. The Raspberry Pi 3 sends `TEXT:` or `SCAN` commands to the RP2040. For scans, the RP2040 processes the RFID-RC522 data (if primary fails), sends `VERIFY:` to the Pi 3, and awaits `CONFIRM:`. Upon receiving `CONFIRM:VALID`, the RP2040 updates the LCD and the Pi 3 logs the transaction. The Pi 3 also sends GUI messages to the RP2040 for LCD display via `TEXT:`.
4.4 Interface Specifications
USB HID: RDR-7081AKU emulates a keyboard, sending UIDs as strings followed by a newline.
Serial Endpoint: Raspberry Pi 3 to RP2040 at 9600 baud.
Command: SCAN, Response: VERIFY:.
Command: CONFIRM:VALID or CONFIRM:INVALID, Response: OK.
Command: TEXT: (max 32 chars), Response: OK.
I2C: LCD address 0x27, 16x2 display, controlled by hd44780 library.
User scans an RFID tag with the RDR-7081AKU → UID is captured as USB HID input.
Raspberry Pi 3 updates the Tkinter GUI, sends VERIFY: to RP2040 (via RDR-7081AKU data).
RP2040 confirms the UID, sends VERIFY: back if scanned via RFID-RC522, and awaits confirmation.
Raspberry Pi 3 checks CSV or user input, sends CONFIRM:VALID (or CONFIRM:INVALID) to RP2040.
Upon CONFIRM:VALID, RP2040 updates LCD with “Scanned: ”, and Pi 3 logs to CSV.
If RDR-7081AKU fails, user scans with RFID-RC522 → RP2040 reads UID, sends VERIFY: to Pi 3.
Pi 3 verifies and sends CONFIRM:VALID, then logs and sends TEXT:Scanned for LCD.
User registers a borrower via a second scan, with verification and updates on both GUI and LCD.
5. Integration Strategy
5.1 Integration Approach
Primary integration via USB HID with RDR-7081AKU, with serial integration for RP2040/RFID-RC522 as a redundancy mechanism and for LCD updates and verification, using a phased approach to test each component.
5.2 Tools and Technologies
Python 3.13.3: For Tkinter GUI and USB HID input handling on Raspberry Pi 3.
Arduino IDE: For RP2040 programming (hd44780, RFID-RC522 libraries).
OpenSCAD: For 3D enclosure design.
KiCAD: For custom PCB design.
Live Server (VS Code): For webpage documentation preview.
5.3 Phased Integration Plan
Phase 1 (May 27-30): Integrate Tkinter GUI with RDR-7081AKU (USB HID) and test LCD display of GUI messages via RP2040.
Phase 2 (May 31-June 3): Add RP2040 and RFID-RC522 for redundancy, test serial communication and initial verification.
Phase 3 (June 4-6): Implement full bidirectional verification, connect CSV logging, and test workflow with dual displays.
Phase 4 (June 7-9): Package in 3D-printed enclosure, final testing.
6. Testing and Validation
6.1 Testing Strategy
Conduct unit tests for RDR-7081AKU (USB HID input), RP2040/RFID-RC522 (RFID scan, serial), and LCD (I2C output), integration tests for data flow and verification between RP2040 and Raspberry Pi 3, and end-to-end tests with 10 tools and 5 borrowers.
6.2 Test Cases
Test RDR-7081AKU scan returns UID within 2 seconds, triggers VERIFY:, and displays “Scanned: ” on LCD after CONFIRM:VALID.
Test RFID-RC522 scan (via RP2040) returns VERIFY: within 2 seconds, updates GUI and LCD after confirmation.
Test Tkinter GUI message (e.g., “TEXT:Stock Check”) displays on LCD within 2 seconds.
Test verification handshake: RP2040 sends VERIFY:, Pi 3 responds with CONFIRM:VALID or CONFIRM:INVALID within 2 seconds.
Test failover mechanism switches to RFID-RC522 seamlessly, with consistent verification.
6.3 Validation Criteria
99% success rate for RFID scans (both readers).
<1% error rate in USB HID, serial communication, I2C updates, and verification handshakes.
Data consistency in CSV logs and LCD display across both readers and GUI messages.
7. Deployment and Maintenance
7.1 Deployment Plan
Deploy on Raspberry Pi 3 with MicroSD card, with the LCD powered via the RP2040. Test in a staging environment (local workshop) before storeroom use.
7.2 Monitoring and Maintenance
Use Pi’s terminal logs and LCD output for debugging. Schedule weekly CSV backups to a USB drive and monitor serial verification logs.
7.3 Rollback Plan
Revert to a previous Python script, RP2040 sketch, and CSV backup if issues arise.
8. Risks and Mitigation
8.1 Potential Risks
RDR-7081AKU USB disconnection or failure.
RFID-RC522 range issues with multiple tags in redundancy mode.
Serial communication delays or failures during verification handshakes.
I2C communication failures affecting LCD updates.
8.2 Mitigation Strategies
Implement failover to RFID-RC522 with user prompt if RDR-7081AKU fails.
Test RFID-RC522 range with shielding (e.g., acrylic separators).
Implement timeout mechanisms for verification (e.g., 2 seconds) and retry logic.
Ensure stable I2C connections and verify serial port availability.
9. Conclusion
This document provides a comprehensive plan for integrating the Inventory Tracking System components with dual RFID readers (RDR-7081AKU and RFID-RC522 for redundancy) and dual displays (GUI and LCD), ensuring efficient division of labor between the Raspberry Pi 3 and RP2040, bidirectional verification of scanned data and transactions, seamless data flow, real-time updates, and reliable operation for storeroom management.
10. Appendices
10.1 References
RP2040 Datasheet (Raspberry Pi Foundation).
RFID-RC522 Datasheet (NXP Semiconductors).
RF Ideas RDR-7081AKU Manual (RF Ideas).
Andrew’s FabAcademy Project (May 15, 2025).
10.2 Glossary
Middleware: Software facilitating communication (not used here but noted for future).
USB HID: Protocol for RDR-7081AKU input.
10.3 Diagrams
System Architecture Diagram: [To be added after KiCAD/Visio design, showing Raspberry Pi 3 → USB HID → RDR-7081AKU; Serial (bidirectional) → RP2040 → SPI/RFID-RC522, I2C/LCD].