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 motor needs far more current than an Arduino pin can give, so it gets its own battery and an L298N driver. The Arduino only sends logic signals: IN1 HIGH and IN2 LOW spin the motor, both LOW stop it. The button on D11 uses the UNO's internal pull-up, so it reads LOW when pressed and needs no resistor.
Li-ion cells: insert them the right way round, never short the holder's wires, and switch the holder off when you finish.
Keep fingers and hair away from the spinning fan blade.
Every part for this build comes in the Geekobot Spark Kit box, a Geekobot exclusive, together with the parts for all 24 projects, from a first blinking LED to a smart fan and a reaction game. The wiring below is the kit's own wiring.
Tick anything you already have and the total updates.
The brain of every Spark Kit project
Sensor Shield v5.0 from the kit: every pin has its own G, V, S header, so modules plug in with female jumpers
Follow the colours: red is power, dark grey is ground, blue is a signal.
The motor runs from the 2 x 18650 pack (7.4 V) through the L298N; the Arduino runs from USB. The two grounds must be joined.
spark_kit_19_fan_on_off.inoVerify & upload in Electrolark// Spark Kit 19: fan on/off with L298N
int IN1 = 4;
int IN2 = 3;
int button = 11; // to GND, uses the internal pull-up
void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
pinMode(button, INPUT_PULLUP);
}
void loop() {
if (digitalRead(button) == LOW) { // pressed
digitalWrite(IN1, HIGH);
digitalWrite(IN2, LOW);
} else {
digitalWrite(IN1, LOW);
digitalWrite(IN2, LOW);
}
}
Use the kit's USB cable (some phone cables carry power only), install the CH340 driver on Windows if the port does not appear, and pick Tools > Board > Arduino Uno.
The battery must be switched on, and the L298N GND must be joined to the Arduino GND. Check the ENA jumper is fitted.
Swap the two motor wires at OUT1 and OUT2.
The motor must run from the battery, never from the Arduino 5V pin.
A motor draws hundreds of milliamps and makes voltage spikes; a pin gives about 20 mA. The L298N switches the battery current for you.
Six AA cells (9 V) work. Four AA cells (6 V) are too low for the L298N's own 5 V regulator.
Yes. It is one of the 24 projects in the Geekobot Spark Kit, and every part on the list comes in the kit box. You can also buy the parts one by one from the list above.
No. Every Spark Kit project is wired on the breadboard or the Sensor Shield with jumper wires.
11 parts: Uno R3 CH340G ATmega328p Compatible Development Board, Arduino USB-A to USB-B Data Cable for UNO/MEGA, L298N Dual H-Bridge Motor Driver Module, Hobby DC Motor (130 / 180 Size), DC Motor Fan Blade (Toy Propeller), Tactile Push Button Switch, 18650 Battery Holder, 2 × 18650 Li-ion Rechargeable Cell, Solderless Breadboard, Dupont Jumper Wires (40 pcs), plus 1 more. 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 45 minutes. The build on this page has 9 steps.
No. This page has the complete, tested code (spark_kit_19_fan_on_off.ino).
About ₹922 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Switching a motor through a driver; Separate power for motors with a common ground; INPUT_PULLUP buttons.
Li-ion cells: insert them the right way round, never short the holder's wires, and switch the holder off when you finish. Keep fingers and hair away from the spinning fan blade.
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.