Daily pill dispenser
At 8:00 a chime sounds, the wheel turns one slot and a single white tablet drops into the cup. You take it and press TAKEN, and the machine waits for tomorrow's 8:00. It is a demo with plain tablets.
- 8 parts
- 6 wiring steps
- Arduino code
- 5 V supply
Quick answer
The short version. Every pin is in the full wiring below.What you need
- Arduino Nano
- DS3231 real-time clock module
- 28BYJ-48 5 V stepper motor with its ULN2003 driver board
- Passive buzzer
- 220 ohm resistor, in series with the buzzer
- 6 mm push button
- 5 V 2 A USB power supply
- A pill wheel with 8 pockets
How to wire it
- Supply plus and minus to the power rail.
- Rail to the Nano's 5V pin, the ULN2003 board's plus and minus, and the DS3231's VCC and GND.
- ULN2003 IN1, IN2, IN3 and IN4 to Nano D11, D10, D9 and D8.
- DS3231 SDA to A4 and SCL to A5.
- TAKEN button between A0 and GND.
- A1 through the 220 ohm resistor to the buzzer plus, and the buzzer minus to GND.
Before you power it: All 5 V, about 0.25 A. A demo with plain tablets, not a medical device: do not rely on it for real medicine.

Parts list
- Arduino Nano
- DS3231 real-time clock module
- 28BYJ-48 5 V stepper motor with its ULN2003 driver board
- Passive buzzer
- 220 ohm resistor, in series with the buzzer
- 6 mm push button (TAKEN)
- 5 V 2 A USB power supply, with a power rail strip
- A pill wheel with 8 pockets, a belt with two equal pulleys, and a cup
Wiring, step by step
- Supply plus and minus to the power rail.
- Rail to the Nano's 5V pin, the ULN2003 board's plus and minus, and the DS3231's VCC and GND. Nothing goes on VIN.
- ULN2003 IN1, IN2, IN3 and IN4 to Nano D11, D10, D9 and D8.
- DS3231 SDA to A4 and SCL to A5.
- TAKEN button between A0 and GND. The Nano's internal pull-up holds A0 high until it is pressed.
- A1 through the 220 ohm resistor to the buzzer plus, and the buzzer minus to GND.
How it works
- The DS3231 keeps the time, about a minute a year off, where the Nano's own ceramic resonator can lose several minutes a day. The Nano reads it over I2C.
- At 8:00 it plays a two-note chime on the buzzer and turns the stepper exactly 256 steps, one eighth of a turn. The ULN2003 chip has the flyback diodes built in.
- A belt with two equal pulleys carries that turn to the pill wheel, so one pocket passes the opening at the bottom and one tablet drops into the cup.
- The sketch allows one dose per day. It beeps again every 20 s until TAKEN is pressed.
The code: pill_dispenser.ino
The Arduino code for this circuit is in the Wirecora Discord, in the channel #arduino-code (owner’s choice, 14 October 2026: the code lives where you can ask about it). It is a plain .ino file you can download there.
From the Short's own checked drawing. It needs the RTClib library (Sketch, Include Library, Manage Libraries) and the Stepper library that comes with the Arduino software. It was checked by simulation, not run on a real board. Set the clock once with rtc.adjust(). The Stepper library wants the pins in the order IN1, IN3, IN2, IN4, hence 11, 9, 10, 8.
What the video simplifies
- The video's clock day runs in 2.6 s; the real clock runs in real time. The wheel's start and stop are eased for the picture, where a plain Stepper call jumps to full speed.
- The pockets that pass behind the cover are refilled out of sight. The electronics are drawn much larger than the kitchen, the hands smaller than life, and the tablet larger than a real 9 mm one.
- The stepper's 11 rpm and the module currents are typical values, not measured. The sounds are synthesised.
- TAKEN is only a button press: the demo cannot know the tablet was swallowed. If it jams, nothing drops and nobody knows. A real dispenser senses the drop with an infrared beam or a load cell and alerts the family.
- For the clock board use the rechargeable LIR2032 it is made for, or remove its charge resistor if you fit a CR2032.
- This was checked by simulation and datasheets, not built.
You found this by searching. Here's the whole path.
- Read how it works
- See it work
- Build it
- Show it
Thirty seconds of video shows the circuit doing its job.
All 5 V, about 0.25 A. A demo with plain tablets, not a medical device: do not rely on it for real medicine.
Built it, or stuck halfway? Post a photo in the Wirecora Discord. Questions get an answer every day.
Same Arduino + motorAlcohol sensor engine lock with an Arduino Nano, an MQ-3 and a relay
Next step: adds a servoSecret knock door lock
Something new: a PIR sensorPIR motion sensor light