Touchless hand sanitiser dispenser
Hold your hand under it and a metal-gear servo presses the pump for you.
Shop by category
Shop all componentsThe VNH5019 is a single H-bridge chip that handles 12 A continuous with thermal and current protection built in. Pololu's carrier board adds the support parts. It has a current-sense pin that gives about 140 mV per amp. A centre-off pot sets speed and direction; the Nano reads the current and shows it on an OLED, stopping the motor if it stays above a limit.
Keep hands away from winches and conveyors when testing.
Use wire thick enough for the motor current.
Tick anything you already have and the total updates.
Inline fuse holder for the 12 V line
Follow the colours: red is power, dark grey is ground, blue is a signal.
12 V adapter big enough for the motor, through a fuse.
vnh5019_control.inoVerify & upload in Electrolark#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const int INA = 7, INB = 8, PWM = 9;
const float LIMIT_A = 4.0;
unsigned long overSince = 0;
bool tripped = false;
void setup() {
pinMode(INA, OUTPUT); pinMode(INB, OUTPUT); pinMode(PWM, OUTPUT);
oled.begin(SSD1306_SWITCHCAPVCC, 0x3C); oled.setTextColor(WHITE);
}
void loop() {
int pot = analogRead(A0) - 512; // -512..511
int speed = abs(pot) < 40 ? 0 : map(abs(pot), 40, 512, 0, 255);
float amps = analogRead(A1) * 5.0 / 1023 / 0.14; // about 140 mV per A
if (amps > LIMIT_A) { if (!overSince) overSince = millis(); if (millis() - overSince > 500) tripped = true; }
else overSince = 0;
if (tripped && speed == 0) tripped = false; // reset by centring the pot
digitalWrite(INA, pot > 0); digitalWrite(INB, pot < 0);
analogWrite(PWM, tripped ? 0 : speed);
oled.clearDisplay(); oled.setTextSize(2); oled.setCursor(0, 0); oled.print(amps, 2); oled.print(" A");
oled.setTextSize(1); oled.setCursor(0, 30); oled.print(pot > 0 ? "Forward " : pot < 0 ? "Reverse " : "Stop "); oled.print(speed);
oled.setCursor(0, 50); oled.print(tripped ? "OVERCURRENT - centre knob" : "");
oled.display();
delay(20);
}
EN is not pulled high or the fuse has blown.
PWM noise affects CS; average several readings.
Its own thermal protection has tripped; add airflow or reduce load.
About 12 A continuous with good cooling, 30 A peak.
The fuse protects the wiring and the adapter from a dead short.
Yes, the VNH5019 works from 5.5 to 24 V.
9 parts: Pololu VNH5019 Motor Driver Carrier, 200RPM 12V Low Noise Dc Motor With Metal Gears - Grade A, Generic Nano CH340 Development Board (Soldered), Rotary Potentiometer Module 10k (3-Pin), 0.96" OLED Display 128x64, Inline Fuse Holder for 5 x 20 mm Glass Fuse, 22AWG Leads, 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 intermediate project and takes about 2 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (vnh5019_control.ino).
H-bridge direction and speed pins; Reading motor current; Software overcurrent protection.
Keep hands away from winches and conveyors when testing. Use wire thick enough for the motor current.
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.