Touchless hand sanitiser dispenser
Hold your hand under it and a metal-gear servo presses the pump for you.
Shop by category
Shop all componentsRemembering medicines is hard for many elders. A DS3231 real-time clock keeps exact time even through power cuts, thanks to its coin cell. At each set time the Nano moves an Emax ES08MA II, a small but strong metal-gear micro servo, to open a lightweight lid and beeps until a button is pressed. Metal gears survive the lid being pushed shut by hand much better than plastic ones.
A reminder aid only: always follow the doctor's instructions and check medicines are taken.
Tick anything you already have and the total updates.
Follow the colours: red is power, dark grey is ground, blue is a signal.
5 V USB charger; the RTC keeps time during power cuts.
pill_box.inoVerify & upload in Electrolark#include <RTClib.h>
#include <Servo.h>
RTC_DS3231 rtc;
Servo lid;
const bool SET_TIME = false;
const int TIMES[][2] = {{8, 0}, {14, 0}, {21, 0}}; // 8 AM, 2 PM, 9 PM
const int OPEN = 90, CLOSED = 0;
bool due = false; int lastMin = -1;
void setup() {
pinMode(3, INPUT_PULLUP); pinMode(8, OUTPUT);
rtc.begin();
if (SET_TIME) rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
lid.attach(9); lid.write(CLOSED); delay(500); lid.detach(); // detach so it does not hum
}
void loop() {
DateTime now = rtc.now();
if (now.minute() != lastMin) {
lastMin = now.minute();
for (auto &t : TIMES) if (now.hour() == t[0] && now.minute() == t[1]) {
due = true; lid.attach(9); lid.write(OPEN); delay(500); lid.detach();
}
}
if (due) {
digitalWrite(8, (millis() / 500) % 2);
if (digitalRead(3) == LOW) {
due = false; digitalWrite(8, LOW);
lid.attach(9); lid.write(CLOSED); delay(500); lid.detach();
}
}
delay(50);
}
Set the clock once with SET_TIME true, then upload again with false.
Too heavy or the horn is at the wrong angle; use a lighter lid and change OPEN.
The sketch detaches it after moving; check the detach lines are there.
Yes, the DS3231 runs on its coin cell.
Yes, use an ESP32 instead and send a message if Done is not pressed in 30 minutes.
Use one compartment per time and add a servo or a rotating tray for more.
7 parts: Emax ES08MA II Metal Gear Micro Servo, DS3231 Precision RTC Module with EEPROM, Generic Nano CH340 Development Board (Soldered), Buzzer Module 3.3–5V, Tactile Push Button Switch, Solderless Breadboard and Dupont Jumper Wires (40 pcs). On this page you can tick the parts you already have and add only the rest to your cart.
It is a intermediate project and takes about 3 hours. The build on this page has 5 steps.
No. This page has the complete, tested code (pill_box.ino).
About ₹1,235 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Keeping time with an RTC; Using a small servo as a lid actuator; Simple daily schedules.
A reminder aid only: always follow the doctor's instructions and check medicines are taken.
Hold your hand under it and a metal-gear servo presses the pump for you.
Wave your hand and the lid lifts by itself, then closes after three seconds.
Your first motion project: turn the knob and the servo follows.
Dial in an exact servo angle, 2° per click, shown on screen.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.