How mh-electronic/capstone_fpga-driven-medicine-dispenser works
This repository implements a cloud-connected medicine dispenser: a doctor records prescriptions, a patient scans an RFID card and selects a visit, and the server sends medication quantities to FPGA-controlled dispensing hardware. Staff can monitor stock, dispensing logs, and an ESP32-CAM video feed. The README documents several hardware and monitoring capabilities; the available source excerpts support the web, Firebase, and UART interactions, while internal HDL wiring is only represented at the top-level/module level.
Main entry points: app.py Dispenser Web Server · system_top.v FPGA System · auth.js Doctor Authentication · app.js Prescription Entry
Components 24
Clinical Workflow
- Doctor Portal
web/Doctor_Interface/login_page.html - Doctor Authentication
web/Doctor_Interface/auth.js - Prescription Entry
web/Doctor_Interface/app.js - Firebase Client Setup
web/Doctor_Interface/firebase-config.js
Patient Dispensing
- Patient Interface
web/User_Interface/templates/auth.html - RFID Scan UI
web/User_Interface/static/auth.js - Dispenser Web Server
web/User_Interface/app.py - Patient and Stock Data
web/User_Interface/firebase.py - Visit Selection
web/User_Interface/static/schedule.js - Prescription and Dispense UI
web/User_Interface/static/prescription.js
Dispenser Hardware
- FPGA System
HDL/system_top.v - Protocol Handler
HDL/protocol_handler.v - RFID Reader
HDL/rc522.v - UART Controller
HDL/uart_controller.v - Servo Control
HDL/servo_driver.v - Dispense Motion FSM
HDL/servo_fsm_unit_anticlockwise.v
Staff Monitoring
- Monitoring Dashboard
web/Monitoring_Dashboard/index.html - Monitoring and Logs
web/Monitoring_Dashboard/script.js - ESP32-CAM
ESP32_CAM/ESP32_CAM.ino
Other components
- Doctor
- Firebase Firestore
- Patient
- Staff
- Camera Stream
Connections 29
- Doctor → Doctor Portal: uses
- Doctor Portal → Doctor Authentication: submits login
- Doctor Authentication → Firebase Client Setup: uses auth
- Doctor Authentication → Prescription Entry: opens portal
- Prescription Entry → Firebase Client Setup: uses client
- Firebase Client Setup → Firebase Firestore: connects
- Prescription Entry → Firebase Firestore: reads and writes
- Patient → Patient Interface: uses
- Patient Interface → RFID Scan UI: starts scan
- RFID Scan UI → Dispenser Web Server: posts scan
- Dispenser Web Server → UART Controller: requests card ID
- UART Controller → FPGA System: exchanges serial data
- FPGA System → RFID Reader: handles RFID
- FPGA System → Protocol Handler: handles commands
- FPGA System → Servo Control: controls actuation
- Servo Control → Dispense Motion FSM: drives motion
- Dispenser Web Server → Patient and Stock Data: calls data functions
- Patient and Stock Data → Firebase Firestore: reads and updates
- RFID Scan UI → Visit Selection: opens visit selection
- Visit Selection → Dispenser Web Server: requests schedule page
- Visit Selection → Prescription and Dispense UI: selects visit
- Prescription and Dispense UI → Dispenser Web Server: loads and requests dispense
- Dispenser Web Server → UART Controller: sends dispense command
- Dispenser Web Server → Patient and Stock Data: records outcome
- Staff → Monitoring Dashboard: uses
- Monitoring Dashboard → Monitoring and Logs: loads monitoring
- Monitoring and Logs → Firebase Firestore: subscribes to status and logs
- Monitoring and Logs → Camera Stream: displays feed
- ESP32-CAM → Camera Stream: provides video