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 pan-tilt mount uses two servos: the bottom one turns left and right, the top one tilts up and down. The MG945 has metal gears and enough torque to turn the whole head, so it goes at the bottom; the lighter S3003 tilts the phone. Two potentiometers on a Nano set the angles, and the sketch smooths the movement so the video does not jerk.
Tick anything you already have and the total updates.
Follow the colours: red is power, dark grey is ground, blue is a signal.
12 V adapter through the 5 V buck for both servos; the Nano on USB or the same 5 V.
pan_tilt.inoVerify & upload in Electrolark#include <Servo.h>
Servo pan, tilt;
const int TILT_MIN = 40, TILT_MAX = 140;
float p = 90, t = 90;
void setup() { pan.attach(9); tilt.attach(10); }
void loop() {
float pt = map(analogRead(A0), 0, 1023, 0, 180);
float tt = map(analogRead(A1), 0, 1023, TILT_MIN, TILT_MAX);
p += (pt - p) * 0.08; // ease towards the knob
t += (tt - t) * 0.08;
pan.write((int)p); tilt.write((int)t);
delay(15);
}
Pot noise; the easing helps, and a 100 nF capacitor from each wiper to GND helps more.
The tilt servo is overloaded; centre the phone or use a lighter clamp.
Servos are on the Nano's 5 V; use the buck.
Yes, replace the pots with Serial commands.
The pan servo carries the whole head, so it needs metal gears; tilt carries only the phone.
Servos hum slightly when moving; still, they are quiet when holding.
8 parts: TowerPro MG945 Metal Gear Servo, Futaba S3003 Standard Servo, 2 × Rotary Potentiometer Module 10k (3-Pin), Generic Nano CH340 Development Board (Soldered), Step-Down Converter to 5V USB / 5V 3A, DC Power Adapter (5.5x2.1mm), 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 beginner project and takes about 2 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (pan_tilt.ino).
About ₹1,221 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Mapping a pot to a servo angle; Smoothing servo motion; Choosing servos by load.
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.