Touchless hand sanitiser dispenser
Hold your hand under it and a metal-gear servo presses the pump for you.
Shop by category
Shop all componentsA linear actuator turns a motor's spin into a straight push or pull with a lead screw, so it can lift a lid or flap and hold it there. This build uses a 12 V micro actuator with a 50 mm stroke, a BTS7960 H-bridge to run it both ways, and an Arduino Uno with two buttons. Pressing and holding Open extends the rod, pressing Close retracts it, and the sketch stops the motor after a safe time so it never drives against its end stop.
Keep fingers clear of the lid hinge and the rod: an actuator pushes with real force and does not stop for a hand.
Tick anything you already have and the total updates.
12 V micro linear actuator, 50 mm stroke
Follow the colours: red is power, dark grey is ground, blue is a signal.
Needs a 12 V DC supply of at least 2 A for the actuator. The Uno runs from USB.
lid_opener.inoVerify & upload in Electrolarkconst int RPWM = 5, LPWM = 6, OPEN_BTN = 2, CLOSE_BTN = 3;
const unsigned long RUN_MS = 6000; // a little longer than one full stroke
unsigned long started = 0;
int dir = 0; // 1 = extend, -1 = retract, 0 = stopped
void setup() {
pinMode(RPWM, OUTPUT); pinMode(LPWM, OUTPUT);
pinMode(OPEN_BTN, INPUT_PULLUP); pinMode(CLOSE_BTN, INPUT_PULLUP);
}
void loop() {
if (digitalRead(OPEN_BTN) == LOW && dir != 1) { dir = 1; started = millis(); }
if (digitalRead(CLOSE_BTN) == LOW && dir != -1) { dir = -1; started = millis(); }
if (dir != 0 && millis() - started > RUN_MS) dir = 0; // stop after one stroke
analogWrite(RPWM, dir == 1 ? 255 : 0);
analogWrite(LPWM, dir == -1 ? 255 : 0);
}
Swap the two actuator wires at M+ and M-.
Check the 12 V supply and that R_EN and L_EN are connected to 5 V.
Check the load is within the actuator's force rating, and that the lid is not catching at the end of travel.
Many actuators like this have end-of-travel switches built in. Check yours; the timed run in the sketch is a second safety.
Yes. Use a supply and driver that can carry its current, and see the linear actuator guide for choosing stroke and force.
Lead-screw actuators usually hold their position without power, but check your model.
7 parts: Uno R3 Development Board (No Cable), Quintrans Micro Linear Actuator 50mm Stroke 12VDC (Made in India), BTS7960 43A High-Current H-Bridge Motor Driver, 2 × Tactile Push Button Switch, 12V 2A (24W) Wall Power Adapter - BIS Certified, Solderless Breadboard and Dupont Jumper Wires (40 pcs). Tools: Digital Multimeter. 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 2 hours. The build on this page has 5 steps.
No. This page has the complete, tested code (lid_opener.ino).
About ₹4,442 for the parts at the prices on this page, plus tools if you do not have them. Quantity price breaks lower the cost when you build several.
How a lead-screw linear actuator turns spin into a push; Driving a motor both ways with an H-bridge; Choosing stroke and mounting points; Time-limiting a motor so it never stalls.
Keep fingers clear of the lid hinge and the rod: an actuator pushes with real force and does not stop for a hand.
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.