MuTech RoboticsLearning Hub
Adults onlyESP32Level 3/3

Smart Medicine Dispenser

A 3D-printed 21-slot wheel drops each dose on time, an IR sensor sees it taken, and the family is alerted if it isn't.

Smart Medicine Dispenser
Adults only

Involves handling medicines. Keep medicines and the device out of children's reach.

Not for children. Build at your own risk.

This is a DIY reminder aid, not a medical device. Always follow your doctor and check the doses you load.

Strictly follow the description given with this video.

Video

The video link will be added here soon.

How it works

  1. At dose time the stepper turns the wheel one slot and the dose drops into the cup with a beep.
  2. The IR sensor in the cup bay sees when the pill is picked up and marks it TAKEN.
  3. Not taken in 15 minutes: the family gets a Telegram alert, and the next dose is never dropped on top.
  4. A hall sensor and magnet find the wheel's HOME position after every power cut.

Parts you need

  • ESP32 dev board× 1Buy
  • DS3231 clock module× 1Buy
  • 28BYJ-48 stepper + ULN2003 driver× 1Buy
  • IR obstacle sensor (cup bay)× 1Buy
  • Hall sensor module + 6×3 mm magnet× 1Buy
  • Active buzzer× 1Buy
  • 5V 2A adapter× 1Buy
Kit for this projectPrice on request
Get the kit

Wiring

Wiring diagram
PowerGroundSignal
#FromConnect to
1 PowerAdapter +5V5V rail
2 GroundAdapter GNDGND rail
3 PowerESP32 VIN5V rail
4 SignalDriver IN1ESP32 D15
5 SignalDriver IN2ESP32 D4
6 SignalDriver IN3ESP32 D5
7 SignalDriver IN4ESP32 D18
8 PowerDriver +5V rail
9 GroundDriver −GND rail
10 SignalClock SDAESP32 D21
11 SignalClock SCLESP32 D22
12 PowerClock VCCESP32 3V3
13 SignalBuzzer +ESP32 D23
14 SignalIR OUTESP32 D34
15 PowerIR VCCESP32 3V3
16 SignalHall DOESP32 D35
17 PowerHall VCCESP32 3V3
18 GroundAll module GNDGND rail

3D print files

  • pill_carousel_21.stlPLA / PETG · 0.2 mm · 25% · no supports · ~2 h 30 minLink at launch
  • dispenser_base.stlPLA / PETG · 0.24 mm · 20% · supports under the cup bay · ~5 hLink at launch

Code

The tested Arduino / ESP32 code for this project will be posted here, ready to copy.