Smart MEDICINE Cabinet With Computer Vision

whatsapp image 2026 02 14 at 6.17.57 pm

Medication mismanagement is a major cause of health complications, especially among elderly and visually impaired patients. Traditional medicine cabinets rely entirely on manual identification, which can lead to wrong medicine intake.

The Smart Medicine Cabinet solves this problem by :

  • Automatically identifying medicine type using computer vision

     

  • Providing feedback through display or audio

     

  • Improving medication safety and organization

     

The system is intentionally limited to detecting:

  • Bacillus Clausii Spores Suspension

     

  • Insulin (vial or pen)

     

  • Eye Drops

     

( This controlled scope improves accuracy and reliability. )

System Components

Hardware Components :
  1. ESP32 / ESP32-CAM

  2. Camera Module

  3. Medicine Cabinet (Compartments)

  4. Speaker / Buzzer (Audio Feedback)

  5. OLED / LCD Display (Optional)

  6. LED Indicators

  7. Power Supply (5V / Battery)

Software Components :
  • Python

  • OpenCV

  • Akaze Algorithm / YOLO (trained model)

  • ESP32 Firmware

  • Serial / Wi-Fi Communication

mart medicine cabinet

CIRCUIT DIAGRAM

Applications :

  • Smart homes for elderly care

  • Hospitals and clinics

  • Assisted living centers

  • Medicine safety systems

  • Healthcare automation projects

Medicine Categories Detected :

Category

Description

Bacillus Clausii Spores Suspension

Clear liquid vial with white cap

Insulin

Insulin vial or insulin pen

Eye Drops

Small dropper bottles

( Other medicines are intentionally ignored to avoid false detection. )

Advantages :

  • Reduces medication errors
  • Simple and user-friendly
  • Limited detection improves accuracy
  • Cost-effective system
  • Supports visually impaired users

Connection Description (Wiring Map) :

Component

Connection

Description

Camera

ESP32-CAM

Captures medicine image

Speaker

GPIO Pin

Audio output

Display

I2C Pins

Shows detected medicine

LED

GPIO

Status indication

Power

5V / GND

System power

Wi-Fi

ESP32

Communication with the Python system

Working Principle :

  1. Image Capture
    • When a medicine is placed in front of the camera, an image is captured.
  2. Computer Vision Processing
    • Image is processed using OpenCV.
    • Trained model (YOLO / CNN) classifies the object as:
      • Bacillus Clausii Spores Suspension
      • Insulin
      • Eye Drop
  3. Decision Logic
    • If medicine belongs to the allowed categories → accepted
    • If unknown → ignored or a warning given
  4. User Feedback
    • Audio:  “Insulin detected”, etc.
    • Display: Medicine type shown on screen
    • LED indication for confirmation
  5. Optional Storage Action

Cabinet opens the correct compartment (future enhancement).

Testing the Hardware and Software

Camera Test :
  • Verify image clarity and focus.
  • Test under different lighting conditions.
Model Test
  • Test with sample medicines.
  • Check accuracy for each category.
Communication Test
  • Verify data transfer between the Python system and the ESP32.
Full System Test
  • Place each medicine type and confirm correct identification.

( Test rejection of unknown objects. )

Troubleshooting :

Issue

Cause

Solution

Wrong detection

Poor lighting

Improve lighting

Camera not working

Power issue

Check voltage

Audio not playing

Speaker wiring

Check the GPIO pin

False positives

Model confusion

Retrain with a better dataset

ESP32 resets

Power drop

Use a stable supply

( The Smart Medicine Cabinet with Computer Vision is an intelligent healthcare system designed to automatically identify and manage medicines using a camera and image processing techniques. The system is trained to detect only three medicines – insulin vials, bacillus clausii spores suspension, and eye drops. Using computer vision and a microcontroller-based system, the cabinet assists users by identifying medicines, giving audio or display feedback, and reducing medication errors. This project is especially useful for elderly people, patients, and healthcare facilities. )

Scroll to Top