本研究旨在利用光的RGB成分,我們設計與實作一套基於FPGA平台的紅藍雙色光控制與光學密碼辨識系統,結合可調式 PWM 輸出與 RGB 感測技術,透過調控紅光與藍光LED的PWM輸入值與空間配置,產生特定的光輸出,並由TCS34725光感測模組量測LED發出的RGB值,作為辨識依據。系統由Xilinx Arty S7-25開發板與MicroBlaze處理器實作,使用UART進行外部數據通訊,並結合Python與Tkinter建立圖形化介面以進行密碼校正、記錄與送出等功能。實驗中,我們先校正環境光,接著在Tkinter GUI中輸入不同紅藍密碼組合,記錄下所對應到的RGB感測值當成我們的密碼。實驗結果證明此系統在不同組合的紅藍光密碼輸入時,感測值之間仍具有足夠的分離度,幾乎不會產生重複的RGB組合,證明了感測值具備良好的唯一性與硬體差異性。接著我們驗證了LED與感測器在不同距離下(1cm~6cm)的 RGB 感測值都有極高的準確率(>97%)。在穩定性方面也有優異的表現,呈現極小的變異係數(<0.6%)。解析度方面隨著LED距離感測器由近到遠遞減,但仍保持良好的解析度。解鎖成功率在其容忍範圍內達到了100%的解鎖率,展現其系統的精確性。搭配藍芽可以同時使用電腦與手機監控 RGB 感測值變化,提升應用的靈活性與遠端監控能力。綜合而言,本系統不僅驗證PWM控制與感測輸出關係,亦提供一種結合空間配置與光學成分的密碼辨識方式。 ;This study aims to utilize the RGB components of light by designing and implementing an FPGA-based dual-color (red and blue) light control and optical password recognition system. The system integrates adjustable PWM output with RGB sensing technology. By modulating the PWM input values and spatial arrangement of the red and blue LEDs, specific light outputs are generated and measured by the TCS34725 RGB sensor module for authentication. The hardware uses a Xilinx Arty S7-25 development board with a MicroBlaze processor, and UART is employed for external data communication. Additionally, a Python-based GUI using Tkinter facilitates password calibration, recording, and input functions. In the experiments, we first calibrated ambient light, then input various red-blue password combinations through the GUI and recorded the corresponding RGB sensor values as passwords. Results demonstrate that the RGB readings under different combinations maintain clear separation with virtually no duplicates, proving excellent uniqueness and hardware variability. Tests showed RGB sensing accuracy remains high (>97%) across LED-to-sensor distances (1cm to 6 cm). The system also exhibits outstanding stability with a very low coefficient of variation (<0.6%). Although resolution decreases with distance, precision remains good. Within the set tolerance, a 100% unlocking success rate was achieved, showcasing system accuracy. With Bluetooth integration, computers and smartphones can monitor RGB variations simultaneously, enhancing flexibility and remote capability. In summary, this system not only verifies the relationship between PWM control and sensing output but also offers a password recognition method that combines spatial configuration with optical components.