MEDICINE SORTING MACHINE

microcontroller & digital circuit
Medicine sorting machine overview

OVERVIEW

  • Automated daily pill sorting to prevent missed doses across four time slots (morning, noon, evening, bedtime).
  • Designed a low-cost dispenser that identifies the active slot, dispenses the set number of pills, and returns to home.
  • Developed a cartridge and track system with a geared wheel for single-pill dispensing, adaptable with hole sizes for different pill types.
  • Implemented drivetrain with TT motor for track movement; servos for opening/closing the cartridge lid; distance/laser sensors and photogates for position detection.
  • Programmed Arduino controller with keypad interface; added logic circuit with Schmitt trigger to encode four photogate signals into digital inputs.

CIRCUIT DESIGN

Circuit / wiring overview

ENCODER LOGIC DIAGRAM

Encoder logic diagram

CIRCUIT LOGIC

Four photogate signals (Y3…Y0, 1 = light, 0 = blocked) are encoded to digital outputs (A1, A2) with a validity flag (V):

Y3Y2Y1Y0 A1A2V
1111xx0
1110001
1100011
1000101
0000111

CONTROL LOGIC

  1. Home: Return carriage to start (TT motor for a fixed duration) and confirm with sensor.
  2. Open: Servo opens cartridge lid.
  3. Select slot: Read encoded photogate state → active time slot (morning / noon / evening / bedtime).
  4. Dispense: For the entered dose count, rotate the geared wheel to drop pills one by one (A/B types supported).
  5. Advance: Drive to the next slot; repeat until all scheduled slots are served.
  6. Close: Servo closes lid and return to home.

DEMO VIDEO

SUMMARY

  • Built a working dispenser with reliable position sensing and per‑slot dosing.
  • Next: add basic machine vision for pill classification, increase supported medicines, integrate reminders, and support multiple cartridge types.

← Back to projects