RoboticsBeginnerPRJ-038

Medicine Reminder and Dispenser Using Arduino

Three pill boxes that beep and open on schedule, so no dose is missed.

Built and tested by Aboobacker sidheeq K P · Industrial Robotics Institute

Circuit diagram of the Medicine Reminder and Dispenser using Arduino Uno
Circuit diagram · Arduino Uno
LevelBeginner
Build time2–3 hours
BoardArduino Uno
Parts7 components

What is the Medicine Reminder and Dispenser?

A medicine reminder that helps people take their medicines on time. Three compartments each hold a different medicine and are opened by their own servo motor. At each scheduled time the buzzer sounds for 2 seconds, then the right compartment opens to release the dose and closes again.

How it works

  1. Each of the three boxes has its own servo motor as a lid.
  2. The Arduino tracks time with millis() from when it is switched on.
  3. At each dose time the buzzer sounds for 2 seconds.
  4. The matching servo turns to 90° to open the box, waits 2 seconds and closes.
  5. Each dose is given only once; change the times in the code for a real schedule.

Parts list

ComponentQty
Arduino Uno1
Servo Motors (SG90)3
Buzzer1
Medicine Boxes (compartments)3
Lithium-ion Batteries2
Battery Case with Switch1
Jumper WiresAs needed

Software

  • Arduino IDE
  • Servo library

Wiring and connections

FromConnect to
Servo 1 signalPin 3
Servo 2 signalPin 5
Servo 3 signalPin 6
All servo VCC5V
All servo GNDGND
Buzzer +Pin 8
Buzzer −GND
Battery + (via switch)VIN
Battery −GND

How to build the Medicine Reminder and Dispenser

  1. Make three small boxes and fix a servo to each one as a lid.
  2. Connect the servo signal wires to pins 3, 5 and 6, and all servo power to 5V and GND.
  3. Connect the buzzer to pin 8 and GND.
  4. Wire the battery case to VIN and GND through the switch.
  5. Set time1, time2 and time3 in the code to your dose times in milliseconds.
  6. Upload the code and switch on; each box opens at its time after a beep.

Medicine Reminder and Dispenser code

Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the Arduino Uno.

#include <Servo.h>

Servo servo1;
Servo servo2;
Servo servo3;

int buzzer = 8;

// Time intervals (in milliseconds)
unsigned long time1 = 5000;    // First dose after 5 sec
unsigned long time2 = 10000;   // Second dose after 10 sec
unsigned long time3 = 15000;   // Third dose after 15 sec

unsigned long startTime;

void dispense(Servo &servo)
{
  digitalWrite(buzzer, HIGH);
  delay(2000);
  digitalWrite(buzzer, LOW);

  servo.write(90);   // Open box
  delay(2000);
  servo.write(0);    // Close box
}

void setup()
{
  servo1.attach(3);
  servo2.attach(5);
  servo3.attach(6);
  pinMode(buzzer, OUTPUT);

  servo1.write(0);
  servo2.write(0);
  servo3.write(0);

  startTime = millis();
}

void loop()
{
  unsigned long currentTime = millis();

  if (currentTime - startTime >= time1) { dispense(servo1); time1 = 99999999; }
  if (currentTime - startTime >= time2) { dispense(servo2); time2 = 99999999; }
  if (currentTime - startTime >= time3) { dispense(servo3); time3 = 99999999; }
}

Real-world uses

  • Elderly care at home
  • Patients on multiple medicines
  • Hospitals and care homes
  • Learning servo timing

Frequently asked questions

What is a Medicine Reminder and Dispenser?

A medicine reminder that helps people take their medicines on time. Three compartments each hold a different medicine and are opened by their own servo motor.

What components are needed for the Medicine Reminder and Dispenser?

You need: Arduino Uno (1), Servo Motors (SG90) (3), Buzzer (1), Medicine Boxes (compartments) (3), Lithium-ion Batteries (2), Battery Case with Switch (1), Jumper Wires. Software: Arduino IDE, Servo library.

Is the Medicine Reminder and Dispenser project good for beginners?

Yes. It is rated beginner and takes about 2–3 hours to build, using the Arduino Uno. The guide on this page explains every connection and step.

Where can I get the code for the Medicine Reminder and Dispenser?

The complete, tested Arduino C++ code is free on this page. Copy it into Arduino IDE and upload it to the board.

Can I buy a kit for the Medicine Reminder and Dispenser?

Yes. IRI sells a kit with the parts for this project (PRJ-038). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.

Industrial Robotics Institute
Logo