A medicine box looks like a perfect idea. One box, one slot for each part of the day. No confusion.
But there is a catch. A normal box depends completely on you. You have to remember the time, and you have to remember the right compartment. The box itself does nothing.
For my third-semester project, I wanted to fix that.
The problem
A normal medicine box cannot answer three simple questions:
- Which compartment is due right now?
- Was the lid actually opened?
- If the dose was missed, does anyone know?
If you forget, the box stays quiet. If someone else is looking after you, they only find out later, or never.
My goal was to build a low-cost box that can answer all three questions. It is a classroom prototype, built with a NodeMCU ESP8266 board and Wi-Fi.
Problem 1: Which compartment is due?
What a normal box does: nothing. You have to know.
What mine does:
Gets the time from the internet over Wi-Fi
Lights the LED of the compartment that is due (Morning or Night)
Shows the dose name on a small OLED screen
Unlocks only that compartment with a servo latch
The other compartment stays locked. So there is less chance of opening the wrong one.
Problem 2:_ Was the lid actually opened?_
What a normal box does: nothing. A lid is either open or closed, and no one is watching.
What mine does: it uses a reed switch (a switch that reacts to a magnet) and counts a dose as taken only after seeing three things in order:
- Lid closed
- Lid opened
- Lid closed again
A closed lid alone is not proof. This sequence also stops a false "taken" if the lid was already open at the scheduled time.
Problem 3: What if the dose is missed?
What a normal box does: nothing. The miss goes unnoticed.
What mine does:
If the lid is not opened within 15 minutes, the box locks the compartment again
It queues a Telegram message for the caretaker
If Wi-Fi is down, it keeps trying until the message goes through
The dose status is saved in memory (EEPROM), so a restart does not repeat a finished dose, and does not pretend an unfinished dose was taken
A fourth problem I did not expect: the circuit itself
Fixing the three problems meant adding servos, sensors and a screen. And all of these can fail in small ways. So the circuit had to be solid too:
The servos get their own power. Servo motors pull a lot of current when they move, which can reset the board. So they run from a separate regulated 5 V adapter.
A 470 µF capacitor smooths the power. Think of a small water tank next to a tap. When the pressure drops for a second, the tank fills the gap.
The grounds are joined. Both power sources must agree on what "zero volts" is. Otherwise the servo cannot understand its signal.
Pin D0 has no built-in pull-up. The Night reed switch is on D0, so I added an external 10 kΩ pull-up to stop the pin from reading random noise.
Did it solve the problem?
I made a test plan with eight checks. All eight passed.
Startup and display: I powered the board by USB. The OLED started and showed Wi-Fi and time status.
Time sync: I connected the box to a 2.4 GHz network. It got the correct time before it started any reminder.
*Morning reminder *(Problem 1): I triggered the Morning dose. The LED turned on, the OLED showed MORNING, and the servo unlocked.
Dose confirmation (Problem 2): I opened and closed the lid during the grace period. The dose was marked taken, the LED turned off, and the compartment locked.
*Missed dose *(Problem 3): I left the lid unopened. The dose was marked missed, the box locked, and one Telegram alert was queued.
Network loss: I disconnected Wi-Fi during a reminder, then reconnected it. The LED, OLED and lid sensor kept working, and the queued alert was sent after Wi-Fi came back.
Restart during a reminder: I reset the board while a reminder was active. The box did not unlock again, and it reported the dose as unconfirmed after reconnecting.
Servo load: I moved each servo, then both in order. The board did not reset, and the servo supply stayed near 5 V.
What it still cannot do
I want to be honest about this, because a medicine device should not over-promise:
- It does not measure how much medicine is left.
- It cannot confirm that someone swallowed the medicine. The reed switch only shows that a lid moved.
- It needs Wi-Fi to get the time every time it starts.
- It is a reminder aid. It does not replace advice from a doctor.
What I learned
Before this project, I thought building something meant making it work once. Now I think it means asking what goes wrong around it.
The problem was never just "remind me at 8 o'clock". It was knowing which compartment, knowing whether the lid moved, and making sure someone finds out when a dose is missed. Then, once those worked, making sure a power dip or a restart does not break them.


Top comments (0)